YetiForceCompany/YetiForceCRM

View on GitHub
app/Module.php

Summary

Maintainability
C
1 day
Test Coverage
C
73%

Function getQuickCreateModules has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getQuickCreateModules($restrictList = false, $tree = false): array
    {
        $restrictListString = $restrictList ? 1 : 0;
        if ($tree) {
            $userModel = \App\User::getCurrentUserModel();
Severity: Minor
Found in app/Module.php - About 4 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

The class Module has an overall complexity of 62 which is very high. The configured complexity threshold is 50.
Open

class Module
{
    /**
     * Cache for tabdata.php.
     *
Severity: Minor
Found in app/Module.php by phpmd

Method getQuickCreateModules has 60 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getQuickCreateModules($restrictList = false, $tree = false): array
    {
        $restrictListString = $restrictList ? 1 : 0;
        if ($tree) {
            $userModel = \App\User::getCurrentUserModel();
Severity: Major
Found in app/Module.php - About 2 hrs to fix

    File Module.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace App;
    
    /**
    Severity: Minor
    Found in app/Module.php - About 2 hrs to fix

      Function createModuleMetaFile has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function createModuleMetaFile()
          {
              Cache::delete('moduleTabs', 'all');
              Cache::delete('getTrackingModules', 'all');
              $filename = ROOT_DIRECTORY . '/user_privileges/tabdata.php';
      Severity: Minor
      Found in app/Module.php - About 45 mins 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 getQuickCreateModules() has an NPath complexity of 1632. The configured NPath complexity threshold is 200.
      Open

          public static function getQuickCreateModules($restrictList = false, $tree = false): array
          {
              $restrictListString = $restrictList ? 1 : 0;
              if ($tree) {
                  $userModel = \App\User::getCurrentUserModel();
      Severity: Minor
      Found in app/Module.php by phpmd

      NPathComplexity

      Since: 0.1

      The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

      Example

      class Foo {
          function bar() {
              // lots of complicated code
          }
      }

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

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

          public static function getQuickCreateModules($restrictList = false, $tree = false): array
          {
              $restrictListString = $restrictList ? 1 : 0;
              if ($tree) {
                  $userModel = \App\User::getCurrentUserModel();
      Severity: Minor
      Found in app/Module.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 34 to the 15 allowed.
      Open

          public static function getQuickCreateModules($restrictList = false, $tree = false): array
      Severity: Critical
      Found in app/Module.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

      Reduce the number of returns of this function 4, down to the maximum allowed 3.
      Open

          public static function getQuickCreateModules($restrictList = false, $tree = false): array
      Severity: Major
      Found in app/Module.php by sonar-php

      Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

      Noncompliant Code Example

      With the default threshold of 3:

      function myFunction(){ // Noncompliant as there are 4 return statements
        if (condition1) {
          return true;
        } else {
          if (condition2) {
            return false;
          } else {
            return true;
          }
        }
        return false;
      }
      

      Avoid using undefined variables such as '$actionSecure' which will lead to PHP notices.
      Open

                      $actionSecure[$actionid] = $actionname;
      Severity: Minor
      Found in app/Module.php by phpmd

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      Avoid using undefined variables such as '$actionSecure' which will lead to PHP notices.
      Open

                  'actionName' => $actionSecure,
      Severity: Minor
      Found in app/Module.php by phpmd

      UndefinedVariable

      Since: 2.8.0

      Detects when a variable is used that has not been defined before.

      Example

      class Foo
      {
          private function bar()
          {
              // $message is undefined
              echo $message;
          }
      }

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

      The class Module has a coupling between objects value of 15. Consider to reduce the number of dependencies under 13.
      Open

      class Module
      {
          /**
           * Cache for tabdata.php.
           *
      Severity: Minor
      Found in app/Module.php by phpmd

      CouplingBetweenObjects

      Since: 1.1.0

      A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

      Example

      class Foo {
          /**
           * @var \foo\bar\X
           */
          private $x = null;
      
          /**
           * @var \foo\bar\Y
           */
          private $y = null;
      
          /**
           * @var \foo\bar\Z
           */
          private $z = null;
      
          public function setFoo(\Foo $foo) {}
          public function setBar(\Bar $bar) {}
          public function setBaz(\Baz $baz) {}
      
          /**
           * @return \SplObjectStorage
           * @throws \OutOfRangeException
           * @throws \InvalidArgumentException
           * @throws \ErrorException
           */
          public function process(\Iterator $it) {}
      
          // ...
      }

      Source https://phpmd.org/rules/design.html#couplingbetweenobjects

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

          public static function getQuickCreateModules($restrictList = false, $tree = false): array
      Severity: Minor
      Found in app/Module.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 '192', column '25').
      Open

                  $formattedName = new \yii\db\Expression(rtrim($sqlString, ',\' \',') . ')');
      Severity: Minor
      Found in app/Module.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 getSharingModuleList has a boolean flag argument $eliminateModules, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public static function getSharingModuleList($eliminateModules = false)
      Severity: Minor
      Found in app/Module.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

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

          public static function getAllModuleNamesFilter($isEntityType = true, $showRestricted = false, $presence = false): array
      Severity: Minor
      Found in app/Module.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 '347', column '16').
      Open

              $query = new \App\Db\Query();
      Severity: Minor
      Found in app/Module.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 '64', column '23').
      Open

                  $dataReader = (new \App\Db\Query())->from('vtiger_entityname')->createCommand()->query();
      Severity: Minor
      Found in app/Module.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 getAllModuleNamesFilter has a boolean flag argument $isEntityType, which is a certain sign of a Single Responsibility Principle violation.
      Open

          public static function getAllModuleNamesFilter($isEntityType = true, $showRestricted = false, $presence = false): array
      Severity: Minor
      Found in app/Module.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

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

          public static function getAllModuleNamesFilter($isEntityType = true, $showRestricted = false, $presence = false): array
      Severity: Minor
      Found in app/Module.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

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

          public static function getQuickCreateModules($restrictList = false, $tree = false): array
      Severity: Minor
      Found in app/Module.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

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

          public static function getAllEntityModuleInfo($sort = false)
      Severity: Minor
      Found in app/Module.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

      Avoid using static access to class 'App\Cache' in method 'createModuleMetaFile'.
      Open

              Cache::delete('getTrackingModules', 'all');
      Severity: Minor
      Found in app/Module.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\UserPrivilegesFile' in method 'changeType'.
      Open

                  UserPrivilegesFile::recalculateAll();
      Severity: Minor
      Found in app/Module.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 getSqlForNameInDisplayFormat uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $fieldsName = array_pop($fieldsName);
                  $formattedName = "{$db->quoteTableName($entityFieldInfo['tablename'])}.{$db->quoteColumnName($fieldsName)}";
              }
      Severity: Minor
      Found in app/Module.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\Utils' in method 'createModuleMetaFile'.
      Open

                      $content = '$tab_seq_array=' . Utils::varExport($moduleMeta['tabPresence']) . ";\n";
      Severity: Minor
      Found in app/Module.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\PrivilegeUtil' in method 'changeType'.
      Open

              if ($moduleModel && $moduleModel->changeType($type) && PrivilegeUtil::modifyPermissions($moduleName, ['RecordPdfInventory'], \Vtiger_Module_Model::ADVANCED_TYPE === $type)) {
      Severity: Minor
      Found in app/Module.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\Language' in method 'getAllModuleNamesFilter'.
      Open

                  $modules[$value['name']] = Language::translate($value['name'], $value['name']);
      Severity: Minor
      Found in app/Module.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_Privileges_Model' in method 'getQuickCreateModules'.
      Open

              $userPrivModel = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
      Severity: Minor
      Found in app/Module.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 '\vtlib\Functions' in method 'getModuleMeta'.
      Open

              $allModules = \vtlib\Functions::getAllModules(false, true);
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getEntitiesInfo'.
      Open

              return Cache::get($cacheName, '');
      Severity: Minor
      Found in app/Module.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 '\Vtiger_Module_Model' in method 'changeType'.
      Open

              $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
      Severity: Minor
      Found in app/Module.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 '\vtlib\Functions' in method 'getAllModuleNamesFilter'.
      Open

              foreach (\vtlib\Functions::getAllModules($isEntityType, $showRestricted, $presence) as $value) {
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getQuickCreateModules'.
      Open

                  $quickCreateModulesTreeCache = \App\Cache::get('getQuickCreateModules', 'tree' . $restrictListString . $userModel->getDetail('roleid'));
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getQuickCreateModules'.
      Open

                  $quickCreateModules = \App\Cache::get('getQuickCreateModules', $restrictListString);
      Severity: Minor
      Found in app/Module.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 '\Vtiger_Module_Model' in method 'getQuickCreateModules'.
      Open

                      $moduleModel = \Vtiger_Module_Model::getInstanceFromArray($row);
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getQuickCreateModules'.
      Open

                  \App\Cache::save('getQuickCreateModules', 'tree' . $restrictListString . $userPrivModel->get('roleid'), $quickCreateModulesTree);
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getEntitiesInfo'.
      Open

              if (!Cache::has($cacheName, '')) {
      Severity: Minor
      Found in app/Module.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 '\Vtiger_Menu_Model' in method 'getQuickCreateModules'.
      Open

                  $menu = \Vtiger_Menu_Model::getAll();
      Severity: Minor
      Found in app/Module.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\Utils' in method 'createModuleMetaFile'.
      Open

                      if (!Utils::saveToFile($filename, $content)) {
      Severity: Minor
      Found in app/Module.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\Log' in method 'createModuleMetaFile'.
      Open

                  Log::error("The file $filename does not exist");
      Severity: Minor
      Found in app/Module.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 '\vtlib\Functions' in method 'getSharingModuleList'.
      Open

              $modules = \vtlib\Functions::getAllModules(true, true, 0, false, 0);
      Severity: Minor
      Found in app/Module.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\Db' in method 'getSqlForNameInDisplayFormat'.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in app/Module.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 createModuleMetaFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      Log::error("The file $filename is not writable");
                  }
      Severity: Minor
      Found in app/Module.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 getQuickCreateModules uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $quickCreateModules = \App\Cache::get('getQuickCreateModules', $restrictListString);
                  if (false !== $quickCreateModules) {
                      return $quickCreateModules;
                  }
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getEntitiesInfo'.
      Open

                  return Cache::save($cacheName, '', $entityInfos);
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getActionId'.
      Open

                  return Cache::get('getActionId', $action);
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getActionId'.
      Open

              Cache::save('getActionId', $action, $actionId, Cache::LONG);
      Severity: Minor
      Found in app/Module.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\Utils' in method 'createModuleMetaFile'.
      Open

                      $content .= 'return ' . Utils::varExport($moduleMeta) . ";\n";
      Severity: Minor
      Found in app/Module.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 getQuickCreateModules uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  $query->andWhere(['quickcreate' => [0, 2]])
                      ->andWhere(['<>', 'vtiger_tab.type', 1]);
              }
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getQuickCreateModules'.
      Open

              \App\Cache::save('getQuickCreateModules', $restrictListString, $quickCreateModules);
      Severity: Minor
      Found in app/Module.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\Cache' in method 'createModuleMetaFile'.
      Open

              Cache::delete('moduleTabs', 'all');
      Severity: Minor
      Found in app/Module.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\Log' in method 'createModuleMetaFile'.
      Open

                      Log::error("The file $filename is not writable");
      Severity: Minor
      Found in app/Module.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 createModuleMetaFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

              } else {
                  Log::error("The file $filename does not exist");
              }
      Severity: Minor
      Found in app/Module.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\User' in method 'getQuickCreateModules'.
      Open

                  $userModel = \App\User::getCurrentUserModel();
      Severity: Minor
      Found in app/Module.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\Cache' in method 'getActionId'.
      Open

              if (Cache::has('getActionId', $action)) {
      Severity: Minor
      Found in app/Module.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

      Define a constant instead of duplicating this literal "getQuickCreateModules" 4 times.
      Open

                  $quickCreateModulesTreeCache = \App\Cache::get('getQuickCreateModules', 'tree' . $restrictListString . $userModel->getDetail('roleid'));
      Severity: Critical
      Found in app/Module.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 "tabName" 4 times.
      Open

              static::$tabdataCache['tabName'] = array_flip(static::$tabdataCache['tabId']);
      Severity: Critical
      Found in app/Module.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 "getActionId" 3 times.
      Open

              if (Cache::has('getActionId', $action)) {
      Severity: Critical
      Found in app/Module.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 "tabPresence" 4 times.
      Open

              $isActive = (isset(static::$tabdataCache['tabPresence'][$moduleId]) && 0 == static::$tabdataCache['tabPresence'][$moduleId]);
      Severity: Critical
      Found in app/Module.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 "tabId" 4 times.
      Open

              static::$tabdataCache['tabName'] = array_flip(static::$tabdataCache['tabId']);
      Severity: Critical
      Found in app/Module.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.

      Doc-block of $moduleName in getEntityInfo is phpdoc param type string which is not a permitted replacement of the nullable param type ?string declared in the signature ('?T' should be documented as 'T|null' or '?T')
      Open

           * @param string $moduleName
      Severity: Minor
      Found in app/Module.php by phan

      Call to undeclared method \App\Db\Query::distinct
      Open

              $dataReader = $query->distinct()->createCommand()->query();
      Severity: Critical
      Found in app/Module.php by phan

      Argument 2 (key) is 0|1 but \App\Cache::get() takes string defined at /code/app/Cache.php:61
      Open

                  $quickCreateModules = \App\Cache::get('getQuickCreateModules', $restrictListString);
      Severity: Minor
      Found in app/Module.php by phan

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

                  $userModel = \App\User::getCurrentUserModel();
      Severity: Critical
      Found in app/Module.php by phan

      Argument 2 (key) is 0|1 but \App\Cache::save() takes string defined at /code/app/Cache.php:89
      Open

              \App\Cache::save('getQuickCreateModules', $restrictListString, $quickCreateModules);
      Severity: Minor
      Found in app/Module.php by phan

      When fetching an array index from a value of type array, found an array index of type ?string, but expected the index to be of the non-nullable type int|string
      Open

              return self::getEntitiesInfo()[$moduleName] ?? null;
      Severity: Minor
      Found in app/Module.php by phan

      Call to undeclared method \App\Db::quoteColumnName
      Open

                      $sqlString .= "{$db->quoteTableName($entityFieldInfo['tablename'])}.{$db->quoteColumnName($column)},' ',";
      Severity: Critical
      Found in app/Module.php by phan

      Call to method error from undeclared class \App\Log
      Open

                  Log::error("The file $filename does not exist");
      Severity: Critical
      Found in app/Module.php by phan

      Call to undeclared method \App\Db\Query::andWhere
      Open

                  $query->andWhere(['quickcreate' => [0, 2]])
      Severity: Critical
      Found in app/Module.php by phan

      Call to undeclared method \App\Db\Query::andWhere
      Open

                  $query->andWhere(['not in', 'vtiger_tab.name', ['ModComments', 'PriceBooks', 'CallHistory', 'OSSMailView']]);
      Severity: Critical
      Found in app/Module.php by phan

      When appending to a value of type array{}, found an array access index of type false, but expected the index to be of type int|string
      Open

                                  $items[$quickCreateModules[$child['mod']]->name] = $quickCreateModules[$child['mod']];
      Severity: Minor
      Found in app/Module.php by phan

      Call to undeclared method \App\Db::quoteColumnName
      Open

                  $formattedName = "{$db->quoteTableName($entityFieldInfo['tablename'])}.{$db->quoteColumnName($fieldsName)}";
      Severity: Critical
      Found in app/Module.php by phan

      Call to undeclared method \App\Db\Query::andWhere
      Open

                  $query->andWhere(['<>', 'vtiger_tab.name', 'Users']);
      Severity: Critical
      Found in app/Module.php by phan

      Variable $actionSecure was undeclared, but array fields are being added to it.
      Open

                      $actionSecure[$actionid] = $actionname;
      Severity: Info
      Found in app/Module.php by phan

      Returning type bool but getEntitiesInfo() is declared to return array
      Open

                  return Cache::save($cacheName, '', $entityInfos);
      Severity: Minor
      Found in app/Module.php by phan

      Call to undeclared method \App\Db::quoteTableName
      Open

                  $formattedName = "{$db->quoteTableName($entityFieldInfo['tablename'])}.{$db->quoteColumnName($fieldsName)}";
      Severity: Critical
      Found in app/Module.php by phan

      Call to undeclared method \App\Db\Query::select
      Open

                  $actionId = (new Db\Query())->select(['actionid'])->from('vtiger_actionmapping')->where(['actionname' => $action])->scalar();
      Severity: Critical
      Found in app/Module.php by phan

      Call to undeclared method \App\Db\Query::from
      Open

              $dataReader = (new Db\Query())->from(['vtiger_actionmapping'])->createCommand()->query();
      Severity: Critical
      Found in app/Module.php by phan

      Default value for array $eliminateModules can't be false
      Open

          public static function getSharingModuleList($eliminateModules = false)
      Severity: Minor
      Found in app/Module.php by phan

      Call to method __construct from undeclared class \yii\db\Expression
      Open

                  $formattedName = new \yii\db\Expression(rtrim($sqlString, ',\' \',') . ')');
      Severity: Critical
      Found in app/Module.php by phan

      Saw possibly unextractable annotation for a fragment of comment '* @param array': after array, did not see an element name (will guess based on comment order)
      Open

           * @param array
      Severity: Info
      Found in app/Module.php by phan

      Call to undeclared method \App\Db\Query::from
      Open

                  $dataReader = (new \App\Db\Query())->from('vtiger_entityname')->createCommand()->query();
      Severity: Critical
      Found in app/Module.php by phan

      Call to undeclared method \App\Db\Query::select
      Open

              $query->select(['vtiger_tab.*'])->from('vtiger_field')
      Severity: Critical
      Found in app/Module.php by phan

      Call to undeclared method \App\Db::quoteTableName
      Open

                      $sqlString .= "{$db->quoteTableName($entityFieldInfo['tablename'])}.{$db->quoteColumnName($column)},' ',";
      Severity: Critical
      Found in app/Module.php by phan

      Call to method error from undeclared class \App\Log
      Open

                      Log::error("The file $filename is not writable");
      Severity: Critical
      Found in app/Module.php by phan

      Avoid excessively long variable names like $quickCreateModulesTreeCache. Keep variable name length under 20.
      Open

                  $quickCreateModulesTreeCache = \App\Cache::get('getQuickCreateModules', 'tree' . $restrictListString . $userModel->getDetail('roleid'));
      Severity: Minor
      Found in app/Module.php by phpmd

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#longvariable

      Avoid excessively long variable names like $quickCreateModulesTree. Keep variable name length under 20.
      Open

                  $quickCreateModulesTree = [];
      Severity: Minor
      Found in app/Module.php by phpmd

      LongVariable

      Since: 0.2

      Detects when a field, formal or local variable is declared with a long name.

      Example

      class Something {
          protected $reallyLongIntName = -3; // VIOLATION - Field
          public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
              $otherReallyLongName = -5; // VIOLATION - Local
              for ($interestingIntIndex = 0; // VIOLATION - For
                   $interestingIntIndex < 10;
                   $interestingIntIndex++ ) {
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#longvariable

      A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 15 and the first side effect is on line 396.
      Open

      <?php
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

      Avoid variables with short names like $b. Configured minimum length is 3.
      Open

                  usort($entity, function ($a, $b) {
      Severity: Minor
      Found in app/Module.php by phpmd

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Avoid variables with short names like $db. Configured minimum length is 3.
      Open

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in app/Module.php by phpmd

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

      Avoid variables with short names like $a. Configured minimum length is 3.
      Open

                  usort($entity, function ($a, $b) {
      Severity: Minor
      Found in app/Module.php by phpmd

      ShortVariable

      Since: 0.2

      Detects when a field, local, or parameter has a very short name.

      Example

      class Something {
          private $q = 15; // VIOLATION - Field
          public static function main( array $as ) { // VIOLATION - Formal
              $r = 20 + $this->q; // VIOLATION - Local
              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                  $r += $this->q;
              }
          }
      }

      Source https://phpmd.org/rules/naming.html#shortvariable

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

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

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

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

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

           * Gets entity info.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * Gets all entities data.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

          public static function init()
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              static::$tabdataCache['tabName'] = array_flip(static::$tabdataCache['tabId']);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function getEntitiesInfo(): array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

              $cacheName = 'ModuleEntityInfo';
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * @return array|null
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              return self::getEntitiesInfo()[$moduleName] ?? null;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function initFromDb()
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              static::$tabdataCache['tabName'] = array_flip(static::$tabdataCache['tabId']);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              static::$tabdataCache = static::getModuleMeta();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * @var array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * Init tabdata from file.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function getEntityInfo(string $moduleName = null): ?array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

          protected static $tabdataCache;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * Init tabdata form db.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

              static::$tabdataCache = require ROOT_DIRECTORY . '/user_privileges/tabdata.php';
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

           * @param array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              if (!Cache::has($cacheName, '')) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * Cache for tabdata.php.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

                      $row['fieldnameArr'] = $row['fieldname'] ? explode(',', $row['fieldname']) : [];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

           * @return array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              return $formattedName;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $dataReader = (new \App\Db\Query())->from('vtiger_entityname')->createCommand()->query();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $entity = static::getEntitiesInfo();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

           * Get module id by module name.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              return static::$tabdataCache['tabId'][$moduleName] ?? false;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

                  $formattedName = "{$db->quoteTableName($entityFieldInfo['tablename'])}.{$db->quoteColumnName($fieldsName)}";
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * Get module nane by module id.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              $modules = \vtlib\Functions::getAllModules(true, true, 0, false, 0);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @return string
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $db = \App\Db::getInstance();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $entityFieldInfo = static::getEntityInfo($moduleName);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  $actionId = $actionIds[$action];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      $entityInfos[$row['modulename']] = $row;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * Function to check whether the module is active.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

      Line exceeds 120 characters; contains 133 characters
      Open

              $isActive = (isset(static::$tabdataCache['tabPresence'][$moduleId]) && 0 == static::$tabdataCache['tabPresence'][$moduleId]);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * @param int $tabId
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              return static::$tabdataCache['tabName'];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  if (!$eliminateModules || !\in_array($row['name'], $eliminateModules)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function getActionId($action)
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * @return bool
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @return int
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * @param array $eliminateModules
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  $sqlString = 'CONCAT(';
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              if (isset($actionIds[$action])) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

                  return static::$isModuleActiveCache[$moduleName];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

          public static function getSharingModuleList($eliminateModules = false)
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

      Line exceeds 120 characters; contains 122 characters
      Open

                      $sqlString .= "{$db->quoteTableName($entityFieldInfo['tablename'])}.{$db->quoteColumnName($column)},' ',";
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

           * Get module owner by module id.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

              return $entity;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $isActive = (isset(static::$tabdataCache['tabPresence'][$moduleId]) && 0 == static::$tabdataCache['tabPresence'][$moduleId]);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

          public static function getAllModuleNames()
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * Get sql for name in display format.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

          protected static $isModuleActiveCache = [];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              return static::$tabdataCache['tabOwnedby'][$tabId] ?? false;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * Get all module names.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              return $sharingModules;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  $fieldsName = array_pop($fieldsName);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

              if (empty($actionId)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

              if (isset(static::$isModuleActiveCache[$moduleName])) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

              return Cache::get($cacheName, '');
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

                  static::$isModuleActiveCache[$moduleName] = true;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @return bool|string
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      $sharingModules[] = $row['name'];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * Function to get a action id for a given action name.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  return Cache::get('getActionId', $action);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              $moduleId = static::getModuleId($moduleName);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              static::$isModuleActiveCache[$moduleName] = $isActive;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

              if (\count($fieldsName) > 1) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

          public static function isModuleActive(string $moduleName): bool
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function getModuleId($moduleName)
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              return static::$tabdataCache['tabName'][$tabId] ?? false;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @param int $tabId
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

          public static function getSqlForNameInDisplayFormat($moduleName)
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

              if ($sort) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

              $fieldsName = $entityFieldInfo['fieldnameArr'];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $formattedName = new \yii\db\Expression(rtrim($sqlString, ',\' \',') . ')');
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              if (Cache::has('getActionId', $action)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $actionId = (new Db\Query())->select(['actionid'])->from('vtiger_actionmapping')->where(['actionname' => $action])->scalar();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  while ($row = $dataReader->read()) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  return Cache::save($cacheName, '', $entityInfos);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              if (\in_array($moduleName, ['CustomView', 'Users', 'Import', 'com_vtiger_workflow', 'PickList'])) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function getModuleName($tabId)
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function getModuleOwner($tabId)
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * Function to get the list of module for which the user defined sharing rules can be defined.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

                      $sqlString .= "{$db->quoteTableName($entityFieldInfo['tablename'])}.{$db->quoteColumnName($column)},' ',";
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @return int|null
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              Cache::save('getActionId', $action, $actionId, Cache::LONG);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

          public static function createModuleMetaFile()
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

              if ($tree) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              while ($row = $dataReader->read()) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                      $row['searchcolumnArr'] = $row['searchcolumn'] ? explode(',', $row['searchcolumn']) : [];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function getAllEntityModuleInfo($sort = false)
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  usort($entity, function ($a, $b) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      return $a['sequence'] < $b['sequence'] ? -1 : 1;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

              return $isActive;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @return bool|int
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  foreach ($fieldsName as &$column) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              if (empty($action)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $actionIds = static::$tabdataCache['actionId'];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  'tabId' => $tabNames,
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

              $tabNames = $tabPresence = $tabOwned = [];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              //Constructing the actionname=>actionid array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $filename = ROOT_DIRECTORY . '/user_privileges/tabdata.php';
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  if (0 === (int) $row['securitycheck']) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      $content = '$tab_seq_array=' . Utils::varExport($moduleMeta['tabPresence']) . ";\n";
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              $restrictListString = $restrictList ? 1 : 0;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * Function to get the list of all accessible modules for Quick Create.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @return array List of Vtiger_Module_Model instances
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      return $quickCreateModulesTreeCache;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  if (false !== $quickCreateModulesTreeCache) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      ->andWhere(['<>', 'vtiger_tab.type', 1]);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

                  foreach ($menu as $parent) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

      Line exceeds 120 characters; contains 182 characters
      Open

              if ($moduleModel && $moduleModel->changeType($type) && PrivilegeUtil::modifyPermissions($moduleName, ['RecordPdfInventory'], \Vtiger_Module_Model::ADVANCED_TYPE === $type)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              if (is_numeric($actionId)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * Get module meta data.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              return [
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              if (file_exists($filename)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

      Line exceeds 120 characters; contains 123 characters
      Open

          public static function getAllModuleNamesFilter($isEntityType = true, $showRestricted = false, $presence = false): array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @param bool $restrictList
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $userModel = \App\User::getCurrentUserModel();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  ->innerJoin('vtiger_tab', 'vtiger_tab.tabid = vtiger_field.tabid')
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  if ($userPrivModel->hasModuleActionPermission($row['tabid'], 'CreateView')) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      if (!empty($parent['childs'])) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              return $actionId;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $allModules = \vtlib\Functions::getAllModules(false, true);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $actionname = $row['actionname'];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * @param bool|int $presence
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              foreach (\vtlib\Functions::getAllModules($isEntityType, $showRestricted, $presence) as $value) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $modules[$value['name']] = Language::translate($value['name'], $value['name']);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  $actionId = (int) $actionId;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $tabOwned[$tabId] = $moduleInfo['ownedby'];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      $moduleMeta = static::getModuleMeta();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      $content .= 'return ' . Utils::varExport($moduleMeta) . ";\n";
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              static::initFromDb();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

              if ($tree) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              foreach ($allModules as $moduleInfo) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  'actionName' => $actionSecure,
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * Get all module names by filter.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $query->andWhere(['not in', 'vtiger_tab.name', ['ModComments', 'PriceBooks', 'CallHistory', 'OSSMailView']]);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              while ($row = $dataReader->read()) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

              Cache::delete('moduleTabs', 'all');
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                          throw new Exceptions\NoPermitted("Cannot write file ($filename)");
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      Log::error("The file $filename is not writable");
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  Log::error("The file $filename does not exist");
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

      Line exceeds 120 characters; contains 148 characters
      Open

                  $quickCreateModulesTreeCache = \App\Cache::get('getQuickCreateModules', 'tree' . $restrictListString . $userModel->getDetail('roleid'));
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  ->where(['<>', 'vtiger_tab.presence', 1]);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      $moduleModel = \Vtiger_Module_Model::getInstanceFromArray($row);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      $quickCreateModules[$row['name']] = $moduleModel;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  $actionAll[$actionname] = $actionid = (int) $row['actionid'];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      $actionSecure[$actionid] = $actionname;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @param int    $type
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function changeType(string $moduleName, int $type)
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

              $userPrivModel = \Users_Privileges_Model::getCurrentUserPrivilegesModel();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $query->andWhere(['quickcreate' => [0, 2]])
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  'tabPresence' => $tabPresence,
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  'actionId' => $actionAll,
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  if (is_writable($filename)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

      Line exceeds 120 characters; contains 137 characters
      Open

                  $actionId = (new Db\Query())->select(['actionid'])->from('vtiger_actionmapping')->where(['actionname' => $action])->scalar();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * @return array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  'tabOwnedby' => $tabOwned,
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

          public static function getAllModuleNamesFilter($isEntityType = true, $showRestricted = false, $presence = false): array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      return $quickCreateModules;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              if ($restrictList) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function getModuleMeta()
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * @param bool $tree
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  $query->andWhere(['<>', 'vtiger_tab.name', 'Users']);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

                  $menu = \Vtiger_Menu_Model::getAll();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $tabNames[$moduleInfo['name']] = $tabId = (int) $moduleInfo['tabid'];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $tabPresence[$tabId] = $moduleInfo['presence'];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $dataReader = (new Db\Query())->from(['vtiger_actionmapping'])->createCommand()->query();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * @throws \App\Exceptions\NoPermitted
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              if ($moduleModel && $moduleModel->changeType($type) && PrivilegeUtil::modifyPermissions($moduleName, ['RecordPdfInventory'], \Vtiger_Module_Model::ADVANCED_TYPE === $type)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

          public static function getQuickCreateModules($restrictList = false, $tree = false): array
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  $quickCreateModules = \App\Cache::get('getQuickCreateModules', $restrictListString);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  if (false !== $quickCreateModules) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              $query->select(['vtiger_tab.*'])->from('vtiger_field')
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

      Line exceeds 120 characters; contains 121 characters
      Open

                  $query->andWhere(['not in', 'vtiger_tab.name', ['ModComments', 'PriceBooks', 'CallHistory', 'OSSMailView']]);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

                  UserPrivilegesFile::recalculateAll();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @param bool     $showRestricted
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              $dataReader = $query->distinct()->createCommand()->query();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * Function to create file about modules.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              Cache::delete('getTrackingModules', 'all');
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                      if (!Utils::saveToFile($filename, $content)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

           * Function changes the module type.
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

           * @param bool     $isEntityType
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

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

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

                  $quickCreateModulesTreeCache = \App\Cache::get('getQuickCreateModules', 'tree' . $restrictListString . $userModel->getDetail('roleid'));
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              $query = new \App\Db\Query();
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              if ($tree) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

      Line exceeds 120 characters; contains 128 characters
      Open

                              $quickCreateModulesTree[] = ['name' => $parent['name'], 'icon' => $parent['icon'], 'modules' => $items];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  if (!empty($quickCreateModules)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                                  $items[$quickCreateModules[$child['mod']]->name] = $quickCreateModules[$child['mod']];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                          if (!empty($items)) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                          foreach ($parent['childs'] as $child) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

                                  unset($quickCreateModules[$child['mod']]);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  \App\Cache::save('getQuickCreateModules', 'tree' . $restrictListString . $userPrivModel->get('roleid'), $quickCreateModulesTree);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                              $quickCreateModulesTree[] = ['name' => $parent['name'], 'icon' => $parent['icon'], 'modules' => $items];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

      Line exceeds 120 characters; contains 125 characters
      Open

                      $quickCreateModulesTree[] = ['name' => 'LBL_OTHER', 'icon' => 'yfm-Other', 'modules' => $quickCreateModules];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

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

                      $quickCreateModulesTree[] = ['name' => 'LBL_OTHER', 'icon' => 'yfm-Other', 'modules' => $quickCreateModules];
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                  return $quickCreateModulesTree;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

                              if (isset($quickCreateModules[$child['mod']])) {
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

      Line exceeds 120 characters; contains 141 characters
      Open

                  \App\Cache::save('getQuickCreateModules', 'tree' . $restrictListString . $userPrivModel->get('roleid'), $quickCreateModulesTree);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

              \App\Cache::save('getQuickCreateModules', $restrictListString, $quickCreateModules);
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

              return $quickCreateModules;
      Severity: Minor
      Found in app/Module.php by phpcodesniffer

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

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

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

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

      There are no issues that match your filters.

      Category
      Status