Fixed code smells after running sonarqube on the project#1429
Merged
realDuYuanChao merged 4 commits intoTheAlgorithms:Developmentfrom Aug 25, 2020
abhijaykumar:Development
Merged
Fixed code smells after running sonarqube on the project#1429realDuYuanChao merged 4 commits intoTheAlgorithms:Developmentfrom abhijaykumar:Development
realDuYuanChao merged 4 commits intoTheAlgorithms:Developmentfrom
abhijaykumar:Development
Conversation
- Local variable names in java must be with the default regular expression ^[a-z][a-zA-Z0-9]*$ https://rules.sonarsource.com/java/tag/convention/RSPEC-117 - The diamond operator ("<>") should be used when the type of the maps are already defined https://rules.sonarsource.com/java/RSPEC-2293 - Package names being camel cased is a code smell
String literals should not be duplicated https://rules.sonarsource.com/java/RSPEC-1192
-Generic types shouldn't be used raw (without type parameters) in variable declarations or return values. Doing so bypasses generic type checking, and defers the catch of unsafe code to runtime. https://rules.sonarsource.com/java/RSPEC-3740 - The dangling else problem appears when nested if/else statements are written without curly braces. In this case, else is associated with the nearest if but that is not always obvious and sometimes the indentation can also be misleading. https://rules.sonarsource.com/java/tag/confusing/RSPEC-5261
Contributor
Author
|
@yanglbme Please review this. |
Member
|
have the changed codes been compiled and tested? if so I think they can be merged. |
Contributor
Author
|
@drabbit75 Yes, all tests are passing after the changes. I was able to generate the code coverage report too. |
Member
|
@abhijaykumar cloud you reopen a new PR and fix build error? Thanks |
Contributor
Author
@shellhub Where's the build error? I ran |
Member
Contributor
Author
|
@shellhub Thanks. Looks like it passed for me since I'm on JDK11. I'll rebuild on JDK8 and create a new PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Multiple code smells were found by SonarQube on the project. Some of them were violations of the below rules:
Here is the overall SonarQube report for the repo (Development) branch post the fixes.
This pull request brings down the code smells from 188 to 177.