Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented Apr 19, 2025

What it does?

Handles exceptions gracefully.

Improvements to do

Remove the code duplication, to be done at a later date.

@Scoppio Scoppio self-assigned this Apr 19, 2025
@Scoppio Scoppio requested a review from rjhancock April 19, 2025 21:26
@codecov
Copy link

codecov bot commented Apr 19, 2025

Codecov Report

Attention: Patch coverage is 0% with 40 lines in your changes missing coverage. Please review.

Project coverage is 30.19%. Comparing base (48ae440) to head (a8a2ced).
Report is 8 commits behind head on master.

Files with missing lines Patch % Lines
megamek/src/megamek/ai/dataset/UnitAction.java 0.00% 20 Missing ⚠️
megamek/src/megamek/ai/dataset/UnitState.java 0.00% 20 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6906      +/-   ##
============================================
- Coverage     30.20%   30.19%   -0.01%     
+ Complexity    15713    15711       -2     
============================================
  Files          2884     2884              
  Lines        283119   283157      +38     
  Branches      49302    49308       +6     
============================================
- Hits          85510    85507       -3     
- Misses       192000   192038      +38     
- Partials       5609     5612       +3     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.


return map;
} catch (Exception e) {
logger.error(e, "Error while trying to serialize Weapon {} data for {}", weapon, entity);

Check warning

Code scanning / CodeQL

Unused format argument Warning

This format call refers to 0 argument(s) but supplies 2 argument(s).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a false positive


return map;
} catch (Exception e) {
logger.error(e, "Error while trying to serialize Weapon {} data for {}", weapon, entity);

Check warning

Code scanning / CodeQL

Unused format argument Warning

This format call refers to 0 argument(s) but supplies 2 argument(s).
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a false positive

Copy link
Collaborator

@rjhancock rjhancock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of adding duplication but there isn't a way not to at this time.

Can be part of later re-factors.

@rjhancock rjhancock merged commit 0a2f6d0 into MegaMek:master Apr 19, 2025
6 checks passed
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