• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

What is the rationale behind the "UnusedParameterRule"?

New Here ,
Sep 01, 2010 Sep 01, 2010

Copy link to clipboard

Copied

Hi,

I wonder if someone can explain the following questions regarding the "UnusedParameterRule":

  1. Why is it a blocker?
    I can imagine a developer gets a warning when he (or she) doesn't use the passed parameters - but I really don't understand why it is a blocker...
  2. (Maybe redundant) Where can I find more information about this (and other) rule(s) and the reasons for creating it/them?
    It is possible I used the wrong search terms, but I really did not find anything... except an example, and I understand the example as such, but not the why!

And I know I can change the severity of the rule or ignore the rule entirely, but it is important to me to understand why I should or shouldn't...

TIA,

Mylène

TOPICS
FlexPMD

Views

722

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 01, 2010 Sep 01, 2010

Copy link to clipboard

Copied

Hi Mylène,

The default severity of a rule is always subject to change depending on the project.

One could argue that an unused formal parameter hits maintainability, and hence would be a blocker.

For that one, I would agree with you. I think that should be a warning by default.

FYI, in the Java PMD documentation website (http://pmd.sourceforge.net/rules/unusedcode.html) states:

Avoid passing parameters to methods or constructors and then not using those parameters.    

and they provide a (too?) simple example.

You can open a ticket on JIRA so that we change the default severity.

Cheers,

Xavier

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 01, 2010 Sep 01, 2010

Copy link to clipboard

Copied

Thanks,

I will

Mylène

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Sep 02, 2010 Sep 02, 2010

Copy link to clipboard

Copied

LATEST

The issue has been fixed against trunk and closed on JIRA

Cheers,

Xavier

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines