YetiForceCompany/YetiForceCRM

View on GitHub
app/TextParser/RecordsList.php

Summary

Maintainability
C
1 day
Test Coverage
F
0%

Function parseConditions has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
Open

    private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Minor
Found in app/TextParser/RecordsList.php - About 5 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 process has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

    public function process()
    {
        $html = '';
        $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
        $pdf = $this->textParser->getParam('pdf');
Severity: Minor
Found in app/TextParser/RecordsList.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 parseConditions has 63 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
    {
        if (empty($conditions)) {
            return '';
        }
Severity: Major
Found in app/TextParser/RecordsList.php - About 2 hrs to fix

    Method process has 62 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function process()
        {
            $html = '';
            $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
            $pdf = $this->textParser->getParam('pdf');
    Severity: Major
    Found in app/TextParser/RecordsList.php - About 2 hrs to fix

      The method process() has an NPath complexity of 1404. The configured NPath complexity threshold is 200.
      Open

          public function process()
          {
              $html = '';
              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
              $pdf = $this->textParser->getParam('pdf');
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phpmd

      NPathComplexity

      Since: 0.1

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

      Example

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

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

      The method parseConditions() has an NPath complexity of 728. The configured NPath complexity threshold is 200.
      Open

          private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
          {
              if (empty($conditions)) {
                  return '';
              }
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phpmd

      NPathComplexity

      Since: 0.1

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

      Example

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

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

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

          public function process()
          {
              $html = '';
              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
              $pdf = $this->textParser->getParam('pdf');
      Severity: Minor
      Found in app/TextParser/RecordsList.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 parseConditions() has a Cyclomatic Complexity of 18. The configured cyclomatic complexity threshold is 10.
      Open

          private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
          {
              if (empty($conditions)) {
                  return '';
              }
      Severity: Minor
      Found in app/TextParser/RecordsList.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 20 to the 15 allowed.
      Open

          public function process()
      Severity: Critical
      Found in app/TextParser/RecordsList.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 45 to the 15 allowed.
      Open

          private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
      Severity: Critical
      Found in app/TextParser/RecordsList.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 method parseConditions has a boolean flag argument $show, which is a certain sign of a Single Responsibility Principle violation.
      Open

          private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phpmd

      BooleanArgumentFlag

      Since: 1.4.0

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

      Example

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

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

      Avoid assigning values to variables in if clauses and the like (line '51', column '104').
      Open

          public function process()
          {
              $html = '';
              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
              $pdf = $this->textParser->getParam('pdf');
      Severity: Minor
      Found in app/TextParser/RecordsList.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 '\Vtiger_ListView_Model' in method 'process'.
      Open

              $listView = \Vtiger_ListView_Model::getInstance($moduleModel->getName(), $cvId);
      Severity: Minor
      Found in app/TextParser/RecordsList.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 '51', column '9').
      Open

          public function process()
          {
              $html = '';
              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
              $pdf = $this->textParser->getParam('pdf');
      Severity: Minor
      Found in app/TextParser/RecordsList.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 assigning values to variables in if clauses and the like (line '58', column '8').
      Open

          public function process()
          {
              $html = '';
              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
              $pdf = $this->textParser->getParam('pdf');
      Severity: Minor
      Found in app/TextParser/RecordsList.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\Language' in method 'parseConditions'.
      Open

              $groupTranslation = \App\Language::translate("LBL_{$group}");
      Severity: Minor
      Found in app/TextParser/RecordsList.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 parseConditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                          } else {
                              $value[] = \App\Language::translate($fieldModel->getDisplayValue($val, false, false, true), $fieldModel->getModuleName());
                          }
      Severity: Minor
      Found in app/TextParser/RecordsList.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 '51', column '57').
      Open

          public function process()
          {
              $html = '';
              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
              $pdf = $this->textParser->getParam('pdf');
      Severity: Minor
      Found in app/TextParser/RecordsList.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

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

                      } else {
                          $queryField = $queryGenerator->getQueryField($fieldName);
                      }
      Severity: Minor
      Found in app/TextParser/RecordsList.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 '83', column '10').
      Open

          public function process()
          {
              $html = '';
              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
              $pdf = $this->textParser->getParam('pdf');
      Severity: Minor
      Found in app/TextParser/RecordsList.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\Language' in method 'parseConditions'.
      Open

                              $value[] = \App\Language::translate($val, $fieldModel->getModuleName());
      Severity: Minor
      Found in app/TextParser/RecordsList.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_Record_Model' in method 'process'.
      Open

                          $sourceRecordModel = \Vtiger_Record_Model::getInstanceById($recordModel->get($sourceField));
      Severity: Minor
      Found in app/TextParser/RecordsList.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 'process'.
      Open

                  $html .= "<div style=\"{$bodyStyle}\">" . \App\Language::translate($customView->get('viewname'), $moduleModel->getName()) . '</div>';
      Severity: Minor
      Found in app/TextParser/RecordsList.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 'parseConditions'.
      Open

                          lcfirst(\App\Language::translate($operatorLabel, $fieldModel->getModuleName())) . '</strong> ' .
      Severity: Minor
      Found in app/TextParser/RecordsList.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\Record' in method 'process'.
      Open

                      if (($sourceField = $fieldModel->get('source_field_name')) && !$recordModel->isEmpty($sourceField) && \App\Record::isExists($recordModel->get($sourceField))) {
      Severity: Minor
      Found in app/TextParser/RecordsList.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 'process'.
      Open

              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
      Severity: Minor
      Found in app/TextParser/RecordsList.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 '154', column '11').
      Open

          private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
          {
              if (empty($conditions)) {
                  return '';
              }
      Severity: Minor
      Found in app/TextParser/RecordsList.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

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

                      } else {
                          $html .= $text;
                      }
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phpmd

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

                  } else {
                      [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $rule['fieldname']), 3, false);
                      if ($sourceFieldName) {
                          $queryField = $queryGenerator->getQueryRelatedField([
                              'relatedModule' => $moduleName,
      Severity: Minor
      Found in app/TextParser/RecordsList.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 '\CustomView_Record_Model' in method 'process'.
      Open

                  $customView = \CustomView_Record_Model::getInstanceById($cvId);
      Severity: Minor
      Found in app/TextParser/RecordsList.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 parseConditions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                      } else {
                          $html .= "{$pre}";
                      }
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phpmd

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

                              $value[] = \App\Language::translate($fieldModel->getDisplayValue($val, false, false, true), $fieldModel->getModuleName());
      Severity: Minor
      Found in app/TextParser/RecordsList.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_Record_Model' in method 'process'.
      Open

                  $recordModel = \Vtiger_Record_Model::getInstanceById($recordId, $this->textParser->moduleName);
      Severity: Minor
      Found in app/TextParser/RecordsList.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\CustomView' in method 'process'.
      Open

                  $roles[] = \App\CustomView::getConditions($cvId);
      Severity: Minor
      Found in app/TextParser/RecordsList.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 'parseConditions'.
      Open

                          \App\Language::translate($fieldModel->getFieldLabel(), $fieldModel->getModuleName()) . '  <strong>' .
      Severity: Minor
      Found in app/TextParser/RecordsList.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 'process'.
      Open

                  $html .= "<th style=\"{$headerStyle}\">" . \App\Language::translate($fieldModel->getFieldLabel(), $this->textParser->moduleName) . '</th>';
      Severity: Minor
      Found in app/TextParser/RecordsList.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 "operator" 3 times.
      Open

                  if (($value = $pdf->getVariable('search_value')) && ($operator = $pdf->getVariable('operator')) && ($fieldModel = $fields[$pdf->getVariable('search_key')])) {
      Severity: Critical
      Found in app/TextParser/RecordsList.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 "rules" 4 times.
      Open

                      'rules' => array_filter($roles),
      Severity: Critical
      Found in app/TextParser/RecordsList.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 "condition" 4 times.
      Open

                      'condition' => 'AND',
      Severity: Critical
      Found in app/TextParser/RecordsList.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 "source_field_name" 3 times.
      Open

                          'fieldname' => $fieldModel->getCustomViewSelectColumnName((string) $fieldModel->get('source_field_name')),
      Severity: Critical
      Found in app/TextParser/RecordsList.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Avoid unused local variables such as '$html'.
      Open

              $html = '';
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phpmd

      UnusedLocalVariable

      Since: 0.2

      Detects when a local variable is declared and/or assigned, but not used.

      Example

      class Foo {
          public function doSomething()
          {
              $i = 5; // Unused
          }
      }

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

      Call to deprecated function \Vtiger_Field_Model::getFieldLabel() defined at /code/modules/Vtiger/models/Field.php:215
      Open

                  $html .= "<th style=\"{$headerStyle}\">" . \App\Language::translate($fieldModel->getFieldLabel(), $this->textParser->moduleName) . '</th>';
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phan

      Parameter $queryGenerator has undeclared type \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
      Open

          private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phan

      Argument 2 (moduleName) is false but \App\Language::translate() takes string defined at /code/app/Language.php:161
      Open

                  $html .= "<div style=\"{$bodyStyle}\">" . \App\Language::translate($customView->get('viewname'), $moduleModel->getName()) . '</div>';
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phan

      Reference to instance property moduleName from undeclared class \App\TextParser
      Open

                  $html .= "<th style=\"{$headerStyle}\">" . \App\Language::translate($fieldModel->getFieldLabel(), $this->textParser->moduleName) . '</th>';
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phan

      Call to method getQueryField from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
      Open

                          $queryField = $queryGenerator->getQueryField($fieldName);
      Severity: Critical
      Found in app/TextParser/RecordsList.php by phan

      Call to method getQueryRelatedField from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
      Open

                          $queryField = $queryGenerator->getQueryRelatedField([
      Severity: Critical
      Found in app/TextParser/RecordsList.php by phan

      Argument 3 (params) is array{} but \Vtiger_Base_UIType::getTextParserDisplayValue() takes string defined at /code/modules/Vtiger/uitypes/Base.php:299
      Open

                          $value = $fieldModel->getUITypeModel()->getTextParserDisplayValue($sourceRecordModel->get($fieldModel->getName()), $sourceRecordModel, []);
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phan

      Reference to instance property moduleName from undeclared class \App\TextParser
      Open

              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phan

      Call to method parseSearchParams from undeclared class \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
      Open

                      $roles[] = $listView->getQueryGenerator()->parseSearchParams($searchParams);
      Severity: Critical
      Found in app/TextParser/RecordsList.php by phan

      Argument 3 (params) is array{} but \Vtiger_Base_UIType::getTextParserDisplayValue() takes string defined at /code/modules/Vtiger/uitypes/Base.php:299
      Open

                          $value = $fieldModel->getUITypeModel()->getTextParserDisplayValue($recordModel->get($fieldModel->getName()), $recordModel, []);
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phan

      Call to method getParam from undeclared class \App\TextParser (Did you mean class \Tests\App\TextParser)
      Open

              $pdf = $this->textParser->getParam('pdf');
      Severity: Critical
      Found in app/TextParser/RecordsList.php by phan

      Reference to instance property moduleName from undeclared class \App\TextParser
      Open

                  $recordModel = \Vtiger_Record_Model::getInstanceById($recordId, $this->textParser->moduleName);
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phan

      Argument 1 (moduleName) is false but \Vtiger_ListView_Model::getInstance() takes string defined at /code/modules/Vtiger/models/ListView.php:35
      Open

              $listView = \Vtiger_ListView_Model::getInstance($moduleModel->getName(), $cvId);
      Severity: Minor
      Found in app/TextParser/RecordsList.php by phan

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

              $pdf = $this->textParser->getParam('pdf');

      Line exceeds 120 characters; contains 170 characters
      Open

                  if (($value = $pdf->getVariable('search_value')) && ($operator = $pdf->getVariable('operator')) && ($fieldModel = $fields[$pdf->getVariable('search_key')])) {

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

                      $roles[] = [

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

              $html .= '<table class="records-list" style="border-collapse:collapse;width:100%;border:1px solid  #ddd;"><thead><tr>';

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

              $html .= '</tr></thead><tbody>';

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

                  if (!$recordModel->isViewable()) {

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

              if (empty($conditions)) {

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

              $group = strtoupper($conditions['condition']);

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

           * Process.

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

          public function process()

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

                  $html .= "<div style=\"{$bodyStyle}\">" . \App\Language::translate($customView->get('viewname'), $moduleModel->getName()) . '</div>';

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

              if (\in_array('conditions', $params)) {

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

                  if (($value = $pdf->getVariable('search_value')) && ($operator = $pdf->getVariable('operator')) && ($fieldModel = $fields[$pdf->getVariable('search_key')])) {

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

                  if ($searchParams = $pdf->getVariable('search_params')) {

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

                      'condition' => 'AND',

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

              $bodyStyle = 'border:1px solid #ddd;padding:4px; ';

      Line exceeds 120 characters; contains 151 characters
      Open

                  $html .= "<th style=\"{$headerStyle}\">" . \App\Language::translate($fieldModel->getFieldLabel(), $this->textParser->moduleName) . '</th>';

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

          public $type = 'pdf';

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

              }

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

                  $roles = [];

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

              foreach ($fields as $fieldModel) {

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

                  $html .= "<th style=\"{$headerStyle}\">" . \App\Language::translate($fieldModel->getFieldLabel(), $this->textParser->moduleName) . '</th>';

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

                  $html .= '</tr>';

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

           * Specific parse conditions.

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

                  if (isset($rule['condition'])) {

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

                      $showPartGroup = strtoupper($rule['condition']) !== $group;

      Line exceeds 120 characters; contains 146 characters
      Open

                          $html .= "<div style=\"font-size:9px;\">{$groupTranslation} " . (\count($rule['rules']) > 1 ? "({$text})" : $text) . '</div>';

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

          public $name = 'LBL_TEXT_PARSER_RECORDS_LIST';

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

              $params = $this->params ?? [];

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

                          'value' => $value,

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

                  $roles[] = \App\CustomView::getConditions($cvId);

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

           * @param array|null          $conditions

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

                      }

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

                      if ($sourceFieldName) {

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

              $html = '';

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

                          $value = $fieldModel->getUITypeModel()->getTextParserDisplayValue($sourceRecordModel->get($fieldModel->getName()), $sourceRecordModel, []);

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

                      }

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

                  return '';

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

           * @return string

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

              $fields = $listView->getListViewHeaders();

      Line exceeds 120 characters; contains 127 characters
      Open

              $html .= '<table class="records-list" style="border-collapse:collapse;width:100%;border:1px solid  #ddd;"><thead><tr>';

      Line exceeds 120 characters; contains 159 characters
      Open

                          $value = $fieldModel->getUITypeModel()->getTextParserDisplayValue($sourceRecordModel->get($fieldModel->getName()), $sourceRecordModel, []);

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

           * @return string

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

                  } else {

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

                      [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $rule['fieldname']), 3, false);

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

          /** @var mixed Parser type */

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

          {

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

              $bodyStyle = 'font-size:9px;';

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

                  $customView = \CustomView_Record_Model::getInstanceById($cvId);

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

                  foreach ($fields as $fieldModel) {

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

              return $html .= '</tbody</table>';

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

          }

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

          {

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

              }

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

              $listView = \Vtiger_ListView_Model::getInstance($moduleModel->getName(), $cvId);

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

                  $conditions = [

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

              $headerStyle = 'text-align:center;background-color:#ddd;';

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

          /**

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

              $count = $counter = \count($conditions['rules']);

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

                      if ($showPartGroup) {

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

                          $html .= "<div style=\"font-size:9px;\">{$groupTranslation} " . (\count($rule['rules']) > 1 ? "({$text})" : $text) . '</div>';

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

                      } else {

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

              $cvId = $pdf->getVariable('viewname');

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

              }

      Line exceeds 120 characters; contains 140 characters
      Open

          private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string

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

              $groupTranslation = \App\Language::translate("LBL_{$group}");

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

                          $html .= $text;

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

          /**

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

              $cvId = $listView->get('viewId');

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

                      'rules' => array_filter($roles),

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

                  $html .= $this->parseConditions($conditions, $listView->getQueryGenerator());

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

              $moduleModel = \Vtiger_Module_Model::getInstance($this->textParser->moduleName);

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

                  $ids = [$ids];

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

                  }

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

                      } elseif (!$fieldModel->get('source_field_name')) {

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

                      $html .= "<td style=\"{$bodyStyle}\">" . $value . '</td>';

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

                      }

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

                          } else {

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

                      }

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

                      if (!($operatorLabel = \App\Condition::STANDARD_OPERATORS[$operator] ?? '')) {

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

                          \App\Language::translate($fieldModel->getFieldLabel(), $fieldModel->getModuleName()) . '  <strong>' .

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

          /** @var string Class name */

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

              if (!\is_array($ids)) {

      Line exceeds 120 characters; contains 145 characters
      Open

                  $html .= "<div style=\"{$bodyStyle}\">" . \App\Language::translate($customView->get('viewname'), $moduleModel->getName()) . '</div>';

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

                  }

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

                  }

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

          private function parseConditions(?array $conditions, \App\QueryGenerator $queryGenerator, string $html = '', bool $show = false): string

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

              foreach ($conditions['rules'] as $rule) {

      Line exceeds 120 characters; contains 131 characters
      Open

                      $queryValue = method_exists($queryField, 'getArrayValue') ? $queryField->getArrayValue() : $queryField->getValue();

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

              return $html;

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

              $ids = $pdf->getVariable('recordsId');

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

              if (\in_array('viewName', $params) && $cvId) {

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

                      ];

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

              foreach ($ids as $recordId) {

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

                      continue;

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

                      $value = '';

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

                      $queryField->setOperator($rule['operator']);

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

                          $queryValue = false !== strpos($queryValue, $separator) ? explode($separator, $queryValue) : [$queryValue];

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

                  --$counter;

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

           *

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

                      $roles[] = $listView->getQueryGenerator()->parseSearchParams($searchParams);

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

              }

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

                  $recordModel = \Vtiger_Record_Model::getInstanceById($recordId, $this->textParser->moduleName);

      Line exceeds 120 characters; contains 175 characters
      Open

                      if (($sourceField = $fieldModel->get('source_field_name')) && !$recordModel->isEmpty($sourceField) && \App\Record::isExists($recordModel->get($sourceField))) {

      Line exceeds 120 characters; contains 147 characters
      Open

                          $value = $fieldModel->getUITypeModel()->getTextParserDisplayValue($recordModel->get($fieldModel->getName()), $recordModel, []);

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

           * @param \App\QueryGenerator $queryGenerator

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

           *

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

           */

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

                      $text = $this->parseConditions($rule, $queryGenerator, '', $showPartGroup);

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

                      $value = implode(', ', $value);

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

                          $value . '</span>';

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

              }

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

                  $html .= '<tr>';

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

                      if (($sourceField = $fieldModel->get('source_field_name')) && !$recordModel->isEmpty($sourceField) && \App\Record::isExists($recordModel->get($sourceField))) {

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

                          $value = $fieldModel->getUITypeModel()->getTextParserDisplayValue($recordModel->get($fieldModel->getName()), $recordModel, []);

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

           * @param bool                $show

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

                      } else {

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

                      $operator = $queryField->getOperator();

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

                  }

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

           */

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

                          'fieldname' => $fieldModel->getCustomViewSelectColumnName((string) $fieldModel->get('source_field_name')),

      Line exceeds 120 characters; contains 126 characters
      Open

                          'fieldname' => $fieldModel->getCustomViewSelectColumnName((string) $fieldModel->get('source_field_name')),

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

                          'operator' => $operator,

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

                  }

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

                  ];

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

              }

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

                          $sourceRecordModel = \Vtiger_Record_Model::getInstanceById($recordModel->get($sourceField));

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

           *

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

           * @param string              $html

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

              $showGroup = $show || 'AND' !== $group;

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

                      $queryField->setValue($rule['value']);

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

                      foreach ($queryValue as $val) {

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

                      if ($counter && $count !== $counter && $showGroup) {

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

                      } else {

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

          }

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

                          ]);

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

                          $separator = '##';

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

                      }

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

              }

      Line exceeds 120 characters; contains 121 characters
      Open

                          \App\Language::translate($fieldModel->getFieldLabel(), $fieldModel->getModuleName()) . '  <strong>' .

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

                          $html .= "<div style=\"font-size:9px;\">{$pre}</div>";

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

                              'relatedModule' => $moduleName,

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

                          $operatorLabel = \App\Condition::DATE_OPERATORS[$operator] ?? '';

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

                      }

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

                          $queryField = $queryGenerator->getQueryRelatedField([

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

                      $value = [];

      Line exceeds 120 characters; contains 127 characters
      Open

                          $queryValue = false !== strpos($queryValue, $separator) ? explode($separator, $queryValue) : [$queryValue];

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

                      }

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

                              $value[] = \App\Language::translate($val, $fieldModel->getModuleName());

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

                      $pre = '<span style="font-size:9px;">' .

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

                              'relatedField' => $fieldName,

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

                              'sourceField' => $sourceFieldName,

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

                          if ($fieldModel->isReferenceField()) {

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

                          lcfirst(\App\Language::translate($operatorLabel, $fieldModel->getModuleName())) . '</strong> ' .

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

                      } elseif (!$show) {

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

                          $queryField = $queryGenerator->getQueryField($fieldName);

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

                              $value[] = \App\Language::translate($fieldModel->getDisplayValue($val, false, false, true), $fieldModel->getModuleName());

      Line exceeds 120 characters; contains 146 characters
      Open

                              $value[] = \App\Language::translate($fieldModel->getDisplayValue($val, false, false, true), $fieldModel->getModuleName());

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

                      $fieldModel = $queryField->getField();

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

                          $html .= "<span style=\"font-size:9px;\">{$groupTranslation} </span>{$pre}";

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

                          $html .= "{$pre}";

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

                      $queryValue = method_exists($queryField, 'getArrayValue') ? $queryField->getArrayValue() : $queryField->getValue();

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

                      if (!\is_array($queryValue)) {

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

                          }

      There are no issues that match your filters.

      Category
      Status