Structural code complexity may be too high
[nz_btn text="Software Elegance" link="http://casthighlight.wpengine.com/category/product/indicators-methodology/code-insights/software-elegance/" target="_self" animate="false" animation_type="ghost" color="pink" size="small" shape="rounded" type="normal" hover_normal="fill" hover_ghost="fill"][nz_btn text="Code Complexity" link="http://casthighlight.wpengine.com/category/product/indicators-methodology/code-insights/software-elegance/code-complexity/" target="_self" animate="false" animation_type="ghost" color="black" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="fill"] This code insight - derived from Tom McCabe's Cyclomatic Complexity - estimates the level of strutural complexity of a piece of source code by counting and summing the total number of logical conditions (if, while, for, case, default), functions and methods. Depending on specific thresholds CAST has developed for each technology, Highlight counts penalty points for the scanned file.Why you should care
Code complexity is the "arthritis" of software. If not managed by your development teams, it can quickly impact many aspects of your applications such as: a) maintainability; b) the ability to add new features because the underlying code foundation is just too complex; and c) the testability and the corresponding QA effort. More importantly, it is generally agreed that a high level of code complexity correlates with the number of introduced software defects, since it's very difficult for a developer to decipher many conditions at the same time while modifying a code base. Long story short, software complexity is error-prone and means higher maintenance and test costs. References: https://en.wikipedia.org/wiki/Cyclomatic_complexity http://www.drdobbs.com/architecture-and-design/measuring-complexity-correctly/240007928 https://dzone.com/articles/measuring-code-complexity https://dzone.com/articles/code-complexity-is-killing-usCAST recommendations
Although code complexity could be considered as part of the software entropy (software quality tends to naturally decreases over time), it is also part of your technical debt. You should ensure your team takes care of controlling structural complexity overy time by regularly refactoring the most complex parts of your source code.About CAST and Highlight's Code Insights
Over the last 25 years, CAST has leveraged unique knowledge on software quality measurement by analyzing thousands of applications and billions of lines of code. Based on this experience and community standards on programming best practices, Highlight implements hundreds of code insights across 15+ technologies to calculate health factors of a software.[nz_btn text="How it works" link="http://casthighlight.wpengine.com/how-it-works/" target="_self" animate="true" animation_type="ghost" color="black" size="small" shape="rounded" type="normal" hover_normal="fill" hover_ghost="fill" icon="icon-cog"][nz_btn text="Features & Analytics" link="http://casthighlight.wpengine.com/outputs-analytics/" target="_self" animate="true" animation_type="ghost" color="pink" size="small" shape="rounded" type="ghost" hover_normal="fill" hover_ghost="fill" icon="icon-stats"]
For reference only. For the complete details please refer the original article
https://doc.casthighlight.com/alt_vg-structural-code-complexity-may-high/
https://doc.casthighlight.com/alt_vg-structural-code-complexity-may-high/
Comments