vaimo/composer-patches

View on GitHub
src/Composer/Commands/PatchCommand.php

Summary

Maintainability
B
4 hrs
Test Coverage

Method configure has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function configure()
    {
        $this->setName('patch');
        $this->setDescription('Apply registered patches to current project');

Severity: Major
Found in src/Composer/Commands/PatchCommand.php - About 2 hrs to fix

    Method execute has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $composer = $this->getComposer();
    
            $appIO = $this->getIO();
    Severity: Minor
    Found in src/Composer/Commands/PatchCommand.php - About 1 hr to fix

      Missing class import via use statement (line '154', column '29').
      Open

              $runtimeUtils = new \Vaimo\ComposerPatches\Utils\RuntimeUtils();

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '148', column '33').
      Open

              $bootstrapFactory = new \Vaimo\ComposerPatches\Factories\BootstrapFactory($composerContext, $appIO);

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '231', column '29').
      Open

              $runtimeUtils = new \Vaimo\ComposerPatches\Utils\RuntimeUtils();

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '152', column '31').
      Open

              $compatExecutor = new \Vaimo\ComposerPatches\Compatibility\Executor();

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '184', column '31').
      Open

              $configDefaults = new \Vaimo\ComposerPatches\Config\Defaults();

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '130', column '31').
      Open

              $contextFactory = new \Vaimo\ComposerPatches\Factories\ComposerContextFactory($composer);

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '133', column '30').
      Open

              $configFactory = new \Vaimo\ComposerPatches\Factories\ConfigFactory($composerContext, array(

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '150', column '31').
      Open

              $outputStrategy = new \Vaimo\ComposerPatches\Strategies\OutputStrategy($outputTriggers);

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Missing class import via use statement (line '155', column '30').
      Open

              $lockSanitizer = new \Vaimo\ComposerPatches\Repository\Lock\Sanitizer($appIO);

      MissingImport

      Since: 2.7.0

      Importing all external classes in a file through use statements makes them clearly visible.

      Example

      function make() {
          return new \stdClass();
      }

      Source http://phpmd.org/rules/cleancode.html#MissingImport

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addArgument
      Open

              $this->addArgument(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_NONE from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_NONE,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_NONE from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_NONE,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_NONE from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_NONE,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to method getOption from undeclared class \Symfony\Component\Console\Input\InputInterface
      Open

              if (!$input->getOption('no-scripts')) {
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Parameter $input has undeclared type \Symfony\Component\Console\Input\InputInterface
      Open

          private function getOptionGraceful(InputInterface $input, $name)
      Severity: Minor
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to method getOption from undeclared class \Symfony\Component\Console\Input\InputInterface
      Open

                  Patch::SOURCE => $input->getOption('filter'),
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::setName
      Open

              $this->setName('patch');
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to method getArgument from undeclared class \Symfony\Component\Console\Input\InputInterface
      Open

                  Patch::TARGETS => $input->getArgument('targets')
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_NONE from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_NONE,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_NONE from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_NONE,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::setDescription
      Open

              $this->setDescription('Apply registered patches to current project');
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::getComposer
      Open

              $composer = $this->getComposer();
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to method getOption from undeclared class \Symfony\Component\Console\Input\InputInterface
      Open

                  Config::PATCHER_GRACEFUL => (bool)$input->getOption('graceful')
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_IS_ARRAY from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_NONE from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_NONE,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Parameter $input has undeclared type \Symfony\Component\Console\Input\InputInterface
      Open

          private function resolveActiveFilters(InputInterface $input, array $behaviourFlags)
      Severity: Minor
      Found in src/Composer/Commands/PatchCommand.php by phan

      Class extends undeclared class \Composer\Command\BaseCommand
      Open

      class PatchCommand extends \Composer\Command\BaseCommand
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_OPTIONAL from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to method getOption from undeclared class \Symfony\Component\Console\Input\InputInterface
      Open

              return $input->hasOption($name) && $input->getOption($name);
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to method hasOption from undeclared class \Symfony\Component\Console\Input\InputInterface
      Open

              return $input->hasOption($name) && $input->getOption($name);
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_NONE from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_NONE,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to method getOption from undeclared class \Symfony\Component\Console\Input\InputInterface
      Open

                  Config::PATCHER_FROM_SOURCE => (bool)$input->getOption('from-source'),
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant IS_ARRAY from undeclared class \Symfony\Component\Console\Input\InputArgument
      Open

                  InputArgument::IS_ARRAY,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant POST_INSTALL_CMD from undeclared class \Composer\Script\ScriptEvents
      Open

                  $composer->getEventDispatcher()->dispatchScript(ScriptEvents::POST_INSTALL_CMD, $isDevMode);
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_NONE from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_NONE,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Parameter $input has undeclared type \Symfony\Component\Console\Input\InputInterface
      Open

          protected function execute(InputInterface $input, OutputInterface $output)
      Severity: Minor
      Found in src/Composer/Commands/PatchCommand.php by phan

      Parameter $output has undeclared type \Symfony\Component\Console\Output\OutputInterface
      Open

          protected function execute(InputInterface $input, OutputInterface $output)
      Severity: Minor
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::getIO
      Open

              $appIO = $this->getIO();
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to method getOption from undeclared class \Symfony\Component\Console\Input\InputInterface
      Open

              $isDevMode = !$input->getOption('no-dev');
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Reference to constant VALUE_NONE from undeclared class \Symfony\Component\Console\Input\InputOption
      Open

                  InputOption::VALUE_NONE,
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Call to undeclared method \Vaimo\ComposerPatches\Composer\Commands\PatchCommand::addOption
      Open

              $this->addOption(
      Severity: Critical
      Found in src/Composer/Commands/PatchCommand.php by phan

      Parameter $input has undeclared type \Symfony\Component\Console\Input\InputInterface
      Open

          protected function getBehaviourFlags(InputInterface $input)
      Severity: Minor
      Found in src/Composer/Commands/PatchCommand.php by phan

      There are no issues that match your filters.

      Category
      Status