TikiWiki/tiki-manager

View on GitHub
src/Command/ConsoleInstanceCommand.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method interact has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function interact(InputInterface $input, OutputInterface $output)
    {
        if (empty($input->getOption('instances'))) {
            $instances = CommandHelper::getInstances('tiki');
            $instancesInfo = CommandHelper::getInstancesInfo($instances);
Severity: Minor
Found in src/Command/ConsoleInstanceCommand.php - About 1 hr to fix

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

        protected function execute(InputInterface $input, OutputInterface $output)
        {
            $instances = CommandHelper::getInstances('tiki');
            $instancesInfo = CommandHelper::getInstancesInfo($instances);
    
    
    Severity: Minor
    Found in src/Command/ConsoleInstanceCommand.php - About 1 hr to fix

      Avoid using static access to class '\TikiManager\Command\Helper\CommandHelper' in method 'interact'.
      Open

                          return CommandHelper::validateInstanceSelection($answer, $instances);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\TikiManager\Command\Helper\CommandHelper' in method 'execute'.
      Open

              $instancesInfo = CommandHelper::getInstancesInfo($instances);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\TikiManager\Command\Helper\CommandHelper' in method 'interact'.
      Open

                  $instances = CommandHelper::getInstances('tiki');

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\TikiManager\Command\Helper\CommandHelper' in method 'interact'.
      Open

                  $instancesInfo = CommandHelper::getInstancesInfo($instances);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\TikiManager\Command\Helper\CommandHelper' in method 'interact'.
      Open

                  CommandHelper::renderInstancesTable($output, $instancesInfo);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\TikiManager\Command\Helper\CommandHelper' in method 'execute'.
      Open

              CommandHelper::validateInstanceSelection($instancesOption, $instances);

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Avoid using static access to class '\TikiManager\Command\Helper\CommandHelper' in method 'execute'.
      Open

              $instances = CommandHelper::getInstances('tiki');

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

      Source https://phpmd.org/rules/cleancode.html#staticaccess

      Possibly zero references to use statement for classlike/namespace App (\TikiManager\Config\App)
      Open

      use TikiManager\Config\App;
      Severity: Minor
      Found in src/Command/ConsoleInstanceCommand.php by phan

      There are no issues that match your filters.

      Category
      Status