YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/WebserviceUsers/services/ManageConsents.php

Summary

Maintainability
B
5 hrs
Test Coverage
F
18%

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

    public function getFieldInstanceByName($name)
    {
        $moduleName = $this->getModule()->getName(true);
        $fieldsLabel = $this->getEditFields();
        $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
Severity: Minor
Found in modules/Settings/WebserviceUsers/services/ManageConsents.php - About 1 hr to fix

    Method getRecordLinks has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getRecordLinks(): array
        {
            $links = [];
            $recordLinks = [
                [
    Severity: Minor
    Found in modules/Settings/WebserviceUsers/services/ManageConsents.php - About 1 hr to fix

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

          public function getFieldInstanceByName($name)
          {
              $moduleName = $this->getModule()->getName(true);
              $fieldsLabel = $this->getEditFields();
              $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];
      Severity: Minor
      Found in modules/Settings/WebserviceUsers/services/ManageConsents.php - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

      Function setDataFromRequest has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function setDataFromRequest(App\Request $request)
          {
              foreach (array_keys($this->getEditFields()) as $field) {
                  if ($request->has($field)) {
                      switch ($field) {
      Severity: Minor
      Found in modules/Settings/WebserviceUsers/services/ManageConsents.php - About 35 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

      Function getDisplayValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getDisplayValue($name)
          {
              switch ($name) {
                  case 'server_id':
                      $servers = Settings_WebserviceApps_Record_Model::getInstanceById($this->get($name));
      Severity: Minor
      Found in modules/Settings/WebserviceUsers/services/ManageConsents.php - About 35 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 class Settings_WebserviceUsers_ManageConsents_Service has a coupling between objects value of 13. Consider to reduce the number of dependencies under 13.
      Open

      class Settings_WebserviceUsers_ManageConsents_Service extends Settings_WebserviceUsers_Record_Model
      {
          /** {@inheritdoc} */
          public $baseTable = 'w_#__manage_consents_user';
      
      

      CouplingBetweenObjects

      Since: 1.1.0

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

      Example

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

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

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

          public function getTypeValues($value = false)

      BooleanArgumentFlag

      Since: 1.4.0

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

      Example

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

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

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

                              throw new \App\Exceptions\Security("ERR_ILLEGAL_FIELD_VALUE||{$field}", 406);

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

                          $params['picklistValues'][$key] = \App\Language::translate($value, $moduleName);

      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'] = [1 => \App\Language::translate('FL_ACTIVE'), 0 => \App\Language::translate('FL_INACTIVE')];

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\Purifier' in method 'getDisplayValue'.
      Open

                      $value = $servers ? \App\Purifier::encodeHtml($servers->getName()) : '<span class="redColor">ERROR</span>';

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class 'App\Db' in method 'save'.
      Open

              $db = App\Db::getInstance('webservice');

      StaticAccess

      Since: 1.4.0

      Static access causes unexchangeable dependencies to other classes and leads to hard to test code. Avoid using static access at all costs and instead inject dependencies through the constructor. The only case when static access is acceptable is when used for factory methods.

      Example

      class Foo
      {
          public function bar()
          {
              Bar::baz();
          }
      }

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

      Avoid using static access to class '\App\Purifier' in method 'getDisplayValue'.
      Open

                      $value = \App\Purifier::encodeHtml($this->get($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 'Settings_Vtiger_Field_Model' in method 'getFieldInstanceByName'.
      Open

              return Settings_Vtiger_Field_Model::init($moduleName, $params);

      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\Fields\Owner' in method 'getDisplayValue'.
      Open

                      $value = \App\Fields\Owner::getLabel($this->get($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 'Vtiger_Link_Model' in method 'getRecordLinks'.
      Open

                  $links[] = Vtiger_Link_Model::getInstanceFromValues($recordLink);

      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 'Settings_WebserviceApps_Record_Model' in method 'getDisplayValue'.
      Open

                      $servers = Settings_WebserviceApps_Record_Model::getInstanceById($this->get($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\Purifier' in method 'getRecordLinks'.
      Open

                      'linkdata' => ['copy-attribute' => 'clipboard-text', 'clipboard-text' => \App\Purifier::encodeHtml($this->get('token'))]

      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\Fields\Token' in method 'getDataForSave'.
      Open

                  $this->set('token', \App\Fields\Token::generateToken());

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

                      $value = \App\Language::translate((empty($this->get($name)) ? 'FL_INACTIVE' : 'FL_ACTIVE'));

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

                      $label = \App\Language::translate($this->getTypeValues($this->get($name)), $this->getModule()->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'] = \App\Language::getAll();

      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\TextUtils' in method 'getDisplayValue'.
      Open

                      $value = \App\TextUtils::textTruncate($label);

      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'] = [1 => \App\Language::translate('FL_ACTIVE'), 0 => \App\Language::translate('FL_INACTIVE')];

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

                      $servers = Settings_WebserviceApps_Module_Model::getActiveServers($this->getModule()->typeApi);

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

                      $value = $this->get($name) ? \App\Language::getLanguageLabel($this->get($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 "status" 6 times.
      Open

              'status' => 'FL_STATUS',

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

              'user_id' => 'FL_USER'

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

                      'linklabel' => 'FL_TOKEN',

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

                      $params['picklistValues'] = [1 => \App\Language::translate('FL_ACTIVE'), 0 => \App\Language::translate('FL_INACTIVE')];

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

                      'linkclass' => 'btn btn-sm btn-primary clipboard',

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

                  case 'token':

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

                      'linkicon' => 'fas fa-copy',

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

                      'linktype' => 'LISTVIEWRECORD',

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

              'language' => 'FL_LANGUAGE',

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

              'server_id' => 'FL_SERVER',

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

              $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

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

                      'linktype' => 'LISTVIEWRECORD',

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

              $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

      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.

      Parameter $value has undeclared type \type
      Open

          public function getTypeValues($value = false)

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

                  $success = $db->createCommand()->insert($table, $data)->execute();

      Declaration of function getDisplayValue($name) should be compatible with function getDisplayValue(string $key) (parameter #1 with no type cannot replace original parameter with type 'string') defined in /code/modules/Settings/Vtiger/models/Record.php:52
      Open

           * @param string $name

      Call to method getLabel from undeclared class \App\Fields\Owner
      Open

                      $value = \App\Fields\Owner::getLabel($this->get($name));

      Call to method getInstance from undeclared class \App\Fields\Owner
      Open

                      $params['picklistValues'] = \App\Fields\Owner::getInstance($moduleName)->getAccessibleUsers('', 'owner');

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

                  $success = $db->createCommand()->update($table, $data, [$index => $this->getId()])->execute();

      Default value for \type $value can't be false
      Open

          public function getTypeValues($value = false)

      Returning type \Vtiger_Field_Model but getFieldInstanceByName() is declared to return string[]
      Open

              return Settings_Vtiger_Field_Model::init($moduleName, $params);

      When fetching an array index from a value of type array{1:'PLL_USER_PERMISSIONS'}, found an array index of type \type, but expected the index to be of type int
      Open

                  return $data[$value] ?: '';

      Remove the code after this "throw".
      Open

                              throw new \App\Exceptions\Security("ERR_ILLEGAL_FIELD_VALUE||{$field}", 406);

      Jump statements (return, break, continue, and goto) and throw expressions move control flow out of the current code block. Typically, any statements in a block that come after a jump or throw are simply wasted keystrokes lying in wait to confuse the unwary.

      Rarely, as illustrated below, code after a jump or throw is reachable. However, such code is difficult to understand, and should be refactored.

      Noncompliant Code Example

      function fun($a) {
        $i = 10;
        return $i + $a;
        $i++;             // this is never executed
      }
      
      function foo($a) {
        if ($a == 5) {
          goto error;
        } else {
          // do the job
        }
        return;
      
        error:
          printf("don't use 5"); // this is reachable but unreadable
      
      }
      

      Compliant Solution

      function fun($a) {
        $i = 10;
        return $i + $a;
      }
      
      function foo($a) {
        if ($a == 5) {
          handleError();
        } else {
          // do the job
        }
        return;
      }
      

      See

      • MISRA C:2004, 14.1 - There shall be no unreachable code
      • MISRA C++:2008, 0-1-1 - A project shall not contain unreachable code
      • MISRA C++:2008, 0-1-9 - There shall be no dead code
      • MISRA C:2012, 2.1 - A project shall not contain unreachable code
      • MISRA C:2012, 2.2 - There shall be no dead code
      • MITRE, CWE-561 - Dead Code
      • CERT, MSC56-J. - Detect and remove superfluous code and values
      • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
      • CERT, MSC07-CPP. - Detect and remove dead code

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

      class Settings_WebserviceUsers_ManageConsents_Service extends Settings_WebserviceUsers_Record_Model
      {
          /** {@inheritdoc} */
          public $baseTable = 'w_#__manage_consents_user';
      
      

      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_WebserviceUsers_ManageConsents_Service extends Settings_WebserviceUsers_Record_Model

      The class Settings_WebserviceUsers_ManageConsents_Service is not named in CamelCase.
      Open

      class Settings_WebserviceUsers_ManageConsents_Service extends Settings_WebserviceUsers_Record_Model
      {
          /** {@inheritdoc} */
          public $baseTable = 'w_#__manage_consents_user';
      
      

      CamelCaseClassName

      Since: 0.2

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

      Example

      class class_name {
      }

      Source

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

              $db = App\Db::getInstance('webservice');

      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

      Terminating statement must be indented to the same level as the CASE body
      Open

                          break;

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

              'server_id' => 'FL_SERVER',

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

              'language' => 'FL_LANGUAGE',

      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

          public $baseTable = 'w_#__manage_consents_user';

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

              'user_id' => 'FL_USER'

      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

              'language' => 'FL_LANGUAGE'

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

           *

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

              'user_id' => 'FL_USER',

      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

          /** {@inheritdoc} */

      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

          public $listFields = [

      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

          /** {@inheritdoc} */

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

           * Function determines fields available in edition view.

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

              'status' => 'FL_STATUS',

      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 $baseIndex = 'id';

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

              'server_id' => 'FL_SERVER',

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

          ];

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

              'login_time' => 'FL_LOGIN_TIME',

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

           * @param mixed $name

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

                      $params['picklistValues'] = \App\Language::getAll();

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

                  case 'user_id':

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

              foreach (array_keys($this->getEditFields()) as $field) {

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

                  if ($request->has($field)) {

      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 getFieldsForSave()

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

          public function getDataForSave()

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

                  case 'type':

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

           *

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

                      $value = \App\Fields\Owner::getLabel($this->get($name));

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

              }

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

              $success = true;

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

                  if ($success) {

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

              }

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

                      switch ($field) {

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

              $fields = $this->getEditFields();

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

          /**

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

                      $value = (int) $value;

      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 'status':

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

                      $params['uitype'] = 16;

      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 'status':

      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

              switch ($key) {

      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

          /** {@inheritdoc} */

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

              $fieldsLabel = $this->getEditFields();

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

                      $servers = Settings_WebserviceApps_Module_Model::getActiveServers($this->getModule()->typeApi);

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

                      $params['typeofdata'] = 'V~O';

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

                      $params['uitype'] = 16;

      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 'type':

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

              return array_intersect_key($this->getData(), $this->getFieldsForSave());

      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 int|string

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

                      $value = $servers ? \App\Purifier::encodeHtml($servers->getName()) : '<span class="redColor">ERROR</span>';

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

              'type' => 'FL_TYPE',

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

          /**

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

              $moduleName = $this->getModule()->getName(true);

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

                  case 'server_id':

      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

                  }

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

                  $success = $db->createCommand()->update($table, $data, [$index => $this->getId()])->execute();

      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 'language':

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

              $fields['token'] = '';

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

                  $this->set('token', \App\Fields\Token::generateToken());

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

           * @param string $key

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

              'status' => 'FL_STATUS',

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

              'type' => 'FL_TYPE',

      Line exceeds 120 characters; contains 193 characters
      Open

              $params = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

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

                      $params['picklistValues'] = [1 => \App\Language::translate('FL_ACTIVE'), 0 => \App\Language::translate('FL_INACTIVE')];

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

                      foreach ($servers as $key => $value) {

      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

                      break;

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

              if (empty($this->getId())) {

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

              return (bool) $success;

      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 'status':

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

          public function save()

      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 $fields = array_intersect_key($fields, $this->changes);

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

              if ($this->isNew()) {

      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

                      $params['uitype'] = 32;

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

                      $params['picklistValues'] = \App\Fields\Owner::getInstance($moduleName)->getAccessibleUsers('', 'owner');

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

          public function setDataFromRequest(App\Request $request)

      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

          /** {@inheritdoc} */

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

           * @param mixed  $value

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

           */

      Line exceeds 120 characters; contains 123 characters
      Open

                      $value = $servers ? \App\Purifier::encodeHtml($servers->getName()) : '<span class="redColor">ERROR</span>';

      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

                  case 'status':

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

                      foreach ($this->getTypeValues() as $key => $value) {

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

                          $params['picklistValues'][$key] = \App\Language::translate($value, $moduleName);

      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

              $db = App\Db::getInstance('webservice');

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

          }

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

                              $value = $request->getInteger($field);

      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 $value;

      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

                      break;

      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

          }

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

                  case 'server_id':

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

                  case 'user_id':

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

              }

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

                      $value = \App\Language::translate((empty($this->get($name)) ? 'FL_INACTIVE' : 'FL_ACTIVE'));

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

                          $params['picklistValues'][$key] = $value['name'];

      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 'type':

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

                      }

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

                  case 'token':

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

              $table = $this->baseTable;

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

              $data = $this->getDataForSave();

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

                          case 'user_id':

      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 getValueToSave($key, $value)

      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

                      $servers = Settings_WebserviceApps_Record_Model::getInstanceById($this->get($name));

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

                      $value = $this->get($name) ? \App\Language::getLanguageLabel($this->get($name)) : '';

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

                  case 'type':

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

          {

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

                      'linkclass' => 'btn btn-sm btn-primary clipboard',

      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

          public function getTypeValues($value = false)

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

              $data = [

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

              if ($value) {

      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 = ['uitype' => 1, 'column' => $name, 'name' => $name, 'label' => $fieldsLabel[$name], 'displaytype' => 1, 'typeofdata' => 'V~M', 'presence' => 0, 'isEditableReadOnly' => false];

      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

                      $params['uitype'] = 16;

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

                      $params['typeofdata'] = 'P~M';

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

              $index = $this->baseIndex;

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

           */

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

                              $value = $request->getByType($field, '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

              }

      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 Display Value, for the current field type with given DB Insert Value.

      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;

      Line exceeds 120 characters; contains 121 characters
      Open

                      $params['picklistValues'] = \App\Fields\Owner::getInstance($moduleName)->getAccessibleUsers('', 'owner');

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

              return Settings_Vtiger_Field_Model::init($moduleName, $params);

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

                      $this->set('id', $db->getLastInsertID("{$table}_{$index}_seq"));

      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

          {

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

          public function getDisplayValue($name)

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

                  case 'language':

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

                      'linkdata' => ['copy-attribute' => 'clipboard-text', 'clipboard-text' => \App\Purifier::encodeHtml($this->get('token'))]

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

                      'linktype' => 'LISTVIEWRECORD',

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

                  case 'language':

      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

              } elseif ($data) {

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

                          case 'server_id':

      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

                              throw new \App\Exceptions\Security("ERR_ILLEGAL_FIELD_VALUE||{$field}", 406);

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

                      $this->set($field, $this->getValueToSave($field, $value));

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

           * Function formats data for saving.

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

          /**

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

           * @param string $name

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

                  case 'server_id':

      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 = \App\Language::translate($this->getTypeValues($this->get($name)), $this->getModule()->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

                      'linktype' => 'LISTVIEWRECORD',

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

                      'linkclass' => 'btn btn-sm btn-primary',

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

              foreach ($recordLinks as $recordLink) {

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

              return $data;

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

                      'linklabel' => 'LBL_DELETE_RECORD',

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

                  $links[] = Vtiger_Link_Model::getInstanceFromValues($recordLink);

      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 getRecordLinks(): 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

                      'linklabel' => 'FL_TOKEN',

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

                  [

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

                      'linkicon' => 'yfi yfi-full-editing-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

                  default:

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

              return $value;

      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 string|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

                  return $data[$value] ?: '';

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

                      $params['uitype'] = 16;

      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

           *

      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 string

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

                      $value = \App\Purifier::encodeHtml($this->get($name));

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

              $links = [];

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

                      'linkicon' => 'fas fa-trash-alt',

      Line exceeds 120 characters; contains 135 characters
      Open

                      $params['picklistValues'] = [1 => \App\Language::translate('FL_ACTIVE'), 0 => \App\Language::translate('FL_INACTIVE')];

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

                  $success = $db->createCommand()->insert($table, $data)->execute();

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

           * Sets data from request.

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

           * @param App\Request $request

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

          }

      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

          }

      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 'user_id':

      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

                      'linktype' => 'LISTVIEWRECORD',

      Line exceeds 120 characters; contains 136 characters
      Open

                      'linkdata' => ['copy-attribute' => 'clipboard-text', 'clipboard-text' => \App\Purifier::encodeHtml($this->get('token'))]

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

                      'linkclass' => 'btn btn-sm btn-danger',

      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

           * Type field values.

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

           */

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

                  \Api\WebservicePremium\Privilege::USER_PERMISSIONS => 'PLL_USER_PERMISSIONS',

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

                      'linkicon' => 'fas fa-copy',

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

                      'linklabel' => 'LBL_EDIT_RECORD',

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

              return $links;

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

           *

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

              $recordLinks = [

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

              ];

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

                      $value = \App\TextUtils::textTruncate($label);

      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

                      'linkurl' => 'javascript:Settings_WebserviceUsers_List_Js.deleteById(' . $this->getId() . ');',

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

           * @param type $value

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

                      'linkurl' => $this->getModule()->getEditViewUrl() . '&record=' . $this->getId(),

      Line exceeds 120 characters; contains 126 characters
      Open

                      $label = \App\Language::translate($this->getTypeValues($this->get($name)), $this->getModule()->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

          /** {@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

                      'modalView' => true,

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

      class Settings_WebserviceUsers_ManageConsents_Service extends Settings_WebserviceUsers_Record_Model

      There are no issues that match your filters.

      Category
      Status