Replies: 1 comment
-
|
As I mentioned in issue #11 the C/C++ MVG metric is increased if a cccc.g: --- cccc.g
+++ cccc.g
@@ -202,7 +202,7 @@
#token PROTECTED "protected" << ; >>
#token PUBLIC "public" << ; >>
#token REGISTER "register" << ; >>
-#token RETURN "return" << IncrementCount(tcMCCABES_VG); >>
+#token RETURN "return" << ; >>
#token KW_SHORT "short" << ; >>
#token SIGNED "signed" << ; >>
#token SIZEOF "sizeof" << ; >>cccc_utl.cc --- cccc_utl.cc 2017-03-03 07:20:06.129169794 +0100
+++ cccc_utl.cc 2017-03-03 07:21:51.938665925 +0100
@@ -299,6 +299,8 @@
{
lexical_counts_for_this_extent[i]=0;
}
+ // Patch for starting the McCabe MVG metric with at least 1.
+ lexical_counts_for_this_extent[tcMCCABES_VG] = 1;
if(allocate_lexcounts==true)
{ |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
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.
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.
It can lead to a big error rate, since some of big functions include several if statements and sprinkled with return statement as well.
Beta Was this translation helpful? Give feedback.
All reactions