diff options
author | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-22 13:29:23 +0000 |
---|---|---|
committer | simonbrandhof <simon.brandhof@gmail.com> | 2010-09-22 13:29:23 +0000 |
commit | 365a5dbae8f05b95f55637659d392688474a1730 (patch) | |
tree | 14d2791ac69c3ffc700b362ec9c3d2a7877e4d47 /sonar-plugin-api | |
parent | d6000bfbea0cf09b47bcfe330b9675fc9a3094bb (diff) | |
download | sonarqube-365a5dbae8f05b95f55637659d392688474a1730.tar.gz sonarqube-365a5dbae8f05b95f55637659d392688474a1730.zip |
SONAR-1798 rename RULE_FAILURES.POINTS to COST
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java | 12 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java | 20 |
2 files changed, 21 insertions, 11 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java index df13d3cdace..fe06d79ab8e 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/database/model/RuleFailureModel.java @@ -52,8 +52,8 @@ public class RuleFailureModel extends BaseIdentifiable { @Column(name = "line", updatable = true, nullable = true) private Integer line; - @Column(name = "points", updatable = true, nullable = true) - private Double points; + @Column(name = "cost", updatable = true, nullable = true) + private Double cost; public RuleFailureModel() { } @@ -112,12 +112,12 @@ public class RuleFailureModel extends BaseIdentifiable { this.line = line; } - public Double getPoints() { - return points; + public Double getCost() { + return cost; } - public RuleFailureModel setPoints(Double d) { - this.points = d; + public RuleFailureModel setCost(Double d) { + this.cost = d; return this; } diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java index ffe819da408..2e6c914011f 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/rules/Violation.java @@ -34,7 +34,7 @@ public class Violation { private String message; private RulePriority priority; private Integer lineId; - private Double points; + private Double cost; /** * Creates of a violation from a rule. Will need to define the resource later on @@ -124,12 +124,22 @@ public class Violation { return this; } - public Double getPoints() { - return points; + /** + * @see <code>setCost()</code> + */ + public Double getCost() { + return cost; } - public Violation setPoints(Double d) { - this.points = d; + /** + * The cost to fix a violation can't be precisely computed without this information. + * Let's take the following example : a rule forbids to have methods whose complexity is greater than 10. Without this field "cost", + * the same violation is created with a method whose complexity is 15 and a method whose complexity is 100. + * If the cost to fix one point of complexity is 0.05h, then 15mn is necessary to fix the method whose complexity is 15, + * and 3h5mn is required to fix the method whose complexity is 100. + */ + public Violation setCost(Double d) { + this.cost = d; return this; } |