Solhint

Solhint

Community Analyzer

Function has cyclomatic complexity current but allowed no more than maxcompl SOLHINT-W1001

Anti-pattern
Minor

Function has cyclomatic complexity current but allowed no more than maxcompl.

Bad Practice

  1. High code complexity
 if (a > b) {
   if (b > c) {
     if (c > d) {
       if (d > e) {
       } else {
       }
     }
   }
 }
for (i = 0; i < b; i += 1) { }
do { d++; } while (b > c);
while (d > e) { }

Recommended

  1. Low code complexity
 if (a > b) {
   if (b > c) {
     if (c > d) {
     }
   }
 }
for (i = 0; i < b; i += 1) { }
do { d++; } while (b > c);
while (d > e) { }

Learn more

code-complexity on Solhint's documentation.