Sonar cleanups 03032019

This commit is contained in:
Ingmar Goudt 2019-03-04 10:43:20 +01:00
parent f46f321635
commit 45f665eb1d
13 changed files with 37 additions and 41 deletions

View file

@ -289,8 +289,9 @@ public final class RateCard {
}
// normalize for the file to [1..100]
for (String name : thisFileRatings.keySet()) {
int r = thisFileRatings.get(name);
for (Map.Entry<String, Integer> ratingByName : thisFileRatings.entrySet()) {
int r = ratingByName.getValue();
String name = ratingByName.getKey();
int newRating = (int) (100.0f * (r - min) / (max - min));
int oldRating = baseRatings.getOrDefault(name, 0);
if (newRating > oldRating) {
@ -339,7 +340,7 @@ public final class RateCard {
}
Integer typeCount = singleCount.get(symbol);
if (typeCount == null) {
typeCount = new Integer(0);
typeCount = 0;
}
typeCount += 1;
singleCount.put(symbol, typeCount);

View file

@ -28,7 +28,7 @@ public class JarVersion {
String manifestPath;
if (classPath.startsWith("jar")) {
// jar source
manifestPath = classPath.substring(0, classPath.lastIndexOf("!") + 1) + "/META-INF/MANIFEST.MF";
manifestPath = classPath.substring(0, classPath.lastIndexOf('!') + 1) + "/META-INF/MANIFEST.MF";
} else {
// dir source (e.g. IDE's debug)
// it's can be generated by runtime, but need extra code and performance: https://stackoverflow.com/questions/34674073/how-to-generate-manifest-mf-file-during-compile-phase