aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassComplexityDistributionBuilder.java2
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassesDecorator.java2
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionComplexityDistributionBuilder.java2
-rw-r--r--plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionsDecorator.java2
4 files changed, 4 insertions, 4 deletions
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassComplexityDistributionBuilder.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassComplexityDistributionBuilder.java
index 2b8eb53be18..2ff7b38cf9f 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassComplexityDistributionBuilder.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/ClassComplexityDistributionBuilder.java
@@ -50,7 +50,7 @@ public final class ClassComplexityDistributionBuilder implements Decorator {
if (shouldExecuteOn(resource, context)) {
RangeDistributionBuilder builder = new RangeDistributionBuilder(CoreMetrics.CLASS_COMPLEXITY_DISTRIBUTION, LIMITS);
for (DecoratorContext childContext : context.getChildren()) {
- if (Scopes.isType(childContext.getResource())) {
+ if (Scopes.isProgramUnit(childContext.getResource())) {
Measure complexity = childContext.getMeasure(CoreMetrics.COMPLEXITY);
if (complexity != null) {
builder.add(complexity.getValue());
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 5e87d950cb4..11501ba7a6b 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
@@ -34,7 +34,7 @@ public final class ClassesDecorator implements Decorator {
if (Scopes.isFile(resource)) {
int classes = 0;
for (DecoratorContext child : context.getChildren()) {
- if (Scopes.isType(child.getResource())) {
+ if (Scopes.isProgramUnit(child.getResource())) {
classes++;
}
}
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionComplexityDistributionBuilder.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionComplexityDistributionBuilder.java
index 66570870c6f..6b9477ba720 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionComplexityDistributionBuilder.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionComplexityDistributionBuilder.java
@@ -66,7 +66,7 @@ public final class FunctionComplexityDistributionBuilder implements Decorator {
}
boolean shouldExecuteOn(Resource resource, DecoratorContext context) {
- return Scopes.isType(resource) && context.getMeasure(CoreMetrics.COMPLEXITY) != null;
+ return Scopes.isProgramUnit(resource) && context.getMeasure(CoreMetrics.COMPLEXITY) != null;
}
public boolean shouldExecuteOnProject(Project project) {
diff --git a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionsDecorator.java b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionsDecorator.java
index 0f15bf37fa5..dddc3c6efca 100644
--- a/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionsDecorator.java
+++ b/plugins/sonar-squid-java-plugin/src/main/java/org/sonar/plugins/squid/decorators/FunctionsDecorator.java
@@ -32,7 +32,7 @@ import org.sonar.java.api.JavaMethod;
public final class FunctionsDecorator implements Decorator {
public void decorate(Resource resource, DecoratorContext context) {
- if (Scopes.isType(resource)) {
+ if (Scopes.isProgramUnit(resource)) {
int methods=0, accessors=0;
for (DecoratorContext child : context.getChildren()) {
if (child.getResource() instanceof JavaMethod) {