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

  • A bit of feedback…

    A small bit of feedback… that’s often what a mobile user is looking for. Haptic feedback – a quick device vibration – is great. It’s subtle, quick, doesn’t interrupt, but gives an actual *feeling* that something happened. And… on iOS, it’s harder to do without building a full ‘native mobile app’. iOS Safari doesn’t support…

  • k as in knife

    Many moons ago my earlier version of my blog had this list I use when spelling things for people over the phone. I managed to find it at archive.org and thought I’d repost… a as in aisle (or aye) b as in bdellium  c as in czar d as in djibouti e as in eight…

  • 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>…

  • Importance of backups

    Well… here we are.  10 years later, and … no backups.  Or… none of the data that’s important. Recently had a drive crash in my main server where this blog is hosted.  Had it happen 2 years ago, but the data was recovered, and I put everything on automatic backups.  Using virtualmin, a great control…

Leave a Reply

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