YetiForceCompany/YetiForceCRM

View on GitHub
modules/Project/Project.php

Summary

Maintainability
F
3 days
Test Coverage
F
2%

Function getHierarchyData has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
    {
        \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
        $currentUser = Users_Privileges_Model::getCurrentUserModel();
        $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Project', 'DetailView', $recordId);
Severity: Minor
Found in modules/Project/Project.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

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

    public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
    {
        \App\Log::trace('Entering getParent(' . $id . ') method ...');
        if ($depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Project/Project.php - About 2 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

    public function getChild(int $id, array &$childRow, int $depthBase): array
    {
        \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
        if (empty($id) || $depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Project/Project.php - About 2 hrs to fix

Cognitive Complexity

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

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

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

Further reading

Method getParent has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
    {
        \App\Log::trace('Entering getParent(' . $id . ') method ...');
        if ($depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
            \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
Severity: Minor
Found in modules/Project/Project.php - About 1 hr to fix

    Function moduleHandler has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
    Open

        public function moduleHandler($moduleName, $eventType)
        {
            if ('module.postinstall' === $eventType) {
                $moduleInstance = vtlib\Module::getInstance($moduleName);
    
    
    Severity: Minor
    Found in modules/Project/Project.php - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method getChild has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getChild(int $id, array &$childRow, int $depthBase): array
        {
            \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
            if (empty($id) || $depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
                \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
    Severity: Minor
    Found in modules/Project/Project.php - About 1 hr to fix

      The class Project has 18 fields. Consider redesigning Project to keep the number of fields under 15.
      Open

      class Project extends CRMEntity
      {
          public $table_name = 'vtiger_project';
          public $table_index = 'projectid';
          public $column_fields = [];
      Severity: Minor
      Found in modules/Project/Project.php by phpmd

      TooManyFields

      Since: 0.1

      Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

      Example

      class Person {
         protected $one;
         private $two;
         private $three;
         [... many more fields ...]
      }

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

      Method getHierarchyData has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
          {
              \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
              $currentUser = Users_Privileges_Model::getCurrentUserModel();
              $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Project', 'DetailView', $recordId);
      Severity: Minor
      Found in modules/Project/Project.php - About 1 hr to fix

        Method getHierarchyData has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
        Severity: Minor
        Found in modules/Project/Project.php - About 45 mins to fix

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

              public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
              {
                  \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
                  $currentUser = Users_Privileges_Model::getCurrentUserModel();
                  $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Project', 'DetailView', $recordId);
          Severity: Minor
          Found in modules/Project/Project.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

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

              public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
              {
                  \App\Log::trace('Entering getParent(' . $id . ') method ...');
                  if ($depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
                      \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
          Severity: Minor
          Found in modules/Project/Project.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

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

              public function getChild(int $id, array &$childRow, int $depthBase): array
              {
                  \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
                  if (empty($id) || $depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
                      \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
          Severity: Minor
          Found in modules/Project/Project.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 30 to the 15 allowed.
          Open

              public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
          Severity: Critical
          Found in modules/Project/Project.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

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

              public function getChild(int $id, array &$childRow, int $depthBase): array
          Severity: Critical
          Found in modules/Project/Project.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

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

              public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
          Severity: Critical
          Found in modules/Project/Project.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

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

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.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

          Missing class import via use statement (line '299', column '8').
          Open

                      new \yii\db\Expression("CASE when (vtiger_users.user_name NOT LIKE '') THEN $userNameSql ELSE vtiger_groups.groupname END as user_name"),
          Severity: Minor
          Found in modules/Project/Project.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 '240', column '8').
          Open

                      new \yii\db\Expression("CASE when (vtiger_users.user_name not like '') THEN $userNameSql ELSE vtiger_groups.groupname END as user_name"),
          Severity: Minor
          Found in modules/Project/Project.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 getHierarchy has a boolean flag argument $getRawData, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public function getHierarchy(int $id, bool $getRawData = false, bool $getLinks = true): array
          Severity: Minor
          Found in modules/Project/Project.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 getHierarchy has a boolean flag argument $getLinks, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public function getHierarchy(int $id, bool $getRawData = false, bool $getLinks = true): array
          Severity: Minor
          Found in modules/Project/Project.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 '297', column '22').
          Open

                  $dataReader = (new App\Db\Query())->select([
          Severity: Minor
          Found in modules/Project/Project.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 '238', column '15').
          Open

                  $row = (new App\Db\Query())->select([
          Severity: Minor
          Found in modules/Project/Project.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 getHierarchyData has a boolean flag argument $getLinks, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
          Severity: Minor
          Found in modules/Project/Project.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 getHierarchyData has a boolean flag argument $getRawData, which is a certain sign of a Single Responsibility Principle violation.
          Open

              public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
          Severity: Minor
          Found in modules/Project/Project.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 getParent uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                          } else {
                              $parentInfo[$columnname] = $row[$columnname];
                          }
          Severity: Minor
          Found in modules/Project/Project.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\Log' in method 'getParent'.
          Open

                  \App\Log::trace('Exiting getParent method ...');
          Severity: Minor
          Found in modules/Project/Project.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 'getHierarchy'.
          Open

                          $listviewHeader[] = App\Language::translate($fieldname, 'Project');
          Severity: Minor
          Found in modules/Project/Project.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\Privilege' in method 'getHierarchyData'.
          Open

                  $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Project', 'DetailView', $recordId);
          Severity: Minor
          Found in modules/Project/Project.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\Module' in method 'getChild'.
          Open

                  $userNameSql = App\Module::getSqlForNameInDisplayFormat('Users');
          Severity: Minor
          Found in modules/Project/Project.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 'ModComments' in method 'moduleHandler'.
          Open

                              ModComments::addWidgetTo(['Project']);
          Severity: Minor
          Found in modules/Project/Project.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 assigning values to variables in if clauses and the like (line '266', column '16').
          Open

              public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
              {
                  \App\Log::trace('Entering getParent(' . $id . ') method ...');
                  if ($depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
                      \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          IfStatementAssignment

          Since: 2.7.0

          Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($foo = 'bar') { // possible typo
                      // ...
                  }
                  if ($baz = 0) { // always false
                      // ...
                  }
              }
          }

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

          Avoid using static access to class '\App\Log' in method 'getChild'.
          Open

                  \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
          Severity: Minor
          Found in modules/Project/Project.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\Config' in method 'getChild'.
          Open

                  if (empty($id) || $depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
          Severity: Minor
          Found in modules/Project/Project.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\Purifier' in method 'getHierarchyData'.
          Open

                          $data = \App\Purifier::encodeHtml($baseInfo[$colname]);
          Severity: Minor
          Found in modules/Project/Project.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\Config' in method 'getParent'.
          Open

                  if ($depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
          Severity: Minor
          Found in modules/Project/Project.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 'getParent'.
          Open

                  $moduleModel = Vtiger_Module_Model::getInstance('Project');
          Severity: Minor
          Found in modules/Project/Project.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 'ModComments' in method 'moduleHandler'.
          Open

                              ModComments::addWidgetTo(['Project']);
          Severity: Minor
          Found in modules/Project/Project.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 'getHierarchyData'.
          Open

                  \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
          Severity: Minor
          Found in modules/Project/Project.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 'getHierarchyData'.
          Open

                  \App\Log::trace('Exiting getHierarchyData method ...');
          Severity: Minor
          Found in modules/Project/Project.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 'getHierarchyData'.
          Open

                  $currentUser = Users_Privileges_Model::getCurrentUserModel();
          Severity: Minor
          Found in modules/Project/Project.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 getHierarchyData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                              } else {
                                  $data = '<strong>' . $data . '</strong>';
                              }
          Severity: Minor
          Found in modules/Project/Project.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 assigning values to variables in if clauses and the like (line '319', column '17').
          Open

              public function getChild(int $id, array &$childRow, int $depthBase): array
              {
                  \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
                  if (empty($id) || $depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
                      \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          IfStatementAssignment

          Since: 2.7.0

          Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

          Example

          class Foo
          {
              public function bar($flag)
              {
                  if ($foo = 'bar') { // possible typo
                      // ...
                  }
                  if ($baz = 0) { // always false
                      // ...
                  }
              }
          }

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

          Avoid using static access to class '\App\Config' in method 'getChild'.
          Open

                  $listColumns = \App\Config::module('Project', 'COLUMNS_IN_HIERARCHY');
          Severity: Minor
          Found in modules/Project/Project.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\Module' in method 'moduleHandler'.
          Open

                      $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
          Severity: Minor
          Found in modules/Project/Project.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\Config' in method 'getHierarchyData'.
          Open

                  $listColumns = \App\Config::module('Project', 'COLUMNS_IN_HIERARCHY');
          Severity: Minor
          Found in modules/Project/Project.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\Field' in method 'getHierarchyData'.
          Open

                      if (\App\Field::getFieldPermission('Project', $colname)) {
          Severity: Minor
          Found in modules/Project/Project.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\Module' in method 'moduleHandler'.
          Open

                      $contactsModuleInstance = vtlib\Module::getInstance('Contacts');
          Severity: Minor
          Found in modules/Project/Project.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\Config' in method 'getHierarchy'.
          Open

                  $listColumns = \App\Config::module('Project', 'COLUMNS_IN_HIERARCHY');
          Severity: Minor
          Found in modules/Project/Project.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\Field' in method 'getHierarchy'.
          Open

                      if (\App\Field::getFieldPermission('Project', $colname)) {
          Severity: Minor
          Found in modules/Project/Project.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\Module' in method 'moduleHandler'.
          Open

                      $accountsModuleInstance = vtlib\Module::getInstance('Accounts');
          Severity: Minor
          Found in modules/Project/Project.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 getHierarchyData uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                                      } else {
                                          $data = '<span>' . $data . '&nbsp;<span class="fas fa-exclamation-circle"></span></span>';
                                      }
          Severity: Minor
          Found in modules/Project/Project.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\Log' in method 'getParent'.
          Open

                      \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
          Severity: Minor
          Found in modules/Project/Project.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 getChild uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
          Open

                              } else {
                                  $childSalesProcessesInfo[$columnname] = $row[$columnname];
                              }
          Severity: Minor
          Found in modules/Project/Project.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\Config' in method 'getParent'.
          Open

                      $listColumns = \App\Config::module('Project', 'COLUMNS_IN_HIERARCHY');
          Severity: Minor
          Found in modules/Project/Project.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\Module' in method 'moduleHandler'.
          Open

                      $helpDeskModuleInstance = vtlib\Module::getInstance('HelpDesk');
          Severity: Minor
          Found in modules/Project/Project.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\Module' in method 'moduleHandler'.
          Open

                      $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
          Severity: Minor
          Found in modules/Project/Project.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\Module' in method 'moduleHandler'.
          Open

                      $moduleInstance = vtlib\Module::getInstance($moduleName);
          Severity: Minor
          Found in modules/Project/Project.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 'getParent'.
          Open

                  \App\Log::trace('Entering getParent(' . $id . ') method ...');
          Severity: Minor
          Found in modules/Project/Project.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 'getChild'.
          Open

                  $moduleModel = Vtiger_Module_Model::getInstance('Project');
          Severity: Minor
          Found in modules/Project/Project.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 'getChild'.
          Open

                  \App\Log::trace('Exiting getChild method ...');
          Severity: Minor
          Found in modules/Project/Project.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\Module' in method 'getParent'.
          Open

                  $userNameSql = App\Module::getSqlForNameInDisplayFormat('Users');
          Severity: Minor
          Found in modules/Project/Project.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 'getChild'.
          Open

                      \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
          Severity: Minor
          Found in modules/Project/Project.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 "modules/ModComments/ModComments.php" 4 times.
          Open

                      if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
          Severity: Critical
          Found in modules/Project/Project.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 "depth" 5 times.
          Open

                  $rows[$baseId] = $this->getChild($baseId, $rows[$baseId], $rows[$baseId]['depth']);
          Severity: Critical
          Found in modules/Project/Project.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 "vtiger_projectcf" 3 times.
          Open

              public $customFieldTable = ['vtiger_projectcf', 'projectid'];
          Severity: Critical
          Found in modules/Project/Project.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 "vtiger_project" 5 times.
          Open

              public $table_name = 'vtiger_project';
          Severity: Critical
          Found in modules/Project/Project.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 "projectname" 7 times.
          Open

                  'Project Name' => 'projectname',
          Severity: Critical
          Found in modules/Project/Project.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 "Projects" 3 times.
          Open

                      $accountsModuleInstance->setRelatedList($moduleInstance, 'Projects', ['ADD', 'SELECT'], 'getDependentsList');
          Severity: Critical
          Found in modules/Project/Project.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 ") method ..." 3 times.
          Open

                  \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
          Severity: Critical
          Found in modules/Project/Project.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 "COLUMNS_IN_HIERARCHY" 4 times.
          Open

                  $listColumns = \App\Config::module('Project', 'COLUMNS_IN_HIERARCHY');
          Severity: Critical
          Found in modules/Project/Project.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 "ModComments" 4 times.
          Open

                      $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
          Severity: Critical
          Found in modules/Project/Project.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 "projectid" 5 times.
          Open

              public $table_index = 'projectid';
          Severity: Critical
          Found in modules/Project/Project.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 "assigned_user_id" 4 times.
          Open

                  'Assigned To' => 'assigned_user_id',
          Severity: Critical
          Found in modules/Project/Project.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 "project" 6 times.
          Open

                  'Project Name' => ['project', 'projectname'],
          Severity: Critical
          Found in modules/Project/Project.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 "Project" 14 times.
          Open

                              ModComments::addWidgetTo(['Project']);
          Severity: Critical
          Found in modules/Project/Project.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 "SELECT" 3 times.
          Open

                      $accountsModuleInstance->setRelatedList($moduleInstance, 'Projects', ['ADD', 'SELECT'], 'getDependentsList');
          Severity: Critical
          Found in modules/Project/Project.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 "vtiger_crmentity" 4 times.
          Open

              public $tab_name = ['vtiger_crmentity', 'vtiger_project', 'vtiger_projectcf', 'vtiger_entity_stats'];
          Severity: Critical
          Found in modules/Project/Project.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.

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

               * @param string Module name
          Severity: Info
          Found in modules/Project/Project.php by phan

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

                      new \yii\db\Expression("CASE when (vtiger_users.user_name not like '') THEN $userNameSql ELSE vtiger_groups.groupname END as user_name"),
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                  $row = (new App\Db\Query())->select([
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                  $dataReader = (new App\Db\Query())->select([
          Severity: Critical
          Found in modules/Project/Project.php by phan

          Saw possibly unextractable annotation for a fragment of comment '* @param string Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)': after string, did not see an element name (will guess based on comment order)
          Open

               * @param string Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
          Severity: Info
          Found in modules/Project/Project.php by phan

          Argument 1 (moduleNames) is array{0:'Project'} but \ModComments::addWidgetTo() takes string defined at /code/modules/ModComments/ModComments.php:72
          Open

                              ModComments::addWidgetTo(['Project']);
          Severity: Minor
          Found in modules/Project/Project.php by phan

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

                  \App\Log::trace('Entering getParent(' . $id . ') method ...');
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                  \App\Log::trace('Exiting getChild method ...');
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                  \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                      new \yii\db\Expression("CASE when (vtiger_users.user_name NOT LIKE '') THEN $userNameSql ELSE vtiger_groups.groupname END as user_name"),
          Severity: Critical
          Found in modules/Project/Project.php by phan

          Argument 1 (moduleNames) is array{0:'Project'} but \ModComments::addWidgetTo() takes string defined at /code/modules/ModComments/ModComments.php:72
          Open

                              ModComments::addWidgetTo(['Project']);
          Severity: Minor
          Found in modules/Project/Project.php by phan

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

                  \App\Log::trace('Exiting getHierarchyData method ...');
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                  \App\Log::trace('Exiting getParent method ...');
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                  \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                      \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                      \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
          Severity: Critical
          Found in modules/Project/Project.php by phan

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

                      \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();
          Severity: Critical
          Found in modules/Project/Project.php by phan

          Similar blocks of code found in 4 locations. Consider refactoring.
          Open

                  foreach ($listColumns as $colname) {
                      if (\App\Field::getFieldPermission('Project', $colname)) {
                          $data = \App\Purifier::encodeHtml($baseInfo[$colname]);
                          if (false === $getRawData && 'projectname' === $colname) {
                              if ($recordId != $id) {
          Severity: Major
          Found in modules/Project/Project.php and 3 other locations - About 4 hrs to fix
          modules/HelpDesk/models/Module.php on lines 111..131
          modules/IStorages/IStorages.php on lines 131..153
          modules/MultiCompany/MultiCompany.php on lines 125..147

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 178.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                      foreach ($listColumns as $columnname) {
                          if ('assigned_user_id' === $columnname) {
                              $parentInfo[$columnname] = $row['user_name'];
                          } elseif (($fieldModel = $moduleModel->getFieldByColumn($columnname)) && \in_array($fieldModel->getFieldDataType(), ['picklist', 'multipicklist'])) {
                              $parentInfo[$columnname] = $fieldModel->getDisplayValue($row[$columnname], false, false, true);
          Severity: Major
          Found in modules/Project/Project.php and 1 other location - About 2 hrs to fix
          modules/Project/Project.php on lines 316..324

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 125.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          Similar blocks of code found in 2 locations. Consider refactoring.
          Open

                          foreach ($listColumns as $columnname) {
                              if ('assigned_user_id' === $columnname) {
                                  $childSalesProcessesInfo[$columnname] = $row['user_name'];
                              } elseif (($fieldModel = $moduleModel->getFieldByColumn($columnname)) && \in_array($fieldModel->getFieldDataType(), ['picklist', 'multipicklist'])) {
                                  $childSalesProcessesInfo[$columnname] = $fieldModel->getDisplayValue($row[$columnname], false, false, true);
          Severity: Major
          Found in modules/Project/Project.php and 1 other location - About 2 hrs to fix
          modules/Project/Project.php on lines 263..271

          Duplicated Code

          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

          Tuning

          This issue has a mass of 125.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

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

                      $contactsModuleInstance = vtlib\Module::getInstance('Contacts');
          Severity: Minor
          Found in modules/Project/Project.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 $helpDeskModuleInstance. Keep variable name length under 20.
          Open

                      $helpDeskModuleInstance = vtlib\Module::getInstance('HelpDesk');
          Severity: Minor
          Found in modules/Project/Project.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 $modcommentsModuleInstance. Keep variable name length under 20.
          Open

                      $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
          Severity: Minor
          Found in modules/Project/Project.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 $accountsModuleInstance. Keep variable name length under 20.
          Open

                      $accountsModuleInstance = vtlib\Module::getInstance('Accounts');
          Severity: Minor
          Found in modules/Project/Project.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 $childSalesProcessesInfo. Keep variable name length under 20.
          Open

                          $childSalesProcessesInfo = [];
          Severity: Minor
          Found in modules/Project/Project.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 $def_detailview_recname. Keep variable name length under 20.
          Open

              public $def_detailview_recname = 'projectname';
          Severity: Minor
          Found in modules/Project/Project.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

          Each class must be in a namespace of at least one level (a top-level vendor name)
          Open

          class Project extends CRMEntity
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          The property $table_name is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $tab_name_index is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $column_fields is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $default_sort_order is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $search_fields_name is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $def_detailview_recname is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

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

              public function getHierarchy(int $id, bool $getRawData = false, bool $getLinks = true): array
          Severity: Minor
          Found in modules/Project/Project.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 $id. Configured minimum length is 3.
          Open

              public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
          Severity: Minor
          Found in modules/Project/Project.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

          The property $list_fields_name is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $def_basicsearch_col is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $mandatory_fields is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $tab_name is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $table_index is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $search_fields is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

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

              public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
          Severity: Minor
          Found in modules/Project/Project.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

          The property $special_functions is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

          The property $default_order_by is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

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

              public function getChild(int $id, array &$childRow, int $depthBase): array
          Severity: Minor
          Found in modules/Project/Project.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

          The property $popup_fields is not named in camelCase.
          Open

          class Project extends CRMEntity
          {
              public $table_name = 'vtiger_project';
              public $table_index = 'projectid';
              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpmd

          CamelCasePropertyName

          Since: 0.2

          It is considered best practice to use the camelCase notation to name attributes.

          Example

          class ClassName {
              protected $property_name;
          }

          Source

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

              // For Popup window record selection
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $list_fields_name = [
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Type' => 'projecttype',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              // For Alphabetical search
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $default_order_by = '';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              /** Indicator if this is a custom module or standard module */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * Mandatory for Saving, Include tables related to this module.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Related to' => ['project', 'linktoaccountscontacts'],
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $table_name = 'vtiger_project';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $column_fields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  // Format: Field Label => fieldname
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'vtiger_entity_stats' => 'crmid', ];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'SINGLE_SSalesProcesses' => ['project', 'ssalesprocessesid'],
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $def_basicsearch_col = 'projectname';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $IsCustomModule = true;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $tab_name = ['vtiger_crmentity', 'vtiger_project', 'vtiger_projectcf', 'vtiger_entity_stats'];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Status' => ['project', 'projectstatus'],
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              // Column value to use on detail view record text display
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Total time [Sum]' => 'sum_time',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              // For Popup listview and UI type support
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Project Name' => ['project', 'projectname'],
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Start Date' => ['project', 'startdate'],
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              ];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Assigned To' => 'assigned_user_id',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $def_detailview_recname = 'projectname';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $relationFields = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              ModComments::addWidgetTo(['Project']);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $baseId = current(array_keys($rows));
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  \App\Log::trace('Entering getHierarchyData(' . $id . ',' . $recordId . ') method ...');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $tab_name_index = [
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $special_functions = ['set_import_assigned_user'];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              // Refers to vtiger_field.fieldname values.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  if ('module.postinstall' === $eventType) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      // Add Project module to the related list of Accounts module
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 121 characters
          Open

                      $accountsModuleInstance->setRelatedList($moduleInstance, 'Projects', ['ADD', 'SELECT'], 'getDependentsList');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 121 characters
          Open

                      $contactsModuleInstance->setRelatedList($moduleInstance, 'Projects', ['ADD', 'SELECT'], 'getDependentsList');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $helpDeskModuleInstance->setRelatedList($moduleInstance, 'Projects', ['SELECT'], 'getRelatedList');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          if (class_exists('ModComments')) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * Function to get project hierarchy in array format.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  if (empty($listColumns)) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $listviewHeader[] = App\Language::translate($fieldname, 'Project');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                  if ($getLinks) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param int   $id
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $table_index = 'projectid';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $search_fields = [
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Type' => ['project', 'projecttype'],
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              ModComments::addWidgetTo(['Project']);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

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

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

               * @param bool  $getLinks
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 138 characters
          Open

                                          $data = '<a href="index.php?module=Project&action=DetailView&record=' . $recordId . '">' . $data . '</a>';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                      } else {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $customFieldTable = ['vtiger_projectcf', 'projectid'];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Project Name' => 'projectname',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  // Format: Field Label => Array(tablename, columnname)
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param bool $getLinks
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $listColumns = $this->list_fields_name;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @throws ReflectionException
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          if (false === $getRawData && 'projectname' === $colname) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                          $data = '<a href="index.php?module=Project&action=DetailView&record=' . $recordId . '">' . $data . '</a>';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              } else {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Start Date' => 'startdate',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              ];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $search_fields_name = [];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              // Callback function list during Importing
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $mandatory_fields = ['createdtime', 'modifiedtime', 'projectname', 'assigned_user_id'];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param string Event Type (module.postinstall, module.disabled, module.enabled, module.preuninstall)
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $moduleInstance = vtlib\Module::getInstance($moduleName);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      // Add Project module to the related list of Accounts module
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $helpDeskModuleInstance = vtlib\Module::getInstance('HelpDesk');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          if (class_exists('ModComments')) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public function getHierarchy(int $id, bool $getRawData = false, bool $getLinks = true): array
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param array $listviewEntries
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  foreach ($listColumns as $colname) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $infoData[] = $data;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * Function to Recursively get all the upper projects of a given.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              // Used when enabling/disabling the mandatory fields for the module.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * Invoked when special actions are performed on the module.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $accountsModuleInstance->setRelatedList($moduleInstance, 'Projects', ['ADD', 'SELECT'], 'getDependentsList');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $contactsModuleInstance->setRelatedList($moduleInstance, 'Projects', ['ADD', 'SELECT'], 'getDependentsList');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          include_once 'modules/ModComments/ModComments.php';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $listColumns = \App\Config::module('Project', 'COLUMNS_IN_HIERARCHY');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * Function to create array of all the sales in the hierarchy.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $currentUser = Users_Privileges_Model::getCurrentUserModel();
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $listColumns = \App\Config::module('Project', 'COLUMNS_IN_HIERARCHY');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      if (\App\Field::getFieldPermission('Project', $colname)) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $listviewEntries[$recordId] = $infoData;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 124 characters
          Open

                          $listviewEntries = $this->getHierarchyData($id, $rowInfo, $accId, $listviewEntries, $getRawData, $getLinks);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param mixed $moduleName
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param int  $id
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $rows = $this->getParent($id, $rows, $encountered);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  if (empty($listColumns)) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 122 characters
          Open

                                          $data = '<span>' . $data . '&nbsp;<span class="fas fa-exclamation-circle"></span></span>';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  foreach ($baseInfo as $accId => $rowInfo) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * Mandatory for Saving, Include tablename and tablekey columnname here.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'vtiger_projectcf' => 'projectid',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @var string[] List of fields in the RelationListView
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  // tablename should not have prefix 'vtiger_'
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $contactsModuleInstance = vtlib\Module::getInstance('Contacts');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  return $listviewEntries;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param int[] $encountered
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      // Add Project module to the related list of HelpDesk module
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public static function registerLinks()
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param bool $getRawData
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $encountered = [$id];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $data = \App\Purifier::encodeHtml($baseInfo[$colname]);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                  $data = '<strong>' . $data . '</strong>';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              $data = $rowDepth . $data;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * Mandatory table for supporting custom fields.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'vtiger_crmentity' => 'crmid',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'vtiger_project' => 'projectid',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  'Status' => 'projectstatus',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $popup_fields = ['projectname'];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      // Mark the module as Standard module
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

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

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

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

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

              /**
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                      if ($hasRecordViewAccess) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $listviewEntries = $this->getHierarchyData($id, $rowInfo, $accId, $listviewEntries, $getRawData, $getLinks);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public $default_sort_order = 'ASC';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param string Module name
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  } elseif ('module.postupdate' === $eventType) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $rows[$baseId] = $this->getChild($baseId, $rows[$baseId], $rows[$baseId]['depth']);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $this->getHierarchyData($id, $rows[$baseId], $baseId, $listviewEntries, $getRawData, $getLinks);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param array $baseInfo
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param int   $recordId
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              $rowDepth = str_repeat(' .. ', $baseInfo['depth']);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 131 characters
          Open

                      \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      if (\App\Field::getFieldPermission('Project', $colname)) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $listColumns = $this->list_fields_name;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param mixed $eventType
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      \App\Db::getInstance()->createCommand()->update('vtiger_tab', ['customized' => 0], ['name' => $moduleName])->execute();
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          include_once 'modules/ModComments/ModComments.php';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                          $data = '<span>' . $data . '&nbsp;<span class="fas fa-exclamation-circle"></span></span>';
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->where(['vtiger_crmentity.deleted' => 0, 'vtiger_project.projectid' => $id])
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $listColumns = \App\Config::module('Project', 'COLUMNS_IN_HIERARCHY');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      foreach ($listColumns as $columnname) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  return $parent;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      new \yii\db\Expression("CASE when (vtiger_users.user_name NOT LIKE '') THEN $userNameSql ELSE vtiger_groups.groupname END as user_name"),
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 149 characters
          Open

                      new \yii\db\Expression("CASE when (vtiger_users.user_name NOT LIKE '') THEN $userNameSql ELSE vtiger_groups.groupname END as user_name"),
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $depth = $depthBase + 1;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public function moduleHandler($moduleName, $eventType)
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      // Add Comments widget to Project module
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $rows = [$baseId => $rows[$baseId]];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param bool  $getRawData
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 126 characters
          Open

                  $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Project', 'DetailView', $recordId);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param int   $depthBase
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $depth = 0;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $depth = $parent[$parentid]['depth'] + 1;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->leftJoin('vtiger_groups', 'vtiger_groups.groupid = vtiger_crmentity.smownerid')
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $childSalesProcessesInfo['depth'] = $depth;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                  $childSalesProcessesInfo[$columnname] = $row[$columnname];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  \App\Log::trace('Exiting getChild method ...');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  return ['header' => $listviewHeader, 'entries' => $listviewEntries];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 158 characters
          Open

              public function getHierarchyData(int $id, array $baseInfo, int $recordId, array &$listviewEntries, bool $getRawData = false, bool $getLinks = true): array
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $hasRecordViewAccess = $currentUser->isAdminUser() || \App\Privilege::isPermitted('Project', 'DetailView', $recordId);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              if ($recordId != $id) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      if (\is_array($rowInfo) && (int) $accId) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  \App\Log::trace('Exiting getHierarchyData method ...');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  \App\Log::trace('Entering getParent(' . $id . ') method ...');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $userNameSql = App\Module::getSqlForNameInDisplayFormat('Users');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->leftJoin('vtiger_users', 'vtiger_users.id = vtiger_crmentity.smownerid')
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $encountered[] = $parentid;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      if (empty($listColumns)) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          } else {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  if ($dataReader->count() > 0) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public function getParent(int $id, array &$parent, array &$encountered, int $depthBase = 0): array
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 165 characters
          Open

                          } elseif (($fieldModel = $moduleModel->getFieldByColumn($columnname)) && \in_array($fieldModel->getFieldDataType(), ['picklist', 'multipicklist'])) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $parent[$id] = $parentInfo;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @return array
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $userNameSql = App\Module::getSqlForNameInDisplayFormat('Users');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->innerJoin('vtiger_crmentity', 'vtiger_crmentity.crmid = vtiger_project.projectid')
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  if (empty($listColumns)) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $childRow[$childAccId] = $childSalesProcessesInfo;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  return $childRow;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $accountsModuleInstance = vtlib\Module::getInstance('Accounts');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  foreach ($listColumns as $fieldname => $colname) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param int   $id
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

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

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

                                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param array $parent
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  if ($depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 149 characters
          Open

                      new \yii\db\Expression("CASE when (vtiger_users.user_name not like '') THEN $userNameSql ELSE vtiger_groups.groupname END as user_name"),
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      if ('' !== $parentid && 0 != $parentid && !\in_array($parentid, $encountered)) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  if (empty($id) || $depthBase === \App\Config::module('Project', 'MAX_HIERARCHY_DEPTH')) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                  $childSalesProcessesInfo[$columnname] = $fieldModel->getDisplayValue($row[$columnname], false, false, true);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      'vtiger_project.*',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $childAccId = $row['projectid'];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      \App\Log::error('Exiting getParent method ... - exceeded maximum depth of hierarchy');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $parentInfo['depth'] = $depth;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              /**
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->leftJoin('vtiger_users', 'vtiger_users.id = vtiger_crmentity.smownerid')
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  ])->from('vtiger_project')
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              $parentInfo[$columnname] = $row['user_name'];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          } elseif (($fieldModel = $moduleModel->getFieldByColumn($columnname)) && \in_array($fieldModel->getFieldDataType(), ['picklist', 'multipicklist'])) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              $parentInfo[$columnname] = $row[$columnname];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      return $childRow;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 132 characters
          Open

                                  $childSalesProcessesInfo[$columnname] = $fieldModel->getDisplayValue($row[$columnname], false, false, true);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $dataReader->close();
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->where(['vtiger_crmentity.deleted' => 0, 'vtiger_project.parentid' => $id])
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->createCommand()->query();
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                                  $childSalesProcessesInfo[$columnname] = $row['user_name'];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param array $childRow
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param int   $depthBase
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              } elseif (($fieldModel = $moduleModel->getFieldByColumn($columnname)) && \in_array($fieldModel->getFieldDataType(), ['picklist', 'multipicklist'])) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              } else {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $moduleModel = Vtiger_Module_Model::getInstance('Project');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      new \yii\db\Expression("CASE when (vtiger_users.user_name not like '') THEN $userNameSql ELSE vtiger_groups.groupname END as user_name"),
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->innerJoin('vtiger_crmentity', 'vtiger_crmentity.crmid = vtiger_project.projectid')
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $parentid = $row['parentid'];
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $this->getParent($parentid, $parent, $encountered, $depthBase + 1);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * @param int   $id
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      'vtiger_project.*',
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $listColumns = \App\Config::module('Project', 'COLUMNS_IN_HIERARCHY');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

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

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

                          foreach ($listColumns as $columnname) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          Line exceeds 120 characters; contains 169 characters
          Open

                              } elseif (($fieldModel = $moduleModel->getFieldByColumn($columnname)) && \in_array($fieldModel->getFieldDataType(), ['picklist', 'multipicklist'])) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               */
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $row = (new App\Db\Query())->select([
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      if (isset($parent[$parentid])) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               *
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  ])->from('vtiger_project')
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              if ('assigned_user_id' === $columnname) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      return $parent;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

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

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

                          if ('assigned_user_id' === $columnname) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                              $parentInfo[$columnname] = $fieldModel->getDisplayValue($row[$columnname], false, false, true);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              public function getChild(int $id, array &$childRow, int $depthBase): array
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  \App\Log::trace('Entering getChild(' . $id . ',' . $depthBase . ') method ...');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      \App\Log::error('Exiting getChild method ... - exceeded maximum depth of hierarchy');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->leftJoin('vtiger_groups', 'vtiger_groups.groupid = vtiger_crmentity.smownerid')
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      ->one();
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

               * Function to Recursively get all the child projects of a given project.
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

              {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      $listColumns = $this->list_fields_name;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

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

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

                  if ($row) {
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $listColumns = $this->list_fields_name;
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  \App\Log::trace('Exiting getParent method ...');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $moduleModel = Vtiger_Module_Model::getInstance('Project');
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                  $dataReader = (new App\Db\Query())->select([
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                          $this->getChild($childAccId, $childRow[$childAccId], $depth);
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

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

                      }
          Severity: Minor
          Found in modules/Project/Project.php by phpcodesniffer

          There are no issues that match your filters.

          Category
          Status