Skip to content

Commit

Permalink
feat: don't check for amount of if statements branches if they contai…
Browse files Browse the repository at this point in the history
…n and or or keywords

FossilOrigin-Name: 19f429ca546746205ea422b2e2ba42ae67738afb472213a86549242ed0f565eb
  • Loading branch information
thindil committed Mar 19, 2024
1 parent 8e335db commit 021c2b0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rules/ifstatements.nim
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,15 @@ proc checkMinMax(node, parent: PNode; messagePrefix: string;
else:
if node.len > rule.options[1].parseInt():
checkResult = false
if not checkResult:
for child in node:
for element in child[0]:
try:
if $element in ["and", "or"]:
checkResult = true
break
except:
discard
if rule.ruleType in {RuleTypes.count, search}:
checkResult = not checkResult
setResult(checkResult = checkResult,
Expand Down

0 comments on commit 021c2b0

Please sign in to comment.