YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/PDF/models/Record.php

Summary

Maintainability
C
1 day
Test Coverage
F
26%

Method save has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function save(Vtiger_PDF_Model $pdfModel, $step = 1)
    {
        $db = \App\Db::getInstance('admin');

        switch ($step) {
Severity: Major
Found in modules/Settings/PDF/models/Record.php - About 2 hrs to fix

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

        public static function save(Vtiger_PDF_Model $pdfModel, $step = 1)
        {
            $db = \App\Db::getInstance('admin');
    
            switch ($step) {
    Severity: Minor
    Found in modules/Settings/PDF/models/Record.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function transformAdvanceFilterToWorkFlowFilter has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function transformAdvanceFilterToWorkFlowFilter(Vtiger_PDF_Model &$pdfModel)
        {
            $conditions = $pdfModel->get('conditions');
            $wfCondition = [];
            if (!empty($conditions)) {
    Severity: Minor
    Found in modules/Settings/PDF/models/Record.php - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

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

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

          public static function save(Vtiger_PDF_Model $pdfModel, $step = 1)
          {
              $db = \App\Db::getInstance('admin');
      
              switch ($step) {

      CyclomaticComplexity

      Since: 0.1

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

      Example

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

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

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

          public static function save(Vtiger_PDF_Model $pdfModel, $step = 1)

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

      See

      Avoid using static access to class 'Settings_PDF_Module_Model' in method 'save'.
      Open

                      $stepFields = Settings_PDF_Module_Model::getFieldsByStep($step);

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

                          } else {
                              $params = $pdfModel->get($field);
                          }

      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 'Settings_PDF_Module_Model' in method 'save'.
      Open

                      $stepFields = Settings_PDF_Module_Model::getFieldsByStep($step);

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

                      } else {
                          foreach ($stepFields as $field) {
                              $fields[$field] = $pdfModel->get($field);
                          }
                          $db->createCommand()->update('a_#__pdf', $fields, ['pdfid' => $pdfModel->getId()])

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

                          \App\Cache::delete(\get_class($pdfModel), $pdfModel->getId());

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

                      $value = \App\Pdf\Pdf::getDriverLabel($value);

      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('admin');

      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\Cache' in method 'delete'.
      Open

              \App\Cache::delete(\get_class($pdfModel), $pdfModel->getId());

      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\Cache' in method 'save'.
      Open

                          \App\Cache::delete(\get_class($pdfModel), $pdfModel->getId());

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

      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_PDF_Module_Model' in method 'getCleanInstance'.
      Open

              $fields = Settings_PDF_Module_Model::getFieldsByStep();

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

                          } else {
                              $params[$field] = $pdfModel->get($field);
                          }

      ElseExpression

      Since: 1.4.0

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

      Example

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

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

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

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

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

              $this->module = Vtiger_Module_Model::getInstance($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 'Vtiger_Loader' in method 'getCleanInstance'.
      Open

              $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'PDF', $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 'Settings_PDF_Module_Model' in method 'save'.
      Open

                      $fields['type'] = Settings_PDF_Module_Model::getTemplateType($pdfModel);

      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

      Define a constant instead of duplicating this literal "groupid" 3 times.
      Open

                              'joincondition' => '', 'groupid' => '0', ];

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

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

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

                          $wfCondition[] = ['fieldname' => '', 'operation' => '', 'value' => '', 'valuetype' => '',

      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' => 'LBL_EDIT_RECORD',

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

                          $wfCondition[] = ['fieldname' => '', 'operation' => '', 'value' => '', 'valuetype' => '',

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

                          if ('conditions' === $field) {

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

                          ->update('a_#__pdf', $fields, ['pdfid' => $pdfModel->getId()])

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

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

              return $this->get('pdfid');

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

                      'linkurl' => $this->getEditViewUrl(),

      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.

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

                      $db->createCommand()
      Severity: Critical
      Found in modules/Settings/PDF/models/Record.php by phan

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

                      $db->createCommand()->insert('a_#__pdf', $params)->execute();
      Severity: Critical
      Found in modules/Settings/PDF/models/Record.php by phan

      Reference to undeclared property \Settings_PDF_Record_Model->module
      Open

              $this->module = Vtiger_Module_Model::getInstance($moduleName);
      Severity: Minor
      Found in modules/Settings/PDF/models/Record.php by phan

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

              return App\Db::getInstance('admin')->createCommand()
      Severity: Critical
      Found in modules/Settings/PDF/models/Record.php by phan

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

                          $db->createCommand()->insert('a_#__pdf', $fields)->execute();
      Severity: Critical
      Found in modules/Settings/PDF/models/Record.php by phan

      Saw unextractable annotation for comment '* @return <number> - Record Id'</number>
      Open

           * @return <Number> - Record Id

      Reference to undeclared property \Settings_PDF_Record_Model->module
      Open

              return $this->module;
      Severity: Minor
      Found in modules/Settings/PDF/models/Record.php by phan

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

                          $db->createCommand()->update('a_#__pdf', $fields, ['pdfid' => $pdfModel->getId()])
      Severity: Critical
      Found in modules/Settings/PDF/models/Record.php by phan

      @throws type of deleteWatermark has undeclared type \yii\db\Exception (Did you mean class \Exception)
      Open

          public static function deleteWatermark(Vtiger_PDF_Model $pdfModel)
      Severity: Minor
      Found in modules/Settings/PDF/models/Record.php by phan

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

              $db->createCommand()
      Severity: Critical
      Found in modules/Settings/PDF/models/Record.php by phan

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

              if (!empty($conditions)) {
                  foreach ($conditions as $index => $condition) {
                      $columns = $condition['columns'];
                      if ('1' == $index && empty($columns)) {
                          $wfCondition[] = ['fieldname' => '', 'operation' => '', 'value' => '', 'valuetype' => '',
      Severity: Major
      Found in modules/Settings/PDF/models/Record.php and 1 other location - About 4 hrs to fix
      modules/Settings/Workflows/models/Record.php on lines 412..427

      Duplicated Code

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

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

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

      Tuning

      This issue has a mass of 178.

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

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

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

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

      Refactorings

      Further Reading

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

      class Settings_PDF_Record_Model extends Settings_Vtiger_Record_Model

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

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

      ShortVariable

      Since: 0.2

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

      Example

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

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

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

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

      ShortVariable

      Since: 0.2

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

      Example

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

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

      The class Settings_PDF_Record_Model is not named in CamelCase.
      Open

      class Settings_PDF_Record_Model extends Settings_Vtiger_Record_Model
      {
          protected $recordCache = [];
          protected $fieldsCache = [];
          protected $moduleRecordId;

      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

              return $this->get('pdfid');

      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

          {

      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 id of the record.

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

           * @return <Number> - Record 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

                      '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

              $recordLinks = [

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

          protected $recordCache = [];

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

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

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

              return $this->module;

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

          public function setModule($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

                          $pdfModel->set('pdfid', $db->getLastInsertID('a_#__pdf_pdfid_seq'));

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

                              ->execute();

      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

                  ],

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

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

              return $this;

      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

           */

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

          public function getId()

      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

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

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

                          }

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

                              $fields[$field] = $pdfModel->get($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

                      $params = [];

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

              $db->createCommand()

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

                  ->execute();

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

                      if ('1' == $index && empty($columns)) {

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

                              $wfCondition[] = ['fieldname' => $column['columnname'], 'operation' => $column['comparator'],

      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->module = Vtiger_Module_Model::getInstance($moduleName);

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

          protected $fieldsCache = [];

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

          protected $moduleRecordId;

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

           *

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

                      'linkurl' => $this->getEditViewUrl(),

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

                      'class' => 'js-edit',

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

              $pdf->setData($data);

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

                  case 'import':

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

                      return $pdfModel->get('pdfid');

      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

           * Delete watermark.

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

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

      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

          }

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

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

      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

              $data = [];

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

                  $data[$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

                      foreach ($stepFields as $field) {

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

                      return $pdfModel->get('pdfid');

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

                      $pdfModel->set('pdfid', $db->getLastInsertID('a_#__pdf_pdfid_seq'));

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

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

          public static function delete(Vtiger_PDF_Model $pdfModel)

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

                  ->delete('a_#__pdf', ['pdfid' => $pdfModel->getId()])

      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

          public function getRecordLinks(): array

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

              switch ($step) {

      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 1:

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

                      $fields = [];

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

           * @throws \yii\db\Exception

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

                          foreach ($columns as $column) {

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

              return $this->get('primary_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

                  [

      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

                              $params[$field] = json_encode($pdfModel->get($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

          {

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

          }

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

              $wfCondition = [];

      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

                  ],

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

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

                              $params[$field] = $pdfModel->get($field);

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

                      $db->createCommand()->insert('a_#__pdf', $params)->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

          /**

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

           * @param Vtiger_PDF_Model $pdfModel

      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

                          foreach ($stepFields as $field) {

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

                          $db->createCommand()->insert('a_#__pdf', $fields)->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

                      }

      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 static function transformAdvanceFilterToWorkFlowFilter(Vtiger_PDF_Model &$pdfModel)

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

                  foreach ($conditions as $index => $condition) {

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

                                  'value' => $column['value'] ?? '', 'valuetype' => $column['valuetype'], 'joincondition' => $column['column_condition'],

      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

           * @return string

      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

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

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

          }

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

                          } else {

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

                      if (!$pdfModel->getId()) {

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

                          foreach ($stepFields as $field) {

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

           * @param Vtiger_PDF_Model $pdfModel

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

              \App\Cache::delete(\get_class($pdfModel), $pdfModel->getId());

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

                          $wfCondition[] = ['fieldname' => '', 'operation' => '', 'value' => '', 'valuetype' => '',

      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

                      $value = $value ? 'LBL_YES' : 'LBL_NO';

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

                      'linkurl' => 'index.php?module=PDF&parent=Settings&action=ExportTemplate&id=' . $this->getId(),

      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' => 'LBL_DELETE_RECORD',

      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 3:

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

                              $params = json_encode($pdfModel->get($field));

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

                              $params = $pdfModel->get($field);

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

                          $fields[$field] = $params;

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

                          ->execute();

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

                      return $pdfModel->getId();

      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

              $watermarkImage = $pdfModel->get('watermark_image');

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

                  return unlink($watermarkImage);

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

              return App\Db::getInstance('admin')->createCommand()

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

                                  'groupjoin' => $condition['condition'], 'groupid' => $column['groupid'], ];

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

                      $stepFields = Settings_PDF_Module_Model::getFieldsByStep($step);

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

                          if ('conditions' === $field) {

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

                      $allFields = Settings_PDF_Module_Model::$allFields;

      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

                  ->update('a_#__pdf', ['watermark_image' => ''], ['pdfid' => $pdfModel->getId()])

      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

              $conditions = $pdfModel->get('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

              $value = $this->get($key);

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

          public static function getCleanInstance($moduleName = 'Vtiger')

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

              $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'PDF', $moduleName);

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

              $fields = Settings_PDF_Module_Model::getFieldsByStep();

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

                  case 2:

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

                      foreach ($allFields as $field) {

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

              if (!empty($conditions)) {

      Line exceeds 120 characters; contains 147 characters
      Open

                                  'value' => $column['value'] ?? '', 'valuetype' => $column['valuetype'], 'joincondition' => $column['column_condition'],

      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

                      $value = \App\Purifier::encodeHtml($value);

      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

              return $pdf;

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

                          \App\Cache::delete(\get_class($pdfModel), $pdfModel->getId());

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

                          if ('conditions' === $field) {

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

          public static function deleteWatermark(Vtiger_PDF_Model $pdfModel)

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

              if (file_exists($watermarkImage)) {

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

                              'joincondition' => '', 'groupid' => '0', ];

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

                  case '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

                  case 'generator':

      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

                      'linklabel' => 'LBL_EXPORT_RECORD',

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

                      'linkurl' => '#',

      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 save(Vtiger_PDF_Model $pdfModel, $step = 1)

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

                              $fields[$field] = $pdfModel->get($field);

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

                      } else {

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

          {

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

           * Function transforms Advance filter to workflow conditions.

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

              $pdfModel->set('conditions', $wfCondition);

      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

              foreach ($fields as $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

                      $fields['type'] = Settings_PDF_Module_Model::getTemplateType($pdfModel);

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

                          \App\Cache::delete(\get_class($pdfModel), $pdfModel->getId());

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

                          }

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

                          } else {

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

           *

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

                      $columns = $condition['columns'];

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

                      if (!empty($columns) && \is_array($columns)) {

      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

                      $value = $value ? 'FL_ACTIVE' : 'FL_INACTIVE';

      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

              $pdf = new $handlerClass();

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

                      $fields = [];

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

                      $db->createCommand()

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

                          ->update('a_#__pdf', $fields, ['pdfid' => $pdfModel->getId()])

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

                      $stepFields = Settings_PDF_Module_Model::getFieldsByStep($step);

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

                          $db->createCommand()->update('a_#__pdf', $fields, ['pdfid' => $pdfModel->getId()])

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

           *

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

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

      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

              }

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

          public function getDisplayValue(string $key)

      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\Pdf\Pdf::getDriverLabel($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

              switch ($key) {

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

      class Settings_PDF_Record_Model extends Settings_Vtiger_Record_Model

      There are no issues that match your filters.

      Category
      Status