Skip to content

Latest commit

 

History

History
63 lines (46 loc) · 2.84 KB

README.rst

File metadata and controls

63 lines (46 loc) · 2.84 KB
Root.Smell.Complexity Parent Index
Sibling aspects ClassSmell MethodSmell Naming

Complexity

This aspect checks on the cyclomatic complexity of your code.

Tastes

Taste Meaning Values
cyclomatic_complexity This the maximum number of embedded branches or embedded loops allowed. 6

* bold denotes default value

Subaspects

This aspect does not have any sub aspects.

Example

for (i=0; i<n; ++i){
    for (i=0; i<n; ++i){
        for (i=0; i<n; ++i){
            for (i=0; i<n; ++i){
                for (i=0; i<n; ++i){
                    for (i=0; i<n; ++i){
                        for (i=0; i<n; ++i){
                            for (i=0; i<n; ++i){
                                ...
                                //do something
...
}

Importance

Very complex code are difficult to read, debug and maintain. It is always a good idea to keep things as simple as possible.

How to fix this

This can be solved by breaking down complex functions into smaller onces.