Deprecate integer property

This commit is contained in:
Clément Fournier
2018-11-26 23:32:50 +01:00
parent 1db950bec6
commit 71713026ce
24 changed files with 215 additions and 96 deletions
@@ -4,22 +4,26 @@
package net.sourceforge.pmd.lang.vm.rule.design;
import static net.sourceforge.pmd.properties.constraints.NumericConstraints.positive;
import net.sourceforge.pmd.lang.vm.ast.ASTElseIfStatement;
import net.sourceforge.pmd.lang.vm.ast.ASTIfStatement;
import net.sourceforge.pmd.lang.vm.ast.ASTprocess;
import net.sourceforge.pmd.lang.vm.ast.AbstractVmNode;
import net.sourceforge.pmd.lang.vm.rule.AbstractVmRule;
import net.sourceforge.pmd.properties.IntegerProperty;
import net.sourceforge.pmd.properties.PropertyDescriptor;
import net.sourceforge.pmd.properties.PropertyFactory;
public class AvoidDeeplyNestedIfStmtsRule extends AbstractVmRule {
private int depth;
private int depthLimit;
private static final IntegerProperty PROBLEM_DEPTH_DESCRIPTOR
= IntegerProperty.named("problemDepth")
private static final PropertyDescriptor<Integer> PROBLEM_DEPTH_DESCRIPTOR
= PropertyFactory.intProperty("problemDepth")
.desc("The if statement depth reporting threshold")
.range(1, 25).defaultValue(3).uiOrder(1.0f).build();
.require(positive()).defaultValue(3).build();
public AvoidDeeplyNestedIfStmtsRule() {
definePropertyDescriptor(PROBLEM_DEPTH_DESCRIPTOR);