/
[build] Improve static code analysis speeds [5.2.2-B2]

[build] Improve static code analysis speeds [5.2.2-B2]

In-Portal uses Phing build tool to assist developers in performing code-related analytics/fixing. The following tools are used:

  • PHP Lint (lint)
  • PHP Mess Detector (phpmd)
  • PHP Code Sniffer (phpcs)
  • PHP Code Sniffer Fixer (phpcbf)
  • PHP Copy Paste Detector (phpcpd)
  • PHP Documentor (phpdoc)
  • PHPUnit (phpunit)

Historically the first three are most time consuming. For example on a large project:

  • PHP Mess Detector could run 17 minutes;
  • PHP Code Sniffer could run 7 minutes.

This ends up every build taking at least 24 minutes.

Solution

Use caching command-line options provided by the PHP_CodeSniffer (–cache) and PHP_MessDetector (–cache & --cache-file).

Related Tasks

INP-1861 - Getting issue details... STATUS