Return to profile for Dave Liddament

Introducing static analysis to legacy projects

45 minute intermediate seminar


PHP has an impressive eco system of quality assurance tools. From relatively simple tools that check for adherence to coding standards, like PHP CS, all the way through to advanced static analysers like PHPStan. Using these reduces defects and boosts code quality.

Adding tools from scratch on a greenfield project is great. Integrating them in to existing codebases is more difficult; often these tools will hundreds of issues and there isn't time to fix them all immediately. Ideally developers will want to make sure all new code adheres to the high standards the QA tools set. But how can they see the new issues in amongst all the legacy problems?

Static Analysis Results Baseliner (SARB) is a tool that can help. It tracks code as it moves between lines in a file, or even through file renames. It uses this information to track issues raised and can filter out those in the baseline to show developers only the new issues they've raised.

This talk shows how SARB works. It gives practical examples with various QA tools. Finally it shows how to make adaptors so that SARB can work with any QA tool.