use of org.sonar.uast.helpers.CaseLike in project sonar-go by SonarSource.
the class NoIdenticalConditionsCheck method handleSwitch.
private void handleSwitch(UastNode node) {
SwitchLike switchLike = SwitchLike.from(node);
if (switchLike == null) {
return;
}
List<UastNode> caseNodes = switchLike.caseNodes();
List<UastNode> allConditions = new ArrayList<>();
for (UastNode caseNode : caseNodes) {
CaseLike caseLike = CaseLike.from(caseNode);
List<UastNode> conditions = caseLike.conditions();
for (UastNode condition : conditions) {
for (UastNode prevCondition : allConditions) {
checkConditions(condition, prevCondition);
}
allConditions.add(condition);
}
}
}
Aggregations