How does SonarQube measure the complexity of Java 8 lambda expressions?

287 views
Skip to first unread message

Joerg

unread,
Sep 19, 2016, 8:23:23 AM9/19/16
to SonarQube
Hello,

Is there any documentation available on how SonarQube measures the complexity of Java 8 lambda expressions (or if it does at all)?

In the SonarQube documentation, I have found only this page here, but there is nothing mentioned on lambda expressions.

http://docs.sonarqube.org/display/SONAR/Metrics+-+Complexity

Thanks in advance.

Kind Regards,

Joerg

Freddy Mallet

unread,
Sep 20, 2016, 10:39:06 AM9/20/16
to Joerg, SonarQube
Hi Joerg,

This is a kind of fundamental question and to be honest we haven't yet took any decision on this point, see https://jira.sonarsource.com/browse/MMF-151

Because obviously when Mc Cabe specified the way to compute the Cyclomatic Complexity there were mainly some very high level entry points (in COBOL programs for instance) and no concept of closures. From a purely theoretical point of view, each lambda should be considered as a method and so should increment at least by one the CC but on the other hand in term of human readability, I think that would be a mistake to increment the CC.

If you are aware of any academical publication on this subject, please share it :)
Thanks
Freddy
 

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/7a7ac0b5-c4a0-4769-9b72-8aaf233f4433%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Freddy MALLET | SonarSource
Product Director & Co-Founder
http://sonarsource.com
Reply all
Reply to author
Forward
0 new messages