mercredi 21 octobre 2015

Cyclomatic Compleity IF ELSE vs SWITCH CASE

Many code analysis tools like sonar through errors for switch case if used instead of is else for cyclomatic complexity . Is there a number which should be a threshold of when one should use if else and when one should use switch case ? Say if its a case of 50 , to reduce cyclomatic complexity one should use switch case ? Would be good if you could support your answer with an example ?

Aucun commentaire:

Enregistrer un commentaire