Menu

#1361 ShortVariable and ShortMethodName configuration

PMD-5.4.0
closed
rules (1)
PMD
3-Major
Feature-Request
java-naming / ShortVariable and ShortMethodName
2015-05-20
2010-05-18
No

"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>

Discussion

  • Roman Muntyanu

    Roman Muntyanu - 2010-10-04

    Please as well consider adding configurable exclusions list because variables like "id" are meaningful, yet short, ending up with a ton of errors.

     
  • blundell

    blundell - 2015-05-19

    does this still apply? ShortMethodName is not configurable from what I can fathom (through xml ruleset file)

     
  • Andreas Dangel

    Andreas Dangel - 2015-05-20

    That's true - both rules are not configurable yet.
    I'll move this as a "feature-request" type issue...

     
  • Andreas Dangel

    Andreas Dangel - 2015-05-20

    Ticket moved from /p/pmd/feature-requests/546/

    Can't be converted:

    • _milestone:
     
  • Andreas Dangel

    Andreas Dangel - 2015-05-20
    • Module: --> PMD
    • Milestone: --> New Tickets
    • Priority: 5 --> 3-Major
    • Type: --> Feature-Request
    • Affects version: -->
    • Ruleset / Rule: --> java-naming / ShortVariable and ShortMethodName
     
  • Andreas Dangel

    Andreas Dangel - 2015-05-20
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: New Tickets --> PMD-5.4.0
     

Log in to post a comment.