YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
F
5 days
Test Coverage
C
76%

File ListView.php has 536 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php
/* +***********************************************************************************
 * The contents of this file are subject to the vtiger CRM Public License Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * The Original Code is:  vtiger CRM Open Source
Severity: Major
Found in modules/Vtiger/models/ListView.php - About 1 day to fix

    Function getListViewHeaders has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getListViewHeaders()
        {
            $headerFieldModels = [];
            if ($this->isEmpty('viewId')) {
                $queryGenerator = $this->getQueryGenerator();
    Severity: Minor
    Found in modules/Vtiger/models/ListView.php - About 5 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        public function getListViewMassActions($linkParams)
        {
            $currentUser = Users_Record_Model::getCurrentUserModel();
            $moduleModel = $this->getModule();
            $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
    Severity: Major
    Found in modules/Vtiger/models/ListView.php - About 4 hrs to fix

      The class Vtiger_ListView_Model has an overall complexity of 116 which is very high. The configured complexity threshold is 50.
      Open

      class Vtiger_ListView_Model extends \App\Base
      {
          /**
           * Function to get the Module Model.
           *
      Severity: Minor
      Found in modules/Vtiger/models/ListView.php by phpmd

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

          public function getAdvancedLinks()
          {
              $moduleModel = $this->getModule();
              $advancedLinks = [];
      
      
      Severity: Major
      Found in modules/Vtiger/models/ListView.php - About 2 hrs to fix

        Method getListViewHeaders has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function getListViewHeaders()
            {
                $headerFieldModels = [];
                if ($this->isEmpty('viewId')) {
                    $queryGenerator = $this->getQueryGenerator();
        Severity: Major
        Found in modules/Vtiger/models/ListView.php - About 2 hrs to fix

          Method getHederLinks has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function getHederLinks($linkParams)
              {
                  $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['LIST_VIEW_HEADER'], $linkParams);
          
                  $headerLinks = [];
          Severity: Major
          Found in modules/Vtiger/models/ListView.php - About 2 hrs to fix

            Function loadListViewCondition has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
            Open

                public function loadListViewCondition()
                {
                    $queryGenerator = $this->getQueryGenerator();
                    if ($entityState = $this->get('entityState')) {
                        $queryGenerator->setStateCondition($entityState);
            Severity: Minor
            Found in modules/Vtiger/models/ListView.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 loadListViewCondition has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function loadListViewCondition()
                {
                    $queryGenerator = $this->getQueryGenerator();
                    if ($entityState = $this->get('entityState')) {
                        $queryGenerator->setStateCondition($entityState);
            Severity: Minor
            Found in modules/Vtiger/models/ListView.php - About 1 hr to fix

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

                  public function getListViewMassActions($linkParams)
                  {
                      $currentUser = Users_Record_Model::getCurrentUserModel();
                      $moduleModel = $this->getModule();
                      $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
              Severity: Minor
              Found in modules/Vtiger/models/ListView.php - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function getRecordsFromArray has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getRecordsFromArray(array $rows)
                  {
                      $listViewRecordModels = $relatedFields = [];
                      $moduleModel = $this->getModule();
                      foreach ($this->getQueryGenerator()->getRelatedFields() as $fieldInfo) {
              Severity: Minor
              Found in modules/Vtiger/models/ListView.php - About 1 hr to fix

              Cognitive Complexity

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

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

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

              Further reading

              Function getAdvancedLinks has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getAdvancedLinks()
                  {
                      $moduleModel = $this->getModule();
                      $advancedLinks = [];
              
              
              Severity: Minor
              Found in modules/Vtiger/models/ListView.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 getBasicLinks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function getBasicLinks()
                  {
                      $basicLinks = [];
                      $moduleModel = $this->getModule();
              
              
              Severity: Minor
              Found in modules/Vtiger/models/ListView.php - About 1 hr to fix

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

                    public function loadSearchLockedFields(App\Request $request): void
                    {
                        $moduleModel = $this->getModule();
                        if (!$request->isEmpty('lockedFields')) {
                            foreach ($request->getArray('lockedFields') as $value) {
                Severity: Minor
                Found in modules/Vtiger/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 loadListViewOrderBy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function loadListViewOrderBy()
                    {
                        $orderBy = $this->get('orderby');
                        if (!empty($orderBy) && \is_array($orderBy)) {
                            $fields = $this->getModule()->getFields();
                Severity: Minor
                Found in modules/Vtiger/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

                Function getListViewLinks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getListViewLinks($linkParams)
                    {
                        $moduleModel = $this->getModule();
                        $links = ['LISTVIEWBASIC' => []];
                
                
                Severity: Minor
                Found in modules/Vtiger/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

                Function getInstance has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public static function getInstance($moduleName, $viewId = 0)
                    {
                        $cacheName = $viewId . ':' . $moduleName;
                        if (\App\Cache::staticHas('ListView_Model', $cacheName)) {
                            return \App\Cache::staticGet('ListView_Model', $cacheName);
                Severity: Minor
                Found in modules/Vtiger/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

                Function getHederLinks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function getHederLinks($linkParams)
                    {
                        $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['LIST_VIEW_HEADER'], $linkParams);
                
                        $headerLinks = [];
                Severity: Minor
                Found in modules/Vtiger/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 getAdvancedLinks() has an NPath complexity of 216. The configured NPath complexity threshold is 200.
                Open

                    public function getAdvancedLinks()
                    {
                        $moduleModel = $this->getModule();
                        $advancedLinks = [];
                
                
                Severity: Minor
                Found in modules/Vtiger/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 an NPath complexity of 23040. The configured NPath complexity threshold is 200.
                Open

                    public function getListViewMassActions($linkParams)
                    {
                        $currentUser = Users_Record_Model::getCurrentUserModel();
                        $moduleModel = $this->getModule();
                        $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
                Severity: Minor
                Found in modules/Vtiger/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 106 lines of code. Current threshold is set to 100. Avoid really long methods.
                Open

                    public function getListViewMassActions($linkParams)
                    {
                        $currentUser = Users_Record_Model::getCurrentUserModel();
                        $moduleModel = $this->getModule();
                        $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                The method loadListViewCondition() has an NPath complexity of 1440. The configured NPath complexity threshold is 200.
                Open

                    public function loadListViewCondition()
                    {
                        $queryGenerator = $this->getQueryGenerator();
                        if ($entityState = $this->get('entityState')) {
                            $queryGenerator->setStateCondition($entityState);
                Severity: Minor
                Found in modules/Vtiger/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 getListViewHeaders() has an NPath complexity of 981. The configured NPath complexity threshold is 200.
                Open

                    public function getListViewHeaders()
                    {
                        $headerFieldModels = [];
                        if ($this->isEmpty('viewId')) {
                            $queryGenerator = $this->getQueryGenerator();
                Severity: Minor
                Found in modules/Vtiger/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 getHederLinks() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                Open

                    public function getHederLinks($linkParams)
                    {
                        $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['LIST_VIEW_HEADER'], $linkParams);
                
                        $headerLinks = [];
                Severity: Minor
                Found in modules/Vtiger/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

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

                    public function getAdvancedLinks()
                    {
                        $moduleModel = $this->getModule();
                        $advancedLinks = [];
                
                
                Severity: Minor
                Found in modules/Vtiger/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

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

                    public function getListViewHeaders()
                    {
                        $headerFieldModels = [];
                        if ($this->isEmpty('viewId')) {
                            $queryGenerator = $this->getQueryGenerator();
                Severity: Minor
                Found in modules/Vtiger/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

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

                    public function getListViewMassActions($linkParams)
                    {
                        $currentUser = Users_Record_Model::getCurrentUserModel();
                        $moduleModel = $this->getModule();
                        $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
                Severity: Minor
                Found in modules/Vtiger/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

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

                    public function loadListViewCondition()
                    {
                        $queryGenerator = $this->getQueryGenerator();
                        if ($entityState = $this->get('entityState')) {
                            $queryGenerator->setStateCondition($entityState);
                Severity: Minor
                Found in modules/Vtiger/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

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

                    public function loadListViewCondition()
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by sonar-php

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

                See

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

                    public function getListViewHeaders()
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by sonar-php

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

                See

                The class Vtiger_ListView_Model has a coupling between objects value of 21. Consider to reduce the number of dependencies under 13.
                Open

                class Vtiger_ListView_Model extends \App\Base
                {
                    /**
                     * Function to get the Module Model.
                     *
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                CouplingBetweenObjects

                Since: 1.1.0

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

                Example

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

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

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

                    public static function getInstanceForPopup($value, $sourceModule = false, int $cvId = 0)
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                BooleanArgumentFlag

                Since: 1.4.0

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

                Example

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

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

                Missing class import via use statement (line '44', column '25').
                Open

                        $queryGenerator = new \App\QueryGenerator($moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                MissingImport

                Since: 2.7.0

                Importing all external classes in a file through use statements makes them clearly visible.

                Example

                function make() {
                    return new \stdClass();
                }

                Source http://phpmd.org/rules/cleancode.html#MissingImport

                Missing class import via use statement (line '78', column '25').
                Open

                        $queryGenerator = new \App\QueryGenerator($moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                MissingImport

                Since: 2.7.0

                Importing all external classes in a file through use statements makes them clearly visible.

                Example

                function make() {
                    return new \stdClass();
                }

                Source http://phpmd.org/rules/cleancode.html#MissingImport

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

                        $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'ListView', $moduleName);
                Severity: Minor
                Found in modules/Vtiger/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_Watchdog_Model' in method 'getHederLinks'.
                Open

                            $watchdog = Vtiger_Watchdog_Model::getInstance($moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/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

                The method getInstance uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            if ($viewId = $queryGenerator->initForDefaultCustomView(true, true)) {
                                $instance->set('viewId', $viewId);
                            } else {
                                $queryGenerator->loadListFields();
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                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 assigning values to variables in if clauses and the like (line '49', column '8').
                Open

                    public static function getInstance($moduleName, $viewId = 0)
                    {
                        $cacheName = $viewId . ':' . $moduleName;
                        if (\App\Cache::staticHas('ListView_Model', $cacheName)) {
                            return \App\Cache::staticGet('ListView_Model', $cacheName);
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                Avoid using static access to class 'Vtiger_Module_Model' in method 'getInstanceForPopup'.
                Open

                        $moduleModel = Vtiger_Module_Model::getInstance($value);
                Severity: Minor
                Found in modules/Vtiger/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 'getInstanceForPopup'.
                Open

                        $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'ListView', $value);
                Severity: Minor
                Found in modules/Vtiger/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\Config' in method 'getHederLinks'.
                Open

                        if (App\Config::module('ModTracker', 'WATCHDOG') && $moduleModel->isPermitted('WatchingModule')) {
                Severity: Minor
                Found in modules/Vtiger/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 assigning values to variables in if clauses and the like (line '56', column '8').
                Open

                    public static function getInstance($moduleName, $viewId = 0)
                    {
                        $cacheName = $viewId . ':' . $moduleName;
                        if (\App\Cache::staticHas('ListView_Model', $cacheName)) {
                            return \App\Cache::staticGet('ListView_Model', $cacheName);
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                Avoid using static access to class '\App\CustomView' in method 'getInstance'.
                Open

                        if (($customView = \App\CustomView::getCustomViewById($viewId)) && $customView['advanced_conditions']) {
                Severity: Minor
                Found in modules/Vtiger/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\Cache' in method 'getInstance'.
                Open

                        if (\App\Cache::staticHas('ListView_Model', $cacheName)) {
                Severity: Minor
                Found in modules/Vtiger/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

                The method getInstanceForPopup uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            $moduleModel->getModalRecordsListFields($queryGenerator, $sourceModule);
                        }
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

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

                            return \App\Cache::staticGet('ListView_Model', $cacheName);
                Severity: Minor
                Found in modules/Vtiger/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

                The method getInstance uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                            } else {
                                $queryGenerator->loadListFields();
                            }
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                ElseExpression

                Since: 1.4.0

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

                Example

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

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

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

                        $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['LIST_VIEW_HEADER'], $linkParams);
                Severity: Minor
                Found in modules/Vtiger/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_Module_Model' in method 'getInstance'.
                Open

                        $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
                Severity: Minor
                Found in modules/Vtiger/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\Condition' in method 'getInstance'.
                Open

                            $instance->set('advancedConditions', \App\Condition::validAdvancedConditions($customView['advanced_conditions']));
                Severity: Minor
                Found in modules/Vtiger/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 'Users_Record_Model' in method 'getListViewMassActions'.
                Open

                        $currentUser = Users_Record_Model::getCurrentUserModel();
                Severity: Minor
                Found in modules/Vtiger/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 'getListViewMassActions'.
                Open

                                'linkdata' => ['confirm' => \App\Language::translate('LBL_ARCHIVE_RECORD_DESC')],
                Severity: Minor
                Found in modules/Vtiger/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 'getListViewMassActions'.
                Open

                                'linkdata' => ['confirm' => \App\Language::translate('LBL_DELETE_RECORD_COMPLETELY_DESC')],
                Severity: Minor
                Found in modules/Vtiger/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 assigning values to variables in if clauses and the like (line '523', column '7').
                Open

                    public function loadListViewCondition()
                    {
                        $queryGenerator = $this->getQueryGenerator();
                        if ($entityState = $this->get('entityState')) {
                            $queryGenerator->setStateCondition($entityState);
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

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

                        \App\Cache::staticSave('ListView_Model', $cacheName, $instance);
                Severity: Minor
                Found in modules/Vtiger/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 'Users_Privileges_Model' in method 'getHederLinks'.
                Open

                        $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                Severity: Minor
                Found in modules/Vtiger/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 'getListViewMassActions'.
                Open

                                'linkdata' => ['confirm' => \App\Language::translate('LBL_ACTIVATE_RECORD_DESC')],
                Severity: Minor
                Found in modules/Vtiger/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 assigning values to variables in if clauses and the like (line '536', column '7').
                Open

                    public function loadListViewCondition()
                    {
                        $queryGenerator = $this->getQueryGenerator();
                        if ($entityState = $this->get('entityState')) {
                            $queryGenerator->setStateCondition($entityState);
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                Avoid assigning values to variables in if clauses and the like (line '468', column '9').
                Open

                    public function getListViewHeaders()
                    {
                        $headerFieldModels = [];
                        if ($this->isEmpty('viewId')) {
                            $queryGenerator = $this->getQueryGenerator();
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                Avoid assigning values to variables in if clauses and the like (line '470', column '11').
                Open

                    public function getListViewHeaders()
                    {
                        $headerFieldModels = [];
                        if ($this->isEmpty('viewId')) {
                            $queryGenerator = $this->getQueryGenerator();
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                The method getListViewHeaders uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            $headerFields = [];
                            if (!$this->isEmpty('header_fields')) {
                                $fields = $this->get('header_fields');
                            } else {
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                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

                The method getListViewHeaders uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                            } else {
                                $customView = App\CustomView::getInstance($this->getModule()->getName());
                                $fields = $customView->getColumnsListByCvid($this->get('viewId'));
                            }
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                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\CustomView' in method 'getListViewHeaders'.
                Open

                                $customView = App\CustomView::getInstance($this->getModule()->getName());
                Severity: Minor
                Found in modules/Vtiger/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_Field_Model' in method 'getListViewHeaders'.
                Open

                                        $headerFields[] = Vtiger_Field_Model::init($row['related_modulename'], [
                                            'uitype' => 10,
                                            'label' => $row['label'],
                                            'referenceList' => [$row['related_modulename']],
                                            'searchByAjax' => true,
                Severity: Minor
                Found in modules/Vtiger/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_Module_Model' in method 'getHederLinks'.
                Open

                        $openStreetMapModuleModel = Vtiger_Module_Model::getInstance('OpenStreetMap');
                Severity: Minor
                Found in modules/Vtiger/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/Vtiger/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 assigning values to variables in if clauses and the like (line '328', column '52').
                Open

                    public function getListViewMassActions($linkParams)
                    {
                        $currentUser = Users_Record_Model::getCurrentUserModel();
                        $moduleModel = $this->getModule();
                        $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                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/Vtiger/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\Relation' in method 'getListViewHeaders'.
                Open

                                    if (($row = \App\Relation::getById($relationId)) && \App\Privilege::isPermitted($row['related_modulename'])) {
                Severity: Minor
                Found in modules/Vtiger/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_Module_Model' in method 'getListViewMassActions'.
                Open

                        $modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');
                Severity: Minor
                Found in modules/Vtiger/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\Privilege' in method 'getListViewHeaders'.
                Open

                                    if (($row = \App\Relation::getById($relationId)) && \App\Privilege::isPermitted($row['related_modulename'])) {
                Severity: Minor
                Found in modules/Vtiger/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', $moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/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 'getHederLinks'.
                Open

                            $links['LIST_VIEW_HEADER'][] = Vtiger_Link_Model::getInstanceFromValues($headerLink);
                Severity: Minor
                Found in modules/Vtiger/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 'getBasicLinks'.
                Open

                            $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'PDF', $moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/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/Vtiger/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 'getListViewMassActions'.
                Open

                                'linkdata' => ['confirm' => \App\Language::translate('LBL_MOVE_TO_TRASH_DESC')],
                Severity: Minor
                Found in modules/Vtiger/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 'getBasicLinks'.
                Open

                                    'linkhint' => \App\Language::translate('LBL_EXPORT_PDF'),
                Severity: Minor
                Found in modules/Vtiger/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 assigning values to variables in if clauses and the like (line '461', column '10').
                Open

                    public function getListViewHeaders()
                    {
                        $headerFieldModels = [];
                        if ($this->isEmpty('viewId')) {
                            $queryGenerator = $this->getQueryGenerator();
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                Avoid assigning values to variables in if clauses and the like (line '530', column '7').
                Open

                    public function loadListViewCondition()
                    {
                        $queryGenerator = $this->getQueryGenerator();
                        if ($entityState = $this->get('entityState')) {
                            $queryGenerator->setStateCondition($entityState);
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                Avoid using static access to class 'App\Config' in method 'getListViewMassActions'.
                Open

                        if ($moduleModel->isTrackingEnabled() && App\Config::module('ModTracker', 'UNREVIEWED_COUNT') && $moduleModel->isPermitted('ReviewingUpdates') && $currentUser->getId() === $currentUser->getRealId()) {
                Severity: Minor
                Found in modules/Vtiger/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 'getListViewLinks'.
                Open

                            $links['LISTVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink);
                Severity: Minor
                Found in modules/Vtiger/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

                The method getListViewHeaders uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                                } else {
                                    $queryGenerator = $this->getQueryGenerator();
                                    if ($field = $queryGenerator->getQueryField($fieldName)->getListViewFields()) {
                                        $queryGenerator->setField($field->getName());
                                        $headerFields[] = $field;
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                ElseExpression

                Since: 1.4.0

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

                Example

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

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

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

                        if ($moduleModel->isPermitted('MassSendSMS') && ($smsNotifierModel = \Vtiger_Module_Model::getInstance('SMSNotifier'))->isSMSActiveForModule($moduleModel->getName())) {
                Severity: Minor
                Found in modules/Vtiger/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 'getListViewLinks'.
                Open

                        $allLinks = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWBASIC', 'LISTVIEW'], $linkParams);
                Severity: Minor
                Found in modules/Vtiger/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_Module_Model' in method 'loadSearchLockedFields'.
                Open

                                    $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
                Severity: Minor
                Found in modules/Vtiger/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', $moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/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\RecordConverter' in method 'getListViewMassActions'.
                Open

                        if ($moduleModel->isPermitted('RecordConventer') && \App\RecordConverter::isActive($moduleModel->getName(), 'List')) {
                Severity: Minor
                Found in modules/Vtiger/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

                The method getListViewEntries uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                Open

                        } else {
                            $pagingModel->set('nextPageExists', false);
                        }
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                ElseExpression

                Since: 1.4.0

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

                Example

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

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

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

                        $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);
                Severity: Minor
                Found in modules/Vtiger/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 'getListViewLinks'.
                Open

                            $links['LISTVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($advancedLink);
                Severity: Minor
                Found in modules/Vtiger/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 assigning values to variables in if clauses and the like (line '533', column '7').
                Open

                    public function loadListViewCondition()
                    {
                        $queryGenerator = $this->getQueryGenerator();
                        if ($entityState = $this->get('entityState')) {
                            $queryGenerator->setStateCondition($entityState);
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                IfStatementAssignment

                Since: 2.7.0

                Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

                Example

                class Foo
                {
                    public function bar($flag)
                    {
                        if ($foo = 'bar') { // possible typo
                            // ...
                        }
                        if ($baz = 0) { // always false
                            // ...
                        }
                    }
                }

                Source http://phpmd.org/rules/cleancode.html#ifstatementassignment

                Define a constant instead of duplicating this literal "linkhint" 5 times.
                Open

                                'linkhint' => 'BTN_WATCHING_MODULE',
                Severity: Critical
                Found in modules/Vtiger/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 "related_modulename" 3 times.
                Open

                                    if (($row = \App\Relation::getById($relationId)) && \App\Privilege::isPermitted($row['related_modulename'])) {
                Severity: Critical
                Found in modules/Vtiger/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 "label" 5 times.
                Open

                                if (!empty($fieldInfo['label'])) {
                Severity: Critical
                Found in modules/Vtiger/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 "linklabel" 17 times.
                Open

                                'linklabel' => 'LBL_IMPORT',
                Severity: Critical
                Found in modules/Vtiger/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 "LIST_VIEW_HEADER" 6 times.
                Open

                        $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['LIST_VIEW_HEADER'], $linkParams);
                Severity: Critical
                Found in modules/Vtiger/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 "ListView_Model" 3 times.
                Open

                        if (\App\Cache::staticHas('ListView_Model', $cacheName)) {
                Severity: Critical
                Found in modules/Vtiger/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=' . $moduleModel->getName() . '&action=MassState&state=Active&sourceView=List',
                Severity: Critical
                Found in modules/Vtiger/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 "advanced_conditions" 3 times.
                Open

                        if (($customView = \App\CustomView::getCustomViewById($viewId)) && $customView['advanced_conditions']) {
                Severity: Critical
                Found in modules/Vtiger/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 "modal" 4 times.
                Open

                                    'linkdata' => ['url' => 'index.php?module=' . $moduleModel->getName() . '&view=PDF&fromview=List', 'type' => 'modal'],
                Severity: Critical
                Found in modules/Vtiger/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 "LISTVIEWBASIC" 5 times.
                Open

                                'linktype' => 'LISTVIEWBASIC',
                Severity: Critical
                Found in modules/Vtiger/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/Vtiger/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 "Model" 5 times.
                Open

                        $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'ListView', $moduleName);
                Severity: Critical
                Found in modules/Vtiger/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 "LBL_EXPORT_PDF" 3 times.
                Open

                                    'linklabel' => \App\Language::translate('LBL_EXPORT_PDF'),
                Severity: Critical
                Found in modules/Vtiger/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 "query_generator" 3 times.
                Open

                        $instance->set('module', $moduleModel)->set('query_generator', $queryGenerator);
                Severity: Critical
                Found in modules/Vtiger/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" 22 times.
                Open

                                'linkicon' => 'fas ' . $iconclass,
                Severity: Critical
                Found in modules/Vtiger/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 "module" 3 times.
                Open

                        return $this->get('module');
                Severity: Critical
                Found in modules/Vtiger/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 "advancedConditions" 3 times.
                Open

                            $instance->set('advancedConditions', \App\Condition::validAdvancedConditions($customView['advanced_conditions']));
                Severity: Critical
                Found in modules/Vtiger/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" 16 times.
                Open

                                'linkurl' => 'javascript:Vtiger_Index_Js.changeWatching(this)',
                Severity: Critical
                Found in modules/Vtiger/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 "viewId" 5 times.
                Open

                            $instance->set('viewId', $viewId);
                Severity: Critical
                Found in modules/Vtiger/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" 11 times.
                Open

                                'linkclass' => $class,
                Severity: Critical
                Found in modules/Vtiger/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 "LISTVIEW" 6 times.
                Open

                                'linktype' => 'LISTVIEW',
                Severity: Critical
                Found in modules/Vtiger/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 "index.php?module=" 6 times.
                Open

                                    'linkdata' => ['url' => 'index.php?module=' . $moduleModel->getName() . '&view=PDF&fromview=List', 'type' => 'modal'],
                Severity: Critical
                Found in modules/Vtiger/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/Vtiger/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" 13 times.
                Open

                                'linktype' => 'LISTVIEWMASSACTION',
                Severity: Critical
                Found in modules/Vtiger/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 "linkdata" 11 times.
                Open

                                'linkdata' => ['off' => 'btn-outline-dark', 'on' => 'btn-dark', 'value' => $watchdog->isWatchingModule() ? 0 : 1],
                Severity: Critical
                Found in modules/Vtiger/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" 22 times.
                Open

                                'linktype' => 'LIST_VIEW_HEADER',
                Severity: Critical
                Found in modules/Vtiger/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 "CreateView" 4 times.
                Open

                        if ($userPrivilegesModel->hasModuleActionPermission('Notification', 'CreateView')) {
                Severity: Critical
                Found in modules/Vtiger/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 "confirm" 4 times.
                Open

                                'linkdata' => ['confirm' => \App\Language::translate('LBL_ACTIVATE_RECORD_DESC')],
                Severity: Critical
                Found in modules/Vtiger/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 "source_field_name" 6 times.
                Open

                                if (!empty($fieldInfo['source_field_name'])) {
                Severity: Critical
                Found in modules/Vtiger/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.

                Return type of getQueryGenerator() is undeclared type \App\QueryGenerator (Did you mean class \Tests\App\QueryGenerator)
                Open

                    public function getQueryGenerator()
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

                Argument 1 (moduleName) is false but \App\CustomView::getInstance() takes string defined at /code/app/CustomView.php:159
                Open

                                $customView = App\CustomView::getInstance($this->getModule()->getName());
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

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

                            $queryGenerator->setAdvancedConditions($advancedConditions);
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

                Argument 1 (moduleName) is false but \Vtiger_Watchdog_Model::getInstance() takes int|string defined at /code/modules/Vtiger/models/Watchdog.php:48
                Open

                            $watchdog = Vtiger_Watchdog_Model::getInstance($moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

                Call to undeclared method \Vtiger_Module_Model::getMassSMSUrlForModule
                Open

                                'linkdata' => ['url' => $smsNotifierModel->getMassSMSUrlForModule($moduleModel->getName()), 'type' => 'modal'],
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                        return $this->getQueryGenerator()->setDistinct('id')->createQuery()->count();
                Severity: Critical
                Found in modules/Vtiger/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', $moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/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.triggerMassEdit("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=showMassEditForm");',
                Severity: Minor
                Found in modules/Vtiger/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=' . $moduleModel->getName() . '&action=MassDelete&sourceView=List',
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

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

                            $queryGenerator->setFields(array_values($this->getModule()->getPopupFields()));
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                            $headerFields = $queryGenerator->getListViewFields();
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                            $queryGenerator->addCondition($searchKey, $searchValue, $operator);
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

                Argument 1 (moduleName) is false but \App\RecordConverter::isActive() takes int|string defined at /code/app/RecordConverter.php:175
                Open

                        if ($moduleModel->isPermitted('RecordConventer') && \App\RecordConverter::isActive($moduleModel->getName(), 'List')) {
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

                Call to undeclared method \Vtiger_Module_Model::isSMSActiveForModule
                Open

                        if ($moduleModel->isPermitted('MassSendSMS') && ($smsNotifierModel = \Vtiger_Module_Model::getInstance('SMSNotifier'))->isSMSActiveForModule($moduleModel->getName())) {
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                            $queryGenerator->addNativeCondition(['vtiger_crmentity.crmid' => $searchResult]);
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                                $queryGenerator->loadListFields();
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                            $queryGenerator->initForCustomViewById($cvId);
                Severity: Critical
                Found in modules/Vtiger/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=' . $moduleModel->getName() . '&view=TransferOwnership")',
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

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

                        foreach ($this->getQueryGenerator()->getRelatedFields() as $fieldInfo) {
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                            $queryGenerator->parseAdvFilter($searchParams);
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                        $queryGenerator = new \App\QueryGenerator($moduleModel->getName());
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                        $queryGenerator = new \App\QueryGenerator($moduleModel->getName());
                Severity: Critical
                Found in modules/Vtiger/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

                                'linkdata' => ['url' => "index.php?module={$moduleModel->getName()}&view=MergeRecords"],
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

                Saw unextractable annotation for comment '* @return <array> - Associate array of Link Type to List of Vtiger_Link_Model instances'</array>
                Open

                     * @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances
                Severity: Info
                Found in modules/Vtiger/models/ListView.php by phan

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

                                    $this->getQueryGenerator()->setRelatedOrder([
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

                Call to undeclared method \Vtiger_Module_Model::getQueryByRelatedField
                Open

                                $moduleModel->getQueryByRelatedField($this, $queryGenerator);
                Severity: Critical
                Found in modules/Vtiger/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', 'MappedFields', $moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/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=' . $moduleModel->getName() . '&action=MassState&state=Trash&sourceView=List',
                Severity: Minor
                Found in modules/Vtiger/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.triggerReviewChanges("index.php?module=ModTracker&sourceModule=' . $moduleModel->getName() . '&action=ChangesReviewedOn&mode=reviewChanges")',
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

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

                                    $this->getQueryGenerator()->setOrder($fieldName, $sortFlag);
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                        $query = $this->getQueryGenerator()->createQuery();
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                        return $this->getRecordsFromArray($this->getQueryGenerator()->createQuery()->all());
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

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

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

                                    if ($field = $queryGenerator->getQueryField($fieldName)->getListViewFields()) {
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                                        $queryGenerator->setField($field->getName());
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

                Call to undeclared method \Vtiger_Module_Model::isAllowModules
                Open

                        if ($userPrivilegesModel->hasModulePermission($openStreetMapModuleModel->getId()) && $openStreetMapModuleModel->isAllowModules($moduleModel->getName())) {
                Severity: Critical
                Found in modules/Vtiger/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

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

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

                            $queryGenerator->addCondition('id', $srcRecord, 'n');
                Severity: Critical
                Found in modules/Vtiger/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

                                'linkdata' => ['url' => 'index.php?module=PermissionInspector&view=UserListModal&srcModule=' . $moduleModel->getName()],
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

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

                     * @param <Array> $linkParams
                Severity: Info
                Found in modules/Vtiger/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=' . $moduleModel->getName() . '&action=MassState&state=Active&sourceView=List',
                Severity: Minor
                Found in modules/Vtiger/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

                                    'linkdata' => ['url' => 'index.php?module=' . $moduleModel->getName() . '&view=PDF&fromview=List', 'type' => 'modal'],
                Severity: Minor
                Found in modules/Vtiger/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', $moduleModel->getName());
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

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

                            $queryGenerator->setStateCondition($entityState);
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                            if ($viewId = $queryGenerator->initForDefaultCustomView(true, true)) {
                Severity: Critical
                Found in modules/Vtiger/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.triggerMassComment("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=showAddCommentForm")',
                Severity: Minor
                Found in modules/Vtiger/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

                                'linkdata' => ['url' => "index.php?module={$moduleModel->getName()}&view=RecordConverter&sourceView=List", 'type' => 'modal'],
                Severity: Minor
                Found in modules/Vtiger/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("' . $moduleModel->getName() . '")',
                Severity: Minor
                Found in modules/Vtiger/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=' . $moduleModel->getName() . '&action=MassState&state=Archived&sourceView=List',
                Severity: Minor
                Found in modules/Vtiger/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

                                'linkclass' => 'js-add-record btn-light addButton modCT_' . $moduleModel->getName(),
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

                Class \Vtiger_Link_Model was passed to foreach, but it does not extend Traversable. This may be intentional, because some of that class's declared properties are accessible from this context. (This check excludes dynamic properties)
                Open

                                foreach ($allLinksByType as $linkModel) {
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

                Call to undeclared method \Vtiger_Module_Model::getQueryByModuleField
                Open

                                $moduleModel->getQueryByModuleField($sourceModule, $this->get('src_field'), $this->get('src_record'), $queryGenerator);
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

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

                            $queryGenerator->initForCustomViewById($viewId);
                Severity: Critical
                Found in modules/Vtiger/models/ListView.php by phan

                Argument 1 (mixed) is 'PermissionInspector' but \Users_Privileges_Model::hasModulePermission() takes int defined at /code/modules/Users/models/Privileges.php:101
                Open

                        if ($userPrivilegesModel->hasModulePermission('PermissionInspector')) {
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phan

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

                            foreach ($relatedFields as $relatedModuleName => $fields) {
                                foreach ($fields as $sourceField => $field) {
                                    $recordData = [
                                        'id' => $row[$sourceField . $relatedModuleName . 'id'] ?? 0,
                                    ];
                Severity: Major
                Found in modules/Vtiger/models/ListView.php and 1 other location - About 1 hr to fix
                modules/Vtiger/models/RelationListView.php on lines 296..307

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

                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

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

                        if (!$request->isEmpty('lockedEmptyFields')) {
                            foreach ($request->getArray('lockedEmptyFields') as $value) {
                                if (strpos($value, ':')) {
                                    [$fieldName, $moduleName] = explode(':', $value);
                                    $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
                Severity: Major
                Found in modules/Vtiger/models/ListView.php and 1 other location - About 1 hr to fix
                modules/Vtiger/models/RelationListView.php on lines 771..780

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

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

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

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

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

                Refactorings

                Further Reading

                Avoid excessively long variable names like $openStreetMapModuleModel. Keep variable name length under 20.
                Open

                        $openStreetMapModuleModel = Vtiger_Module_Model::getInstance('OpenStreetMap');
                Severity: Minor
                Found in modules/Vtiger/models/ListView.php by phpmd

                LongVariable

                Since: 0.2

                Detects when a field, formal or local variable is declared with a long name.

                Example

                class Something {
                    protected $reallyLongIntName = -3; // VIOLATION - Field
                    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                        $otherReallyLongName = -5; // VIOLATION - Local
                        for ($interestingIntIndex = 0; // VIOLATION - For
                             $interestingIntIndex < 10;
                             $interestingIntIndex++ ) {
                        }
                    }
                }

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

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

                class Vtiger_ListView_Model extends \App\Base

                The class Vtiger_ListView_Model is not named in CamelCase.
                Open

                class Vtiger_ListView_Model extends \App\Base
                {
                    /**
                     * Function to get the Module Model.
                     *
                Severity: Minor
                Found in modules/Vtiger/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

                     */

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

                        $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'ListView', $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

                     * @return Vtiger_ListView_Model instance

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

                     * Static Function to get the Instance of Vtiger ListView model for a given module and custom view.

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

                     * Function to get the Module Model.

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

                        $moduleModel = Vtiger_Module_Model::getInstance($moduleName);

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

                     * @return Vtiger_Module_Model instance

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

                    {

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

                        $cacheName = $viewId . ':' . $moduleName;

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

                            return \App\Cache::staticGet('ListView_Model', $cacheName);

                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

                     * @param string $moduleName - Module 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

                        if (\App\Cache::staticHas('ListView_Model', $cacheName)) {

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

                    {

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

                        $instance = new $modelClassName();

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

                     * @param int    $viewId     - Custom View 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

                    /**

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

                    public static function getInstance($moduleName, $viewId = 0)

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

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

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

                     *

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

                    /**

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

                    /**

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

                        $headerLinks = [];

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

                                'linkurl' => 'javascript:Vtiger_Index_Js.sendNotification(this)',

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

                                'linktype' => 'LIST_VIEW_HEADER',

                Line exceeds 120 characters; contains 136 characters
                Open

                                'linkdata' => ['url' => 'index.php?module=PermissionInspector&view=UserListModal&srcModule=' . $moduleModel->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

                     */

                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

                        if ($viewId) {

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

                            if ($viewId = $queryGenerator->initForDefaultCustomView(true, true)) {

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

                     *

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

                     * @return array List of Vtiger_Link_Model instances

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

                            $watchdog = Vtiger_Watchdog_Model::getInstance($moduleModel->getName());

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

                            $headerLinks[] = [

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

                                'linkclass' => $class,

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

                                'linkhint' => 'LBL_SEND_NOTIFICATION',

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

                            $headerLinks[] = [

                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

                                'linkdata' => ['url' => "index.php?module={$moduleModel->getName()}&view=MergeRecords"],

                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

                        \App\Cache::staticSave('ListView_Model', $cacheName, $instance);

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

                     * @return Vtiger_ListView_Model instance

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

                        return $instance->set('module', $moduleModel)->set('query_generator', $queryGenerator);

                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 Quick Links for the List view of the module.

                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

                                $class = 'btn-dark';

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

                                'linkdata' => ['off' => 'btn-outline-dark', 'on' => 'btn-dark', 'value' => $watchdog->isWatchingModule() ? 0 : 1],

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

                                'linkurl' => 'javascript:Vtiger_List_Js.showMap()',

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

                                'linkicon' => 'yfi yfi-merging-records',

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

                            $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'PDF', $moduleModel->getName());

                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

                     * Static Function to get the Instance of Vtiger ListView model for a given module and custom view.

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

                     */

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

                    public static function getInstanceForPopup($value, $sourceModule = false, int $cvId = 0)

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

                            $queryGenerator->initForCustomViewById($cvId);

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

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

                                'linktype' => 'LIST_VIEW_HEADER',

                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

                            $advancedLinks[] = [

                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

                            $instance->set('advancedConditions', \App\Condition::validAdvancedConditions($customView['advanced_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

                        return $instance;

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

                        $queryGenerator = new \App\QueryGenerator($moduleModel->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

                     *

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

                                'linkicon' => 'fas ' . $iconclass,

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

                        $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

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

                        if ($userPrivilegesModel->hasModulePermission($openStreetMapModuleModel->getId()) && $openStreetMapModuleModel->isAllowModules($moduleModel->getName())) {

                Line exceeds 120 characters; contains 123 characters
                Open

                                'linkurl' => 'javascript:Vtiger_List_Js.triggerExportAction("' . $this->getModule()->getExportUrl() . '")',

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

                            $instance->set('viewId', $viewId);

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

                                $instance->set('viewId', $viewId);

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

                            $instance->set('viewId', $cvId);

                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

                     * @param array $linkParams

                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

                                'linkicon' => 'fas fa-user-secret',

                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

                                'linkurl' => 'javascript:Vtiger_List_Js.triggerExportAction("' . $this->getModule()->getExportUrl() . '")',

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

                        $instance->set('module', $moduleModel)->set('query_generator', $queryGenerator);

                Line exceeds 120 characters; contains 126 characters
                Open

                            $instance->set('advancedConditions', \App\Condition::validAdvancedConditions($customView['advanced_conditions']));

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

                        $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'ListView', $value);

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

                            $moduleModel->getModalRecordsListFields($queryGenerator, $sourceModule);

                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

                            $iconclass = 'fa-eye-slash';

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

                            ];

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

                        $openStreetMapModuleModel = Vtiger_Module_Model::getInstance('OpenStreetMap');

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

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

                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

                        $links = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), ['LIST_VIEW_HEADER'], $linkParams);

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

                            }

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

                            $headerLinks[] = [

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

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

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

                        if ($userPrivilegesModel->hasModulePermission('PermissionInspector')) {

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

                    /**

                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

                     *

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

                    public function getHederLinks($linkParams)

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

                                'linkurl' => 'javascript:Vtiger_Index_Js.changeWatching(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

                                'linklabel' => 'LBL_MERGING',

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

                        if (!$sourceModule && !empty($sourceModule)) {

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

                            if ($watchdog->isWatchingModule()) {

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

                                'linkicon' => 'fas fa-paper-plane',

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

                                'linkclass' => 'js-mass-action--merge',

                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 mixed  $sourceModule

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

                            ];

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

                                'linkhint' => 'LBL_SHOW_MAP',

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

                        foreach ($headerLinks as $headerLink) {

                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

                            $instance->set('advancedConditionsRaw', $customView['advanced_conditions']);

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

                     * @param string $value        - Module Name

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

                        if ($cvId) {

                Line exceeds 120 characters; contains 130 characters
                Open

                                'linkdata' => ['off' => 'btn-outline-dark', 'on' => 'btn-dark', 'value' => $watchdog->isWatchingModule() ? 0 : 1],

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

                                'active' => !$watchdog->isLock(),

                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 ($userPrivilegesModel->hasModuleActionPermission('Notification', '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

                                'linktype' => 'LIST_VIEW_HEADER',

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

                                'linkdata' => ['url' => 'index.php?module=PermissionInspector&view=UserListModal&srcModule=' . $moduleModel->getName()],

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

                            $links['LIST_VIEW_HEADER'][] = Vtiger_Link_Model::getInstanceFromValues($headerLink);

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

                        if (($customView = \App\CustomView::getCustomViewById($viewId)) && $customView['advanced_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

                    {

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

                            $moduleModel->set('sourceModule', $sourceModule);

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

                            ];

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

                            $headerLinks[] = [

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

                     * @return array of advanced links

                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

                        $advancedLinks = [];

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

                            $queryGenerator->initForCustomViewById($viewId);

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

                        }

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

                        $moduleModel = Vtiger_Module_Model::getInstance($value);

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

                            $class = 'btn-outline-dark';

                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

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

                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

                            } 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

                        $instance = new $modelClassName();

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

                        if (App\Config::module('ModTracker', 'WATCHDOG') && $moduleModel->isPermitted('WatchingModule')) {

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

                                'linkhint' => 'BTN_WATCHING_MODULE',

                Line exceeds 120 characters; contains 162 characters
                Open

                        if ($userPrivilegesModel->hasModulePermission($openStreetMapModuleModel->getId()) && $openStreetMapModuleModel->isAllowModules($moduleModel->getName())) {

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

                                'modalView' => true,

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

                    }

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

                     * Function to give advance links of a module.

                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

                                'linklabel' => 'LBL_IMPORT',

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

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

                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

                        $queryGenerator = new \App\QueryGenerator($moduleModel->getName());

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

                                $queryGenerator->loadListFields();

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

                     * @param int    $cvId

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

                                $iconclass = 'fa-eye';

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

                                'linkhint' => 'BTN_PERMISSION_INSPECTOR',

                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' => $moduleModel->getImportUrl(),

                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

                        }

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

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

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

                        $massActionLinks = [];

                Line exceeds 120 characters; contains 168 characters
                Open

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

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

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

                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

                                    'linkicon' => 'fas fa-plus-circle',

                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

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

                Line exceeds 120 characters; contains 128 characters
                Open

                                'dataUrl' => 'index.php?module=' . $moduleModel->getName() . '&action=MassState&state=Archived&sourceView=List',

                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

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

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

                        $modCommentsModel = Vtiger_Module_Model::getInstance('ModComments');

                Line exceeds 120 characters; contains 208 characters
                Open

                        if ($moduleModel->isTrackingEnabled() && App\Config::module('ModTracker', 'UNREVIEWED_COUNT') && $moduleModel->isPermitted('ReviewingUpdates') && $currentUser->getId() === $currentUser->getRealId()) {

                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

                        }

                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

                        }

                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

                            ];

                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('MassSendSMS') && ($smsNotifierModel = \Vtiger_Module_Model::getInstance('SMSNotifier'))->isSMSActiveForModule($moduleModel->getName())) {

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

                     * @return Vtiger_Link_Model[]

                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

                                'dataUrl' => 'index.php?module=' . $moduleModel->getName() . '&action=MassState&state=Active&sourceView=List',

                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

                            $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

                                'linklabel' => 'LBL_MASS_SEND_SMS',

                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

                                $advancedLinks[] = [

                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

                    public function getListViewMassActions($linkParams)

                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

                        }

                Line exceeds 120 characters; contains 142 characters
                Open

                        if ($moduleModel->isCommentEnabled() && $modCommentsModel->isPermitted('CreateView') && $moduleModel->isPermitted('MassAddComment')) {

                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=' . $moduleModel->getName() . '&view=TransferOwnership")',

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

                                'linkicon' => 'fas fa-check-circle',

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

                                'linktype' => 'LISTVIEWMASSACTION',

                Line exceeds 120 characters; contains 138 characters
                Open

                                    'linkdata' => ['url' => 'index.php?module=' . $moduleModel->getName() . '&view=PDF&fromview=List', 'type' => 'modal'],

                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

                                'linktype' => 'LISTVIEWMASSACTION',

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

                                'linklabel' => 'LBL_MASS_MOVE_TO_TRASH',

                Line exceeds 120 characters; contains 125 characters
                Open

                                'dataUrl' => 'index.php?module=' . $moduleModel->getName() . '&action=MassState&state=Trash&sourceView=List',

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

                        if ($moduleModel->isTrackingEnabled() && App\Config::module('ModTracker', 'UNREVIEWED_COUNT') && $moduleModel->isPermitted('ReviewingUpdates') && $currentUser->getId() === $currentUser->getRealId()) {

                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

                        $currentUser = Users_Record_Model::getCurrentUserModel();

                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

                                'linklabel' => 'LBL_MASS_EDIT',

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

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

                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

                                'linkdata' => ['confirm' => \App\Language::translate('LBL_ARCHIVE_RECORD_DESC')],

                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

                                    'linkclass' => 'js-mass-action',

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

                                'linkurl' => 'javascript:Vtiger_List_Js.triggerQuickExport("' . $moduleModel->getName() . '")',

                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

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

                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' => ['confirm' => \App\Language::translate('LBL_MOVE_TO_TRASH_DESC')],

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

                            ];

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

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

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

                                'linklabel' => 'LBL_REVIEW_CHANGES',

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

                                'linkdata' => ['url' => "index.php?module={$moduleModel->getName()}&view=RecordConverter&sourceView=List", 'type' => 'modal'],

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

                            $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'MappedFields', $moduleModel->getName());

                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

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

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

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

                        }

                Line exceeds 120 characters; contains 126 characters
                Open

                        if ($moduleModel->isPermitted('RecordConventer') && \App\RecordConverter::isActive($moduleModel->getName(), 'List')) {

                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('QuickExportToExcel')) {

                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

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

                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

                    /**

                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

                        }

                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

                                'linktype' => 'LISTVIEWMASSACTION',

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

                                'linklabel' => 'LBL_MASS_ADD_COMMENT',

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

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

                Line exceeds 120 characters; contains 157 characters
                Open

                                'linkurl' => 'javascript:Vtiger_List_Js.triggerTransferOwnership("index.php?module=' . $moduleModel->getName() . '&view=TransferOwnership")',

                Line exceeds 120 characters; contains 198 characters
                Open

                                'linkurl' => 'javascript:Vtiger_List_Js.triggerReviewChanges("index.php?module=ModTracker&sourceModule=' . $moduleModel->getName() . '&action=ChangesReviewedOn&mode=reviewChanges")',

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

                            ];

                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

                            }

                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

                        $links = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWMASSACTION'], $linkParams);

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

                                'dataUrl' => 'index.php?module=' . $moduleModel->getName() . '&action=MassState&state=Trash&sourceView=List',

                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

                            $massActionLinks[] = [

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

                            $massActionLinks[] = [

                Line exceeds 120 characters; contains 142 characters
                Open

                                'linkdata' => ['url' => "index.php?module={$moduleModel->getName()}&view=RecordConverter&sourceView=List", 'type' => 'modal'],

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

                                    'linkdata' => ['url' => 'index.php?module=' . $moduleModel->getName() . '&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

                                    '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

                     * @param array $linkParams

                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

                                'linkdata' => ['confirm' => \App\Language::translate('LBL_DELETE_RECORD_COMPLETELY_DESC')],

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

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

                                'linkurl' => 'javascript:Vtiger_List_Js.triggerMassComment("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=showAddCommentForm")',

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

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

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

                                'dataUrl' => 'index.php?module=' . $moduleModel->getName() . '&action=MassState&state=Archived&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

                            ];

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

                            $massActionLinks[] = [

                Line exceeds 120 characters; contains 172 characters
                Open

                                'linkurl' => 'javascript:Vtiger_List_Js.triggerMassComment("index.php?module=' . $moduleModel->getName() . '&view=MassActionAjax&mode=showAddCommentForm")',

                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:Vtiger_List_Js.triggerReviewChanges("index.php?module=ModTracker&sourceModule=' . $moduleModel->getName() . '&action=ChangesReviewedOn&mode=reviewChanges")',

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

                        if ($moduleModel->isPermitted('RecordConventer') && \App\RecordConverter::isActive($moduleModel->getName(), 'List')) {

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

                                'linkclass' => 'u-cursor-pointer 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

                        return $advancedLinks;

                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

                                'linklabel' => 'LBL_MASS_DELETE',

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

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

                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

                                'linkdata' => ['url' => $smsNotifierModel->getMassSMSUrlForModule($moduleModel->getName()), 'type' => 'modal'],

                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

                                'linklabel' => 'LBL_ADD_RECORD',

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

                            $templates = $pdfModel->getActiveTemplatesForModule($moduleModel->getName(), '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

                                    $links[$type][] = $linkModel;

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

                     * @return \App\QueryGenerator

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

                     * @return Vtiger_Field_Model[] - List of Vtiger_Field_Model instances

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

                                    $fieldModel->set('source_field_name', $fieldInfo['source_field_name']);

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

                                $headerFields[] = $fieldModel;

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

                            if (($advancedConditions = $this->get('advancedConditions')) && !empty($advancedConditions['relationColumns'])) {

                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

                                '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

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

                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

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

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

                                'dataUrl' => 'index.php?module=' . $moduleModel->getName() . '&action=MassDelete&sourceView=List',

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

                        if ($moduleModel->isCommentEnabled() && $modCommentsModel->isPermitted('CreateView') && $moduleModel->isPermitted('MassAddComment')) {

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

                                'linkhref' => true,

                Line exceeds 120 characters; contains 138 characters
                Open

                                    'linkdata' => ['url' => 'index.php?module=' . $moduleModel->getName() . '&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

                    public function getListViewLinks($linkParams)

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

                            $links['LISTVIEW'][] = Vtiger_Link_Model::getInstanceFromValues($advancedLink);

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

                     * Function to get the list view header.

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

                    {

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

                            $headerFields = [];

                Line exceeds 120 characters; contains 124 characters
                Open

                                $fieldModel = clone Vtiger_Module_Model::getInstance($fieldInfo['module_name'])->getFieldByName($fieldName);

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

                                    if (!$this->getModule()->getFieldByName($fieldInfo['source_field_name'])->isActiveField()) {

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

                        }

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

                        }

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

                     * @return array of Basic 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

                     * Get query generator instance.

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

                                if (!empty($fieldInfo['source_field_name'])) {

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

                                            'searchByAjax' => true,

                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

                     *

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

                                'linktype' => 'LISTVIEWMASSACTION',

                Line exceeds 120 characters; contains 126 characters
                Open

                                'dataUrl' => 'index.php?module=' . $moduleModel->getName() . '&action=MassState&state=Active&sourceView=List',

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

                                'linkdata' => ['confirm' => \App\Language::translate('LBL_ACTIVATE_RECORD_DESC')],

                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

                        }

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

                                'linklabel' => 'LBL_RECORD_CONVERTER',

                Line exceeds 120 characters; contains 176 characters
                Open

                        if ($moduleModel->isPermitted('MassSendSMS') && ($smsNotifierModel = \Vtiger_Module_Model::getInstance('SMSNotifier'))->isSMSActiveForModule($moduleModel->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

                        }

                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

                        $basicLinks = $this->getBasicLinks();

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

                        $allLinks = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['LISTVIEWBASIC', 'LISTVIEW'], $linkParams);

                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-comment-sms',

                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

                                'linktype' => 'LISTVIEWBASIC',

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

                                    'linkdata' => ['url' => 'index.php?module=' . $moduleModel->getName() . '&view=PDF&fromview=List', 'type' => 'modal'],

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

                        return $basicLinks;

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

                    }

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

                            }

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

                    /**

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

                                    if (($row = \App\Relation::getById($relationId)) && \App\Privilege::isPermitted($row['related_modulename'])) {

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

                            if ($fieldModel && (!$fieldModel->isViewable() || !$fieldModel->getPermissions())) {

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

                                    'linktype' => 'LISTVIEWBASIC',

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

                        if (!empty($allLinks)) {

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

                     */

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

                        $headerFieldModels = [];

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

                                $fields = $customView->getColumnsListByCvid($this->get('viewId'));

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

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

                        $basicLinks = [];

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

                            $handlerClass = Vtiger_Loader::getComponentClassName('Model', 'PDF', $moduleModel->getName());

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

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

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

                     * Function to get the list of listview links for the module.

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

                     *

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

                            foreach ($allLinks as $type => $allLinksByType) {

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

                    public function getQueryGenerator()

                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

                            } 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

                                        continue;

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

                                    }

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

                                            'relationId' => $relationId,

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

                                continue;

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

                    }

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

                    /**

                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

                    /**

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

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

                        if ($this->isEmpty('viewId')) {

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

                            foreach ($fields as $fieldInfo) {

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

                                            'referenceList' => [$row['related_modulename']],

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

                     * Function to get Basic 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

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

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

                                $fieldModel = clone Vtiger_Module_Model::getInstance($fieldInfo['module_name'])->getFieldByName($fieldName);

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

                                    $fieldModel->set('isLabelCustomized', true);

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

                                    if ($field = $queryGenerator->getQueryField($fieldName)->getListViewFields()) {

                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

                                foreach ($advancedConditions['relationColumns'] as $relationId) {

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

                                'linkurl' => $moduleModel->getCreateRecordUrl(),

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

                     * @return <Array> - Associate array of Link Type to List of Vtiger_Link_Model instances

                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

                    }

                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

                            $headerFields = $queryGenerator->getListViewFields();

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

                                    $fieldModel->set('label', $fieldInfo['label']);

                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

                        foreach ($headerFields as $fieldModel) {

                Line exceeds 120 characters; contains 127 characters
                Open

                                'linkdata' => ['url' => $smsNotifierModel->getMassSMSUrlForModule($moduleModel->getName()), '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

                                'linkclass' => 'js-add-record btn-light addButton modCT_' . $moduleModel->getName(),

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

                        $advancedLinks = $this->getAdvancedLinks();

                Line exceeds 120 characters; contains 130 characters
                Open

                                    if (($row = \App\Relation::getById($relationId)) && \App\Privilege::isPermitted($row['related_modulename'])) {

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

                        return $links;

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

                            ];

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

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

                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

                        return $links;

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

                            if (!$this->isEmpty('header_fields')) {

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

                                $customView = App\CustomView::getInstance($this->getModule()->getName());

                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

                                            'uitype' => 10,

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

                                        ], 'relationColumn_' . $relationId);

                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

                            $queryGenerator->setField('id');

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

                                $fieldName = $fieldInfo['field_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

                                        $headerFields[] = $field;

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

                                            'label' => $row['label'],

                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

                        foreach ($massActionLinks as $massActionLink) {

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

                            $basicLinks[] = [

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

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

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

                                $basicLinks[] = [

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

                        foreach ($basicLinks as $basicLink) {

                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

                                        $queryGenerator->setField($field->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

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

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

                        $links = ['LISTVIEWBASIC' => []];

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

                            $links['LISTVIEWBASIC'][] = Vtiger_Link_Model::getInstanceFromValues($basicLink);

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

                                foreach ($allLinksByType as $linkModel) {

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

                                }

                Line exceeds 120 characters; contains 125 characters
                Open

                            if (($advancedConditions = $this->get('advancedConditions')) && !empty($advancedConditions['relationColumns'])) {

                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['LISTVIEWMASSACTION'][] = Vtiger_Link_Model::getInstanceFromValues($massActionLink);

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

                                'showLabel' => 1,

                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

                        foreach ($advancedLinks as $advancedLink) {

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

                            $queryGenerator->setFields(array_values($this->getModule()->getPopupFields()));

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

                                $fields = $this->get('header_fields');

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

                                if (!empty($fieldInfo['label'])) {

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

                                    $fieldModel->set('isCalculateField', false);

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

                                        $headerFields[] = Vtiger_Field_Model::init($row['related_modulename'], [

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

                                            'permissions' => true,

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

                     */

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

                                [$fieldName, $moduleName, $sourceFieldName] = array_pad(explode(':', $fieldName), 3, false);

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

                                } elseif (isset($fields[$fieldName])) {

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

                            $queryGenerator->setAdvancedConditions($advancedConditions);

                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 ('s' === $operator && 1 === \strlen($searchValue)) {

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

                        if ($sourceModule) {

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

                     * @param Vtiger_Paging_Model $pagingModel

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

                        $this->loadListViewCondition();

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

                        $query = $this->getQueryGenerator()->createQuery();

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

                        $count = \count($rows);

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

                    public function getAllEntries()

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

                     * @param array $rows

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

                        return $headerFieldModels;

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

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

                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

                        if ($searchParams = $this->get('search_params')) {

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

                        if ($operator = $this->get('operator')) {

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

                        if ($searchResult && \is_array($searchResult)) {

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

                                $moduleModel->getQueryByModuleField($sourceModule, $this->get('src_field'), $this->get('src_record'), $queryGenerator);

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

                        if ($count > $pageLimit) {

                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->loadListViewCondition();

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

                        $listViewRecordModels = $relatedFields = [];

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

                                }

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

                            $recordModel = $moduleModel->getRecordFromArray($row);

                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 ($sourceFieldName && isset($fields[$sourceFieldName])) {

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

                                        'relatedSortOrder' => $sortFlag,

                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 list view entries.

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

                    public function getListViewEntries(Vtiger_Paging_Model $pagingModel)

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

                        $listViewRecordModels = $this->getRecordsFromArray($rows);

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

                     * Function to get the list view all entries.

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

                    /**

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

                                        unset($row[$sourceField . $relatedModuleName . $relatedFieldName]);

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

                            }

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

                            $listViewRecordModels[$row['id']] = $recordModel;

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

                    }

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

                    /**

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

                     * Function to get the list view entries count.

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

                                        'relatedModule' => $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

                        if ($entityState = $this->get('entityState')) {

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

                        }

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

                        }

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

                    {

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

                        $this->loadListViewOrderBy();

                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

                            $extRecordModel = [];

                Line exceeds 120 characters; contains 183 characters
                Open

                            $name = $fieldModel->get('source_field_name') ? "{$fieldModel->getName()}:{$fieldModel->getModuleName()}:{$fieldModel->get('source_field_name')}" : $fieldModel->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

                        }

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

                     * @return Vtiger_Record_Model[] - Associative array of record id mapped to Vtiger_Record_Model instance.

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

                        $this->loadListViewOrderBy();

                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

                                foreach ($fields as $sourceField => $field) {

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

                                    $extRecordModel[$sourceField][$relatedModuleName] = Vtiger_Module_Model::getInstance($relatedModuleName)->getRecordFromArray($recordData);

                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

                            $queryGenerator->setStateCondition($entityState);

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

                        $srcRecord = $this->get('src_record');

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

                            $searchValue = $this->get('search_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

                        $pagingModel->calculatePageRange($count);

                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 $this->getRecordsFromArray($this->getQueryGenerator()->createQuery()->all());

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

                            $headerFieldModels[$name] = $fieldModel;

                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

                                $searchValue = [$searchValue, strtolower($searchValue)];

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

                            if (method_exists($moduleModel, 'getQueryByRelatedField')) {

                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 int|string|null number of records. The result may be a string depending on the

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

                    {

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

                                        'id' => $row[$sourceField . $relatedModuleName . 'id'] ?? 0,

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

                            $recordModel->ext = $extRecordModel;

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

                                        'sourceField' => $sourceFieldName,

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

                            if (method_exists($moduleModel, 'getQueryByModuleField')) {

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

                            $pagingModel->set('nextPageExists', true);

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

                    }

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

                     * @return \Vtiger_Record_Model[]

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

                    }

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

                        }

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

                    }

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

                    /**

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

                    }

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

                            foreach ($relatedFields as $relatedModuleName => $fields) {

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

                                    $recordData = [

                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->addCondition('id', $srcRecord, 'n');

                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

                        $pageLimit = $pagingModel->getPageLimit();

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

                        $query->limit($pageLimit + 1)->offset($pagingModel->getStartIndex());

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

                        unset($rows);

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

                        return $listViewRecordModels;

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

                     */

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

                     * Get models of records from array.

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

                            $relatedFields[$fieldInfo['relatedModule']][$fieldInfo['sourceField']][] = $fieldInfo['relatedField'];

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

                                    ];

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

                        $orderBy = $this->get('orderby');

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

                            $fields = $this->getModule()->getFields();

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

                                    $this->getQueryGenerator()->setRelatedOrder([

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

                                        'relatedField' => $fieldName,

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

                            $queryGenerator->addCondition($searchKey, $searchValue, $operator);

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

                        $searchResult = $this->get('searchResult');

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

                            $queryGenerator->addNativeCondition(['vtiger_crmentity.crmid' => $searchResult]);

                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

                        foreach ($this->getQueryGenerator()->getRelatedFields() as $fieldInfo) {

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

                        foreach ($rows as $row) {

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

                                    foreach ($field as $relatedFieldName) {

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

                                    }

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

                            $name = $fieldModel->get('source_field_name') ? "{$fieldModel->getName()}:{$fieldModel->getModuleName()}:{$fieldModel->get('source_field_name')}" : $fieldModel->getName();

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

                     * Set list view order by.

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

                    public function loadListViewOrderBy()

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

                        }

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

                                $moduleModel->getQueryByRelatedField($this, $queryGenerator);

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

                     * @return Vtiger_Record_Model[] - Associative array of record id mapped to Vtiger_Record_Model instance.

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

                            array_pop($rows);

                Line exceeds 120 characters; contains 158 characters
                Open

                                    $extRecordModel[$sourceField][$relatedModuleName] = Vtiger_Module_Model::getInstance($relatedModuleName)->getRecordFromArray($recordData);

                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 ($orderBy as $fieldName => $sortFlag) {

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

                            $queryGenerator->parseAdvFilter($searchParams);

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

                        $rows = $query->all();

                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

                                    $this->getQueryGenerator()->setOrder($fieldName, $sortFlag);

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

                        if ($this->getModule()->get('name') === $this->get('src_module') && !empty($srcRecord)) {

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

                            $searchKey = $this->get('search_key');

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

                        $sourceModule = $this->get('src_module');

                Line exceeds 120 characters; contains 135 characters
                Open

                                $moduleModel->getQueryByModuleField($sourceModule, $this->get('src_field'), $this->get('src_record'), $queryGenerator);

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

                    public function getRecordsFromArray(array $rows)

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

                        }

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

                                        $recordData[$relatedFieldName] = $row[$sourceField . $relatedModuleName . $relatedFieldName];

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

                        return $listViewRecordModels;

                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

                     * Load list view 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

                        if ($advancedConditions = $this->get('advancedConditions')) {

                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

                            $pagingModel->set('nextPageExists', 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

                     *

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

                     *                         underlying database engine and to support integer values higher than a 32bit PHP integer can handle.

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

                    public function getListViewCount()

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

                    }

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

                     * Locked fields according to parameters passed.

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

                     * @param App\Request $request

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

                     */

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

                        }

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

                                    $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);

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

                                if (strpos($value, ':')) {

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

                                    $value = $fieldName;

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

                     *

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

                        if (!$request->isEmpty('lockedFields')) {

                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

                        $moduleModel = $this->getModule();

                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 $this->getQueryGenerator()->setDistinct('id')->createQuery()->count();

                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

                                $moduleModel->getFieldByName($value)->set('searchLockedFields', true);

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

                     */

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

                        $this->loadListViewCondition();

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

                    public function loadSearchLockedFields(App\Request $request): void

                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 ($request->getArray('lockedEmptyFields') as $value) {

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

                                $moduleModel->getFieldByName($value)->set('searchLockedEmptyFields', true);

                Line exceeds 120 characters; contains 131 characters
                Open

                     *                         underlying database engine and to support integer values higher than a 32bit PHP integer can handle.

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

                        if (!$request->isEmpty('lockedEmptyFields')) {

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

                                    [$fieldName, $moduleName] = explode(':', $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

                            foreach ($request->getArray('lockedFields') as $value) {

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

                     * @return void

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

                            }

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

                class Vtiger_ListView_Model extends \App\Base

                There are no issues that match your filters.

                Category
                Status