Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upFixed code smells after running sonarqube on the project #1429
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
@yanglbme Please review this. |
have the changed codes been compiled and tested? if so I think they can be merged. |
@drabbit75 Yes, all tests are passing after the changes. I was able to generate the code coverage report too. |
LGTM |
@abhijaykumar cloud you reopen a new PR and fix build error? Thanks |
@shellhub Where's the build error? I ran |
@shellhub Thanks. Looks like it passed for me since I'm on JDK11. I'll rebuild on JDK8 and create a new PR. |
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.