Repository navigation
[java] Fix #3741: Deprecate UseObjectForClearerApi - #6779
Conversation
aa02848 to
30e1c6f
Compare
|
Compared to main: (comment created at 2026-06-19 17:11:00+00:00 for 61c26e9) |
30e1c6f to
fcbb514
Compare
fcbb514 to
0bb23cd
Compare
0bb23cd to
29440bf
Compare
|
Would it make sense to add a second threshold A syntax with enums like To emulate the current |
|
Ehh... I don't like it.
Do you just want to be able to replicate the old behavior exactly, or do you see a real need for a rule like this? |
Personally I'm not using either of these rules 🙈 , but both "number of all parameters" and "number of parameters of the same type" are things I'd consider in a code review and I would use different threshold for pointing them out as issues. |
This could be a future improvement (aka different PR). Ideally, one could enable a single rule twice with different configurations in PMD (which currently isn't possible, but maybe when overriding the rule name? didn't try this), e.g.: <rule ref="category/apex/design.xml/ExcessiveParameterList" name="ExcessiveParameterListSameType">
<properties>
<property name="minimum" value="4" />
<property name="sameType" value="true" />
</properties>
</rule>
<rule ref="category/apex/design.xml/ExcessiveParameterList">
<properties>
<property name="minimum" value="10" />
<property name="sameType" value="false" />
</properties>
</rule> |
|
Did you check the comment on #1867? E.g. will ExcessiveParameterList report a violation for a method declaration, that implements a method declared in a interface? From the code, it probably does, because we don't ignore overridden methods. This might actually be an issue on its own (False positive when implementing inherited method) and probably should be solved separately. |
|
I've removed "- Close #1867 " from the opening post, since ExcessiveParameterList suffers from the same problem. |
Describe the PR
Enhance description of ExcessiveParameterList and deprecate UseObjectForClearerAPI
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)