aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorDavid Gageot <david@gageot.net>2012-10-05 13:56:00 +0200
committerDavid Gageot <david@gageot.net>2012-10-05 13:56:25 +0200
commit9ecd1e8d2219a2eab8aa08ff978b2348ec8e40d5 (patch)
treeee9b72fb60f7ee0ed54abcdd271ddb319f364ea9 /plugins
parent8e45ea89cbe20e90278f9e9afa9da2ec58f7a859 (diff)
downloadsonarqube-9ecd1e8d2219a2eab8aa08ff978b2348ec8e40d5.tar.gz
sonarqube-9ecd1e8d2219a2eab8aa08ff978b2348ec8e40d5.zip
Fix violations
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoOverallSensor.java21
1 files changed, 11 insertions, 10 deletions
diff --git a/plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoOverallSensor.java b/plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoOverallSensor.java
index 8ce1aa6e51e..378b1e86eec 100644
--- a/plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoOverallSensor.java
+++ b/plugins/sonar-jacoco-plugin/src/main/java/org/sonar/plugins/jacoco/JaCoCoOverallSensor.java
@@ -118,30 +118,31 @@ public class JaCoCoOverallSensor implements Sensor {
@Override
protected void saveMeasures(SensorContext context, JavaFile resource, Collection<Measure> measures) {
for (Measure measure : measures) {
- Measure mergedMeasure = convertForAllTests(measure);
+ Measure mergedMeasure = convertForOverall(measure);
if (mergedMeasure != null) {
context.saveMeasure(resource, mergedMeasure);
}
}
}
- private Measure convertForAllTests(Measure measure) {
+ private Measure convertForOverall(Measure measure) {
+ Measure itMeasure = null;
if (CoreMetrics.LINES_TO_COVER.equals(measure.getMetric())) {
- return new Measure(CoreMetrics.OVERALL_LINES_TO_COVER, measure.getValue());
+ itMeasure = new Measure(CoreMetrics.OVERALL_LINES_TO_COVER, measure.getValue());
} else if (CoreMetrics.UNCOVERED_LINES.equals(measure.getMetric())) {
- return new Measure(CoreMetrics.OVERALL_UNCOVERED_LINES, measure.getValue());
+ itMeasure = new Measure(CoreMetrics.OVERALL_UNCOVERED_LINES, measure.getValue());
} else if (CoreMetrics.COVERAGE_LINE_HITS_DATA.equals(measure.getMetric())) {
- return new Measure(CoreMetrics.OVERALL_COVERAGE_LINE_HITS_DATA, measure.getData());
+ itMeasure = new Measure(CoreMetrics.OVERALL_COVERAGE_LINE_HITS_DATA, measure.getData());
} else if (CoreMetrics.CONDITIONS_TO_COVER.equals(measure.getMetric())) {
- return new Measure(CoreMetrics.OVERALL_CONDITIONS_TO_COVER, measure.getValue());
+ itMeasure = new Measure(CoreMetrics.OVERALL_CONDITIONS_TO_COVER, measure.getValue());
} else if (CoreMetrics.UNCOVERED_CONDITIONS.equals(measure.getMetric())) {
- return new Measure(CoreMetrics.OVERALL_UNCOVERED_CONDITIONS, measure.getValue());
+ itMeasure = new Measure(CoreMetrics.OVERALL_UNCOVERED_CONDITIONS, measure.getValue());
} else if (CoreMetrics.COVERED_CONDITIONS_BY_LINE.equals(measure.getMetric())) {
- return new Measure(CoreMetrics.OVERALL_COVERED_CONDITIONS_BY_LINE, measure.getData());
+ itMeasure = new Measure(CoreMetrics.OVERALL_COVERED_CONDITIONS_BY_LINE, measure.getData());
} else if (CoreMetrics.CONDITIONS_BY_LINE.equals(measure.getMetric())) {
- return new Measure(CoreMetrics.OVERALL_CONDITIONS_BY_LINE, measure.getData());
+ itMeasure = new Measure(CoreMetrics.OVERALL_CONDITIONS_BY_LINE, measure.getData());
}
- return null;
+ return itMeasure;
}
}