You know Pdepend, PHPMD? well it's a WTF counter for PHP, usefull for codereviews The concept is simple, when you review some code, if you think :
- What The Fuck?
- What The Fuck is that shit?
- Who The Fuck made this?
You simply add a @wtf_start and @wtf_stop as a comment before and after the code that needs fixing. PHPWTF will parse the code and report the wtfs it finds. Ideally we could even make it usable by Jenkins with a nice graph and code exploration :)
To run the example, you just need to go to where your the script is then type in your console : php phpwtf.php --path="./examples/.php,./examples/.js,./examples/*.html" --recursive --format=html
of course phptwtf script supports help command
phpwtf Command list :
--path=string "the relative paths where to look for files, ex: "./path/*.php,./path/*.js" Notice the , as separator"
--recursive "do you want the parser to loop in recursive directories"
--format=string "accepts xml (default), html and stats. Allow combination using +, ie : xml+stats. Note that html already generates stats too"
--output-path=string "Path for reports generation, defaults to ./reports/"
Accepting contributions :)
The Logo and favicon are courtesy of David Smith and under MIT Licence of the phpwtf project.