ShortVariable and ShortMethodName configuration
A source code analyzer
Brought to you by:
adangel,
juansotuyo
"ShortVariable" and "ShortMethodName" rules are not configurable as they should be.
Instead of :
//VariableDeclaratorId[string-length(@Image) < 3]
Use :
//VariableDeclaratorId[string-length(@Image) < $minimum]
With :
<properties>
<property name="minimum" description="The variable length reporting threshold" value="3"/>
</properties>
Please as well consider adding configurable exclusions list because variables like "id" are meaningful, yet short, ending up with a ton of errors.
does this still apply? ShortMethodName is not configurable from what I can fathom (through xml ruleset file)
That's true - both rules are not configurable yet.
I'll move this as a "feature-request" type issue...
Ticket moved from /p/pmd/feature-requests/546/
Can't be converted:
This will be implemented for pmd 5.4.0.
Commit: https://github.com/pmd/pmd/commit/869d4c7005e2293297a3f42c4a30530fb8e9e396