YetiForceCompany/YetiForceCRM

View on GitHub
app/Cli.php

Summary

Maintainability
C
7 hrs
Test Coverage
F
24%

Method __construct has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function __construct()
    {
        $this->exec = \function_exists('exec');
        $this->climate = new \League\CLImate\CLImate();
        if (!$this->exec) {
Severity: Major
Found in app/Cli.php - About 2 hrs to fix

    Function showHelp has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        private function showHelp(): void
        {
            if ($this->climate->arguments->defined('module')) {
                $module = $this->climate->arguments->get('module');
                $className = "\\App\\Cli\\{$module}";
    Severity: Minor
    Found in app/Cli.php - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method showHelp has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function showHelp(): void
        {
            if ($this->climate->arguments->defined('module')) {
                $module = $this->climate->arguments->get('module');
                $className = "\\App\\Cli\\{$module}";
    Severity: Minor
    Found in app/Cli.php - About 1 hr to fix

      Function __construct has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function __construct()
          {
              $this->exec = \function_exists('exec');
              $this->climate = new \League\CLImate\CLImate();
              if (!$this->exec) {
      Severity: Minor
      Found in app/Cli.php - About 1 hr to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      The method __construct() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
      Open

          public function __construct()
          {
              $this->exec = \function_exists('exec');
              $this->climate = new \League\CLImate\CLImate();
              if (!$this->exec) {
      Severity: Minor
      Found in app/Cli.php by phpmd

      CyclomaticComplexity

      Since: 0.1

      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

      Example

      // Cyclomatic Complexity = 11
      class Foo {
      1   public function example() {
      2       if ($a == $b) {
      3           if ($a1 == $b1) {
                      fiddle();
      4           } elseif ($a2 == $b2) {
                      fiddle();
                  } else {
                      fiddle();
                  }
      5       } elseif ($c == $d) {
      6           while ($c == $d) {
                      fiddle();
                  }
      7        } elseif ($e == $f) {
      8           for ($n = 0; $n < $h; $n++) {
                      fiddle();
                  }
              } else {
                  switch ($z) {
      9               case 1:
                          fiddle();
                          break;
      10              case 2:
                          fiddle();
                          break;
      11              case 3:
                          fiddle();
                          break;
                      default:
                          fiddle();
                          break;
                  }
              }
          }
      }

      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

      Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
      Open

          private function showHelp(): void
      Severity: Critical
      Found in app/Cli.php by sonar-php

      Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

      See

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

              $this->climate = new \League\CLImate\CLImate();
      Severity: Minor
      Found in app/Cli.php by phpmd

      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

      The method __construct has a boolean flag argument $full, which is a certain sign of a Single Responsibility Principle violation.
      Open

                      public function exec($command, $full = false)
      Severity: Minor
      Found in app/Cli.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

      A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

      Example

      class Foo {
          public function bar($flag = true) {
          }
      }

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

      Missing class import via use statement (line '138', column '16').
      Open

              foreach (new \DirectoryIterator(ROOT_DIRECTORY . '/app/Cli') as $fileInfo) {
      Severity: Minor
      Found in app/Cli.php by phpmd

      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 '33', column '32').
      Open

                  $this->climate->setUtil(new \League\CLImate\Util\UtilFactory(new class() extends \League\CLImate\Util\System\System {
      Severity: Minor
      Found in app/Cli.php by phpmd

      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

      The method actionsList uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  \call_user_func([$instance, $action]);
              }
      Severity: Minor
      Found in app/Cli.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

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

      Avoid using static access to class 'App\Version' in method '__construct'.
      Open

              $this->climate->white('Version: ' . Version::get() . ' | CRM URL: ' . \Config\Main::$site_URL);
      Severity: Minor
      Found in app/Cli.php by phpmd

      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 '\App\User' in method '__construct'.
      Open

              \App\User::setCurrentUserId(\Users::getActiveAdminId());
      Severity: Minor
      Found in app/Cli.php by phpmd

      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 '\Users' in method '__construct'.
      Open

              \App\User::setCurrentUserId(\Users::getActiveAdminId());
      Severity: Minor
      Found in app/Cli.php by phpmd

      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

      The method __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $this->modulesList();
              }
      Severity: Minor
      Found in app/Cli.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

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

      The method showHelp uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      $this->climate->white('Action list for module ' . $this->climate->arguments->get('module'));
                      $this->climate->columns(array_merge([' > Action name <' => ' > Description <'], $instance->methods));
                      $this->climate->lightGreen()->border('─', 200);
                      foreach (array_keys($instance->methods) as $method) {
      Severity: Minor
      Found in app/Cli.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

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

      Avoid using static access to class '\App\Language' in method '__construct'.
      Open

              \App\Language::setTemporaryLanguage('en-US');
      Severity: Minor
      Found in app/Cli.php by phpmd

      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

      The method showHelp uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $modules = $this->getModulesList();
                  $modules = array_keys($modules);
                  $this->climate->white('Modules list:')->columns($modules);
                  $this->climate->lightGreen()->border('─', 200);
      Severity: Minor
      Found in app/Cli.php by phpmd

      ElseExpression

      Since: 1.4.0

      An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

      Example

      class Foo
      {
          public function bar($flag)
          {
              if ($flag) {
                  // one branch
              } else {
                  // another branch
              }
          }
      }

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

      Remove this unused private "getModulesList" method.
      Open

          private function getModulesList(): array
      Severity: Major
      Found in app/Cli.php by sonar-php

      private methods that are never executed are dead code: unnecessary, inoperative code that should be removed. Cleaning out dead code decreases the size of the maintained codebase, making it easier to understand the program and preventing bugs from being introduced.

      Noncompliant Code Example

      public class Foo
      {
        private function Foo() {}   // Compliant, private empty constructor intentionally used to prevent any direct instantiation of a class.
      
        public static function doSomething()
        {
          $foo = new Foo();
          ...
        }
      
        private function unusedPrivateFunction() {  // Noncompliant
        }
      }
      

      Compliant Solution

      public class Foo
      {
        private function Foo(){}   // Compliant, private empty constructor intentionally used to prevent any direct instantiation of a class.
      
        public static function doSomething()
        {
          $foo = new Foo();
        }
      }
      

      See

      Define a constant instead of duplicating this literal "error" 6 times.
      Open

                  $this->climate->to('error')->lightRed('Error:  YetiForce CLI works only on the OS user who owns the CRM files');
      Severity: Critical
      Found in app/Cli.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Remove this unused private "showHelp" method.
      Open

          private function showHelp(): void
      Severity: Major
      Found in app/Cli.php by sonar-php

      private methods that are never executed are dead code: unnecessary, inoperative code that should be removed. Cleaning out dead code decreases the size of the maintained codebase, making it easier to understand the program and preventing bugs from being introduced.

      Noncompliant Code Example

      public class Foo
      {
        private function Foo() {}   // Compliant, private empty constructor intentionally used to prevent any direct instantiation of a class.
      
        public static function doSomething()
        {
          $foo = new Foo();
          ...
        }
      
        private function unusedPrivateFunction() {  // Noncompliant
        }
      }
      

      Compliant Solution

      public class Foo
      {
        private function Foo(){}   // Compliant, private empty constructor intentionally used to prevent any direct instantiation of a class.
      
        public static function doSomething()
        {
          $foo = new Foo();
        }
      }
      

      See

      Define a constant instead of duplicating this literal "description" 3 times.
      Open

                      'description' => 'Module name',
      Severity: Critical
      Found in app/Cli.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "module" 12 times.
      Open

                  'module' => [
      Severity: Critical
      Found in app/Cli.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "prefix" 3 times.
      Open

                      'prefix' => 'm',
      Severity: Critical
      Found in app/Cli.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Define a constant instead of duplicating this literal "action" 12 times.
      Open

                  'action' => [
      Severity: Critical
      Found in app/Cli.php by sonar-php

      Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

      On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

      Noncompliant Code Example

      With the default threshold of 3:

      function run() {
        prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
        execute('action1');
        release('action1');
      }
      

      Compliant Solution

      ACTION_1 = 'action1';
      
      function run() {
        prepare(ACTION_1);
        execute(ACTION_1);
        release(ACTION_1);
      }
      

      Exceptions

      To prevent generating some false-positives, literals having less than 5 characters are excluded.

      Avoid unused parameters such as '$command'.
      Open

                      public function exec($command, $full = false)
      Severity: Minor
      Found in app/Cli.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Avoid unused parameters such as '$full'.
      Open

                      public function exec($command, $full = false)
      Severity: Minor
      Found in app/Cli.php by phpmd

      UnusedFormalParameter

      Since: 0.2

      Avoid passing parameters to methods or constructors and then not using those parameters.

      Example

      class Foo
      {
          private function bar($howdy)
          {
              // $howdy is not used
          }
      }

      Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

      Call to method white from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->white('Version: ' . Version::get() . ' | CRM URL: ' . \Config\Main::$site_URL);
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

              } elseif ($this->climate->arguments->defined('module') && $this->climate->arguments->defined('action')) {
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method radio from undeclared class \League\CLImate\CLImate
      Open

              $input = $this->climate->radio('Action:', array_merge($instance->methods, ['Exit' => 'Exit']));
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method white from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->white("php cli.php -m $module");
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method __construct from undeclared class \League\CLImate\Util\UtilFactory
      Open

                  $this->climate->setUtil(new \League\CLImate\Util\UtilFactory(new class() extends \League\CLImate\Util\System\System {
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method to from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->to('error')->lightRed('Error:  YetiForce CLI works only on the OS user who owns the CRM files');
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                  $this->actionsList($this->climate->arguments->get('module'));
      Severity: Minor
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->to('error')->lightRed("Error: Action '{$this->climate->arguments->get('action')}' does not exist in '{$this->climate->arguments->get('module')}'");
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method usage from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->usage();
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                  if ($this->climate->arguments->defined('action') && !empty($this->climate->arguments->get('action'))) {
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method white from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->white('Modules list:')->columns($modules);
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method __construct from undeclared class \League\CLImate\CLImate
      Open

              $this->climate = new \League\CLImate\CLImate();
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

              if ($this->climate->arguments->defined('help')) {
      Severity: Minor
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->to('error')->lightRed("Error: Module '{$this->climate->arguments->get('module')}' does not exist");
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method white from undeclared class \League\CLImate\CLImate
      Open

                          $this->climate->white("php cli.php -m $module -a $method");
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method lightGreen from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->lightGreen()->border('─', 200);
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method clear from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->clear();
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method lightGreen from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->lightGreen()->border('─', 200);
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method setUtil from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->setUtil(new \League\CLImate\Util\UtilFactory(new class() extends \League\CLImate\Util\System\System {
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method lightGreen from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->lightGreen()->border('─', 200);
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method usage from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->usage();
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

              if ($this->climate->arguments->defined('module')) {
      Severity: Minor
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                      \call_user_func([$instance, $this->climate->arguments->get('action')]);
      Severity: Minor
      Found in app/Cli.php by phan

      Reference to static property site_URL from undeclared class \Config\Main
      Open

              $this->climate->white('Version: ' . Version::get() . ' | CRM URL: ' . \Config\Main::$site_URL);
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method backgroundBlue from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->backgroundBlue()->out($instance->methods[$this->climate->arguments->get('action')]);
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method to from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->to('error')->lightRed('Error: YetiForce CLI only works from the operating system console (CLI)');
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
      Open

              \App\User::setCurrentUserId(\Users::getActiveAdminId());
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->backgroundBlue()->out($instance->methods[$this->climate->arguments->get('action')]);
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method clear from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->clear();
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->arguments->add([
      Severity: Minor
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->arguments->parse();
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method to from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->to('error')->lightRed("Error: Action '{$this->climate->arguments->get('action')}' does not exist in '{$this->climate->arguments->get('module')}'");
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                  \call_user_func([$instance, $this->climate->arguments->get('action')]);
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method to from undeclared class \League\CLImate\CLImate
      Open

                          $this->climate->to('error')->lightRed("Error: Action '{$this->climate->arguments->get('action')}' does not exist in '{$this->climate->arguments->get('module')}'");
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method white from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->white('Action list for module ' . $this->climate->arguments->get('module'));
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                      if (!method_exists($instance, $this->climate->arguments->get('action'))) {
      Severity: Minor
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->white('Action list for module ' . $this->climate->arguments->get('module'));
      Severity: Minor
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

              } elseif ($this->climate->arguments->defined('module') && !$this->climate->arguments->defined('action') && !empty($this->climate->arguments->get('module'))) {
      Severity: Minor
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                  if (!method_exists($instance, $this->climate->arguments->get('action'))) {
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method lightGreen from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->lightGreen()->border('─', 200);
      Severity: Critical
      Found in app/Cli.php by phan

      Property \App\Cli->climate has undeclared type \League\CLImate\CLImate
      Open

          public $climate;
      Severity: Minor
      Found in app/Cli.php by phan

      Class extends undeclared class \League\CLImate\Util\System\System (Did you mean class \App\Cli\System)
      Open

                  $this->climate->setUtil(new \League\CLImate\Util\UtilFactory(new class() extends \League\CLImate\Util\System\System {
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method usage from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->usage();
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method border from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->border('─', 200);
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method to from undeclared class \League\CLImate\CLImate
      Open

                  $this->climate->to('error')->lightRed("Error: Module '$module' does not exist");
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method columns from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->columns(array_merge([' > Action name <' => ' > Description <'], $instance->methods));
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method lightGreen from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->lightGreen()->border('─', 200);
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                  $className = "\\App\\Cli\\{$this->climate->arguments->get('module')}";
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method to from undeclared class \League\CLImate\CLImate
      Open

                      $this->climate->to('error')->lightRed("Error: Module '{$this->climate->arguments->get('module')}' does not exist");
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method lightGreen from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->lightGreen()->border('─', 200);
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method radio from undeclared class \League\CLImate\CLImate
      Open

              $input = $this->climate->radio('Module:', $modules);
      Severity: Critical
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                  $module = $this->climate->arguments->get('module');
      Severity: Minor
      Found in app/Cli.php by phan

      Reference to instance property arguments from undeclared class \League\CLImate\CLImate
      Open

                          $this->climate->to('error')->lightRed("Error: Action '{$this->climate->arguments->get('action')}' does not exist in '{$this->climate->arguments->get('module')}'");
      Severity: Minor
      Found in app/Cli.php by phan

      Call to method clear from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->clear();
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method tab from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->tab(2)->lightGreen('Y e t i F o r c e     C L I');
      Severity: Critical
      Found in app/Cli.php by phan

      Call to method lightGreen from undeclared class \League\CLImate\CLImate
      Open

              $this->climate->lightGreen()->border('─', 200);
      Severity: Critical
      Found in app/Cli.php by phan

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          return true;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->usage();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (!$this->exec) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          return 40;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->clear();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->lightGreen()->border('─', 200);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ],
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      return;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Show modules list.
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->exec = \function_exists('exec');
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'prefix' => 'h',
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $this->climate->to('error')->lightRed("Error: Action '{$this->climate->arguments->get('action')}' does not exist in '{$this->climate->arguments->get('module')}'");
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ('Exit' === $module || empty($module)) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->tab(2)->lightGreen('Y e t i F o r c e     C L I');
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'help' => [
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->showHelp();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->border('─', 200);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /** @var bool Php support exec */
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate = new \League\CLImate\CLImate();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function __construct()
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (!$this->exec) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->setUtil(new \League\CLImate\Util\UtilFactory(new class() extends \League\CLImate\Util\System\System {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'description' => 'Module action name',
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (\PHP_SAPI !== 'cli') {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->arguments->parse();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $instance = new $className($this);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->backgroundBlue()->out($instance->methods[$this->climate->arguments->get('action')]);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'prefix' => 'm',
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'description' => 'Module name',
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function modulesList(): void
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->showHelp();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Construct.
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      public function width()
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->arguments->add([
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'action' => [
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              } elseif ($this->climate->arguments->defined('module') && $this->climate->arguments->defined('action')) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->actionsList($module);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          return '';
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->to('error')->lightRed('Error: YetiForce CLI only works from the operating system console (CLI)');
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              \App\User::setCurrentUserId(\Users::getActiveAdminId());
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              \App\Language::setTemporaryLanguage('en-US');
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'prefix' => 'a',
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ($this->climate->arguments->defined('help')) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  \call_user_func([$instance, $this->climate->arguments->get('action')]);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              } else {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->modulesList();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          return 120;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $className = "\\App\\Cli\\{$this->climate->arguments->get('module')}";
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $module = $input->prompt();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $climate;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Line exceeds 120 characters; contains 179 characters
      Open

                      $this->climate->to('error')->lightRed("Error: Action '{$this->climate->arguments->get('action')}' does not exist in '{$this->climate->arguments->get('module')}'");
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->usage();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Line exceeds 120 characters; contains 129 characters
      Open

                  $this->climate->setUtil(new \League\CLImate\Util\UtilFactory(new class() extends \League\CLImate\Util\System\System {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Line exceeds 120 characters; contains 124 characters
      Open

                  $this->climate->to('error')->lightRed('Error:  YetiForce CLI works only on the OS user who owns the CRM files');
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ],
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return void
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $modules = $this->getModulesList();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /** @var \League\CLImate\CLImate CLImate instance. */
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      protected function systemHasAnsiSupport()
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }));
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->to('error')->lightRed('Error:  YetiForce CLI works only on the OS user who owns the CRM files');
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $input = $this->climate->radio('Module:', $modules);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return string[]
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public $exec = true;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      public function exec($command, $full = false)
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (\function_exists('getmyuid') && getmyuid() !== fileowner(__FILE__)) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Line exceeds 120 characters; contains 125 characters
      Open

                  $this->climate->to('error')->lightRed('Error: YetiForce CLI only works from the operating system console (CLI)');
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->lightGreen()->border('─', 200);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->white('Version: ' . Version::get() . ' | CRM URL: ' . \Config\Main::$site_URL);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      'description' => 'Help',
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->actionsList($this->climate->arguments->get('module'));
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  if (!method_exists($instance, $this->climate->arguments->get('action'))) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $action = $input->prompt();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $className = "\\App\\Cli\\{$module}";
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  if (!class_exists($className)) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $this->climate->lightGreen()->border('─', 200);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      foreach (array_keys($instance->methods) as $method) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (!class_exists($className)) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $this->climate->to('error')->lightRed("Error: Module '{$this->climate->arguments->get('module')}' does not exist");
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $instance->helpMode = true;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      public function height()
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->lightGreen()->border('─', 200);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  ],
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              } elseif ($this->climate->arguments->defined('module') && !$this->climate->arguments->defined('action') && !empty($this->climate->arguments->get('module'))) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Line exceeds 120 characters; contains 166 characters
      Open

              } elseif ($this->climate->arguments->defined('module') && !$this->climate->arguments->defined('action') && !empty($this->climate->arguments->get('module'))) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->clear();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Get modules list.
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $modules = [];
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->to('error')->lightRed("Error: Module '$module' does not exist");
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $module = $this->climate->arguments->get('module');
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  'module' => [
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              ]);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $modules['Exit'] = 'Exit';
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          private function showHelp(): void
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  if ($this->climate->arguments->defined('action') && !empty($this->climate->arguments->get('action'))) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              } else {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  if ($fileInfo->isFile() && 'Base' !== $fileInfo->getBasename('.php')) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $instance = new $className($this);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if (!$this->exec) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              } else {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $this->climate->clear();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  \call_user_func([$instance, $action]);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      if (!method_exists($instance, $this->climate->arguments->get('action'))) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Line exceeds 120 characters; contains 131 characters
      Open

                      $this->climate->to('error')->lightRed("Error: Module '{$this->climate->arguments->get('module')}' does not exist");
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $instance = new $className($this);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  foreach ($modules as $module) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Line exceeds 120 characters; contains 183 characters
      Open

                          $this->climate->to('error')->lightRed("Error: Action '{$this->climate->arguments->get('action')}' does not exist in '{$this->climate->arguments->get('module')}'");
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $this->climate->white("php cli.php -m $module");
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $this->climate->lightGreen()->border('─', 200);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $modules = $this->getModulesList();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              foreach (new \DirectoryIterator(ROOT_DIRECTORY . '/app/Cli') as $fileInfo) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @param string $module
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           *
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->lightGreen()->border('─', 200);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return void
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Show help.
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ($this->climate->arguments->defined('module')) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      return;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $modules = array_keys($modules);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $className = "\\App\\Cli\\{$module}";
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              $input = $this->climate->radio('Action:', array_merge($instance->methods, ['Exit' => 'Exit']));
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * Show actions list.
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->showHelp();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              if ('Exit' === $action) {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          private function getModulesList(): array
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $instance = new $className($this);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          /**
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           * @return void
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $this->climate->white("php cli.php -m $module -a $method");
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              return $modules;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          public function actionsList(string $module): void
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

           */
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $className = "\\App\\Cli\\{$module}";
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->modulesList();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          return;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $this->climate->white('Action list for module ' . $this->climate->arguments->get('module'));
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->white('Modules list:')->columns($modules);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

          }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $module = $fileInfo->getBasename('.php');
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->usage();
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

              }
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $this->climate->to('error')->lightRed("Error: Action '{$this->climate->arguments->get('action')}' does not exist in '{$this->climate->arguments->get('module')}'");
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      \call_user_func([$instance, $this->climate->arguments->get('action')]);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  } else {
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $this->climate->columns(array_merge([' > Action name <' => ' > Description <'], $instance->methods));
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                      $modules[$module] = $instance->moduleName;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  return;
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                  $this->climate->lightGreen()->border('─', 200);
      Severity: Minor
      Found in app/Cli.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status