From 2354a1598072700ef24fb5d41ab26d82f383fb6b Mon Sep 17 00:00:00 2001 From: Simon Brandhof Date: Tue, 7 Oct 2014 15:51:47 +0200 Subject: Fix quality flaws --- .../org/sonar/plugins/core/sensors/AbstractCoverageDecorator.java | 4 ++-- .../main/java/org/sonar/plugins/core/sensors/UnitTestDecorator.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AbstractCoverageDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AbstractCoverageDecorator.java index 41973ea7239..25c5d0942bf 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AbstractCoverageDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/AbstractCoverageDecorator.java @@ -43,13 +43,13 @@ public abstract class AbstractCoverageDecorator implements Decorator { } public void decorate(final Resource resource, final DecoratorContext context) { - if (shouldDecorate(resource, context)) { + if (shouldDecorate(resource)) { computeMeasure(context); computeMeasureForNewCode(context); } } - protected boolean shouldDecorate(final Resource resource, final DecoratorContext context) { + protected boolean shouldDecorate(final Resource resource) { return !ResourceUtils.isUnitTestClass(resource); } diff --git a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/UnitTestDecorator.java b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/UnitTestDecorator.java index 3423b73ee21..a79c13b6df1 100644 --- a/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/UnitTestDecorator.java +++ b/plugins/sonar-core-plugin/src/main/java/org/sonar/plugins/core/sensors/UnitTestDecorator.java @@ -45,12 +45,12 @@ public class UnitTestDecorator implements Decorator { return !Project.AnalysisType.STATIC.equals(project.getAnalysisType()); } - public boolean shouldDecorateResource(Resource resource, DecoratorContext context) { + public boolean shouldDecorateResource(Resource resource) { return ResourceUtils.isUnitTestClass(resource) || !ResourceUtils.isEntity(resource); } public void decorate(Resource resource, DecoratorContext context) { - if (shouldDecorateResource(resource, context)) { + if (shouldDecorateResource(resource)) { sumChildren(context, CoreMetrics.TEST_EXECUTION_TIME); sumChildren(context, CoreMetrics.SKIPPED_TESTS); Double tests = sumChildren(context, CoreMetrics.TESTS); -- cgit v1.2.3