Documentation inconsistency for cyclomatic complexity metrics

17 views
Skip to first unread message

anand sudhan

unread,
May 15, 2017, 11:35:40 AM5/15/17
to SonarQube
Hello Folks,

For explanataion on Sonarqube cyclomatic complexity metrics - I found this link.

I used a Sonarqube 5.6.6 server, with Javascript plugin 2.20 and Java Plugin 4.5.

On testing Java and Javascript plugins I found the following inconsistencies:
  • For Java:
    • return statements not counted as +1 anymore (this is the non- last return statements of a method)
    • catch and throw statements are not counted as +1 anymore
  • For Javascript:
    • return statments not counted as +!
    • throw is not counted as +1
    • function expression is not considered as +1
I couldn't find release notes references for the plugins that corresponded to these changes in behaviour of the plugins( I was using Java 3.0 and Javascript 2.8 before).

Kindly update the documentation link for cyclomatic complexity metrics - if it is obsolete.

Thanks,
Anand



G. Ann Campbell

unread,
May 15, 2017, 1:50:55 PM5/15/17
to SonarQube
Hi Anand,

Thanks for bringing this to our attention. I've updated the documentation. Here are the relevant tickets:



Ann

anand sudhan

unread,
May 15, 2017, 2:40:26 PM5/15/17
to SonarQube
Hi Ann,

Thanks for the swift response. There are couple more corrections:
  • Typo here in Java section ", (that is not the last statement of a method)" - you can delete this - as it was associated with return statements
  • Also Catch statements dont add to complexity in Java - that is based on my testing - you may want to consider removing catch also from the Java section.
Thanks! - Anand

G. Ann Campbell

unread,
May 15, 2017, 2:42:45 PM5/15/17
to anand sudhan, SonarQube
Thanks Anand! Done.



---
G. Ann Campbell | SonarSource
Product Manager
@GAnnCampbell

--
You received this message because you are subscribed to a topic in the Google Groups "SonarQube" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sonarqube/o2phHkTlh-M/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sonarqube+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/f75be68f-495c-4226-8a2e-5c76d22663f5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages