Migration Tool for 5.6 to 5.7.x using custom PHPMD rules.

Permalink
I started writing custom static analysis rules to assist people migrating code to 5.7.x. I've written a few custom rules to alert people to namespace issues, directory structure changes, class naming convention changes, and some deprecation warnings. I attached my first tests using the email_list_signup package from the 5.7 add-on tutorial.
Interested parties can checkout the link below to the full phpmd zip. I'll post links to newer versions as they become available.

1 Attachment

 
VPenkov replied on at Permalink Reply
VPenkov
I'm certainly interested and it would be greatly appreciated.
codifyio replied on at Permalink Reply
I'm glad someone else is interested. After work tomorrow I'm going to throw it all into a repository. I'll post the link here. Cheers!
codifyio replied on at Permalink Reply
I decided to simply link to the full phpmd.zip embedded with the custom rules, as you seem to be the only interested party so far. If this zip doesn't work for you for some reason just download it from their site and drop in the custom ruleset xml and the custom classes (paths below).

Get it here:https://drive.google.com/open?id=0BzJg1XNiB0YZS1llSTdEdDh2QTQ&au...

phpmd/src/main/php/PHPMD/Rule/Concrete5_7/ Class files for custom rules live here.

phpmd/src/main/php/resources/rulesets/concrete5_7.xml is the custom ruleset

phpmd/src/bin/phpmd is the executable


I've just been dropping the directories I want to test into that last directory and running with:
php phpmd C:\Path\To\Test\Directory html concrete5_7 --reportfile .\results\results.html


In the above command line, you can change 'html' to 'text' (and maybe xml). If you want to include some of the other rules, and not just the concrete5_7 ruleset, you can use a ',' delineated list where there is no space between rule1 and rule2 such as concrete5_7,cleancode which will also include the clean code rules.

I set this up yesterday just to get the ball rolling and haven't spent much time on it. I will be making the rules stronger/cleaner as well as creating many more. I plan on adding an option to auto fix the selected errors/warnings. If you make any rules please post. I'll post more as I make them as well.