As the result shows, there are only 2 if-else in the “jump” method, but it is still reported as an issue.
But it shouldn’t be reported as an issue.
Please tell me what I should modify my rule to reach my goal.
my SonarQube version: 8.9.2.46101
the language I use: Java
I don’t know if you managed to solve your problem but it looks to me like the reuse of the same instance of IfStatementVisitor between method visits. As a consequence, you keep increasing ifcounter without ever clearing it.
And thus once ifcounter is greater or equal to 3, it will systematically report on the next if statement it encounters regardless of the method it is visiting.