YetiForceCompany/YetiForceCRM

View on GitHub
modules/Documents/models/ListView.php

Summary

Maintainability
C
7 hrs
Test Coverage
A
90%

Method getListViewMassActions has 86 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getListViewMassActions($linkParams)
    {
        $moduleModel = $this->getModule();
        $moduleName = $moduleModel->getName();

Severity: Major
Found in modules/Documents/models/ListView.php - About 3 hrs to fix

    Method getAdvancedLinks has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function getAdvancedLinks()
        {
            $moduleModel = $this->getModule();
            $moduleName = $moduleModel->getName();
            $advancedLinks = [];
    Severity: Minor
    Found in modules/Documents/models/ListView.php - About 1 hr to fix

      Function getListViewMassActions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getListViewMassActions($linkParams)
          {
              $moduleModel = $this->getModule();
              $moduleName = $moduleModel->getName();
      
      
      Severity: Minor
      Found in modules/Documents/models/ListView.php - About 55 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 getAdvancedLinks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getAdvancedLinks()
          {
              $moduleModel = $this->getModule();
              $moduleName = $moduleModel->getName();
              $advancedLinks = [];
      Severity: Minor
      Found in modules/Documents/models/ListView.php - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      The method getListViewMassActions() has an NPath complexity of 512. The configured NPath complexity threshold is 200.
      Open

          public function getListViewMassActions($linkParams)
          {
              $moduleModel = $this->getModule();
              $moduleName = $moduleModel->getName();
      
      
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phpmd

      NPathComplexity

      Since: 0.1

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

      Example

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

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

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

          public function getListViewMassActions($linkParams)
          {
              $moduleModel = $this->getModule();
              $moduleName = $moduleModel->getName();
      
      
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phpmd

      CyclomaticComplexity

      Since: 0.1

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

      Example

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

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

      Avoid using static access to class 'Vtiger_Link_Model' in method 'getListViewMassActions'.
      Open

                  $links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'PDF', $moduleName);
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                          'linklabel' => \App\Language::translate('LBL_EXPORT_PDF'),
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Avoid using static access to class 'Vtiger_Link_Model' in method 'getListViewMassActions'.
      Open

              $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                          'title' => \App\Language::translate('LBL_EXPORT_PDF'),
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

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

                  $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'MappedFields', $moduleName);
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phpmd

      StaticAccess

      Since: 1.4.0

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

      Example

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

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

      Define a constant instead of duplicating this literal "linklabel" 12 times.
      Open

                      'linklabel' => 'LBL_EXPORT',
      Severity: Critical
      Found in modules/Documents/models/ListView.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "js-mass-record-event" 4 times.
      Open

                      'linkclass' => 'js-mass-record-event',
      Severity: Critical
      Found in modules/Documents/models/ListView.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "linkclass" 6 times.
      Open

                          'linkclass' => 'js-mass-action',
      Severity: Critical
      Found in modules/Documents/models/ListView.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "linkurl" 10 times.
      Open

                      'linkurl' => "javascript:Vtiger_List_Js.triggerExportAction('$exportUrl')",
      Severity: Critical
      Found in modules/Documents/models/ListView.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "linkicon" 11 times.
      Open

                      'linkicon' => 'fas fa-upload',
      Severity: Critical
      Found in modules/Documents/models/ListView.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "LISTVIEWMASSACTION" 11 times.
      Open

                      'linktype' => 'LISTVIEWMASSACTION',
      Severity: Critical
      Found in modules/Documents/models/ListView.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "linktype" 12 times.
      Open

                      'linktype' => 'LISTVIEW',
      Severity: Critical
      Found in modules/Documents/models/ListView.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "javascript:" 4 times.
      Open

                      'linkurl' => 'javascript:',
      Severity: Critical
      Found in modules/Documents/models/ListView.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Define a constant instead of duplicating this literal "dataUrl" 4 times.
      Open

                      'dataUrl' => "index.php?module=$moduleName&action=MassState&state=Active&sourceView=List",
      Severity: Critical
      Found in modules/Documents/models/ListView.php by sonar-php

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

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

      Noncompliant Code Example

      With the default threshold of 3:

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

      Compliant Solution

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

      Exceptions

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

      Argument 3 (moduleName) is false but \Vtiger_Loader::getComponentClassName() takes string defined at /code/include/Loader.php:149
      Open

                  $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'MappedFields', $moduleName);
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

      Argument 3 (moduleName) is false but \Vtiger_Loader::getComponentClassName() takes string defined at /code/include/Loader.php:149
      Open

                  $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'PDF', $moduleName);
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                      'linkurl' => "javascript:Vtiger_List_Js.triggerQuickExport('$moduleName')",
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

      Saw unextractable annotation for comment '* @param <array> $linkParams'</array>
      Open

           * @param <Array> $linkParams

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                          'linkdata' => ['url' => 'index.php?module=' . $moduleName . '&view=PDF&fromview=List', 'type' => 'modal'],
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                      'linkurl' => "javascript:Vtiger_List_Js.triggerTransferOwnership('index.php?module={$moduleName}&view=TransferOwnership')",
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

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

                  $queryGenerator->addCondition($this->get('folder_id'), $folderValue, 'e');
      Severity: Critical
      Found in modules/Documents/models/ListView.php by phan

      Saw unextractable annotation for comment '* @return <array> - Associative array of Link type to List of Vtiger_Link_Model instances for Mass Actions'</array>
      Open

           * @return <Array> - Associative array of Link type to List of  Vtiger_Link_Model instances for Mass Actions

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                      'linkurl' => "javascript:Vtiger_List_Js.triggerMassEdit('index.php?module=$moduleName&view=MassActionAjax&mode=showMassEditForm&sourceView=List');",
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                          'url' => 'index.php?module=' . $moduleName . '&view=MassAddDocuments&sourceView=List',
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

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

              $queryGenerator->setField('filetype');
      Severity: Critical
      Found in modules/Documents/models/ListView.php by phan

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                      'dataUrl' => "index.php?module=$moduleName'&action=MassState&state=Archived&sourceView=List",
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                      'dataUrl' => "index.php?module=$moduleName&action=MassDelete&sourceView=List",
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                      'dataUrl' => "index.php?module=$moduleName&action=MassState&state=Active&sourceView=List",
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                      'linkurl' => "javascript:Documents_List_Js.massMove('index.php?module=$moduleName&view=MoveDocuments&sourceView=List');",
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

      Suspicious type false of a variable or expression used to build a string. (Expected type to be able to cast to a string)
      Open

                      'dataUrl' => "index.php?module=$moduleName&action=MassState&state=Trash&sourceView=List",
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phan

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

      class Documents_ListView_Model extends Vtiger_ListView_Model

      The class Documents_ListView_Model is not named in CamelCase.
      Open

      class Documents_ListView_Model extends Vtiger_ListView_Model
      {
          public function getAdvancedLinks()
          {
              $moduleModel = $this->getModule();
      Severity: Minor
      Found in modules/Documents/models/ListView.php by phpmd

      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

              }

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

                  $templates = $pdfModel->getActiveTemplatesForModule($moduleName, 'List');

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

              $moduleName = $moduleModel->getName();

      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

                  ];

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

                      'linklabel' => 'LBL_EXPORT',

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

          public function getAdvancedLinks()

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

                  $pdfModel = new $handlerClass();

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

              $moduleModel = $this->getModule();

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

              $advancedLinks = [];

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

                      'linkurl' => "javascript:Vtiger_List_Js.triggerExportAction('$exportUrl')",

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

                  $advancedLinks[] = [

      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

                      'linktype' => 'LISTVIEW',

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

              if ($moduleModel->isPermitted('ExportPdf')) {

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

              if ($moduleModel->isPermitted('Export')) {

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

          {

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

                  $exportUrl = $this->getModule()->getExportUrl();

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

                  $mfModel = new $handlerClass();

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

                      'linkicon' => 'yfi-document-templates',

      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' => 'javascript:',

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

                      'dataUrl' => "index.php?module=$moduleName&action=MassState&state=Trash&sourceView=List",

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

              }

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

              if (!empty($folderValue)) {

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

              }

      Line exceeds 120 characters; contains 126 characters
      Open

                          'linkdata' => ['url' => 'index.php?module=' . $moduleName . '&view=PDF&fromview=List', 'type' => 'modal'],

      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 <Array> $linkParams

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

              $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), $linkTypes, $linkParams);

      Line exceeds 120 characters; contains 164 characters
      Open

                      'linkurl' => "javascript:Vtiger_List_Js.triggerMassEdit('index.php?module=$moduleName&view=MassActionAjax&mode=showMassEditForm&sourceView=List');",

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

                      'linkclass' => 'js-show-modal',

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

              if ($moduleModel->isPermitted('MassActive')) {

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

                      'linklabel' => 'LBL_MASS_ACTIVATE',

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

              foreach ($massActionLinks as $massActionLink) {

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

                  $queryGenerator->addCondition($this->get('folder_id'), $folderValue, 'e');

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

                          'title' => \App\Language::translate('LBL_EXPORT_PDF'),

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

           * @return <Array> - Associative array of Link type to List of  Vtiger_Link_Model instances for Mass Actions

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

              //Opensource fix to make documents module mass editable

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

      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

                      'linklabel' => 'LBL_TRANSFER_OWNERSHIP',

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

                      'linkclass' => 'js-mass-record-event',

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

                      'linklabel' => 'LBL_MASS_ARCHIVE',

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

          public function loadListViewCondition()

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

                      'linkclass' => 'js-mass-record-event',

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

              $queryGenerator = $this->getQueryGenerator();

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

          {

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

              $queryGenerator->setField('filetype');

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

                          'linkicon' => 'fas fa-file-pdf',

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

           */

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

                      'linkurl' => "javascript:Vtiger_List_Js.triggerMassEdit('index.php?module=$moduleName&view=MassActionAjax&mode=showMassEditForm&sourceView=List');",

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

              if ($moduleModel->isPermitted('MassArchived')) {

      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 = $moduleModel->getName();

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

              $massActionLinks = [];

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

              }

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

              if ($moduleModel->isPermitted('MassMoveDocuments')) {

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

                      'linklabel' => 'LBL_MASS_ADD',

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

                          'cb' => 'Documents_MassAddDocuments_Js.register',

      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-file-export',

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

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

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

                  if (\count($templates) > 0) {

      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-edit',

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

              }

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

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

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

                          'linkdata' => ['url' => 'index.php?module=' . $moduleName . '&view=PDF&fromview=List', 'type' => 'modal'],

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

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

           * Function to get the list of Mass actions for the module.

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

                  $massActionLinks[] = [

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

                      'linklabel' => 'LBL_MOVE',

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

              if ($moduleModel->isPermitted('MassTransferOwnership')) {

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

              }

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

                      'dataUrl' => "index.php?module=$moduleName&action=MassState&state=Active&sourceView=List",

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

              if ($moduleModel->isPermitted('MassTrash')) {

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

                  $massActionLinks[] = [

      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' => 'js-mass-action',

      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

                      'linkurl' => "javascript:Vtiger_List_Js.triggerTransferOwnership('index.php?module={$moduleName}&view=TransferOwnership')",

      Line exceeds 120 characters; contains 139 characters
      Open

                      'linkurl' => "javascript:Vtiger_List_Js.triggerTransferOwnership('index.php?module={$moduleName}&view=TransferOwnership')",

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

                  ];

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

                  $massActionLinks[] = [

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

                      'linkclass' => 'js-mass-record-event',

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

                  ];

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

          }

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

              if ($moduleModel->isPermitted('QuickExportToExcel')) {

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

                          'linklabel' => 'LBL_GENERATE_RECORDS',

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

              $linkTypes = ['LISTVIEWMASSACTION'];

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

                  $massActionLinks[] = [

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

                      'linktype' => 'LISTVIEWMASSACTION',

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

                  $massActionLinks[] = [

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

                      'linktype' => 'LISTVIEWMASSACTION',

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

                      'linklabel' => 'LBL_MASS_DELETE',

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

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

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

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

                      'linktype' => 'LISTVIEWMASSACTION',

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

                      $advancedLinks[] = [

      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

                      'linktype' => 'LISTVIEWMASSACTION',

      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' => "javascript:Documents_List_Js.massMove('index.php?module=$moduleName&view=MoveDocuments&sourceView=List');",

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

                      'linkicon' => 'fas fa-folder-open',

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

                      'linktype' => 'LISTVIEWMASSACTION',

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

              if ($moduleModel->isPermitted('CreateView')) {

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

                      ],

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

                  $massActionLinks[] = [

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

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

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

                      'dataUrl' => "index.php?module=$moduleName'&action=MassState&state=Archived&sourceView=List",

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

                      'dataUrl' => "index.php?module=$moduleName&action=MassDelete&sourceView=List",

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

                  if (\count($templates) > 0) {

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

                  $advancedLinks[] = [

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

                  $templates = $mfModel->getActiveTemplatesForModule($moduleName, 'List');

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

                          'linkurl' => 'javascript:Vtiger_List_Js.triggerGenerateRecords();',

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

              }

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

                          'view' => 'List',

      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_MASS_MOVE_TO_TRASH',

      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

                      'linklabel' => 'LBL_EDIT',

      Line exceeds 120 characters; contains 137 characters
      Open

                      'linkurl' => "javascript:Documents_List_Js.massMove('index.php?module=$moduleName&view=MoveDocuments&sourceView=List');",

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

                          'url' => 'index.php?module=' . $moduleName . '&view=MassAddDocuments&sourceView=List',

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

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

                      'linkurl' => 'javascript:',

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

                  $links['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);

      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_QUICK_EXPORT',

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

              if ($moduleModel->isPermitted('RecordMappingList')) {

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

              return $advancedLinks;

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

                      'linkicon' => 'yfi yfi-change-of-owner',

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

                      'linktype' => 'LISTVIEWMASSACTION',

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

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

              $folderValue = $this->get('folder_value');

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

                          'linklabel' => \App\Language::translate('LBL_EXPORT_PDF'),

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

              $moduleModel = $this->getModule();

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

                  $massActionLinks[] = [

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

                      'linkdata' => [

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

                      'linkurl' => 'javascript:',

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

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

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

              parent::loadListViewCondition();

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

                      $advancedLinks[] = [

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

                      'linkurl' => "javascript:Vtiger_List_Js.triggerQuickExport('$moduleName')",

      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 getListViewMassActions($linkParams)

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

              if ($moduleModel->isPermitted('MassEdit')) {

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

                      'linkclass' => 'js-mass-record-event',

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

                  $massActionLinks[] = [

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

                      'linkurl' => 'javascript:',

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

              if ($moduleModel->isPermitted('MassDelete')) {

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

      class Documents_ListView_Model extends Vtiger_ListView_Model

      There are no issues that match your filters.

      Category
      Status