We are using Sonar to analyze our code and configured PMD, findbugs and checkstyle rules in a custom quality profile of Sonar. The PMD rule Code style cyclomatic complexity gathers the violations in our code if the threshold has been breached for this rule. Sonar also has a Complexity widget in the Project dashboard which displays complexity based on class, method and file. Does this Complexity widget consider the same rules defined by PMD rule engine for computing code style cyclomatic complexity or does this widget have its own way of calculating complexity? Does Sonar complexity widget use the violations reported by PMD rule engine in determining the complexity?
The reason for asking this question is, if both have different approaches of calculating complexity, then we would like to refer only one method and also which one is the best to keep.