diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2011-04-20 15:25:30 +0200 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2011-04-20 15:26:55 +0200 |
commit | 0766d9835cb65e88c5335dd686f8f37d803cf1f9 (patch) | |
tree | 0db9cf78a796b039cd7b4357a76767e021a63426 /plugins/sonar-squid-java-plugin/src | |
parent | 033b6d93dcf2ef91b481fc242ec724902dbd75e1 (diff) | |
download | sonarqube-0766d9835cb65e88c5335dd686f8f37d803cf1f9.tar.gz sonarqube-0766d9835cb65e88c5335dd686f8f37d803cf1f9.zip |
SONAR-2255 the metric 'classes' must not be 0 on unit tests
Diffstat (limited to 'plugins/sonar-squid-java-plugin/src')
-rw-r--r-- | plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassesDecorator.java | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassesDecorator.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassesDecorator.java index 11501ba7a6b..1ff4d0ead80 100644 --- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassesDecorator.java +++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassesDecorator.java @@ -23,15 +23,12 @@ import org.sonar.api.batch.Decorator; import org.sonar.api.batch.DecoratorContext; import org.sonar.api.measures.CoreMetrics; import org.sonar.api.measures.Measure; -import org.sonar.api.resources.Java; -import org.sonar.api.resources.Project; -import org.sonar.api.resources.Resource; -import org.sonar.api.resources.Scopes; +import org.sonar.api.resources.*; public final class ClassesDecorator implements Decorator { public void decorate(Resource resource, DecoratorContext context) { - if (Scopes.isFile(resource)) { + if (Scopes.isFile(resource) && !Qualifiers.UNIT_TEST_FILE.equals(resource.getQualifier())) { int classes = 0; for (DecoratorContext child : context.getChildren()) { if (Scopes.isProgramUnit(child.getResource())) { |