Replace IntegerProperty

This commit is contained in:
Clément Fournier
2017-10-15 22:22:36 +02:00
parent 13f3651048
commit a47471f742
13 changed files with 48 additions and 25 deletions

View File

@ -14,8 +14,10 @@ public class AvoidDeeplyNestedIfStmtsRule extends AbstractApexRule {
private int depth;
private int depthLimit;
private static final IntegerProperty PROBLEM_DEPTH_DESCRIPTOR = new IntegerProperty("problemDepth",
"The if statement depth reporting threshold", 1, 25, 3, 1.0f);
private static final IntegerProperty PROBLEM_DEPTH_DESCRIPTOR
= IntegerProperty.builder("problemDepth")
.desc("The if statement depth reporting threshold")
.min(1).max(25).defalt(3).uiOrder(1.0f).build();
public AvoidDeeplyNestedIfStmtsRule() {
definePropertyDescriptor(PROBLEM_DEPTH_DESCRIPTOR);

View File

@ -37,8 +37,10 @@ import net.sourceforge.pmd.properties.IntegerProperty;
*/
public class StdCyclomaticComplexityRule extends AbstractApexRule {
public static final IntegerProperty REPORT_LEVEL_DESCRIPTOR = new IntegerProperty("reportLevel",
"Cyclomatic Complexity reporting threshold", 1, 30, 10, 1.0f);
public static final IntegerProperty REPORT_LEVEL_DESCRIPTOR
= IntegerProperty.builder("reportLevel")
.desc("Cyclomatic Complexity reporting threshold")
.min(1).max(30).defalt(10).uiOrder(1.0f).build();
public static final BooleanProperty SHOW_CLASSES_COMPLEXITY_DESCRIPTOR = new BooleanProperty(
"showClassesComplexity", "Add class average violations to the report", true, 2.0f);