-
Notifications
You must be signed in to change notification settings - Fork 20
Closed
Description
It's a great open source Cyclomatic Complexity tool with extensive details about the program.
However, I found some issue while using it to test out our project. Here is a simple function that would help to illustrate the problem.
int main (){
int a ,b ;
a = 26;
b =10;
if (a > 10 ||b < 45 && (a+b)< 55){
return 1;
}
return 2;
}I might be wrong, but as far as I concern, this function should score MVG = 4, since we have three decision points while the measurement result by CCCC would be MVG = 5.
Thus, I did some experiment about it.
- MVG will go down to 4, if I remove the "return 2;" statement.
- MVG will go down to 4, if the "return 1;" replaced by other code instead of a return statement.
It can lead to a big error rate, since some of big functions include several if statements and sprinkled with return statement as well.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels