-
Affects PMD Version: Command run:
Output:
Code Sample demonstrating the issue:
Running PMD through: [CLI] Windows 10 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The ClassNotFoundException can be ignored, this rule doesn't need type information. What happens here is simply that your code is not complex enough to trigger a violation. The rule by default reports methods that have a cyclo over 10. The first method has cyclo 6, the second 4, the Refer to the doc of the rule, which mentions the following snippet if you want to customize the report threshold: <rule ref="category/java/design.xml/CyclomaticComplexity">
<properties>
<property name="classReportLevel" value="80" />
<property name="methodReportLevel" value="10" />
<property name="cycloOptions" value="" />
</properties>
</rule> |
Beta Was this translation helpful? Give feedback.
-
Fair enough, thank you for the explanation. It was the ClassNotFoundException that threw me, when I saw that I figured it was a parsing error versus it being below a minimum threshold.
From: Clément Fournier <[email protected]>
Sent: Wednesday, January 15, 2020 5:57 PM
To: pmd/pmd <[email protected]>
Cc: MrAngry52 <[email protected]>; Author <[email protected]>
Subject: Re: [pmd/pmd] [java] Getting ClassNotFoundException on standard PMD cyclomatic complexity plug-in (#2229)
The ClassNotFoundException can be ignored, this rule doesn't need type information.
What happens here is simply that your code is not complex enough to trigger a violation. The rule by default reports methods that have a cyclo over 10. The first method has cyclo 6, the second 4, the main 3.
Refer to the doc of the rule<https://pmd.github.io/latest/pmd_rules_java_design.html#cyclomaticcomplexity>, which mentions the following snippet if you want to customize the report threshold:
<rule ref="category/java/design.xml/CyclomaticComplexity">
<properties>
<property name="classReportLevel" value="80" />
<property name="methodReportLevel" value="10" />
<property name="cycloOptions" value="" />
</properties>
</rule>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#2229?email_source=notifications&email_token=AHFCVEX6GJXMVGAREVMKJVLQ565IPA5CNFSM4KHMODZ2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJCPLBQ#issuecomment-574944646>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AHFCVEU52DVW5DOGQ6EW6M3Q565IPANCNFSM4KHMODZQ>.
|
Beta Was this translation helpful? Give feedback.
The ClassNotFoundException can be ignored, this rule doesn't need type information.
What happens here is simply that your code is not complex enough to trigger a violation. The rule by default reports methods that have a cyclo over 10. The first method has cyclo 6, the second 4, the
main
3.Refer to the doc of the rule, which mentions the following snippet if you want to customize the report threshold: