Add checkstyle rule UnusedLocalVariable
, UnusedLocalMethodCheck
#34823
Labels
status: waiting-for-triage
An issue we've not yet triaged or decided on
Add Checkstyle Rules:
UnusedLocalVariable
andUnusedLocalMethod
Rationale:
Our project currently leverages Checkstyle to enforce code quality, particularly by identifying and preventing unused imports. This practice helps to keep our codebase clean and efficient. Extending this philosophy, we aim to minimize overhead and eliminate obsolete (dead) code throughout the project. Introducing the
UnusedLocalVariable
andUnusedLocalMethod
Checkstyle rules directly supports this goal.Benefits:
Implementation:
By adding these two Checkstyle rules to our configuration, the build process will automatically flag any instances of unused local variables and methods. Developers will then be prompted to either remove these elements or justify their existence. This proactive approach ensures that our codebase remains lean and maintainable over time.
References:
Related Examples:
RemoveUnusedPrivateFields
#34814RemoveUnusedLocalVariables
#34809RemoveUnusedPrivateMethods
#34808UnusedLocalVariable
,UnusedLocalMethodCheck
#34816The text was updated successfully, but these errors were encountered: