<rule ref="rulesets/design.xml/CouplingBetweenObjects"> <properties> <property name="maximum" value="20" /> </properties> </rule>
@napestershine in case you are interested here are configurations based on SIG (https://www.softwareimprovementgroup.com/) recommendation https://github.com/AJenbo/agcms/blob/master/phpmd.xml
I did relax the lines per function rule. Ideally, functions should be 16 lines, but 31 is generally acceptable.
I just updated my application to SF5.1 and I have config and file
I am getting:
src/Kernel.php:14 Avoid assigning values to variables in if clauses and the like (line '22', column '27'). src/Kernel.php:27 Avoid assigning values to variables in if clauses and the like (line '34', column '27').
And I guess I never touched this file. so what is best practice in this case ?
/** * @SuppressWarnings(PHPMD) * @author Symfony Framework */ class Kernel extends BaseKernel ...
The biggest difference is that SIG allows for various percentages distributions, something like:
100% of functions are 60 lines or less
95% of functions are 30 lines or less
75% of functions are 15 lines or less
But PHPMD only allows for 100% are X or less.
If that is something we can work on supporting that would be a really good upgrade to the tool.