terryyin / lizard

A simple code complexity analyser without caring about the C/C++ header files or Java imports, supports most of the popular languages.
Other
1.85k stars 250 forks source link

[--modified]What does "--modified" mean? Incremental analysis? #203

Open cyw3 opened 6 years ago

cyw3 commented 6 years ago

I do not understand "--modified" option. Does it mean "Incremental analysis" ???

-m, --modified Calculate modified cyclomatic complexity number, which count a switch/case with multiple cases as one CCN.

cyw3 commented 6 years ago

And how to use it.

terryyin commented 6 years ago

Hi,

The ‘-m’ or ‘—modified’ options does only a small change to the result. By default, a switch/case with 3 cases will by counted as 3 CCN. With ‘-m’, it will be counted as only 1.

Just Lizard -m will do.

Terry\

On 29 Nov 2017, at 1:06 PM, cyw3 notifications@github.com wrote:

And how to use it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/terryyin/lizard/issues/203#issuecomment-347754427, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwJYtlY-n5jlNKjNhTZTKqcxnuXhEDDks5s7OZmgaJpZM4Qua8I.

cyw3 commented 6 years ago

Why “With ‘-m’, it will be counted as only 1.”?? What is the meanning of '-m'?

terryyin commented 6 years ago

-m means “modified”, which is a bit of an over-generalization for just change the counting of switch/case.The reason behind this is some people believe that a switch/case with many cases doesn’t add as much complexity as ifs do, which I don’t quite agree. So this option is added to switch between the two ways of counting.On 29 Nov 2017, at 5:22 PM, cyw3 notifications@github.com wrote:Why “With ‘-m’, it will be counted as only 1.”?? What is the meanning of '-m'?—You are receiving this because you commented.Reply to this email directly, view it on GitHub, or mute the thread.