Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Trivago Tech Blog:
Continuous Performance Monitoring for PHP - The tale of Blackfire at trivago
Oct 30, 2017 @ 16:48:38

On the Trivago Tech blog they've shared some of their experience in continuous performance improvements in PHP applications and how the Blackfire.io service helped them get their best performance.

Our mission is to provide the user with the ideal hotel at the lowest rate. Our backend consists of several services written in different languages. To succeed at this goal we do complex tasks in our main application developed in PHP. While doing this we need to keep the website as fast as possible.

We started to look for some tool that could help us identify performance issues in our code base. We evaluated Blackfire and decided that it was a good fit for our use case.

The article starts by answering the question of "why Blackfire?" and continues on, showing how they integrated it with their workflow. They use the SaltStack tooling to set up servers and configure them so it was just a matter of integrating the Blackfire agent and probe extension via that. They include an overall diagram of how it fits into the architecture and how they worked around the lack of Bitbucket server support. The post finishes with some examples of performance metrics from before and after the optimizations from their results stored in InfluxDB.

tagged: trivago continuous performance monitoring blackfire blackfireio metrics results architecture

Link: http://tech.trivago.com/2017/10/27/continuous-performance-monitoring-for-php---the-tale-of-blackfire-at-trivago/

Community News:
Exakat - Static analysis tools for PHP
Feb 27, 2017 @ 20:25:25

On the Exakat GitHub account Damien Seguy has put together a pretty complete list of static analyzers you can use for your PHP applications.

The list is broken down into the types of scanners:

  • Bugs finders
  • Coding standards
  • DIY
  • Fixers
  • Metrics
  • SaaS
  • Misc

Each section includes a good list of tools and links to each of them (usually just to other GitHub repositories but some go to actual project pages). There's a lot of them to look through but be careful to evaluate the current state of the project. Just because it's linked here doesn't mean it's a complete tool.

tagged: static scanner tool language bug standard metrics saas list

Link: https://github.com/exakat/php-static-analysis-tools

SitePoint PHP Blog:
Visualize Your Code’s Quality with PhpMetrics
Dec 26, 2014 @ 18:48:31

The SitePoint PHP blog has a recent tutorial showing how to use PhpMetrics to visualize your application and the quality of its code.

We had been looking into code quality checking tools for a while here on SitePoint – most recently in a series on Jenkins, but none of those could do what a project I’ve only recently found out about can. PhpMetrics uses D3 and some sophisticated analysis algorithms to scan your application’s code and output intricate reports about it.

He walks you through the install (via Composer) and how to clone two example projects, Laravel and Symfony, to evaluate. He includes the command line to run the evaluation and plenty of screenshots showing the results for things like:

  • Cyclomatic complexity
  • Abstractness
  • Maintainability
  • Code density

He uses the results from these two projects in his examples and, at the end of the post, summarizes and compares the results it produced.

tagged: code quality metrics phpmetrics visualize tutorial

Link: http://www.sitepoint.com/visualize-codes-quality-phpmetrics/

Peter Aba:
phpmetrics of popular php projects
Sep 15, 2014 @ 15:11:01

Peter Aba has put together a a set of visualizations around the popularity of various PHP projects using the phpmetrics tool. He decided to run it against several projects he knows of and share the results.

I came across a new tool called phpmetrics. It can be used for, what a surprise, calculating and displaying metrics for php. I fell in love with this cute little tool in an instance and decided to run it on some php projects that I consider important. I’m aware of the fact that the list is currently far from complete, but it’s probably still worth a look. I especially love the “maintenability” (sic!) reports, I find those big red spots just as disgusting as I find ugly code the same.

He's broken it up into a few different sections with lots of different projects under each:

  • Frameworks
  • CMS
  • E-commerce
  • Development tools

There's also an "Other" (and "Backfire") category that contains the results for the results of phpmetrics itself. He also includes a few issues he ran across during the processing of the metrics, some with the phpmetrics tool itself and some with the libraries themselves.

tagged: metrics popular projects phpmetrics results visualization

Link: https://peteraba.com/blog/phpmetrics-of-popular-projects/

QaFoo:
Code Review Tool
Nov 05, 2012 @ 15:41:16

On the QaFoo site they've shared a tool they use for doing code reviews in a new post to their blog. The tool, just called review, lets you run several different metrics on the code including the PHP "mess detector", PDepend and PHPCPD (copy & paste detector).

