PHP Quality Tools – phploc lines of code
Need to check the lines of code in a PHP codebase? The phploc tool has you covered.
$ phpqa phploc ./app
This will give a summary of lines of code, separating out comments and non-comments, then gives you a whole lot more.
The cyclocmatic complexity measure is possible one of the more useful tools. Understanding that you have classes and methods that might be ‘too complex’ is the first step in dealing with that.
Why should you care about complexity? Less complex code provides
- Ease of long-term maintenance
- Ability for new folks to understand the code more quickly
- Smaller focused methods to test
