diff options
author | Julien HENRY <julien.henry@sonarsource.com> | 2015-01-14 17:14:00 +0100 |
---|---|---|
committer | Julien HENRY <julien.henry@sonarsource.com> | 2015-01-15 09:08:58 +0100 |
commit | 12c4a20acb61ff6f516c7e7bb8996db606b263ab (patch) | |
tree | b831b5467f8e37d05b8329e398141f99caa98a4f /plugins/sonar-xoo-plugin/src | |
parent | 1e6facc12390d970ad259af550ea3dba8426a79f (diff) | |
download | sonarqube-12c4a20acb61ff6f516c7e7bb8996db606b263ab.tar.gz sonarqube-12c4a20acb61ff6f516c7e7bb8996db606b263ab.zip |
SONAR-5931 Publish new measure API
Diffstat (limited to 'plugins/sonar-xoo-plugin/src')
6 files changed, 8 insertions, 18 deletions
diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/MeasureSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/MeasureSensor.java index 471a5835639..a890b63ac9d 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/MeasureSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/MeasureSensor.java @@ -28,8 +28,7 @@ import org.sonar.api.batch.measure.MetricFinder; import org.sonar.api.batch.sensor.Sensor; import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.batch.sensor.SensorDescriptor; -import org.sonar.api.batch.sensor.measure.Measure; -import org.sonar.api.measures.CoreMetrics; +import org.sonar.api.batch.sensor.measure.NewMeasure; import org.sonar.xoo.Xoo; import java.io.File; @@ -88,7 +87,7 @@ public class MeasureSensor implements Sensor { if (metric == null) { throw new IllegalStateException("Unknow metric with key: " + metricKey); } - Measure<Serializable> newMeasure = context.newMeasure() + NewMeasure<Serializable> newMeasure = context.newMeasure() .forMetric(metric) .onFile(xooFile); if (Boolean.class.equals(metric.valueType())) { @@ -111,9 +110,7 @@ public class MeasureSensor implements Sensor { public void describe(SensorDescriptor descriptor) { descriptor .name("Xoo Measure Sensor") - .provides(CoreMetrics.LINES) - .onlyOnLanguages(Xoo.KEY) - .onOnFileType(InputFile.Type.MAIN, InputFile.Type.TEST); + .onlyOnLanguages(Xoo.KEY); } @Override diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java index fbff5f75641..8d14771bab4 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SymbolReferencesSensor.java @@ -87,8 +87,7 @@ public class SymbolReferencesSensor implements Sensor { public void describe(SensorDescriptor descriptor) { descriptor .name("Xoo Symbol Reference Sensor") - .onlyOnLanguages(Xoo.KEY) - .onOnFileType(InputFile.Type.MAIN, InputFile.Type.TEST); + .onlyOnLanguages(Xoo.KEY); } @Override diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SyntaxHighlightingSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SyntaxHighlightingSensor.java index d72b50b4089..004c186b208 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SyntaxHighlightingSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/lang/SyntaxHighlightingSensor.java @@ -85,8 +85,7 @@ public class SyntaxHighlightingSensor implements Sensor { public void describe(SensorDescriptor descriptor) { descriptor .name("Xoo Highlighting Sensor") - .onlyOnLanguages(Xoo.KEY) - .onOnFileType(InputFile.Type.MAIN, InputFile.Type.TEST); + .onlyOnLanguages(Xoo.KEY); } @Override diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CreateIssueByInternalKeySensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CreateIssueByInternalKeySensor.java index 04dc7be446f..886104c14a0 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CreateIssueByInternalKeySensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/CreateIssueByInternalKeySensor.java @@ -35,8 +35,7 @@ public class CreateIssueByInternalKeySensor implements Sensor { descriptor .name("CreateIssueByInternalKeySensor") .onlyOnLanguages(Xoo.KEY) - .createIssuesForRuleRepositories(XooRulesDefinition.XOO_REPOSITORY) - .onOnFileType(InputFile.Type.MAIN, InputFile.Type.TEST); + .createIssuesForRuleRepositories(XooRulesDefinition.XOO_REPOSITORY); } @Override diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssueOnDirPerFileSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssueOnDirPerFileSensor.java index 548b596c300..66a31686e03 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssueOnDirPerFileSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssueOnDirPerFileSensor.java @@ -36,8 +36,7 @@ public class OneIssueOnDirPerFileSensor implements Sensor { descriptor .name("One Issue On Dir Per File") .onlyOnLanguages(Xoo.KEY) - .createIssuesForRuleRepositories(XooRulesDefinition.XOO_REPOSITORY) - .onOnFileType(InputFile.Type.MAIN, InputFile.Type.TEST); + .createIssuesForRuleRepositories(XooRulesDefinition.XOO_REPOSITORY); } @Override diff --git a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java index 081bb1a0a2b..3e0b9f48ee5 100644 --- a/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java +++ b/plugins/sonar-xoo-plugin/src/main/java/org/sonar/xoo/rule/OneIssuePerLineSensor.java @@ -24,7 +24,6 @@ import org.sonar.api.batch.sensor.Sensor; import org.sonar.api.batch.sensor.SensorContext; import org.sonar.api.batch.sensor.SensorDescriptor; import org.sonar.api.batch.sensor.issue.Issue.Severity; -import org.sonar.api.measures.CoreMetrics; import org.sonar.api.rule.RuleKey; import org.sonar.xoo.Xoo; @@ -38,10 +37,8 @@ public class OneIssuePerLineSensor implements Sensor { public void describe(SensorDescriptor descriptor) { descriptor .name("One Issue Per Line") - .dependsOn(CoreMetrics.LINES) .onlyOnLanguages(Xoo.KEY) - .createIssuesForRuleRepositories(XooRulesDefinition.XOO_REPOSITORY) - .onOnFileType(InputFile.Type.MAIN, InputFile.Type.TEST); + .createIssuesForRuleRepositories(XooRulesDefinition.XOO_REPOSITORY); } @Override |