YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/AutomaticAssignment/models/Module.php

Summary

Maintainability
C
1 day
Test Coverage
F
57%

Method getFieldInstanceByName has 172 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getFieldInstanceByName($name)
    {
        switch ($name) {
            case 'subject':
                $params = [
Severity: Major
Found in modules/Settings/AutomaticAssignment/models/Module.php - About 6 hrs to fix

    Function getFieldInstanceByName has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getFieldInstanceByName($name)
        {
            switch ($name) {
                case 'subject':
                    $params = [
    Severity: Minor
    Found in modules/Settings/AutomaticAssignment/models/Module.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

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

    <?php
    
    /**
     * Automatic assignment module model class.
     *
    Severity: Minor
    Found in modules/Settings/AutomaticAssignment/models/Module.php - About 2 hrs to fix

      Function getListFields has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getListFields(): array
          {
              if (!isset($this->listFieldModels)) {
                  $fields = $this->listFields;
                  $fieldObjects = [];
      Severity: Minor
      Found in modules/Settings/AutomaticAssignment/models/Module.php - About 25 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      The method getFieldInstanceByName() has 175 lines of code. Current threshold is set to 100. Avoid really long methods.
      Open

          public function getFieldInstanceByName($name)
          {
              switch ($name) {
                  case 'subject':
                      $params = [

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

          public function getFieldInstanceByName($name)
          {
              switch ($name) {
                  case 'subject':
                      $params = [

      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

      This function "getFieldInstanceByName" has 174 lines, which is greater than the 150 lines authorized. Split it into smaller functions.
      Open

          public function getFieldInstanceByName($name)

      A function that grows too large tends to aggregate too many responsibilities.

      Such functions inevitably become harder to understand and therefore harder to maintain.

      Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.

      Those smaller functions will not only be easier to understand, but also probably easier to test.

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

                      $fieldObject = new \App\Base(['name' => $fieldName, 'label' => $fieldLabel]);

      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 '\vtlib\Functions' in method 'getFieldInstanceByName'.
      Open

                      foreach (\vtlib\Functions::getAllModules(true, false, 0) as $module) {

      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 getEditViewStructure uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
      Open

                  } else {
                      $defaultValue = $fieldModel->get('defaultvalue');
                      $fieldModel->set('fieldvalue', $defaultValue ?? '');
                  }

      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 '\Vtiger_Field_Model' in method 'getFieldInstanceByName'.
      Open

              return \Vtiger_Field_Model::init($this->getName(true), $params, $name);

      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 'getFieldInstanceByName'.
      Open

                          \App\AutoAssign::METHOD_ROUND_ROBIN => \App\Language::translate('PLL_ROUND_ROBIN', $this->getName(true))

      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 'getFieldInstanceByName'.
      Open

                          1 => \App\Language::translate('PLL_ACTIVE', $this->getName(true))

      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\YetiForce\Shop' in method 'hasCreatePermissions'.
      Open

              return \App\YetiForce\Shop::check('YetiForceAutoAssignment');

      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 'getSupportedModules'.
      Open

              return Vtiger_Module_Model::getAll([0], ['SMSNotifier', 'OSSMailView', 'Dashboard', 'ModComments', 'Notification'], true);

      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 'getFieldInstanceByName'.
      Open

                          0 => \App\Language::translate('PLL_INACTIVE', $this->getName(true)),

      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 'getFieldInstanceByName'.
      Open

                          \App\AutoAssign::METHOD_LOAD_BALANCE => \App\Language::translate('PLL_LOAD_BALANCED', $this->getName(true)),

      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 'getFieldInstanceByName'.
      Open

                          $params['picklistValues'][$module['tabid']] = \App\Language::translate($module['name'], $module['name']);

      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 "tabid" 5 times.
      Open

          public $listFields = ['subject' => 'FL_SUBJECT', 'tabid' => 'FL_MODULE',  'state' => 'FL_STATE'];

      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 "picklistValues" 6 times.
      Open

                          'picklistValues' => []

      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 "BL_ASSIGN_USERS" 3 times.
      Open

                  'BL_ASSIGN_USERS' => ['icon' => 'yfi yfi-users-2'],

      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 "purifyType" 12 times.
      Open

                          'purifyType' => \App\Purifier::TEXT,

      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 "blockLabel" 13 times.
      Open

                  $block = $fieldModel->get('blockLabel') ?: '';

      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 "uitype" 12 times.
      Open

                          'uitype' => 1,

      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 "state" 4 times.
      Open

          public $listFields = ['subject' => 'FL_SUBJECT', 'tabid' => 'FL_MODULE',  'state' => 'FL_STATE'];

      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 "tooltip" 3 times.
      Open

                          'tooltip' => 'LBL_HANDLER_DESC',

      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 "defaultvalue" 4 times.
      Open

                      $defaultValue = $fieldModel->get('defaultvalue');

      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 "typeofdata" 12 times.
      Open

                          'typeofdata' => 'V~M',

      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 "table" 11 times.
      Open

                          'table' => $this->getBaseTable()

      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 "maximumlength" 12 times.
      Open

                          'maximumlength' => '100',

      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 "index.php?module=" 3 times.
      Open

              return 'index.php?module=' . $this->getName() . '&parent=Settings&view=Edit';

      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 "label" 13 times.
      Open

                      $fieldObject = new \App\Base(['name' => $fieldName, 'label' => $fieldLabel]);

      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 "65535" 3 times.
      Open

                          'maximumlength' => '65535',

      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 "subject" 4 times.
      Open

          public $listFields = ['subject' => 'FL_SUBJECT', 'tabid' => 'FL_MODULE',  'state' => 'FL_STATE'];

      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 "BL_BASIC_DATA" 7 times.
      Open

                  'BL_BASIC_DATA' => ['icon' => 'yfi-company-detlis'],

      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 "BL_USER_SELECTION_CONDITIONS" 4 times.
      Open

                  'BL_USER_SELECTION_CONDITIONS' => ['icon' => 'mdi mdi-account-filter-outline'],

      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.

      Reference to undeclared property \Settings_AutomaticAssignment_Module_Model->listFieldModels
      Open

              if (!isset($this->listFieldModels)) {

      Reference to undeclared property \Settings_AutomaticAssignment_Module_Model->listFieldModels
      Open

              return $this->listFieldModels;

      Call to method check from undeclared class \App\YetiForce\Shop
      Open

              return \App\YetiForce\Shop::check('YetiForceAutoAssignment');

      Reference to undeclared property \Settings_AutomaticAssignment_Module_Model->listFieldModels
      Open

                  $this->listFieldModels = $fieldObjects;

      Avoid excessively long class names like Settings_AutomaticAssignment_Module_Model. Keep class name length under 40.
      Open

      class Settings_AutomaticAssignment_Module_Model extends Settings_Vtiger_Module_Model
      {
          /** {@inheritdoc} */
          public $baseTable = 's_#__auto_assign';
          /** {@inheritdoc} */

      LongClassName

      Since: 2.9

      Detects when classes or interfaces are declared with excessively long names.

      Example

      class ATooLongClassNameThatHintsAtADesignProblem {
      
      }
      
      interface ATooLongInterfaceNameThatHintsAtADesignProblem {
      
      }

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

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

      class Settings_AutomaticAssignment_Module_Model extends Settings_Vtiger_Module_Model

      The class Settings_AutomaticAssignment_Module_Model is not named in CamelCase.
      Open

      class Settings_AutomaticAssignment_Module_Model extends Settings_Vtiger_Module_Model
      {
          /** {@inheritdoc} */
          public $baseTable = 's_#__auto_assign';
          /** {@inheritdoc} */

      CamelCaseClassName

      Since: 0.2

      It is considered best practice to use the CamelCase notation to name classes.

      Example

      class class_name {
      }

      Source

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

          public $baseIndex = 'id';

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

          public $customFieldTable = ['s_#__auto_assign_users' => 'id', 's_#__auto_assign_groups' => 'id', 's_#__auto_assign_roles' => 'id'];

      Line exceeds 120 characters; contains 135 characters
      Open

          public $customFieldTable = ['s_#__auto_assign_users' => 'id', 's_#__auto_assign_groups' => 'id', 's_#__auto_assign_roles' => 'id'];

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

          /** {@inheritdoc} */

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

                      }

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

              'tabid', 'subject', 'state', 'workflow', 'handler', 'gui', 'conditions', 'members', 'method', 'default_assign', 'record_limit', 'record_limit_conditions'

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

           * @return array

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

           * Function get supported modules.

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

              return Vtiger_Module_Model::getAll([0], ['SMSNotifier', 'OSSMailView', 'Dashboard', 'ModComments', 'Notification'], true);

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

           * @param string $fieldName

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

                      if (!$this->isSortByName($fieldName)) {

      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 ($this->editFields as $fieldName) {

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

          public $listFields = ['subject' => 'FL_SUBJECT', 'tabid' => 'FL_MODULE',  'state' => 'FL_STATE'];

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

          public function getCreateRecordUrl()

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

          }

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

          public function isSortByName($fieldName)

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

              }

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

          public $editFields = [

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

           * @return string - url

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

           *

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

                      $fieldObjects[$fieldName] = $fieldObject;

      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

           * @return array

      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

           */

      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

           * Function verifies if it is possible to sort by given field in list view.

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

              return $this->listFieldModels;

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

          /**

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

          /** {@inheritdoc} */

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

          public $name = 'AutomaticAssignment';

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

              return 'index.php?module=' . $this->getName() . '&parent=Settings&view=Edit';

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

           * Function to get the url for Create view of the module.

      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 'index.php?module=' . $this->getName() . '&parent=Settings&view=Edit';

      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

           * @return array - List of modules

      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

                  $this->listFieldModels = $fieldObjects;

      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

           *

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

              return 'index.php?module=' . $this->getName() . '&parent=Settings&view=List';

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

                  return true;

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

              return false;

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

                  foreach ($fields as $fieldName => $fieldLabel) {

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

          public function getDefaultUrl()

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

                  $fields = $this->listFields;

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

           * Editable fields.

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

           * @return string - url

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

          /**

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

          public static function getSupportedModules()

      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 bool

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

          {

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

          public function getListFields(): array

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

          /** @var string[] Fields name for edit view */

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

          ];

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

          public function getEditableFields(): array

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

              return $this->editFields;

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

           *

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

          public function getEditViewStructure($recordModel = null): array

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

          public $baseTable = 's_#__auto_assign';

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

          /** {@inheritdoc} */

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

           */

      Line exceeds 120 characters; contains 130 characters
      Open

              return Vtiger_Module_Model::getAll([0], ['SMSNotifier', 'OSSMailView', 'Dashboard', 'ModComments', 'Notification'], true);

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

                      $fieldObject = new \App\Base(['name' => $fieldName, 'label' => $fieldLabel]);

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

           * @param string $name

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

                          'maximumlength' => '100',

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

                          'maximumlength' => '128',

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

                          0 => \App\Language::translate('PLL_INACTIVE', $this->getName(true)),

      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

                      $params = [

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

          /** {@inheritdoc} */

      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

                  if ($recordModel && $recordModel->has($fieldName)) {

      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

                  'BL_BASIC_DATA' => ['icon' => 'yfi-company-detlis'],

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

              ];

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

                          'uitype' => 56,

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

                          'name' => $name,

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

                          'uitype' => 56,

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

                          'blockLabel' => 'BL_BASIC_DATA',

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

                      $params = [

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

                          'uitype' => 16,

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

                          'typeofdata' => 'I~M',

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

                      ];

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

                      $params['picklistValues'] = [

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

                          'name' => $name,

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

          /** {@inheritdoc} */

      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

           * Function to get the url for edit view of the module.

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

          {

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

           * Function to get the url for default view of the module.

      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 (!isset($this->listFieldModels)) {

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

                          $fieldObject->set('sort', true);

      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

           * Get structure fields.

      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

                  $structure[$block][$fieldName] = $fieldModel;

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

                  'BL_ASSIGN_USERS' => ['icon' => 'yfi yfi-users-2'],

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

                          'purifyType' => \App\Purifier::TEXT,

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

                      break;

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

                          'label' => 'FL_HANDLER',

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

                          'table' => $this->getBaseTable()

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

                      break;

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

                  case 'state':

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

                          'table' => $this->getBaseTable(),

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

                          \App\AutoAssign::METHOD_LOAD_BALANCE => \App\Language::translate('PLL_LOAD_BALANCED', $this->getName(true)),

      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 (\in_array($fieldName, ['tabid', 'state', 'subject'])) {

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

                  $fieldObjects = [];

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

          /**

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

              $blocks = [

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

                  'BL_USER_SELECTION_CONDITIONS' => ['icon' => 'mdi mdi-account-filter-outline'],

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

           *

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

                          'label' => 'FL_MANUAL',

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

           *

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

          public function getBlockIcon($name): string

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

              switch ($name) {

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

                  case 'subject':

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

                          'maximumlength' => '128',

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

                          'name' => $name,

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

                          'picklistValues' => []

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

                          'maximumlength' => '100',

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

                          'defaultvalue' => 1,

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

                          'blockLabel' => 'BL_BASIC_DATA',

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

                          'purifyType' => \App\Purifier::INTEGER,

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

                          'blockLabel' => 'BL_USER_SELECTION_CONDITIONS',

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

                          'purifyType' => \App\Purifier::TEXT,

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

                  case 'record_limit':

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

          /** @var array Members table */

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

          public function getEditViewUrl()

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

           * @return string URL

      Line exceeds 120 characters; contains 161 characters
      Open

              'tabid', 'subject', 'state', 'workflow', 'handler', 'gui', 'conditions', 'members', 'method', 'default_assign', 'record_limit', 'record_limit_conditions'

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

           * @param Settings_AutomaticAssignment_Record_Model|null $recordModel

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

           *

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

              $structure = [];

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

                  $fieldModel = $this->getFieldInstanceByName($fieldName);

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

                      $fieldModel->set('fieldvalue', $recordModel->get($fieldName));

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

                          'name' => $name,

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

                          'label' => 'FL_WORKFLOW',

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

                          'blockLabel' => 'BL_BASIC_DATA',

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

                          'typeofdata' => 'C~O',

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

                          'name' => $name,

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

                          $params['picklistValues'][$module['tabid']] = \App\Language::translate($module['name'], $module['name']);

      Line exceeds 120 characters; contains 128 characters
      Open

                          \App\AutoAssign::METHOD_LOAD_BALANCE => \App\Language::translate('PLL_LOAD_BALANCED', $this->getName(true)),

      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

           * @return Vtiger_Field_Model

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

                          'typeofdata' => 'V~M',

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

                      ];

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

                  case 'workflow':

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

                          'table' => $this->getBaseTable()

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

                          'label' => 'FL_MODULE_NAME',

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

                      foreach (\vtlib\Functions::getAllModules(true, false, 0) as $module) {

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

                          1 => \App\Language::translate('PLL_ACTIVE', $this->getName(true))

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

                      break;

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

          }

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

                      $params = [

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

                          'typeofdata' => 'I~M',

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

                          'maximumlength' => '100',

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

                          'table' => $this->getBaseTable(),

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

              return $structure;

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

           */

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

                          'name' => $name,

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

                      $params = [

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

                          'typeofdata' => 'C~O',

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

                      $params = [

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

                          'maximumlength' => '9999',

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

                      }

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

                  case 'method':

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

                          'label' => 'FL_METHOD',

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

                  $block = $fieldModel->get('blockLabel') ?: '';

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

              return $blocks[$name]['icon'] ?? '';

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

                          'typeofdata' => 'C~O',

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

                          'purifyType' => \App\Purifier::BOOL,

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

                          'tooltip' => 'LBL_HANDLER_DESC',

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

                          }

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

                          'name' => $name,

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

                  'BL_CONDITIONS' => ['icon' => 'fas fa-filter fa-sm'],

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

          public function getFieldInstanceByName($name)

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

                      $params = [

      Line exceeds 120 characters; contains 129 characters
      Open

                          if (\in_array($module['name'], ['SMSNotifier', 'OSSMailView', 'Dashboard', 'ModComments', 'Notification'])) {

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

                      $defaultValue = $fieldModel->get('defaultvalue');

      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

                  case 'handler':

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

                          'blockLabel' => 'BL_BASIC_DATA',

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

                          'purifyType' => \App\Purifier::BOOL,

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

                      ];

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

                      break;

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

                          'purifyType' => \App\Purifier::INTEGER,

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

                      break;

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

          {

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

                      break;

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

                          'label' => 'FL_STATE',

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

                      ];

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

                      $params['picklistValues'] = [

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

                          'name' => $name,

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

                      $fieldModel->set('fieldvalue', $defaultValue ?? '');

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

           * Get block icon.

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

          /**

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

                          'table' => $this->getBaseTable()

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

                  case 'tabid':

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

                          if (\in_array($module['name'], ['SMSNotifier', 'OSSMailView', 'Dashboard', 'ModComments', 'Notification'])) {

      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

                          \App\AutoAssign::METHOD_ROUND_ROBIN => \App\Language::translate('PLL_ROUND_ROBIN', $this->getName(true))

      Line exceeds 120 characters; contains 124 characters
      Open

                          \App\AutoAssign::METHOD_ROUND_ROBIN => \App\Language::translate('PLL_ROUND_ROBIN', $this->getName(true))

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

           * @param string $name

      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

          {

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

                      $params = [

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

                          'blockLabel' => 'BL_BASIC_DATA',

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

                  case 'gui':

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

                          'uitype' => 56,

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

                          'purifyType' => \App\Purifier::BOOL,

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

                          'typeofdata' => 'I~M',

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

           */

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

                          'blockLabel' => 'BL_BASIC_DATA',

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

           * Get fields instance by name.

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

                          'table' => $this->getBaseTable(),

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

                          'label' => 'FL_SUBJECT',

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

                      ];

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

                          'uitype' => 1,

      Line exceeds 120 characters; contains 125 characters
      Open

                          $params['picklistValues'][$module['tabid']] = \App\Language::translate($module['name'], $module['name']);

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

                          'table' => $this->getBaseTable()

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

                      break;

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

                          'maximumlength' => '128',

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

                      ];

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

                          'label' => 'FL_RECORD_LIMIT',

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

                          'uitype' => 16,

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

                          'uitype' => 7,

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

                          'uitype' => 16,

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

                      $params = [

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

                          'defaultvalue' => 0,

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

                          'table' => $this->getBaseTable(),

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

                      $params = [

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

                          'tooltip' => 'LBL_DEFAULT_ASSIGN_DEC',

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

                          'blockLabel' => 'BL_USER_SELECTION_CONDITIONS',

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

                          'purifyType' => \App\Purifier::TEXT,

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

                  case 'members':

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

                          'uitype' => 33,

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

                          'purifyType' => \App\Purifier::TEXT

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

                  case 'default_assign':

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

                          'typeofdata' => 'I~O',

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

                          'table' => $this->getBaseTable(),

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

          {

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

                          'maximumlength' => '65535',

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

                      ];

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

                      break;

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

                          'name' => $name,

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

                      $params = [

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

                          'maximumlength' => '65535',

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

                      $params = [

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

                          'table' => $this->getBaseTable(),

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

                          'uitype' => 53,

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

                          'purifyType' => \App\Purifier::INTEGER,

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

                      break;

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

                  case 'conditions':

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

                          'uitype' => 21,

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

                          'label' => 'FL_MEMBERS',

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

          /** {@inheritDoc} */

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

                      ];

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

                          'blockLabel' => 'BL_ASSIGN_USERS',

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

                          'tooltip' => 'LBL_RECORD_LIMIT_DESC',

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

                          'typeofdata' => 'I~M',

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

                          'typeofdata' => 'V~O',

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

                          'maximumlength' => '99999',

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

                          'purifyType' => \App\Purifier::TEXT,

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

                          'name' => $name,

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

                          'name' => $name,

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

                      break;

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

                          'table' => $this->getBaseTable(),

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

                      break;

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

                  case 'record_limit_conditions':

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

                          'uitype' => 21,

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

          }

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

                          'typeofdata' => 'V~M',

      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

                          'blockLabel' => 'BL_ASSIGN_USERS',

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

                          'picklistValues' => []

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

                  default:

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

                      break;

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

          }

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

                          'label' => 'FL_CRITERIA_FOR_COUNTING_RECORDS',

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

                          'defaultvalue' => 0,

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

                          'label' => 'FL_RECORD_CONDITIONS',

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

                          'hideLabel' => true,

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

                          'blockLabel' => 'BL_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

                          'name' => $name,

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

                      break;

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

              return \Vtiger_Field_Model::init($this->getName(true), $params, $name);

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

                          'typeofdata' => 'V~O',

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

                      $params['picklistValues'] = [];

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

                      $params = [

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

                          'label' => 'FL_DEFAULT_ASSIGN',

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

          public function hasCreatePermissions()

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

              return \App\YetiForce\Shop::check('YetiForceAutoAssignment');

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

                          'maximumlength' => '65535',

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

                          'blockLabel' => 'BL_USER_SELECTION_CONDITIONS',

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

                          'maximumlength' => '-2147483648,2147483647',

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

                          'purifyType' => \App\Purifier::INTEGER,

      Class name "Settings_AutomaticAssignment_Module_Model" is not in camel caps format
      Open

      class Settings_AutomaticAssignment_Module_Model extends Settings_Vtiger_Module_Model

      There are no issues that match your filters.

      Category
      Status