YetiForceCompany/YetiForceCRM

View on GitHub
tests/App/Conditions.php

Summary

Maintainability
C
1 day
Test Coverage
A
100%

Function testIfAllOperatorsExist has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    public function testIfAllOperatorsExist()
    {
        foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
            if ($item->isFile() && 'php' === $item->getExtension()) {
                $fileName = $item->getBasename('.php');
Severity: Minor
Found in tests/App/Conditions.php - About 3 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 testCheckConditions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testCheckConditions()
    {
        $recordModel = \Tests\Base\C_RecordActions::createSQuotesRecord();
        $checkConditions = \App\Condition::checkConditions([
            'condition' => 'AND',
Severity: Minor
Found in tests/App/Conditions.php - About 1 hr to fix

    Method testIfAllOperatorsExist has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function testIfAllOperatorsExist()
        {
            foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
                if ($item->isFile() && 'php' === $item->getExtension()) {
                    $fileName = $item->getBasename('.php');
    Severity: Minor
    Found in tests/App/Conditions.php - About 1 hr to fix

      The method testIfAllOperatorsExist() has an NPath complexity of 327. The configured NPath complexity threshold is 200.
      Open

          public function testIfAllOperatorsExist()
          {
              foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
                  if ($item->isFile() && 'php' === $item->getExtension()) {
                      $fileName = $item->getBasename('.php');
      Severity: Minor
      Found in tests/App/Conditions.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 testIfAllOperatorsExist() has a Cyclomatic Complexity of 16. The configured cyclomatic complexity threshold is 10.
      Open

          public function testIfAllOperatorsExist()
          {
              foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
                  if ($item->isFile() && 'php' === $item->getExtension()) {
                      $fileName = $item->getBasename('.php');
      Severity: Minor
      Found in tests/App/Conditions.php by phpmd

      CyclomaticComplexity

      Since: 0.1

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

      Example

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

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

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

          public function testIfAllOperatorsExist()
      Severity: Critical
      Found in tests/App/Conditions.php by sonar-php

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

      See

      Missing class import via use statement (line '28', column '17').
      Open

              foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
      Severity: Minor
      Found in tests/App/Conditions.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

      Avoid using static access to class '\Vtiger_Loader' in method 'testIfAllOperatorsExist'.
      Open

                      $className = \Vtiger_Loader::getComponentClassName('UIType', $fileName, 'Vtiger', false);
      Severity: Minor
      Found in tests/App/Conditions.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 '\Tests\Base\C_RecordActions' in method 'testCheckConditions'.
      Open

              $recordModel = \Tests\Base\C_RecordActions::createSQuotesRecord();
      Severity: Minor
      Found in tests/App/Conditions.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\Condition' in method 'testCheckConditions'.
      Open

              $checkConditions = \App\Condition::checkConditions([
                  'condition' => 'AND',
                  'rules' => [
                      [
                          'fieldname' => 'createdtime:SQuotes',
      Severity: Minor
      Found in tests/App/Conditions.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\Condition' in method 'testCheckConditions'.
      Open

              $checkConditions = \App\Condition::checkConditions([
                  'condition' => 'AND',
                  'rules' => [
                      [
                          'fieldname' => 'createdtime:SQuotes',
      Severity: Minor
      Found in tests/App/Conditions.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 "value" 4 times.
      Open

                          'value' => date('Y-m-d H:i:s', strtotime('last day')) . ',' . date('Y-m-d H:i:s', strtotime('next day')),
      Severity: Critical
      Found in tests/App/Conditions.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 "Y-m-d H:i:s" 4 times.
      Open

                          'value' => date('Y-m-d H:i:s', strtotime('last day')) . ',' . date('Y-m-d H:i:s', strtotime('next day')),
      Severity: Critical
      Found in tests/App/Conditions.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 "Class not found: " 3 times.
      Open

                      $this->assertTrue(class_exists($className), 'Class not found: ' . $className);
      Severity: Critical
      Found in tests/App/Conditions.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 "fieldname" 4 times.
      Open

                          'fieldname' => 'createdtime:SQuotes',
      Severity: Critical
      Found in tests/App/Conditions.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 "operator" 6 times.
      Open

                          $fn = 'operator' . ucfirst($operator);
      Severity: Critical
      Found in tests/App/Conditions.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.

      Call to undeclared method \Tests\App\Conditions::assertTrue
      Open

                              $this->assertTrue(\in_array($fn, $methodsQueryFields), "No query operator $operator (function $fn) in class $classNameQueryFields");
      Severity: Critical
      Found in tests/App/Conditions.php by phan

      Call to undeclared method \Tests\App\Conditions::assertFalse
      Open

              $this->assertFalse($checkConditions);
      Severity: Critical
      Found in tests/App/Conditions.php by phan

      Call to undeclared method \Tests\App\Conditions::assertTrue
      Open

                              $this->assertTrue(\in_array($fn, $methodsRecordFields), "No record operator $operator (function $fn) in class $classNameRecordFields");
      Severity: Critical
      Found in tests/App/Conditions.php by phan

      Call to undeclared method \Tests\App\Conditions::assertTrue
      Open

                      $this->assertTrue(class_exists($className), 'Class not found: ' . $className);
      Severity: Critical
      Found in tests/App/Conditions.php by phan

      Call to undeclared method \Tests\App\Conditions::assertTrue
      Open

                      $this->assertTrue(class_exists($classNameQueryFields), 'Class not found: ' . $classNameQueryFields);
      Severity: Critical
      Found in tests/App/Conditions.php by phan

      Call to undeclared method \Tests\App\Conditions::assertTrue
      Open

              $this->assertTrue($checkConditions);
      Severity: Critical
      Found in tests/App/Conditions.php by phan

      Call to undeclared method \Tests\App\Conditions::assertTrue
      Open

                      $this->assertTrue(class_exists($classNameRecordFields), 'Class not found: ' . $classNameRecordFields);
      Severity: Critical
      Found in tests/App/Conditions.php by phan

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

              $checkConditions = \App\Condition::checkConditions([
                  'condition' => 'AND',
                  'rules' => [
                      [
                          'fieldname' => 'createdtime:SQuotes',
      Severity: Major
      Found in tests/App/Conditions.php and 1 other location - About 1 hr to fix
      tests/App/Conditions.php on lines 90..104

      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 109.

      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

              $checkConditions = \App\Condition::checkConditions([
                  'condition' => 'AND',
                  'rules' => [
                      [
                          'fieldname' => 'createdtime:SQuotes',
      Severity: Major
      Found in tests/App/Conditions.php and 1 other location - About 1 hr to fix
      tests/App/Conditions.php on lines 73..87

      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 109.

      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 ($instance->getRecordOperators() as $operator) {
                          $fn = 'operator' . ucfirst($operator);
                          if ($methodsRecordFields && !\in_array($fn, $methodsRecordFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
                              $fn = 'getStdOperator';
                          }
      Severity: Major
      Found in tests/App/Conditions.php and 1 other location - About 1 hr to fix
      tests/App/Conditions.php on lines 40..48

      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 102.

      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 ($instance->getQueryOperators() as $operator) {
                          $fn = 'operator' . ucfirst($operator);
                          if ($methodsQueryFields && !\in_array($fn, $methodsQueryFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
                              $fn = 'getStdOperator';
                          }
      Severity: Major
      Found in tests/App/Conditions.php and 1 other location - About 1 hr to fix
      tests/App/Conditions.php on lines 54..62

      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 102.

      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 $classNameRecordFields. Keep variable name length under 20.
      Open

                      $classNameRecordFields = '\App\Conditions\RecordFields\\' . $fileName . 'Field';
      Severity: Minor
      Found in tests/App/Conditions.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 variables with short names like $fn. Configured minimum length is 3.
      Open

                          $fn = 'operator' . ucfirst($operator);
      Severity: Minor
      Found in tests/App/Conditions.php by phpmd

      ShortVariable

      Since: 0.2

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

      Example

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

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

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

                  if ($item->isFile() && 'php' === $item->getExtension()) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

      Line exceeds 120 characters; contains 125 characters
      Open

                      $methodsRecordFields = class_exists($classNameRecordFields) ? get_class_methods($classNameRecordFields) : [];
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

           * Testing check conditions.
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

              ], $recordModel);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'fieldname' => 'createdtime:SQuotes',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      ],
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'fieldname' => 'subject:SQuotes',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

          public function testIfAllOperatorsExist()
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

      Line exceeds 120 characters; contains 156 characters
      Open

                              $this->assertTrue(\in_array($fn, $methodsQueryFields), "No query operator $operator (function $fn) in class $classNameQueryFields");
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $this->assertTrue(class_exists($classNameRecordFields), 'Class not found: ' . $classNameRecordFields);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      ],
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

      Line exceeds 120 characters; contains 138 characters
      Open

                          if ($methodsQueryFields && !\in_array($fn, $methodsQueryFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                  'condition' => 'AND',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                  'rules' => [
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'operator' => 'bw',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          $fn = 'operator' . ucfirst($operator);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          if ($methodsQueryFields && !\in_array($fn, $methodsQueryFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                  'condition' => 'AND',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                  ],
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          if ($methodsQueryFields) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $methodsRecordFields = class_exists($classNameRecordFields) ? get_class_methods($classNameRecordFields) : [];
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          if ($methodsRecordFields && !\in_array($fn, $methodsRecordFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

              }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

          }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

          /**
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      foreach ($instance->getQueryOperators() as $operator) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

      Line exceeds 120 characters; contains 125 characters
      Open

                          'value' => date('Y-m-d H:i:s', strtotime('last day')) . ',' . date('Y-m-d H:i:s', strtotime('next day')),
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

           * Testing constructor method.
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

           * @throws \App\Exceptions\AppException
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      foreach ($instance->getRecordOperators() as $operator) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

              $recordModel = \Tests\Base\C_RecordActions::createSQuotesRecord();
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

              $checkConditions = \App\Condition::checkConditions([
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'operator' => 'bw',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'value' => date('Y-m-d H:i:s', strtotime('last day')) . ',' . date('Y-m-d H:i:s', strtotime('next day')),
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'operator' => 'e',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

              $this->assertTrue($checkConditions);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

              $this->assertFalse($checkConditions);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

           * @codeCoverageIgnore
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $classNameQueryFields = '\App\Conditions\QueryFields\\' . $fileName . 'Field';
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                              $fn = 'getStdOperator';
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                  'rules' => [
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      [
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $this->assertTrue(class_exists($className), 'Class not found: ' . $className);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $this->assertTrue(class_exists($classNameQueryFields), 'Class not found: ' . $classNameQueryFields);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          if ($methodsRecordFields) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                              $this->assertTrue(\in_array($fn, $methodsRecordFields), "No record operator $operator (function $fn) in class $classNameRecordFields");
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

              ], $recordModel);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

           *
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

          {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                  }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'fieldname' => 'createdtime:SQuotes',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      [
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

              foreach ((new \DirectoryIterator(ROOT_DIRECTORY . '/modules/Vtiger/uitypes/')) as $item) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $methodsQueryFields = class_exists($classNameQueryFields) ? get_class_methods($classNameQueryFields) : [];
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          $fn = 'operator' . ucfirst($operator);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      ],
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      [
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

      Line exceeds 120 characters; contains 122 characters
      Open

                      $methodsQueryFields = class_exists($classNameQueryFields) ? get_class_methods($classNameQueryFields) : [];
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                              $this->assertTrue(\in_array($fn, $methodsQueryFields), "No query operator $operator (function $fn) in class $classNameQueryFields");
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $classNameRecordFields = '\App\Conditions\RecordFields\\' . $fileName . 'Field';
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

           */
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'value' => 'System CRM YetiForce',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'value' => date('Y-m-d H:i:s', strtotime('next day')) . ',' . date('Y-m-d H:i:s', strtotime('next year')),
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'operator' => 'e',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $className = \Vtiger_Loader::getComponentClassName('UIType', $fileName, 'Vtiger', false);
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                              $fn = 'getStdOperator';
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'fieldname' => 'subject:SQuotes',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                  ],
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

              $checkConditions = \App\Condition::checkConditions([
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

      Line exceeds 120 characters; contains 126 characters
      Open

                          'value' => date('Y-m-d H:i:s', strtotime('next day')) . ',' . date('Y-m-d H:i:s', strtotime('next year')),
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $fileName = $item->getBasename('.php');
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      $instance = new $className();
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

          public function testCheckConditions()
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                          'value' => 'System CRM YetiForce',
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      ],
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      }
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

      Line exceeds 120 characters; contains 140 characters
      Open

                          if ($methodsRecordFields && !\in_array($fn, $methodsRecordFields) && isset(\App\Condition::DATE_OPERATORS[$operator])) {
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

      Line exceeds 120 characters; contains 159 characters
      Open

                              $this->assertTrue(\in_array($fn, $methodsRecordFields), "No record operator $operator (function $fn) in class $classNameRecordFields");
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

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

                      [
      Severity: Minor
      Found in tests/App/Conditions.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status