Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: new GM commands and client commands [WIP] #6242

Closed
wants to merge 4 commits into from

Conversation

Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented Dec 4, 2024

No description provided.

playersChangingTeam.clear();

// Changes requested by players follow the default behavior
legacyProcessTeamChangeRequest();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TWGameManager.legacyProcessTeamChangeRequest
should be avoided because it has been deprecated.
Copy link

codecov bot commented Dec 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 28.92%. Comparing base (2e45dc0) to head (f9adf19).
Report is 7 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6242      +/-   ##
============================================
- Coverage     28.99%   28.92%   -0.07%     
  Complexity    13982    13982              
============================================
  Files          2652     2672      +20     
  Lines        268296   268935     +639     
  Branches      47764    47821      +57     
============================================
+ Hits          77799    77802       +3     
- Misses       186615   187251     +636     
  Partials       3882     3882              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

}

private JComponent getArgumentComponent(Argument<?> argument) {
if (argument instanceof CoordXArgument intArg) {

Check notice

Code scanning / CodeQL

Chain of 'instanceof' tests Note

This if block performs a chain of 13 type tests - consider alternatives, e.g. polymorphism or the visitor pattern.
1));
}

private JSpinner createSpinner(CoordXArgument coordX) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'coordX' is never used.
1));
}

private JSpinner createSpinner(CoordYArgument coordY) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'coordY' is never used.
1));
}

private JComboBox<String> createPlayerComboBox(PlayerArgument playerArgument) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'playerArgument' is never used.
return comboBox;
}

private JComboBox<String> createUnitComboBox(UnitArgument unitArgument) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'unitArgument' is never used.
if (wtype != null) {
r.add(wtype.getName() + " (" + atype.getShortName() + ')');
if (weaponType != null) {
r.add(weaponType.getName() + " (" + ammoType.getShortName() + ')');

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
ammoType
may be null at this access as suggested by
this
null guard.
@@ -120,12 +120,12 @@
r.subject = subjectId;
r.indent(2);
r.newlines++;
r.add(wtype.getName() + " " + ammoType.getSubMunitionName());
r.add(wtype.getRackSize());
r.add(weaponType.getName() + " " + ammoType.getSubMunitionName());

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
weaponType
may be null at this access as suggested by
this
null guard.
@@ -111,7 +111,7 @@
bMissed = roll.getIntValue() < toHit.getValue();
// Set Margin of Success/Failure.
toHit.setMoS(roll.getIntValue() - Math.max(2, toHit.getValue()));
int duration = wtype.getRackSize() * 2;
int duration = weaponType.getRackSize() * 2;

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
weaponType
may be null at this access as suggested by
this
null guard.
@@ -112,7 +112,7 @@
bMissed = roll.getIntValue() < toHit.getValue();
// Set Margin of Success/Failure.
toHit.setMoS(roll.getIntValue() - Math.max(2, toHit.getValue()));
int duration = wtype.getRackSize() * 2;
int duration = weaponType.getRackSize() * 2;

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
weaponType
may be null at this access as suggested by
this
null guard.
int missileDamage = (wtype instanceof LRMWeapon) ? 1 : 2;
int mineDamage = wtype.getRackSize() * missileDamage;
int missileDamage = (weaponType instanceof LRMWeapon) ? 1 : 2;
int mineDamage = weaponType.getRackSize() * missileDamage;

Check warning

Code scanning / CodeQL

Dereferenced variable may be null Warning

Variable
weaponType
may be null at this access as suggested by
this
null guard.
@Scoppio Scoppio self-assigned this Dec 5, 2024
@Scoppio Scoppio closed this Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant