sonarQube(5)添加可配置参数

1、代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
public class TXTooMuchIfCheck extends IssuableSubscriptionVisitor {

private static final int DEFAULT_MAXIMUM_LINE = 3;
@RuleProperty(key = "maximumLine",
description = "if-else if-else最大层数",
defaultValue = "" + DEFAULT_MAXIMUM_LINE)
public int maximumLine = DEFAULT_MAXIMUM_LINE;

public List<Tree.Kind> nodesToVisit() {
// TODO
}

@Override
public void visitNode(Tree tree) {
// TODO
}

}

2、效果

这里写图片描述

这里写图片描述