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

Similar Posts

  • PHP Quality Tools

    Curious about checking out the quality of your PHP project, but don’t know where to start? https://github.com/jakzal/phpqa is a project providing docker images of various tools to help measure aspects of your PHP code. will run the phploc tool on your current folder But… you can alias the tool, then simply run $ phpqa <toolname>…

  • Onboarding freelancers

    Maari Casey over at uncompany had a recent LinkedIn post about planning for freelancers. She made some good points, but I think skipped one, and it’s not just relevant for freelancers. Even well before an organization might need extra work – be it freelance or employee – companies need to have a plan for onboarding….

  • CyclopsMonitor

    I’ve been posting more about this new service over on linkedin, but haven’t posted much here. CyclopsMonitor is a web monitoring service – checking if a web address is up, how fast it responds, if specific content is available, when SSL/TLS certs expire, when domain name expires, and… sending you notifications when problems occur. Currently,…

Leave a Reply

Your email address will not be published. Required fields are marked *