moodle-local_codechecker icon indicating copy to clipboard operation
moodle-local_codechecker copied to clipboard

Review includes in index.php and run.php

Open sarjona opened this issue 4 years ago • 0 comments

While reviewing https://github.com/moodlehq/moodle-local_codechecker/pull/90, @vmdef has raised a couple of interesting things to review related to the included files in index.php and run.php:

if (is_file(__DIR__ . '/phpcs/autoload.php') === true) {
    include_once(__DIR__ . '/phpcs/autoload.php');
} else {
    include_once('PHP/CodeSniffer/autoload.php');
}
// PHPCompatibility autoloading.
require_once('PHPCSAliases.php');

  1. "PHP/CodeSniffer/autoload.php" include might not be required any more.
  2. PHPCSAliases.php is included through PHPCompatibility/ruleset.xml, so we don't need to include it here.

This issue is about the check if this piece of code can be improved and some of these includes can be removed definitively.

sarjona avatar Oct 28 '20 14:10 sarjona