YetiForceCompany/YetiForceCRM

View on GitHub
modules/Vtiger/views/List.php

Summary

Maintainability
D
1 day
Test Coverage
B
86%

process accesses the super-global variable $_SESSION.
Open

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        if ($request->isAjax()) {
Severity: Minor
Found in modules/Vtiger/views/List.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

preProcess accesses the super-global variable $_SESSION.
Open

    public function preProcess(App\Request $request, $display = true)
    {
        parent::preProcess($request, false);

        $moduleName = $request->getModule();
Severity: Minor
Found in modules/Vtiger/views/List.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

preProcess accesses the super-global variable $_SESSION.
Open

    public function preProcess(App\Request $request, $display = true)
    {
        parent::preProcess($request, false);

        $moduleName = $request->getModule();
Severity: Minor
Found in modules/Vtiger/views/List.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Function initializeListViewContents has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
    {
        $moduleName = $request->getModule();
        $pageNumber = $request->getInteger('page');
        $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
Severity: Minor
Found in modules/Vtiger/views/List.php - About 4 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 initializeListViewContents has 105 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
    {
        $moduleName = $request->getModule();
        $pageNumber = $request->getInteger('page');
        $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
Severity: Major
Found in modules/Vtiger/views/List.php - About 4 hrs to fix

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

    class Vtiger_List_View extends Vtiger_Index_View
    {
        protected $listViewEntries = false;
        protected $listViewCount = false;
        protected $listViewLinks = false;
    Severity: Minor
    Found in modules/Vtiger/views/List.php by phpmd

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

        public function process(App\Request $request)
        {
            $viewer = $this->getViewer($request);
            $moduleName = $request->getModule();
            if ($request->isAjax()) {
    Severity: Minor
    Found in modules/Vtiger/views/List.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        public function process(App\Request $request)
        {
            $viewer = $this->getViewer($request);
            $moduleName = $request->getModule();
            if ($request->isAjax()) {
    Severity: Minor
    Found in modules/Vtiger/views/List.php - About 1 hr to fix

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

          public function preProcess(App\Request $request, $display = true)
          {
              parent::preProcess($request, false);
      
              $moduleName = $request->getModule();
      Severity: Minor
      Found in modules/Vtiger/views/List.php - About 1 hr to fix

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

            public function preProcess(App\Request $request, $display = true)
            {
                parent::preProcess($request, false);
        
                $moduleName = $request->getModule();
        Severity: Minor
        Found in modules/Vtiger/views/List.php - About 35 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        The method initializeListViewContents() has an NPath complexity of 884736. The configured NPath complexity threshold is 200.
        Open

            public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
            {
                $moduleName = $request->getModule();
                $pageNumber = $request->getInteger('page');
                $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 initializeListViewContents() has 109 lines of code. Current threshold is set to 100. Avoid really long methods.
        Open

            public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
            {
                $moduleName = $request->getModule();
                $pageNumber = $request->getInteger('page');
                $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phpmd

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

            public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
            {
                $moduleName = $request->getModule();
                $pageNumber = $request->getInteger('page');
                $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 process() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
        Open

            public function process(App\Request $request)
            {
                $viewer = $this->getViewer($request);
                $moduleName = $request->getModule();
                if ($request->isAjax()) {
        Severity: Minor
        Found in modules/Vtiger/views/List.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 37 to the 15 allowed.
        Open

            public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
        Severity: Critical
        Found in modules/Vtiger/views/List.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 20 to the 15 allowed.
        Open

            public function process(App\Request $request)
        Severity: Critical
        Found in modules/Vtiger/views/List.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_List_View has a coupling between objects value of 14. Consider to reduce the number of dependencies under 13.
        Open

        class Vtiger_List_View extends Vtiger_Index_View
        {
            protected $listViewEntries = false;
            protected $listViewCount = false;
            protected $listViewLinks = false;
        Severity: Minor
        Found in modules/Vtiger/views/List.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 preProcess has a boolean flag argument $display, which is a certain sign of a Single Responsibility Principle violation.
        Open

            public function preProcess(App\Request $request, $display = true)
        Severity: Minor
        Found in modules/Vtiger/views/List.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 '218', column '22').
        Open

                $pagingModel = new Vtiger_Paging_Model();
        Severity: Minor
        Found in modules/Vtiger/views/List.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

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

            public function postProcess(App\Request $request, $display = true)
        Severity: Minor
        Found in modules/Vtiger/views/List.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

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

                    if ($this->viewName && App\CustomView::hasViewChanged($moduleName, $this->viewName)) {
        Severity: Minor
        Found in modules/Vtiger/views/List.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 initializeListViewContents uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $searchParamsRaw = $searchParams = [];
                }
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'CustomView_Record_Model' in method 'getPageTitle'.
        Open

        }
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'getBreadcrumbTitle'.
        Open

                        . ': ' . \App\Language::translate($customView->get('viewname'), $moduleName) . ']</small> </div>';
        Severity: Minor
        Found in modules/Vtiger/views/List.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 process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                    } else {
                        App\CustomView::setSortBy($moduleName, $orderBy);
                        if ($request->has('page')) {
                            App\CustomView::setCurrentPage($moduleName, $this->viewName, $request->getInteger('page'));
                        }
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'CustomView_Record_Model' in method 'getBreadcrumbTitle'.
        Open

        }
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'CustomView_Record_Model' in method 'preProcess'.
        Open

                    $customViewModel = CustomView_Record_Model::getInstanceById($this->viewName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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\CustomView' in method 'process'.
        Open

                        App\CustomView::setCurrentView($moduleName, $this->viewName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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\CustomView' in method 'process'.
        Open

                        App\CustomView::setSortBy($moduleName, $orderBy);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'CRMEntity' in method 'initializeListViewContents'.
        Open

                    $moduleInstance = CRMEntity::getInstance($moduleName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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\CustomView' in method 'initializeListViewContents'.
        Open

                    $pageNumber = App\CustomView::getCurrentPage($moduleName, $this->viewName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 initializeListViewContents uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $advancedConditions = $this->listViewModel->get('advancedConditionsRaw');
                }
        Severity: Minor
        Found in modules/Vtiger/views/List.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 '122', column '22').
        Open

            public function process(App\Request $request)
            {
                $viewer = $this->getViewer($request);
                $moduleName = $request->getModule();
                if ($request->isAjax()) {
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'process'.
        Open

                            App\CustomView::setSortBy($moduleName, $orderBy ?: $customViewModel->getSortOrderBy());
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'getPageTitle'.
        Open

                $title = App\Language::translate($moduleName, $moduleName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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_ListView_Model' in method 'preProcess'.
        Open

                $this->listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $this->viewName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'initializeListViewContents'.
        Open

                    $searchValue = App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $searchKey, $operator);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'initializeListViewContents'.
        Open

                if (App\Config::performance('LISTVIEW_COMPUTE_PAGE_COUNT')) {
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'CustomView_Record_Model' in method 'preProcess'.
        Open

                $viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($moduleName, $mid));
        Severity: Minor
        Found in modules/Vtiger/views/List.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\CustomView' in method 'process'.
        Open

                            App\CustomView::setCurrentPage($moduleName, $this->viewName, $request->getInteger('page'));
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'preProcess'.
        Open

                $viewer->assign('MODULE_MODEL', Vtiger_Module_Model::getInstance($moduleName));
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'CustomView_Record_Model' in method 'process'.
        Open

                        if ($orderBy || ($customViewModel = CustomView_Record_Model::getInstanceById($this->viewName))) {
        Severity: Minor
        Found in modules/Vtiger/views/List.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\CustomView' in method 'preProcess'.
        Open

                if ($this->viewName && $request->isEmpty('viewname') && App\CustomView::hasViewChanged($moduleName, $this->viewName)) {
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'CustomView_Record_Model' in method 'getBreadcrumbTitle'.
        Open

        }
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'getPageTitle'.
        Open

                    $title .= ' [' . App\Language::translate('LBL_FILTER', $moduleName) . ': ' . App\Language::translate($customView->get('viewname'), $moduleName) . ']';
        Severity: Minor
        Found in modules/Vtiger/views/List.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\CustomView' in method 'preProcess'.
        Open

                        App\CustomView::setSortBy($moduleName, $customViewModel->getSortOrderBy());
        Severity: Minor
        Found in modules/Vtiger/views/List.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\CustomView' in method 'preProcess'.
        Open

                    App\CustomView::setCurrentView($moduleName, $this->viewName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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_ListView_Model' in method 'initializeListViewContents'.
        Open

                    $this->listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $this->viewName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'getBreadcrumbTitle'.
        Open

                $title = \App\Language::translate($this->pageTitle, $moduleName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 '198', column '28').
        Open

            public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)
            {
                $moduleName = $request->getModule();
                $pageNumber = $request->getInteger('page');
                $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'initializeListViewContents'.
        Open

                if (empty($orderBy) && !($orderBy = App\CustomView::getSortBy($moduleName))) {
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'process'.
        Open

                    $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'initializeListViewContents'.
        Open

                    $this->listViewModel->set('advancedConditions', \App\Condition::validAdvancedConditions($advancedConditions));
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'initializeListViewContents'.
        Open

                $searchParams = App\Condition::validSearchParams($moduleName, $request->getArray('search_params'));
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'getPageTitle'.
        Open

                $title = $title . ' ' . App\Language::translate($this->pageTitle, $moduleName);
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'getPageTitle'.
        Open

                    $title .= ' [' . App\Language::translate('LBL_FILTER', $moduleName) . ': ' . App\Language::translate($customView->get('viewname'), $moduleName) . ']';
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'getBreadcrumbTitle'.
        Open

                    $title .= '<div class="pl-1 pb-1 align-items-end"><small class="breadCrumbsFilter"> [' . \App\Language::translate('LBL_FILTER', $moduleName)
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'process'.
        Open

                    $viewer->assign('MODULE_MODEL', Vtiger_Module_Model::getInstance($moduleName));
        Severity: Minor
        Found in modules/Vtiger/views/List.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 'CustomView_Record_Model' in method 'getPageTitle'.
        Open

        }
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                    $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);
        Severity: Critical
        Found in modules/Vtiger/views/List.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 "viewname" 9 times.
        Open

                if ($request->has('viewname') && !empty(CustomView_Record_Model::getAll($moduleName)[$request->getByType('viewname', 2)])) {
        Severity: Critical
        Found in modules/Vtiger/views/List.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 "search_key" 3 times.
        Open

                if (!$request->isEmpty('search_key', true)) {
        Severity: Critical
        Found in modules/Vtiger/views/List.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 "operator" 3 times.
        Open

                if (!$request->isEmpty('operator', true)) {
        Severity: Critical
        Found in modules/Vtiger/views/List.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 "search_params" 3 times.
        Open

                $searchParams = App\Condition::validSearchParams($moduleName, $request->getArray('search_params'));
        Severity: Critical
        Found in modules/Vtiger/views/List.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

                $linkParams = ['MODULE' => $moduleName, 'ACTION' => $request->getByType('view', 1)];
        Severity: Critical
        Found in modules/Vtiger/views/List.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

                $advancedConditions = $request->has('advancedConditions') ? $request->getArray('advancedConditions') : [];
        Severity: Critical
        Found in modules/Vtiger/views/List.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 "entityState" 9 times.
        Open

                if (isset($_SESSION['lvs'][$moduleName]['entityState'])) {
        Severity: Critical
        Found in modules/Vtiger/views/List.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 "searchResult" 3 times.
        Open

                if (!$request->isEmpty('searchResult', true)) {
        Severity: Critical
        Found in modules/Vtiger/views/List.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.

        Reference to undeclared property \CRMEntity->default_order_by
        Open

                        foreach ((array) $moduleInstance->default_order_by as $value) {
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phan

        Assigning \Vtiger_Record_Model[] to property but \Vtiger_List_View->listViewEntries is false
        Open

                    $this->listViewEntries = $this->listViewModel->getListViewEntries($pagingModel);
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('LISTVIEW_MASSACTIONS', $linkModels['LISTVIEWMASSACTION'] ?? []);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('MODULE_MODEL', Vtiger_Module_Model::getInstance($moduleName));
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Variable $searchParamsRaw was undeclared, but array fields are being added to it.
        Open

                        $searchParamsRaw[] = $fieldListGroup;
        Severity: Info
        Found in modules/Vtiger/views/List.php by phan

        Assigning array<int>[]|array{LISTVIEW:array<int>}|array{LISTVIEWBASIC:array<int>}|array{LISTVIEWBASIC:array{}}</int></int></int> to property but \Vtiger_List_View->listViewLinks is false
        Open

                    $this->listViewLinks = $this->listViewModel->getListViewLinks($linkParams);
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phan

        Reference to undeclared property \CRMEntity->default_sort_order
        Open

                    if ($moduleInstance->default_order_by && $moduleInstance->default_sort_order) {
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('MODULE', $moduleName);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('VIEW', $request->getByType('view', 1));
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('PAGE_NUMBER', $pageNumber);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('VIEW_MODEL', $this->listViewModel);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Argument 1 (var) is false but \count() takes \Countable|array
        Open

                $noOfEntries = \count($this->listViewEntries);
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                    $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                    $viewer->assign('MODULE_MODEL', Vtiger_Module_Model::getInstance($moduleName));
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                    $viewer->assign('OPERATOR', $operator);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Reference to undeclared property \CRMEntity->default_order_by
        Open

                    if ($moduleInstance->default_order_by && $moduleInstance->default_sort_order) {
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($moduleName, $mid));
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                    $viewer->assign('VIEWID', $this->viewName);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Assigning int|null|string to property but \Vtiger_List_View->listViewCount is false
        Open

                        $this->listViewCount = $this->listViewModel->getListViewCount();
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('HEADER_LINKS', $this->listViewModel->getHederLinks($linkParams));
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

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

                    $transformedSearchParams = $this->listViewModel->getQueryGenerator()->parseBaseSearchParamsToCondition($searchParams);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('MID', $mid);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                    $viewer->assign('ALPHABET_VALUE', $searchValue);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('LISTVIEW_LINKS', $this->listViewLinks);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('PAGING_MODEL', $pagingModel);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('SEARCH_DETAILS', $searchParams);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('VIEWID', $this->viewName);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('SEARCH_PARAMS', $searchParamsRaw);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                    $viewer->assign('MODULE_NAME', $moduleName);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Reference to undeclared property \CRMEntity->default_sort_order
        Open

                            $orderBy[$value] = $moduleInstance->default_sort_order;
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phan

        Assigning \Vtiger_Field_Model[] to property but \Vtiger_List_View->listViewHeaders is false
        Open

                    $this->listViewHeaders = $this->listViewModel->getListViewHeaders();
        Severity: Minor
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('IS_MODULE_EDITABLE', $this->listViewModel->getModule()->isPermitted('CreateView'));
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('ADVANCED_CONDITIONS', $advancedConditions);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('START_PAGIN_FROM', $pagingModel->getStartPagingFrom());
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('LOCKED_EMPTY_FIELDS', $request->isEmpty('lockedEmptyFields', true) ? [] : $request->getArray('lockedEmptyFields'));
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('ORDER_BY', $orderBy);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('LISTVIEW_COUNT', $totalCount);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('PAGE_COUNT', $pagingModel->getPageCount());
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('IS_MODULE_DELETABLE', $this->listViewModel->getModule()->isPermitted('Delete'));
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);
        Severity: Critical
        Found in modules/Vtiger/views/List.php by phan

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

                    foreach ($request->getArray('search_params') as $fieldListGroup) {
                        $searchParamsRaw[] = $fieldListGroup;
                        foreach ($fieldListGroup as $fieldSearchInfo) {
                            $fieldSearchInfo['searchValue'] = $fieldSearchInfo[2];
                            $fieldSearchInfo['fieldName'] = $fieldName = $fieldSearchInfo[0];
        Severity: Major
        Found in modules/Vtiger/views/List.php and 1 other location - About 1 hr to fix
        modules/Vtiger/views/RecordsList.php on lines 187..195

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

        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 $transformedSearchParams. Keep variable name length under 20.
        Open

                    $transformedSearchParams = $this->listViewModel->getQueryGenerator()->parseBaseSearchParamsToCondition($searchParams);
        Severity: Minor
        Found in modules/Vtiger/views/List.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_List_View extends Vtiger_Index_View

        The class Vtiger_List_View is not named in CamelCase.
        Open

        class Vtiger_List_View extends Vtiger_Index_View
        {
            protected $listViewEntries = false;
            protected $listViewCount = false;
            protected $listViewLinks = false;
        Severity: Minor
        Found in modules/Vtiger/views/List.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

            protected $listViewHeaders = false;

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

                $moduleName = $request->getModule();

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

            protected $listViewCount = 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

                $moduleName = 'Vtiger' === $moduleName ? 'YetiForce' : $moduleName;

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

                    $title .= ' [' . App\Language::translate('LBL_FILTER', $moduleName) . ': ' . App\Language::translate($customView->get('viewname'), $moduleName) . ']';

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

             * Page title.

        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

             * @var string

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

                if ($request->has('viewname') && !empty(CustomView_Record_Model::getAll($moduleName)[$request->getByType('viewname', 2)])) {

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

             * List view model instance.

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

            public function getPageTitle(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

            /** {@inheritdoc} */

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

            protected $listViewLinks = false;

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

            protected $listViewModel;

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

            protected $listViewEntries = false;

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

            /**

        Line exceeds 120 characters; contains 132 characters
        Open

                if ($request->has('viewname') && !empty(CustomView_Record_Model::getAll($moduleName)[$request->getByType('viewname', 2)])) {

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

            protected $viewName;

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

            /** {@inheritdoc} */

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

             */

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

                }

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

            /** @var int|string List view name or id. */

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

                    $customView = CustomView_Record_Model::getAll($moduleName)[$request->getByType('viewname', 2)];

        Line exceeds 120 characters; contains 132 characters
        Open

                if ($request->has('viewname') && !empty(CustomView_Record_Model::getAll($moduleName)[$request->getByType('viewname', 2)])) {

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

                $title = App\Language::translate($moduleName, $moduleName);

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

                return $title;

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

            public function getBreadcrumbTitle(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

                $title = \App\Language::translate($this->pageTitle, $moduleName);

        Line exceeds 120 characters; contains 162 characters
        Open

                    $title .= ' [' . App\Language::translate('LBL_FILTER', $moduleName) . ': ' . App\Language::translate($customView->get('viewname'), $moduleName) . ']';

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

                        App\CustomView::setSortBy($moduleName, $customViewModel->getSortOrderBy());

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

                    if ($request->has('entityState')) {

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

            public function getProcessTemplate(): string

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

                    "modules.$moduleName.resources.CustomView",

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

                    if ($moduleInstance->default_order_by && $moduleInstance->default_sort_order) {

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

                        $orderBy = [];

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

                if (empty($pageNumber)) {

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

                    $customView = CustomView_Record_Model::getAll($moduleName)[$request->getByType('viewname', 2)];

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

                    $this->listViewModel->set('entityState', $_SESSION['lvs'][$moduleName]['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

                        if ($orderBy || ($customViewModel = CustomView_Record_Model::getInstanceById($this->viewName))) {

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

                    }

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

                }

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

             *

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

             * Function to get the list of Script models to be included.

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

                    "modules.$moduleName.resources.List",

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

             */

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

                if (!$this->listViewModel) {

        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

                parent::preProcess($request, false);

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

                $mid = 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

                return 'ListViewContents.tpl';

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

                $moduleName = $request->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

                    $this->preProcessDisplay($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

                $viewer = $this->getViewer($request);

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

                        if ($request->has('page')) {

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

                    'modules.Vtiger.resources.List',

        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

                    "modules.$moduleName.resources.ListSearch",

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

                if ($request->isAjax()) {

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

                        App\CustomView::setCurrentView($moduleName, $this->viewName);

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

            public function initializeListViewContents(App\Request $request, Vtiger_Viewer $viewer)

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

                    $viewer->assign('MODULE_MODEL', Vtiger_Module_Model::getInstance($moduleName));

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

                    $moduleInstance = CRMEntity::getInstance($moduleName);

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

                if (!$request->isEmpty('searchResult', 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

                    $pageNumber = App\CustomView::getCurrentPage($moduleName, $this->viewName);

        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->listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $this->viewName);

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

                $viewer = $this->getViewer($request);

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

                $viewer->assign('HEADER_LINKS', $this->listViewModel->getHederLinks($linkParams));

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

                $viewer->assign('MODULE_MODEL', Vtiger_Module_Model::getInstance($moduleName));

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

            public function preProcessTplName(App\Request $request)

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

                    if ($this->viewName && App\CustomView::hasViewChanged($moduleName, $this->viewName)) {

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

                    $viewer->assign('VIEWID', $this->viewName);

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

                $viewer->assign('VIEW', $request->getByType('view', 1));

        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

                $moduleName = $request->getModule();

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

             * @return Vtiger_JsScript_Model[] - List of Vtiger_JsScript_Model instances

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

                $orderBy = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);

        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->initializeListViewContents($request, $viewer);

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

            public function process(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

                        $_SESSION['lvs'][$moduleName]['entityState'] = $request->getByType('entityState');

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

                    $viewer->assign('MODULE_NAME', $moduleName);

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

                $viewer->view('ListViewPostProcess.tpl', $moduleName);

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

                    'modules.CustomView.resources.CustomView',

        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

                            App\CustomView::setSortBy($moduleName, $orderBy ?: $customViewModel->getSortOrderBy());

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

                        }

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

                        App\CustomView::setSortBy($moduleName, $orderBy);

        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

                $title = $title . ' ' . App\Language::translate($this->pageTitle, $moduleName);

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

                return $title;

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

                if ($request->has('mid')) {

        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->listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $this->viewName);

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

                if ($display) {

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

                $moduleName = $request->getModule();

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

             * Get template name for process.

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

                $moduleName = $request->getModule();

        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

                    $mid = $request->getInteger('mid');

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

                $this->viewName = App\CustomView::getInstance($moduleName)->getViewId();

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

                if ($this->viewName && $request->isEmpty('viewname') && App\CustomView::hasViewChanged($moduleName, $this->viewName)) {

        Line exceeds 120 characters; contains 127 characters
        Open

                if ($this->viewName && $request->isEmpty('viewname') && App\CustomView::hasViewChanged($moduleName, $this->viewName)) {

        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

                    $viewer->assign('USER_MODEL', Users_Record_Model::getCurrentUserModel());

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

                $viewer->view($this->getProcessTemplate(), $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

                $jsFileNames = [

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

             * Function to initialize the required data in smarty to display the List View Contents.

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

                if ($request->has('viewname') && !empty(CustomView_Record_Model::getAll($moduleName)[$request->getByType('viewname', 2)])) {

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

                $moduleName = $request->getModule();

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

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

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

             * @return string

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

            public function postProcess(App\Request $request, $display = true)

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

             *

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

                if (empty($orderBy) && !($orderBy = App\CustomView::getSortBy($moduleName))) {

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

                $linkParams = ['MODULE' => $moduleName, 'ACTION' => $request->getByType('view', 1)];

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

                    App\CustomView::setCurrentView($moduleName, $this->viewName);

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

            }

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

            /** {@inheritdoc} */

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

                parent::postProcess($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

            public function getFooterScripts(App\Request $request)

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

                    'modules.Vtiger.resources.ListSearch',

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

                return array_merge(parent::getFooterScripts($request), $this->checkAndConvertJsScripts($jsFileNames));

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

             * @param Vtiger_Viewer $viewer

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

            /**

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

            protected $pageTitle = 'LBL_VIEW_LIST';

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

             * @var Vtiger_ListView_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

                    $customViewModel = CustomView_Record_Model::getInstanceById($this->viewName);

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

                $viewer->assign('MID', $mid);

        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 = $request->getArray('orderby', \App\Purifier::STANDARD, [], \App\Purifier::SQL);

        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

                $viewer = $this->getViewer($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

                $pageNumber = $request->getInteger('page');

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

                    $this->listViewModel->set('searchResult', $request->getArray('searchResult', 'Integer'));

        Line exceeds 120 characters; contains 152 characters
        Open

                    $title .= '<div class="pl-1 pb-1 align-items-end"><small class="breadCrumbsFilter"> [' . \App\Language::translate('LBL_FILTER', $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

             * Pre process.

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

                    $title .= '<div class="pl-1 pb-1 align-items-end"><small class="breadCrumbsFilter"> [' . \App\Language::translate('LBL_FILTER', $moduleName)

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

             * @param bool         $display

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

                        . ': ' . \App\Language::translate($customView->get('viewname'), $moduleName) . ']</small> </div>';

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

                $moduleName = $request->getModule();

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

            public function preProcess(App\Request $request, $display = true)

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

                $viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAllByGroup($moduleName, $mid));

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

            {

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

                if (isset($_SESSION['lvs'][$moduleName]['entityState'])) {

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

                return 'ListViewPreProcess.tpl';

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

            /** {@inheritdoc} */

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

            /** {@inheritdoc} */

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

            }

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

                        $this->viewName = App\CustomView::getInstance($moduleName)->getViewId();

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

                    $this->initializeListViewContents($request, $viewer);

        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

                        foreach ((array) $moduleInstance->default_order_by as $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

                            $orderBy[$value] = $moduleInstance->default_sort_order;

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

                    if ($customViewModel) {

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

                $viewer->assign('VIEWID', $this->viewName);

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

                            App\CustomView::setCurrentPage($moduleName, $this->viewName, $request->getInteger('page'));

        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('page', $pageNumber);

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

                $operator = 's';

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

                $searchParams = App\Condition::validSearchParams($moduleName, $request->getArray('search_params'));

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

                $viewer->assign('LISTVIEW_LINKS', $this->listViewLinks);

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

                    $pagingModel->set('totalCount', (int) $this->listViewCount);

        Line exceeds 120 characters; contains 140 characters
        Open

                $viewer->assign('LOCKED_EMPTY_FIELDS', $request->isEmpty('lockedEmptyFields', true) ? [] : $request->getArray('lockedEmptyFields'));

        Line exceeds 120 characters; contains 125 characters
        Open

                $linkParams = ['MODULE' => $moduleName, 'ACTION' => $request->getByType('view', 'Alnum'), 'CVID' => $this->viewName];

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

                if (!$this->listViewHeaders) {

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

                $viewer->assign('PAGE_NUMBER', $pageNumber);

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

                $linkModels = $this->listViewModel->getListViewMassActions($linkParams);

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

                $pagingModel = new Vtiger_Paging_Model();

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

                if ($advancedConditions) {

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

                            $fieldSearchInfo['searchValue'] = $fieldSearchInfo[2];

        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

                $totalCount = false;

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

                    $totalCount = (int) $this->listViewCount;

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

                $viewer->assign('IS_MODULE_EDITABLE', $this->listViewModel->getModule()->isPermitted('CreateView'));

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

                if (!$request->isEmpty('operator', true)) {

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

                    $this->listViewModel->set('search_key', $searchKey);

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

                    $this->listViewModel->set('search_value', $searchValue);

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

                }

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

                $viewer->assign('ORDER_BY', $orderBy);

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

                if (App\Config::performance('LISTVIEW_COMPUTE_PAGE_COUNT')) {

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

                $linkParams = ['MODULE' => $moduleName, 'ACTION' => $request->getByType('view', 'Alnum'), 'CVID' => $this->viewName];

        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

                    $transformedSearchParams = $this->listViewModel->getQueryGenerator()->parseBaseSearchParamsToCondition($searchParams);

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

                        foreach ($fieldListGroup as $fieldSearchInfo) {

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

                            $fieldSearchInfo['fieldName'] = $fieldName = $fieldSearchInfo[0];

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

                if (!$this->listViewEntries) {

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

                }

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

                $viewer->assign('LISTVIEW_MASSACTIONS', $linkModels['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

                $viewer->assign('START_PAGIN_FROM', $pagingModel->getStartPagingFrom());

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

                    $viewer->assign('ALPHABET_VALUE', $searchValue);

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

                    $this->listViewModel->set('search_params', $transformedSearchParams);

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

                    $this->listViewLinks = $this->listViewModel->getListViewLinks($linkParams);

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

                $viewer->assign('LISTVIEW_ENTRIES_COUNT', $noOfEntries);

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

                }

        Line exceeds 120 characters; contains 122 characters
        Open

                    $this->listViewModel->set('advancedConditions', \App\Condition::validAdvancedConditions($advancedConditions));

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

                    //To make smarty to get the details easily accesible

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

                    $searchParamsRaw = $searchParams = [];

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

                    $this->listViewEntries = $this->listViewModel->getListViewEntries($pagingModel);

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

                $viewer->assign('IS_MODULE_DELETABLE', $this->listViewModel->getModule()->isPermitted('Delete'));

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

                    $this->listViewModel->set('entityState', $request->getByType('entityState'));

        Line exceeds 120 characters; contains 130 characters
        Open

                    $transformedSearchParams = $this->listViewModel->getQueryGenerator()->parseBaseSearchParamsToCondition($searchParams);

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

                            $searchParams[$fieldName] = $fieldSearchInfo;

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

                    $this->listViewHeaders = $this->listViewModel->getListViewHeaders();

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

                }

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

                    $searchKey = $request->getByType('search_key', 'Alnum');

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

                    $searchValue = App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $searchKey, $operator);

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

                $viewer->assign('PAGE_COUNT', $pagingModel->getPageCount());

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

                $viewer->assign('ADVANCED_CONDITIONS', $advancedConditions);

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

                $viewer->assign('LOCKED_EMPTY_FIELDS', $request->isEmpty('lockedEmptyFields', true) ? [] : $request->getArray('lockedEmptyFields'));

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

                    $viewer->assign('OPERATOR', $operator);

        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

                $viewer->assign('MODULE', $moduleName);

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

                $viewer->assign('LISTVIEW_ENTRIES', $this->listViewEntries);

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

                $viewer->assign('LISTVIEW_COUNT', $totalCount);

        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->listViewModel->set('operator', $operator);

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

                if (!$request->isEmpty('search_key', true)) {

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

                    $this->listViewModel->loadSearchLockedFields($request);

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

                    foreach ($request->getArray('search_params') as $fieldListGroup) {

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

                $viewer->assign('PAGING_MODEL', $pagingModel);

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

                    if (!$this->listViewCount) {

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

                $viewer->assign('VIEW_MODEL', $this->listViewModel);

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

                $pagingModel->set('viewid', $this->viewName);

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

                    $this->listViewModel->set('advancedConditions', \App\Condition::validAdvancedConditions($advancedConditions));

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

                            $fieldSearchInfo['specialOption'] = \in_array($fieldSearchInfo[1], ['ch', 'kh']) ? true : '';

        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

                $noOfEntries = \count($this->listViewEntries);

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

                if (!$this->listViewLinks) {

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

                        $this->listViewCount = $this->listViewModel->getListViewCount();

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

                if (!empty($orderBy)) {

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

                    $this->listViewModel->set('orderby', $orderBy);

        Line exceeds 120 characters; contains 140 characters
        Open

                    $searchValue = App\Condition::validSearchValue($request->getByType('search_value', 'Text'), $moduleName, $searchKey, $operator);

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

                if ($request->has('entityState')) {

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

                    $advancedConditions = $this->listViewModel->get('advancedConditionsRaw');

        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

                    $operator = $request->getByType('operator');

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

                $advancedConditions = $request->has('advancedConditions') ? $request->getArray('advancedConditions') : [];

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

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

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

                $viewer->assign('LISTVIEW_HEADERS', $this->listViewHeaders);

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

                $viewer->assign('SEARCH_PARAMS', $searchParamsRaw);

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

                        $searchParamsRaw[] = $fieldListGroup;

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

                    }

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

                $viewer->assign('SEARCH_DETAILS', $searchParams);

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

        class Vtiger_List_View extends Vtiger_Index_View

        There are no issues that match your filters.

        Category
        Status