Tag Archives: codequality
Code Quality – Why Avoid Higher Cyclomatic Complexity?
This article represents my thoughts on why one should avoid a higher cyclomatic complexity (value more than 15 or so). Recently, I have been doing code reviews for multiple projects using Sonar. This is where I came across the rule called as “Cyclomatic Complexity”. The rule raises an alert for all the methods whose cyclomatic complexity is found to be more than 10. Thus, I thought of listing down reasons why one should pay attention to the cyclomatic complexity of method when he/she is writing fresh method or making changes to existing method. Personally, I do agree and strongly believe that one should avoid writing methods/function of code complexity higher than 15 or …
I found it very helpful. However the differences are not too understandable for me