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

Mech -> Mek updates. #5981

Merged
merged 60 commits into from
Sep 13, 2024
Merged

Conversation

rjhancock
Copy link
Collaborator

All classes under src/bot updated with correct copyrights and all Mech -> Mek conversions. Compiles and passes tests.

Copy link

codecov bot commented Sep 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.07%. Comparing base (2adcb57) to head (e600511).
Report is 64 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5981      +/-   ##
============================================
+ Coverage     28.85%   29.07%   +0.21%     
+ Complexity    13981    13957      -24     
============================================
  Files          2580     2576       -4     
  Lines        269204   267397    -1807     
  Branches      48042    47803     -239     
============================================
+ Hits          77691    77733      +42     
+ Misses       187538   185761    -1777     
+ Partials       3975     3903      -72     

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

!(movingUnit instanceof Protomech))) {
if (Mek.LOC_HEAD == loc ||
Mek.LOC_CT == loc ||
ProtoMek.LOC_HEAD == loc ||

Check warning

Code scanning / CodeQL

Useless comparison test Warning

Test is always false, because of
this condition
.
* @param playerId The ID of the player owning the target.
* @return TRUE if the unit is on the broken units list without being on the honorless enemies list.
*/
boolean isEnemyBroken(int targetid, int playerId, boolean forcedWithdrawal);
boolean isEnemyBroken(int targetId, int playerId, boolean forcedWithdrawal);

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'forcedWithdrawal' is never used.
precogThread = new Thread(precognition, "Princess-precognition (" + getName() + ")");
precogThread.start();
precognitionThread = new Thread(precognition, "Princess-precognition (" + getName() + ")");
precognitionThread.start();

Check warning

Code scanning / CodeQL

Start of thread in constructor Warning

Class
Princess
starts a thread in its constructor.
megamek/src/megamek/common/LandAirMech.java Fixed Show fixed Hide fixed
megamek/src/megamek/common/LandAirMech.java Fixed Show fixed Hide fixed
megamek/src/megamek/common/LandAirMech.java Fixed Show fixed Hide fixed
megamek/src/megamek/common/LandAirMech.java Fixed Show fixed Hide fixed
} else {
target = new Coords(Integer.parseInt(args[1]) - 1, Integer
.parseInt(args[2]) - 1);
target = new Coords(Integer.parseInt(args[1]) - 1, Integer.parseInt(args[2]) - 1);

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
} else {
target = new Coords(Integer.parseInt(args[1]) - 1, Integer
.parseInt(args[2]) - 1);
target = new Coords(Integer.parseInt(args[1]) - 1, Integer.parseInt(args[2]) - 1);

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
}

if (target == null && args.length > 3) {
target = new Coords(Integer.parseInt(args[2]) - 1, Integer
.parseInt(args[3]) - 1);
target = new Coords(Integer.parseInt(args[2]) - 1, Integer.parseInt(args[3]) - 1);

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
}

if (target == null && args.length > 3) {
target = new Coords(Integer.parseInt(args[2]) - 1, Integer
.parseInt(args[3]) - 1);
target = new Coords(Integer.parseInt(args[2]) - 1, Integer.parseInt(args[3]) - 1);

Check notice

Code scanning / CodeQL

Missing catch of NumberFormatException Note

Potential uncaught 'java.lang.NumberFormatException'.
ArrayList<Entity> aeros = new ArrayList<>();
for (Entity e : entities) {
if (e.isAero()) {
ArrayList<Entity> aeroSpaceUnits = new ArrayList<>();

Check failure

Code scanning / CodeQL

Container contents are never accessed Error

The contents of this container are never accessed.
Updated Dependencies
@rjhancock rjhancock marked this pull request as ready for review September 8, 2024 14:41
return getMountedDisplay(m, loc, null);
}

private String getMountedDisplay(Mounted m, int loc, CriticalSlot cs) {
private String getMountedDisplay(Mounted<?> m, int loc, CriticalSlot cs) {

Check notice

Code scanning / CodeQL

Useless parameter Note

The parameter 'loc' is never used.
@@ -207,9 +193,9 @@
private Map<Integer, Integer> countBays(Entity entity) {
Map<Integer, Integer> bayCount = new HashMap<>();
for (Bay bay : entity.getTransportBays()) {
if (bay instanceof MechBay) {
if (bay instanceof MekBay) {

Check notice

Code scanning / CodeQL

Chain of 'instanceof' tests Note

This if block performs a chain of 9 type tests - consider alternatives, e.g. polymorphism or the visitor pattern.
@HammerGS HammerGS merged commit f85236a into MegaMek:master Sep 13, 2024
5 checks passed
@rjhancock rjhancock deleted the mechwarrior-class-rename branch September 13, 2024 17:48
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.

2 participants