We, at Qafoo, do Code Reviews quite often together with our customers. This often focusses on dicussing metrics, browsing the associated code and discussing solutions for the issues found. We started using a bunch of shell scripts for that, like everyone else, but at some point we came up with a webinterface to do this in a more comfortable way. Now we want to share this tool with you.

Included in the post are several screenshots showing the results of the different types of evaluations - the ones mentioned above as well as things like "methods per class", cyclomatic complexity and NPath complexity. There's also a source code browser and a visual class structure generation tool (UML). It's under a AGPLv3 license and can be found on their site.

tagged: code review tool metrics browser uml github

Link:

Sebastian Bergmann's Blog:
Towards Better Code Coverage Metrics in the PHP World
Jun 20, 2011 @ 13:10:57

Sebastian Bergmann has a new post to his blog talking about some of the future plans for better code coverage metrics for PHP applications (not just the statistics that we have now as generated from PHPUnit runs combined with Code_Coverage PEAR package and Xdebug).

Xdebug currently only supports what is usually referred to as Line Coverage. This software metric measures whether each executable line was executed. Based on the line coverage information provided by Xdebug, PHP_CodeCoverage also calculates the Function / Method Coverage software metric that measures whether each function or method has been invoked.

The various kinds of coverage they're planning the in future include statement coverage, branch coverage (boolean evaluation), call coverage, path coverage with an alternative of linear code sequence and jump coverage (LCSAJ).

tagged: codecoverage metrics analyze code xdebug phpunit phpcodecoverage pear

Link:

Sebastian Bergmann's Blog:
On PHPUnit and Software Metrics
Feb 08, 2008 @ 15:31:00

In one of his latest entries, Sebastian Bergmann answers a question from another blogger about the future of software metrics and project mess detection as a part of the PHPUnit project.

When I started to work on these projects, there was no other place for me then to develop them as part of PHPUnit. [...] But the more I thought about it, I realized that these features do not belong into PHPUnit but into a suite of tools that PHPUnit is a well-integrated part of.

He did, however, include it as a part of the PHPUnit 3.2 release at that time. Now, however, there are the tools and platforms to make those tests useful outside of the PHPUnit environment and is allowing him to move it out from the testing application and on to closer integration with other software.

tagged: phpunit software metrics project mess detection integration

Link:

Nick Halstead's Blog:
Programming Tips #7 & #8
Dec 11, 2007 @ 15:32:00

Nick Halstead has posted two more programming tips in his series - this time they cover "non-coding" and "XHTML analytics:

The first, tip #7, was written up by Jonathan Holland. He talks about a method of using metrics software that works correctly with XHTML syntax. His example script basically does a dynamic add to the page when it's loaded to put the script tag in after the validation has taken place.

The next tip, #8 (written by Dordea Cosmin), looks at "non coding" types of things you can do to help work towards success in your company. These sorts of things include diplomacy, being friendly, and continuing education.

tagged: programming tip xhtml metrics noncoding diplomacy education programming tip xhtml metrics noncoding diplomacy education

Link:

Nick Halstead's Blog:
Programming Tips #7 & #8
Dec 11, 2007 @ 15:32:00

Nick Halstead has posted two more programming tips in his series - this time they cover "non-coding" and "XHTML analytics:

The first, tip #7, was written up by Jonathan Holland. He talks about a method of using metrics software that works correctly with XHTML syntax. His example script basically does a dynamic add to the page when it's loaded to put the script tag in after the validation has taken place.

The next tip, #8 (written by Dordea Cosmin), looks at "non coding" types of things you can do to help work towards success in your company. These sorts of things include diplomacy, being friendly, and continuing education.

tagged: programming tip xhtml metrics noncoding diplomacy education programming tip xhtml metrics noncoding diplomacy education

Link:

Sebastian Bergmann's Blog:
PHPUnit and Cyclomatic Complexity
Aug 02, 2007 @ 12:56:00

Sebastian Bergmann mentions today about a feature in an upcoming release of a popuular unit testing tool for PHP, PHPUnit - the addition of more software metrics.

The upcoming 3.1.6 release of PHPUnit adds a couple of software metrics to the data that is stored in PHPUnit's test database. Among these metrics is the Cyclomatic Complexity Number (CCN).

An example of how the CCN works is shown in the post giving the className, methodName and the complexity ranking given for the combination. His example shows the rankings for a part of the eZ Components software.

tagged: phpunit unittest cyclomatic complexity database software metrics phpunit unittest cyclomatic complexity database software metrics

Link:


Trending Topics: