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

Address a number of sonarqube java issues #1181

Merged
merged 8 commits into from
Dec 11, 2024

Conversation

peternied
Copy link
Member

@peternied peternied commented Dec 5, 2024

Description

Fixed issues:

  • Remove this use of "put"; it is deprecated.
  • Remove this unnecessary cast to "Map".
  • Rename field "TYPE" to prevent any misunderstanding/clash with field "type" defined in superclass "org.opensearch.migrations.bulkload.models.MigrationItem".
  • Reorder the modifiers to comply with the Java Language Specification.
  • Change the visibility of this constructor to "protected".
  • Replace this lambda with method reference '*Template.class::isInstance'.
  • Replace this lambda with method reference '*Template.class::cast'.
  • Remove this unused method parameter "templateType".
  • Remove the parentheses around the "kvp" parameter

Exclusions for false positives:

  • Set the credentials provider explicitly on this builder
  • Set the region explicitly on this builder

Issues Resolved

Note; I've not worked on any issues that are part of the critical paths for transformations or sub-shard processing.

From

✅ Build passed: Found 53 issues, which is within the baseline of 89.

To

✅ Build passed: Found 27 issues, which is within the baseline of 89.

Check List

  • New functionality includes testing
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Fixed issues:
- Remove this use of "put"; it is deprecated.
- Remove this unnecessary cast to "Map".
- Rename field "TYPE" to prevent any misunderstanding/clash with field "type" defined in superclass "org.opensearch.migrations.bulkload.models.MigrationItem".
- Reorder the modifiers to comply with the Java Language Specification.
- Change the visibility of this constructor to "protected".
- Replace this lambda with method reference '*Template.class::isInstance'.
- Replace this lambda with method reference '*Template.class::cast'.
- Remove this unused method parameter "templateType".
- Remove the parentheses around the "kvp" parameter

Exclusions for false positives:
- Set the credentials provider explicitly on this builder
- Set the region explicitly on this builder

Signed-off-by: Peter Nied <[email protected]>
Signed-off-by: Peter Nied <[email protected]>
@peternied peternied marked this pull request as draft December 6, 2024 17:48
@peternied
Copy link
Member Author

Moving to draft while attempting to root cause a memory leak - https://opensearch.atlassian.net/browse/MIGRATIONS-2250

Copy link

codecov bot commented Dec 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.63%. Comparing base (0a329c0) to head (cb38dbe).
Report is 1 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1181      +/-   ##
============================================
+ Coverage     80.61%   80.63%   +0.02%     
+ Complexity     3080     3075       -5     
============================================
  Files           421      421              
  Lines         15598    15609      +11     
  Branches       1053     1053              
============================================
+ Hits          12575    12587      +12     
+ Misses         2380     2379       -1     
  Partials        643      643              
Flag Coverage Δ
unittests 80.63% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@peternied peternied marked this pull request as ready for review December 9, 2024 14:29
Copy link
Collaborator

@lewijacn lewijacn left a comment

Choose a reason for hiding this comment

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

Are you going to lower the baseline now?

@peternied peternied merged commit 3eb8c08 into opensearch-project:main Dec 11, 2024
22 checks passed
@peternied peternied deleted the more-java-sonar branch December 11, 2024 22:36
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