YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
C
1 day
Test Coverage
F
0%

Function convert has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
Open

    protected function convert(array $entries): array
    {
        $columns = array_keys($this->columns);
        $fieldName = $this->fieldModel->getName();
        $columnCounter = $records = $sum = [];
Severity: Minor
Found in modules/Vtiger/views/Kanban.php - About 3 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 loadColumns has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function loadColumns(): void
    {
        $moduleName = $this->fieldModel->getModuleName();
        $fieldName = $this->fieldModel->getName();
        $fieldNameForColor = App\Colors::sanitizeValue($fieldName);
Severity: Major
Found in modules/Vtiger/views/Kanban.php - About 2 hrs to fix

    Method convert has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function convert(array $entries): array
        {
            $columns = array_keys($this->columns);
            $fieldName = $this->fieldModel->getName();
            $columnCounter = $records = $sum = [];
    Severity: Minor
    Found in modules/Vtiger/views/Kanban.php - About 1 hr to fix

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

          public function loadColumns(): void
          {
              $moduleName = $this->fieldModel->getModuleName();
              $fieldName = $this->fieldModel->getName();
              $fieldNameForColor = App\Colors::sanitizeValue($fieldName);
      Severity: Minor
      Found in modules/Vtiger/views/Kanban.php - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          protected function getSummaryFields(): array
          {
              if (empty($this->board['detail_fields'])) {
                  $summaryFieldsList = $this->moduleModel->getSummaryViewFieldsList();
                  $fields = [];
      Severity: Minor
      Found in modules/Vtiger/views/Kanban.php - About 1 hr to fix

      Cognitive Complexity

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

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

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

      Further reading

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

          public function process(App\Request $request)
          {
              $ajax = $request->isAjax();
              $moduleName = $request->getModule();
              $this->viewName = $request->has('viewName') ? $request->getByType('viewName', \App\Purifier::ALNUM) : App\CustomView::getInstance($moduleName)->getViewId();
      Severity: Minor
      Found in modules/Vtiger/views/Kanban.php - About 1 hr to fix

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

            protected function convert(array $entries): array
            {
                $columns = array_keys($this->columns);
                $fieldName = $this->fieldModel->getName();
                $columnCounter = $records = $sum = [];
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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 24 to the 15 allowed.
        Open

            protected function convert(array $entries): array
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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_Kanban_View has a coupling between objects value of 18. Consider to reduce the number of dependencies under 13.
        Open

        class Vtiger_Kanban_View extends Vtiger_Index_View
        {
            /** @var array Active board details. */
            protected $board;
        
        
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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

        Missing class import via use statement (line '35', column '14').
        Open

                    throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.php by phpmd

        MissingImport

        Since: 2.7.0

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

        Example

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

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

        Missing class import via use statement (line '139', column '15').
        Open

                        throw new \App\Exceptions\AppException('ERR_NOT_ALLOWED_FIELD_TYPE');
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.php by phpmd

        MissingImport

        Since: 2.7.0

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

        Example

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

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

        Missing class import via use statement (line '153', column '22').
        Open

                $pagingModel = new Vtiger_Paging_Model();
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.php by phpmd

        MissingImport

        Since: 2.7.0

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

        Example

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

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

        Avoid using static access to class 'CustomView_Record_Model' in method 'process'.
        Open

                    $viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAll($moduleName));
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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 '212', column '11').
        Open

            protected function convert(array $entries): array
            {
                $columns = array_keys($this->columns);
                $fieldName = $this->fieldModel->getName();
                $columnCounter = $records = $sum = [];
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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\Colors' in method 'loadColumns'.
        Open

                $fieldNameForColor = App\Colors::sanitizeValue($fieldName);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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\Utils\Kanban' in method 'process'.
        Open

                $boards = \App\Utils\Kanban::getBoards($moduleName, true);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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

                $this->moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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 '110', column '9').
        Open

            public function loadColumns(): void
            {
                $moduleName = $this->fieldModel->getModuleName();
                $fieldName = $this->fieldModel->getName();
                $fieldNameForColor = App\Colors::sanitizeValue($fieldName);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.php by phpmd

        IfStatementAssignment

        Since: 2.7.0

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

        Example

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

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

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

            public function loadColumns(): void
            {
                $moduleName = $this->fieldModel->getModuleName();
                $fieldName = $this->fieldModel->getName();
                $fieldNameForColor = App\Colors::sanitizeValue($fieldName);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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\Fields\Picklist' in method 'loadColumns'.
        Open

                        $picklistValues = App\Fields\Picklist::getValues($fieldName);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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 'loadColumns'.
        Open

                                'label' => \App\Language::translate($value['picklistValue'], $moduleName),
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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\User' in method 'loadColumns'.
        Open

        }
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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 '199', column '7').
        Open

            protected function convert(array $entries): array
            {
                $columns = array_keys($this->columns);
                $fieldName = $this->fieldModel->getName();
                $columnCounter = $records = $sum = [];
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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\Language' in method 'getPageTitle'.
        Open

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

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

                            $color = "{$moduleName}_{$fieldNameForColor}_" . App\Colors::sanitizeValue($value['picklistValue']);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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 {
                    $this->board = reset($boards);
                }
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.php by phpmd

        ElseExpression

        Since: 1.4.0

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

        Example

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

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

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

                $this->fieldModel = \Vtiger_Field_Model::getInstanceFromFieldId($this->board['fieldid']);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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 {
                    $viewer->assign('BOARDS', $boards);
                    $viewer->assign('VIEW', $request->getByType('view', 1));
                    $viewer->assign('CUSTOM_VIEWS', CustomView_Record_Model::getAll($moduleName));
                    $viewer->assign('VIEWID', $this->viewName);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.php by phpmd

        ElseExpression

        Since: 1.4.0

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

        Example

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

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

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

                return $title . ' ' . App\Language::translate('LBL_VIEW_KANBAN', $moduleName);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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\Fields\Owner' in method 'loadColumns'.
        Open

                        $owner = App\Fields\Owner::getInstance($moduleName);
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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 "colorBg" 3 times.
        Open

                                'colorBg' => 'picklistLb_' . $color,
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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 "isEditable" 3 times.
        Open

                                'isEditable' => isset($allowedValues[$value['picklistValue']]),
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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 "private" 3 times.
        Open

                            $allowedValues = $owner->getAccessibleUsers('private', 'owner');
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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 "board" 3 times.
        Open

                if ($request->has('board') && isset($boards[$request->getInteger('board')])) {
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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 "class" 3 times.
        Open

                                'class' => '',
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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 "owner" 4 times.
        Open

                    case 'owner':
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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.

        Rename "$columns" which has the same name as the field declared at line 29.
        Open

                $columns = array_keys($this->columns);
        Severity: Major
        Found in modules/Vtiger/views/Kanban.php by sonar-php

        Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

        Noncompliant Code Example

        class Foo {
          public $myField;
        
          public function doSomething() {
            $myField = 0;
            ...
          }
        }
        

        See

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

                                'colorBr' => 'picklistCBr_' . $color,
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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 "picklistValue" 4 times.
        Open

                            $color = "{$moduleName}_{$fieldNameForColor}_" . App\Colors::sanitizeValue($value['picklistValue']);
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.php by sonar-php

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

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

        Noncompliant Code Example

        With the default threshold of 3:

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

        Compliant Solution

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

        Exceptions

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

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

                                'label' => \App\Language::translate($value['picklistValue'], $moduleName),
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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.

        Call to undeclared method \Vtiger_Viewer::assign
        Open

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

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

                        $owner = App\Fields\Owner::getInstance($moduleName);
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('ACTIVE_FIELD', $this->fieldModel);
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.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/Kanban.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

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

        Call to method getImageById from undeclared class \App\User (Did you mean class \Tests\App\User)
        Open

                                    'image' => \App\User::getImageById($key)['url'] ?? '',
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

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

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                $viewer->assign('DATA', $this->getRecords($request));
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.php by phan

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

                $listViewModel->getQueryGenerator()->setFields(array_merge($this->getSummaryFields(), ['id', $this->fieldModel->getName()], $this->board['sum_fields']));
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

                    $viewer->assign('BOARDS', $boards);
        Severity: Critical
        Found in modules/Vtiger/views/Kanban.php by phan

        Call to undeclared method \Vtiger_Viewer::assign
        Open

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

        Call to undeclared method \Vtiger_Viewer::assign
        Open

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

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

        class Vtiger_Kanban_View extends Vtiger_Index_View

        The class Vtiger_Kanban_View is not named in CamelCase.
        Open

        class Vtiger_Kanban_View extends Vtiger_Index_View
        {
            /** @var array Active board details. */
            protected $board;
        
        
        Severity: Minor
        Found in modules/Vtiger/views/Kanban.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 $fieldModel;

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

            {

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

                return $title . ' ' . App\Language::translate('LBL_VIEW_KANBAN', $moduleName);

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

            /** {@inheritdoc} */

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

            }

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

                        $allowedValues = $this->fieldModel->getPicklistValues();

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

                                    'image' => \App\User::getImageById($key)['url'] ?? '',

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

                $this->viewName = $request->has('viewName') ? $request->getByType('viewName', \App\Purifier::ALNUM) : App\CustomView::getInstance($moduleName)->getViewId();

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

                $viewer->assign('ACTIVE_FIELD', $this->fieldModel);

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

            /**

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

                    case 'owner':

        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->columns[$value['picklistValue']] = [

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

                    throw new \App\Exceptions\NoPermitted('LBL_PERMISSION_DENIED', 406);

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

                $ajax = $request->isAjax();

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

            {

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

                                'colorBg' => 'picklistLb_' . $color,

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

                                'colorBr' => 'picklistCBr_' . $color,

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

                                $this->columns[$key] = [

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

            protected $columns = [];

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

            {

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

                if ($request->has('board') && isset($boards[$request->getInteger('board')])) {

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

                    $viewer->view('Kanban/Main.tpl', $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

                    case 'picklist':

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

                        if ($users = $owner->getAccessibleUsers('Public')) {

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

                            $allowedValues = $owner->getAccessibleUsers('private', 'owner');

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

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

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

                                    'class' => '',

        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

                $this->moduleModel = \Vtiger_Module_Model::getInstance($moduleName);

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

             * @return void

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

             */

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

                $moduleName = $this->fieldModel->getModuleName();

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

                if (!Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModuleActionPermission($request->getModule(), 'Kanban')) {

        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

                $viewer->assign('DATA', $this->getRecords($request));

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

                if ($ajax) {

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

                    $viewer->assign('BOARDS', $boards);

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

                                'label' => \App\Language::translate($value['picklistValue'], $moduleName),

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

                                'class' => '',

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

            protected $board;

        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

            {

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

                $boards = \App\Utils\Kanban::getBoards($moduleName, true);

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

                    $this->board = reset($boards);

        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->view('Kanban/Kanban.tpl', $moduleName);

        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

                switch ($this->fieldModel->getFieldDataType()) {

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

            /** {@inheritdoc} */

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

            public function getPageTitle(App\Request $request)

        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 process(App\Request $request)

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

                $viewer->assign('ACTIVE_BOARD', $this->board);

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

            /** @var array Active board details. */

        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

                    $this->board = $boards[$request->getInteger('board')];

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

                $this->fieldModel = \Vtiger_Field_Model::getInstanceFromFieldId($this->board['fieldid']);

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

            public function loadColumns(): void

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

                        $owner->showRoleName = false;

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

            /** @var array Kanban columns details . */

        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

                } else {

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

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

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

             * Get columns for kanban.

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

                $fieldNameForColor = App\Colors::sanitizeValue($fieldName);

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

                                'isEditable' => isset($allowedValues[$value['picklistValue']]),

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

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

                        foreach ($picklistValues as $value) {

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

                            $color = "{$moduleName}_{$fieldNameForColor}_" . App\Colors::sanitizeValue($value['picklistValue']);

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

                        }

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

                        $owner = App\Fields\Owner::getInstance($moduleName);

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

                            $allowedValues = $owner->getAccessibleGroups('private', 'owner', true);

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

             * Get kanban records.

        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

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

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

                if ($sumFields = $this->board['sum_fields']) {

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

                        foreach ($sumFields as $sumFieldName) {

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

                            $sum[$column][$sumFieldName] = 0;

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

                                    $sum[$column][$sumFieldName] = ((float) $val) + $sum[$column][$sumFieldName];

        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 [

        Line exceeds 120 characters; contains 164 characters
        Open

                $this->viewName = $request->has('viewName') ? $request->getByType('viewName', \App\Purifier::ALNUM) : App\CustomView::getInstance($moduleName)->getViewId();

        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('VIEW', $request->getByType('view', 1));

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

                        $picklistValues = App\Fields\Picklist::getValues($fieldName);

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

                                    'label' => $value,

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

                                    'colorBg' => 'ownerCBg_' . $key,

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

                                $this->columns[$key] = [

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

                $listViewModel->getQueryGenerator()->setFields(array_merge($this->getSummaryFields(), ['id', $this->fieldModel->getName()], $this->board['sum_fields']));

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

            /**

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

                                $fields[] = $fieldName;

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

             * @param Vtiger_Record_Model[] $entries

        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

            protected $moduleModel;

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

                                    'isEditable' => isset($allowedValues[$key]),

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

            /**

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

             * @return string[]

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

                        }

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

            {

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

            /** @var \Vtiger_Field_Model Field Model instance. */

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

            public function checkPermission(App\Request $request)

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

                $viewer->assign('MODULE_MODEL', $this->moduleModel);

        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

                $fieldName = $this->fieldModel->getName();

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

                                'description' => $value['description'] ?? '',

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

                            ];

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

                        break;

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

                                    'icon' => 'fas fa-user',

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

                                    'class' => '',

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

                        break;

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

             * @return array

        Line exceeds 120 characters; contains 161 characters
        Open

                $listViewModel->getQueryGenerator()->setFields(array_merge($this->getSummaryFields(), ['id', $this->fieldModel->getName()], $this->board['sum_fields']));

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

            }

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

             *

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

                        }

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

            {

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

                $pagingModel = new Vtiger_Paging_Model();

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

                            if ($fieldModel->isViewableInDetailView()) {

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

             * Convert the data.

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

                $fieldName = $this->fieldModel->getName();

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

                        }

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

                        }

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

                        throw new \App\Exceptions\AppException('ERR_NOT_ALLOWED_FIELD_TYPE');

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

             *

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

            protected function getRecords(App\Request $request): array

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

             */

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

            }

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

                foreach ($entries as $id => $recordModel) {

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

                                if ($val = $recordModel->get($sumFieldName)) {

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

                    $columnCounter[$column] = isset($records[$column]) ? \count($records[$column]) : 0;

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

                                ];

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

                        if ($group = $owner->getAccessibleGroups('private', 'owner', true)) {

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

                                    'label' => $value,

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

                                    'icon' => 'adminIcon-groups',

        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 function getSummaryFields(): array

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

                    $summaryFieldsList = $this->moduleModel->getSummaryViewFieldsList();

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

                    if ($summaryFieldsList) {

        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 \Vtiger_Module_Model Module Model instance. */

        Line exceeds 120 characters; contains 131 characters
        Open

                if (!Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModuleActionPermission($request->getModule(), 'Kanban')) {

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

                $viewer->assign('COLUMNS', $this->columns);

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

                                'icon' => $value['icon'] ?? '',

        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 ($columns as $column) {

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

                    if (\in_array($column, $columns)) {

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

                        if ($sumFields) {

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

                    'records' => $records,

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

             */

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

                return $this->convert($listViewModel->getListViewEntries($pagingModel));

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

                    $column = $recordModel->get($fieldName);

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

                                    'colorBr' => 'ownerCBr_' . $key,

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

                    $fields = [];

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

                        foreach ($summaryFieldsList as $fieldName => $fieldModel) {

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

            /**

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

                $columnCounter = $records = $sum = [];

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

                foreach ($columns as $column) {

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

                ];

        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

                }

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

             * Get summary fields for kanban item.

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

                if (empty($this->board['detail_fields'])) {

        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

                    'columnCounter' => $columnCounter,

        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

                    }

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

                    return $fields;

        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 function convert(array $entries): array

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

                                }

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

                }

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

                                    'isEditable' => isset($allowedValues[$key]),

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

            }

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

                $listViewModel = Vtiger_ListView_Model::getInstance($moduleName, $this->viewName);

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

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

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

                                    'colorBg' => 'ownerCBg_' . $key,

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

                    default:

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

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

        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

                $pagingModel->set('limit', Vtiger_Paging_Model::PAGE_MAX_LIMIT);

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

                }

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

                return $this->board['detail_fields'];

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

                $columns = array_keys($this->columns);

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

                        $records[$column][$id] = $recordModel;

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

                        }

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

            }

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

                                    'colorBr' => 'ownerCBr_' . $key,

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

                            }

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

                            foreach ($sumFields as $sumFieldName) {

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

                    'sum' => $sum,

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

                }

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

             *

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

             * @return array

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

                }

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

        class Vtiger_Kanban_View extends Vtiger_Index_View

        There are no issues that match your filters.

        Category
        Status