YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
F
6 days
Test Coverage
F
0%

Function getDetailViewLinks has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
Open

    public function getDetailViewLinks(array $linkParams): array
    {
        if ($this->has('Links')) {
            return $this->get('Links');
        }
Severity: Minor
Found in modules/Vtiger/models/DetailView.php - About 1 day 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 getDetailViewLinks has 265 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getDetailViewLinks(array $linkParams): array
    {
        if ($this->has('Links')) {
            return $this->get('Links');
        }
Severity: Major
Found in modules/Vtiger/models/DetailView.php - About 1 day to fix

    File DetailView.php has 475 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

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

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

      class Vtiger_DetailView_Model extends \App\Base
      {
          protected $module = false;
          protected $record = false;
          public $widgetsList = [];
      Severity: Minor
      Found in modules/Vtiger/models/DetailView.php by phpmd

      Method getDetailViewRelatedLinks has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function getDetailViewRelatedLinks()
          {
              $recordModel = $this->getRecord();
              $parentModuleModel = $this->getModule();
              $this->getWidgets();
      Severity: Major
      Found in modules/Vtiger/models/DetailView.php - About 3 hrs to fix

        Function getWidgets has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getWidgets()
            {
                if (empty($this->widgetsList)) {
                    $moduleModel = $this->getModule();
                    $moduleName = $this->getModuleName();
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php - About 2 hrs to fix

        Cognitive Complexity

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

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

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

        Further reading

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

            public function getCustomHeaderFields()
            {
                $moduleName = $this->getModuleName();
                $path = 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'headerfields';
                if (!is_dir($path)) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 getDetailViewRelatedLinks has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getDetailViewRelatedLinks()
            {
                $recordModel = $this->getRecord();
                $parentModuleModel = $this->getModule();
                $this->getWidgets();
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 getSideBarLinks has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            public function getSideBarLinks($linkParams)
            {
                $linkTypes = ['SIDEBARLINK', 'SIDEBARWIDGET'];
                $moduleLinks = $this->getModule()->getSideBarLinks($linkTypes);
        
        
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php - About 25 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 getDetailViewRelatedLinks() has an NPath complexity of 3240. The configured NPath complexity threshold is 200.
        Open

            public function getDetailViewRelatedLinks()
            {
                $recordModel = $this->getRecord();
                $parentModuleModel = $this->getModule();
                $this->getWidgets();
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 getDetailViewLinks() has an NPath complexity of 9029615664. The configured NPath complexity threshold is 200.
        Open

            public function getDetailViewLinks(array $linkParams): array
            {
                if ($this->has('Links')) {
                    return $this->get('Links');
                }
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 getDetailViewLinks() has 268 lines of code. Current threshold is set to 100. Avoid really long methods.
        Open

            public function getDetailViewLinks(array $linkParams): array
            {
                if ($this->has('Links')) {
                    return $this->get('Links');
                }
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

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

            public function getDetailViewLinks(array $linkParams): array
            {
                if ($this->has('Links')) {
                    return $this->get('Links');
                }
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 getDetailViewRelatedLinks() has a Cyclomatic Complexity of 20. The configured cyclomatic complexity threshold is 10.
        Open

            public function getDetailViewRelatedLinks()
            {
                $recordModel = $this->getRecord();
                $parentModuleModel = $this->getModule();
                $this->getWidgets();
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 class Vtiger_DetailView_Model has a coupling between objects value of 20. Consider to reduce the number of dependencies under 13.
        Open

        class Vtiger_DetailView_Model extends \App\Base
        {
            protected $module = false;
            protected $record = false;
            public $widgetsList = [];
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 '558', column '16').
        Open

                foreach (new DirectoryIterator($path) as $fileinfo) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 '119', column '16').
        Open

                        $wfs = new VTWorkflowManager();
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'Users_Privileges_Model' in method 'getDetailViewLinks'.
        Open

                    $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_EXTENDED',
                            'linklabel' => 'LBL_ARCHIVE_RECORD',
                            'title' => \App\Language::translate('LBL_ARCHIVE_RECORD'),
                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=State&state=Archived&record=' . $recordModel->getId(),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                            'title' => \App\Language::translate('LBL_ARCHIVE_RECORD'),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewRelatedLinks'.
        Open

                if ($parentModuleModel->isCommentEnabled() && ($modCommentsModel = Vtiger_Module_Model::getInstance('ModComments')) && $modCommentsModel->isPermitted('DetailView')) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                            $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                                'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                                'linklabel' => '',
                                'linkdata' => ['url' => "index.php?module={$moduleName}&view=GenerateModal&fromview=Detail&record={$recordId}"],
                                'linkicon' => 'fas fa-external-link-alt',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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\Components\InterestsConflict' in method 'getDetailViewLinks'.
        Open

                    if (\Config\Components\InterestsConflict::$isActive && \App\Components\InterestsConflict::getParent($recordId, $moduleName)) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                            $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                                'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                                'linkdata' => ['url' => "index.php?module={$moduleName}&view=InterestsConflictModal&mode=users&fromView=Detail&record={$recordId}"],
                                'linkicon' => 'yfi yfi-conflict-list',
                                'linkhint' => 'LBL_INTERESTS_CONFLICT_USERS',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                            'linklabel' => '',
                            'linkurl' => 'javascript:Vtiger_Index_Js.sendNotification(this)',
                            'linkicon' => 'fas fa-paper-plane',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_EXTENDED',
                            'linklabel' => 'LBL_ACTIVATE_RECORD',
                            'title' => \App\Language::translate('LBL_ACTIVATE_RECORD'),
                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=State&state=Active&record=' . $recordModel->getId(),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                            'title' => \App\Language::translate('LBL_EXPORT_PDF'),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                    $stateColors = App\Config::search('LIST_ENTITY_STATE_COLOR');
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_EXTENDED',
                            'linklabel' => 'LBL_DELETE_RECORD_COMPLETELY',
                            'title' => \App\Language::translate('LBL_DELETE_RECORD_COMPLETELY'),
                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=Delete&record=' . $recordModel->getId(),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                            'linkdata' => ['confirm' => \App\Language::translate('LBL_DELETE_RECORD_COMPLETELY_DESC'), 'source-view' => 'Href'],
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_BASIC',
                            'linklabel' => 'LBL_DUPLICATE',
                            'linkurl' => $recordModel->getDuplicateRecordUrl(),
                            'linkicon' => 'fas fa-clone',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 '417', column '91').
        Open

            public function getDetailViewRelatedLinks()
            {
                $recordModel = $this->getRecord();
                $parentModuleModel = $this->getModule();
                $this->getWidgets();
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        IfStatementAssignment

        Since: 2.7.0

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

        Example

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

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

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

                        'countRelated' => App\Config::module('ModTracker', 'UNREVIEWED_COUNT') && $parentModuleModel->isPermitted('ReviewingUpdates'),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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\Components\InterestsConflict' in method 'getDetailViewLinks'.
        Open

                    if (\Config\Components\InterestsConflict::$isActive && \App\Components\InterestsConflict::getParent($recordId, $moduleName)) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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\Field' in method 'getDetailViewLinks'.
        Open

                    if ($fields = App\Field::getQuickChangerFields($moduleModel->getId())) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/include.php');
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_EXTENDED',
                            'linklabel' => 'LBL_MOVE_TO_TRASH',
                            'title' => \App\Language::translate('LBL_MOVE_TO_TRASH'),
                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=State&state=Trash&record=' . $recordModel->getId(),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_BASIC',
                            'linklabel' => \App\Language::translate('LBL_EXPORT_PDF'),
                            'dataUrl' => 'index.php?module=' . $moduleName . '&view=PDF&fromview=Detail&record=' . $recordId,
                            'linkicon' => 'fas fa-file-pdf',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_BASIC',
                            'linklabel' => 'BTN_RECORD_OPEN',
                            'linkdata' => ['url' => 'index.php?module=' . $recordModel->getModuleName() . '&view=RecordUnlock&record=' . $recordModel->getId()],
                            'linkicon' => 'fas fa-lock-open',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

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

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                            $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                                'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                                'linklabel' => '',
                                'linkurl' => 'javascript:Vtiger_Detail_Js.showWorkflowTriggerView(this)',
                                'linkicon' => 'fas fa-plus-circle',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_BASIC',
                            'linklabel' => 'BTN_RECORD_EDIT',
                            'linkurl' => $recordModel->getEditViewUrl(),
                            'linkicon' => 'yfi yfi-full-editing-view',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                            'title' => \App\Language::translate('LBL_DUPLICATE_RECORD'),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewRelatedLinks'.
        Open

                    \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 getDetailViewLinks uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
                    if (\Config\Components\InterestsConflict::$isActive && \App\Components\InterestsConflict::getParent($recordId, $moduleName)) {
                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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\Config' in method 'getDetailViewLinks'.
        Open

                    if (App\Config::module('ModTracker', 'WATCHDOG') && $moduleModel->isPermitted('WatchingRecords')) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

        Avoid using static access to class 'Vtiger_Watchdog_Model' in method 'getDetailViewLinks'.
        Open

                        $watchdog = Vtiger_Watchdog_Model::getInstanceById($recordId, $moduleName);
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

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

                            'title' => \App\Language::translate('LBL_DELETE_RECORD_COMPLETELY'),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

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

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                    $relatedLink = Vtiger_Link_Model::getInstanceFromValues($relatedLinkEntry);
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                            $widgetName = Vtiger_Loader::getComponentClassName('Widget', $widget['type'], $moduleName);
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                $listLinks = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), $listLinkTypes);
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                            'linkdata' => ['confirm' => \App\Language::translate('LBL_ACTIVATE_RECORD_DESC'), 'source-view' => 'Href'],
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                $allLinks = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['DETAIL_VIEW_ADDITIONAL', 'DETAIL_VIEW_BASIC', 'DETAIL_VIEW_HEADER_WIDGET', 'DETAIL_VIEW_EXTENDED', 'DETAILVIEWTAB', 'DETAILVIEWRELATED'], $linkParams);
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $relatedLinks[] = Vtiger_Link_Model::getInstanceFromValues([
                            'linklabel' => $relation->get('label'),
                            'linkurl' => $relation->getListUrl($recordModel),
                            'linkicon' => '',
                            'relatedModuleName' => $relation->get('relatedModuleName'),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

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

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_BASIC',
                            'linklabel' => 'BTN_ASSIGN_TO',
                            'linkdata' => ['url' => 'index.php?module=' . $recordModel->getModuleName() . '&view=AutoAssignRecord&record=' . $recordModel->getId()],
                            'linkicon' => 'yfi yfi-automatic-assignment',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewRelatedLinks'.
        Open

                        'countRelated' => App\Config::relation('SHOW_RECORDS_COUNT'),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewRelatedLinks'.
        Open

                    \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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_Record_Model' in method 'getInstance'.
        Open

                $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                            'linkdata' => ['url' => "index.php?module={$moduleName}&view=InterestsConflictModal&mode=unlock&fromView=Detail&record={$recordId}"],
                            'linkicon' => 'fas fa-lock-open',
                            'linkhint' => 'LBL_INTERESTS_CONFLICT_UNLOCK',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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\AutoAssign' in method 'getDetailViewLinks'.
        Open

                    if ($recordModel->isPermitted('AutoAssignRecord') && \App\AutoAssign::getAutoAssignForRecord($recordModel, \App\AutoAssign::MODE_MANUAL)) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                            'title' => \App\Language::translate('LBL_MOVE_TO_TRASH'),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 '568', column '9').
        Open

            public function getCustomHeaderFields()
            {
                $moduleName = $this->getModuleName();
                $path = 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'headerfields';
                if (!is_dir($path)) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        IfStatementAssignment

        Since: 2.7.0

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

        Example

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

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

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

                        Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/VTEntityMethodManager.php');
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                            'linklabel' => '',
                            'linkurl' => 'javascript:Vtiger_Index_Js.changeWatching(this)',
                            'linkicon' => 'fas ' . $iconClass,
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                    $smsModuleModel = Vtiger_Module_Model::getInstance('SMSNotifier');
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                            'linklabel' => 'BTN_SMSNOTIFIER',
                            'linkurl' => 'javascript:Vtiger_Detail_Js.triggerSMSmodal(this)',
                            'linkicon' => 'yfm-SMSNotifier',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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\Module' in method 'getDetailViewRelatedLinks'.
        Open

                    && \App\Module::isModuleActive('Chat') && !\App\RequestUtil::getBrowserInfo()->ie
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                            'linkdata' => ['confirm' => \App\Language::translate('LBL_ARCHIVE_RECORD_DESC'), 'source-view' => 'Href'],
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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\ModuleHierarchy' in method 'getDetailViewRelatedLinks'.
        Open

                    && false !== \App\ModuleHierarchy::getModuleLevel($parentModuleModel->getName())
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                            'linkdata' => ['url' => "index.php?module={$moduleName}&view=InterestsConflictModal&mode=confirmation&fromView=Detail&record={$recordId}"],
                            'linkicon' => 'yfi yfi-confirm-conflict',
                            'linkhint' => 'LBL_INTERESTS_CONFLICT_CONFIRMATION',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                            'linkhint' => 'BTN_PERMISSION_INSPECTOR',
                            'linkdata' => ['url' => "index.php?module=PermissionInspector&view=UserListModal&srcModule=$moduleName&srcRecord=$recordId"],
                            'linkicon' => 'fas fa-user-secret',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                                $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([
                                    'linktype' => 'DETAIL_VIEW_BASIC',
                                    'linklabel' => $field['btn_name'],
                                    'linkurl' => "javascript:Vtiger_Detail_Js.runRecordChanger({$field['id']})",
                                    'linkicon' => $field['icon'] ?? 'mdi mdi-nfc-tap',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 '383', column '50').
        Open

            public function getDetailViewRelatedLinks()
            {
                $recordModel = $this->getRecord();
                $parentModuleModel = $this->getModule();
                $this->getWidgets();
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 '207', column '8').
        Open

            public function getDetailViewLinks(array $linkParams): array
            {
                if ($this->has('Links')) {
                    return $this->get('Links');
                }
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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\RecordConverter' in method 'getDetailViewLinks'.
        Open

                    if ($moduleModel->isPermitted('RecordConventer') && \App\RecordConverter::isAvailable($recordModel, 'Detail')) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',
                            'linklabel' => 'LBL_RECORD_CONVERTER',
                            'linkdata' => ['url' => "index.php?module={$moduleModel->getName()}&view=RecordConverter&sourceView=Detail&selected_ids=[{$recordModel->getId()}]"],
                            'linkicon' => 'fas fa-exchange-alt',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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\Field' in method 'getDetailViewLinks'.
        Open

                            if (App\Field::checkQuickChangerConditions($field, $recordModel)) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 'getDetailViewLinks'.
        Open

                            'title' => \App\Language::translate('LBL_ACTIVATE_RECORD'),
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'DetailView', $moduleName);
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

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

                        $modelClassName = Vtiger_Loader::getComponentClassName('HeaderField', $name, $moduleName);
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.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 unused parameters such as '$linkParams'.
        Open

            public function getSideBarLinks($linkParams)
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        UnusedFormalParameter

        Since: 0.2

        Avoid passing parameters to methods or constructors and then not using those parameters.

        Example

        class Foo
        {
            private function bar($howdy)
            {
                // $howdy is not used
            }
        }

        Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

        syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')'
        Open

                        && array_filter($recordModel->getModule()->getFieldsByType('phone', true), fn ($fieldModel) => !$recordModel->isEmpty($fieldModel->getName()))
        Severity: Critical
        Found in modules/Vtiger/models/DetailView.php by phan

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                    if ($recordModel->privilegeToArchive()) {
                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_EXTENDED',
                            'linklabel' => 'LBL_ARCHIVE_RECORD',
                            'title' => \App\Language::translate('LBL_ARCHIVE_RECORD'),
        Severity: Major
        Found in modules/Vtiger/models/DetailView.php and 2 other locations - About 2 hrs to fix
        modules/Vtiger/models/DetailView.php on lines 251..262
        modules/Vtiger/models/DetailView.php on lines 275..286

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

        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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                    if ($recordModel->privilegeToMoveToTrash()) {
                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_EXTENDED',
                            'linklabel' => 'LBL_MOVE_TO_TRASH',
                            'title' => \App\Language::translate('LBL_MOVE_TO_TRASH'),
        Severity: Major
        Found in modules/Vtiger/models/DetailView.php and 2 other locations - About 2 hrs to fix
        modules/Vtiger/models/DetailView.php on lines 251..262
        modules/Vtiger/models/DetailView.php on lines 263..274

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

        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

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

                    if ($recordModel->privilegeToActivate()) {
                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([
                            'linktype' => 'DETAIL_VIEW_EXTENDED',
                            'linklabel' => 'LBL_ACTIVATE_RECORD',
                            'title' => \App\Language::translate('LBL_ACTIVATE_RECORD'),
        Severity: Major
        Found in modules/Vtiger/models/DetailView.php and 2 other locations - About 2 hrs to fix
        modules/Vtiger/models/DetailView.php on lines 263..274
        modules/Vtiger/models/DetailView.php on lines 275..286

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

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

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

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

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

        Refactorings

        Further Reading

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

                foreach ($parentModuleModel->getRelations() as $relation) {
                    if ($relation->isRelatedViewType('RelatedTab') && (!$relation->isDirectRelation() || !($relationField = $relation->getRelationField()) || $relationField->isActiveField())) {
                        $relatedLinks[] = [
                            'linktype' => 'DETAILVIEWRELATED',
                            'linklabel' => $relation->get('label'),
        Severity: Major
        Found in modules/Vtiger/models/DetailView.php and 1 other location - About 1 hr to fix
        modules/Accounts/models/DetailView.php on lines 125..136

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

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

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

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

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

        Refactorings

        Further Reading

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

                if (
                    \App\User::getCurrentUserId() === \App\User::getCurrentUserRealId()
                    && \App\Module::isModuleActive('Chat') && !\App\RequestUtil::getBrowserInfo()->ie
                    && false !== \App\ModuleHierarchy::getModuleLevel($parentModuleModel->getName())
                ) {
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php and 1 other location - About 55 mins to fix
        modules/Accounts/models/DetailView.php on lines 113..124

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

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

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

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

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

        Refactorings

        Further Reading

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

                if ($parentModuleModel->isTrackingEnabled() && $parentModuleModel->isPermitted('ModTracker')) {
                    $relatedLinks[] = [
                        'linktype' => 'DETAILVIEWTAB',
                        'linklabel' => 'LBL_UPDATES',
                        'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showRecentActivities&page=1',
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php and 1 other location - About 30 mins to fix
        modules/Accounts/models/DetailView.php on lines 93..103

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

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

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

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

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

        Refactorings

        Further Reading

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

        class Vtiger_DetailView_Model extends \App\Base

        The class Vtiger_DetailView_Model is not named in CamelCase.
        Open

        class Vtiger_DetailView_Model extends \App\Base
        {
            protected $module = false;
            protected $record = false;
            public $widgetsList = [];
        Severity: Minor
        Found in modules/Vtiger/models/DetailView.php by phpmd

        CamelCaseClassName

        Since: 0.2

        It is considered best practice to use the CamelCase notation to name classes.

        Example

        class class_name {
        }

        Source

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

            {

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

            public function setModule($moduleInstance)

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

             */

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

            /**

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

             * @return Vtiger_Record_Model

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

                $this->module = $moduleInstance;

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

            }

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

             * @param Vtiger_Module_Model $moduleInstance - module model

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

             * Function to get Module instance.

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

             * @return Vtiger_Module_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

             * Function to get the Record model.

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

             * @return Vtiger_DetailView_Model>

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

                return $this->record;

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

            protected $record = false;

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

            public $widgets = [];

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

             *

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

            /**

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

            public function getModule()

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

            public $widgetsList = [];

        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 set the module instance.

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

             */

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

             *

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

                return $this->module;

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

                return $this;

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

            {

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

            }

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

            {

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

             */

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

             *

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

            public function getRecord()

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

            protected $module = false;

        Line exceeds 120 characters; contains 157 characters
        Open

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

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

                    if ($smsModuleModel->isSMSActiveForModule($moduleName)

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

                            'linkurl' => 'javascript:Vtiger_Detail_Js.triggerSMSmodal(this)',

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

                            'linkclass' => 'js-show-modal btn-outline-dark btn-sm',

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

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

        Line exceeds 120 characters; contains 148 characters
        Open

                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=State&state=Active&record=' . $recordModel->getId(),

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

                        ]);

        Line exceeds 120 characters; contains 126 characters
        Open

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

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

                            'linkclass' => 'entityStateBtn btn-outline-dark btn-sm js-action-confirm',

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

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

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

                        $pdfModel = new $handlerClass();

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

             *

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

            public function setRecord($recordModuleInstance)

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

                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                        $mfModel = new $handlerClass();

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

                                'linkclass' => 'btn js-show-modal btn-outline-dark btn-sm',

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

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

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                            'linklabel' => 'LBL_RECORD_CONVERTER',

        Line exceeds 120 characters; contains 158 characters
        Open

                        && array_filter($recordModel->getModule()->getFieldsByType('phone', true), fn ($fieldModel) => !$recordModel->isEmpty($fieldModel->getName()))

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

                    if ($recordModel->isEditable()) {

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                        ]);

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

                            'style' => empty($stateColors['Archived']) ? '' : "background: {$stateColors['Archived']};",

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

                    if ($recordModel->privilegeToMoveToTrash()) {

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

                            'linkurl' => $recordModel->getDuplicateRecordUrl(),

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

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

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

             * @param <type> $recordModuleInstance - record model

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

            {

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

                                'linkdata' => ['url' => "index.php?module={$moduleName}&view=InterestsConflictModal&mode=users&fromView=Detail&record={$recordId}"],

        Line exceeds 120 characters; contains 156 characters
        Open

                                'linkdata' => ['url' => "index.php?module={$moduleName}&view=InterestsConflictModal&mode=users&fromView=Detail&record={$recordId}"],

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

                        }

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                    if ($userPrivilegesModel->hasModulePermission('Notification') && $userPrivilegesModel->hasModuleActionPermission('Notification', 'CreateView')) {

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

                            'linkhint' => 'BTN_PERMISSION_INSPECTOR',

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                        ]);

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

                            if (App\Field::checkQuickChangerConditions($field, $recordModel)) {

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

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

        Line exceeds 120 characters; contains 151 characters
        Open

                    if ($recordModel->isPermitted('AutoAssignRecord') && \App\AutoAssign::getAutoAssignForRecord($recordModel, \App\AutoAssign::MODE_MANUAL)) {

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

                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=Delete&record=' . $recordModel->getId(),

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

                        ]);

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

             * @return Vtiger_DetailView_Model

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

                return $this;

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

                                'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                            $iconClass = 'fa-eye';

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

                    if ($moduleModel->isPermitted('RecordConventer') && \App\RecordConverter::isAvailable($recordModel, 'Detail')) {

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

                            'linkclass' => 'js-edit-btn btn btn-outline-dark btn-sm',

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

                            'linkdata' => ['url' => 'index.php?module=' . $recordModel->getModuleName() . '&view=RecordUnlock&record=' . $recordModel->getId()],

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

                        ]);

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

                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                            'linklabel' => 'LBL_ACTIVATE_RECORD',

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

                    if ($recordModel->privilegeToArchive()) {

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

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

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

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

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

                    if ($recordModel->privilegeToDelete()) {

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

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

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

                            'linklabel' => 'LBL_DUPLICATE',

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

                        }

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

                            'linktype' => 'DETAIL_VIEW_BASIC',

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

                            'dataUrl' => 'index.php?module=' . $moduleName . '&view=PDF&fromview=Detail&record=' . $recordId,

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

                $this->record = $recordModuleInstance;

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

                                'linkicon' => 'yfi yfi-conflict-list',

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

                        $workflows = $wfs->getWorkflowsForModule($moduleName, VTWorkflowManager::$TRIGGER);

        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 ($watchdog->isWatchingRecord()) {

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

                        ]);

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

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

        Line exceeds 120 characters; contains 145 characters
        Open

                            'linkdata' => ['url' => "index.php?module=PermissionInspector&view=UserListModal&srcModule=$moduleName&srcRecord=$recordId"],

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

                            'modalView' => true,

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

                                    'linkicon' => $field['icon'] ?? 'mdi mdi-nfc-tap',

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

                                    'linkclass' => 'btn-sm ' . $field['class'],

        Line exceeds 120 characters; contains 152 characters
        Open

                            'linkdata' => ['url' => 'index.php?module=' . $recordModel->getModuleName() . '&view=RecordUnlock&record=' . $recordModel->getId()],

        Line exceeds 120 characters; contains 156 characters
        Open

                            'linkdata' => ['url' => 'index.php?module=' . $recordModel->getModuleName() . '&view=AutoAssignRecord&record=' . $recordModel->getId()],

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

                            'style' => empty($stateColors['Active']) ? '' : "background: {$stateColors['Active']};",

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

                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=State&state=Archived&record=' . $recordModel->getId(),

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

                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=State&state=Trash&record=' . $recordModel->getId(),

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

                            'style' => empty($stateColors['Trash']) ? '' : "background: {$stateColors['Trash']};",

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

                    }

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

            }

        Line exceeds 120 characters; contains 138 characters
        Open

                    if (\Config\Components\InterestsConflict::$isActive && \App\Components\InterestsConflict::getParent($recordId, $moduleName)) {

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                            'linkclass' => 'btn-outline-primary btn-sm js-show-modal',

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

                                'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                                'modalView' => true,

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

                        Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/include.php');

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

                        $wfs = new VTWorkflowManager();

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

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

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

                            'linktype' => 'DETAIL_VIEW_BASIC',

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                            'linktype' => 'DETAIL_VIEW_BASIC',

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([

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

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

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

                            'linkdata' => ['confirm' => \App\Language::translate('LBL_MOVE_TO_TRASH_DESC'), 'source-view' => 'Href'],

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

                            'linklabel' => 'LBL_DELETE_RECORD_COMPLETELY',

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

                        $additionalClass = '';

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([

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

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

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

                    }

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

                    $relatedLink = Vtiger_Link_Model::getInstanceFromValues($relatedLinkEntry);

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

             *

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

             * @param array $linkParams array of link models

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

             */

        Line exceeds 120 characters; contains 153 characters
        Open

                            'linkdata' => ['url' => "index.php?module={$moduleName}&view=InterestsConflictModal&mode=unlock&fromView=Detail&record={$recordId}"],

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

                            'linkclass' => 'btn-outline-primary btn-sm js-show-modal',

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

                        ]);

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

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

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

                                'linkurl' => 'javascript:Vtiger_Detail_Js.showWorkflowTriggerView(this)',

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

                                'linkicon' => 'fas fa-external-link-alt',

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

                        $class = 'btn-outline-dark btn-sm';

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

                    }

        Line exceeds 120 characters; contains 124 characters
        Open

                    if ($moduleModel->isPermitted('RecordConventer') && \App\RecordConverter::isAvailable($recordModel, 'Detail')) {

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

                            'linkicon' => 'yfm-SMSNotifier',

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

                                $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([

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

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

        Line exceeds 120 characters; contains 147 characters
        Open

                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=State&state=Trash&record=' . $recordModel->getId(),

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

                            'linkclass' => 'entityStateBtn btn-outline-dark btn-sm js-action-confirm',

        Line exceeds 120 characters; contains 136 characters
        Open

                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=Delete&record=' . $recordModel->getId(),

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

                        $linkModelList['DETAIL_VIEW_BASIC'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                            'linktype' => 'DETAIL_VIEW_BASIC',

        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 (!$pdfModel->checkActiveTemplates($recordId, $moduleName, 'Detail')) {

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                    }

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

                     && ($recordModel->isEditable() || ($recordModel->isPermitted('EditView') && $moduleModel->isPermitted('WorkflowTriggerWhenRecordIsBlocked') && $recordModel->isBlocked()))) {

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

                            ]);

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

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

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

                                'linklabel' => '',

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

                                'linkdata' => ['url' => "index.php?module={$moduleName}&view=GenerateModal&fromview=Detail&record={$recordId}"],

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

                    }

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                            'linkhint' => 'LBL_SEND_NOTIFICATION',

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

                            'linkclass' => 'btn-outline-dark btn-sm',

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

                    } elseif ($recordModel->isUnlockByFields()) {

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

                            'linkdata' => ['url' => 'index.php?module=' . $recordModel->getModuleName() . '&view=AutoAssignRecord&record=' . $recordModel->getId()],

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

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

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

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

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

             *

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

                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                            'linkdata' => ['url' => "index.php?module={$moduleName}&view=InterestsConflictModal&mode=unlock&fromView=Detail&record={$recordId}"],

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

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

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

                            'linkicon' => 'yfi yfi-confirm-conflict',

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

                        if ($mfModel && $mfModel->checkActiveTemplates($recordId, $moduleName, 'Detail')) {

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

                        }

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

                        $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                            'linkclass' => 'btn-outline-dark btn-sm',

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

                    $smsModuleModel = Vtiger_Module_Model::getInstance('SMSNotifier');

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

                        foreach ($fields as $field) {

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

                            }

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

                        ]);

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

                    }

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

                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=State&state=Active&record=' . $recordModel->getId(),

        Line exceeds 120 characters; contains 127 characters
        Open

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

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

                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([

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

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

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

                            'linkclass' => 'btn-dark btn-sm js-action-confirm',

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

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

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

            }

        Line exceeds 120 characters; contains 138 characters
        Open

                    if (\Config\Components\InterestsConflict::$isActive && \App\Components\InterestsConflict::getParent($recordId, $moduleName)) {

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

                                'linkhint' => 'LBL_INTERESTS_CONFLICT_USERS',

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

                        }

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

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

        Line exceeds 120 characters; contains 136 characters
        Open

                                'linkdata' => ['url' => "index.php?module={$moduleName}&view=GenerateModal&fromview=Detail&record={$recordId}"],

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

                            ]);

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

                            $class = 'btn-dark btn-sm';

        Line exceeds 120 characters; contains 157 characters
        Open

                    if ($userPrivilegesModel->hasModulePermission('Notification') && $userPrivilegesModel->hasModuleActionPermission('Notification', 'CreateView')) {

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

                            'linkdata' => ['url' => "index.php?module=PermissionInspector&view=UserListModal&srcModule=$moduleName&srcRecord=$recordId"],

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

                    }

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

                            'linkhint' => 'BTN_RECORD_EDIT',

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

                            'linklabel' => 'BTN_RECORD_OPEN',

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

                    if ($recordModel->isPermitted('AutoAssignRecord') && \App\AutoAssign::getAutoAssignForRecord($recordModel, \App\AutoAssign::MODE_MANUAL)) {

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

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

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

                            'linktype' => 'DETAIL_VIEW_EXTENDED',

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

            /**

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

                    $userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();

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

                    if (\Config\Components\InterestsConflict::$isActive && \App\Components\InterestsConflict::getParent($recordId, $moduleName)) {

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

                                'linkhint' => 'BTN_WORKFLOW_TRIGGER',

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

                        $iconClass = 'fa-eye-slash';

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

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

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

                            'linkicon' => 'yfi yfi-automatic-assignment',

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

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

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

                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                            'linktype' => 'DETAIL_VIEW_EXTENDED',

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

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

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

            /**

        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

                if ($this->has('Links')) {

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

                $moduleName = $moduleModel->getName();

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

                $linkModelList = [];

        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

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

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

                                'linkclass' => 'btn-outline-warning btn-sm',

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

                                'linkhint' => 'BTN_GENERATE_RECORD',

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

                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                        ]);

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

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

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

                        ]);

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

                        && array_filter($recordModel->getModule()->getFieldsByType('phone', true), fn ($fieldModel) => !$recordModel->isEmpty($fieldModel->getName()))

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

                            'linklabel' => 'BTN_SMSNOTIFIER',

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

                    if ($fields = App\Field::getQuickChangerFields($moduleModel->getId())) {

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

                        }

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

                            'linkicon' => 'yfi yfi-full-editing-view',

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

                            'linkhint' => 'BTN_RECORD_OPEN',

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

                            'linklabel' => 'BTN_ASSIGN_TO',

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

                    $stateColors = App\Config::search('LIST_ENTITY_STATE_COLOR');

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

                            'linklabel' => 'LBL_MOVE_TO_TRASH',

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

                            $additionalClass = ' d-none';

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

             *

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

                }

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

                    if (\Config\Components\InterestsConflict::$isActive && \App\Components\InterestsConflict::getParent($recordId, $moduleName)) {

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

                            'linkdata' => ['url' => "index.php?module={$moduleName}&view=InterestsConflictModal&mode=confirmation&fromView=Detail&record={$recordId}"],

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

                            'linkhint' => 'LBL_INTERESTS_CONFLICT_CONFIRMATION',

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

                            $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                            ]);

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

                        Vtiger_Loader::includeOnce('~~modules/com_vtiger_workflow/VTEntityMethodManager.php');

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

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

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

                            $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

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

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

                        ]);

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

                            'linklabel' => '',

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

                    }

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

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

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

                            'modalView' => true,

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

                            'linkdata' => ['url' => "index.php?module={$moduleModel->getName()}&view=RecordConverter&sourceView=Detail&selected_ids=[{$recordModel->getId()}]"],

        Line exceeds 120 characters; contains 168 characters
        Open

                            'linkdata' => ['url' => "index.php?module={$moduleModel->getName()}&view=RecordConverter&sourceView=Detail&selected_ids=[{$recordModel->getId()}]"],

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

                            'linkclass' => 'btn-outline-dark btn-sm',

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

                                    'linktype' => 'DETAIL_VIEW_BASIC',

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

                            'linkhint' => 'BTN_ASSIGN_TO',

        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' => \App\Language::translate('LBL_MOVE_TO_TRASH'),

        Line exceeds 120 characters; contains 125 characters
        Open

                            'linkdata' => ['confirm' => \App\Language::translate('LBL_MOVE_TO_TRASH_DESC'), 'source-view' => 'Href'],

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

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

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

                        }

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

            public function getDetailViewRelatedLinks()

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

                    ];

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

                        'linkKey' => 'LBL_RECORD_SUMMARY',

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

                    'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showDetailViewByMode&requestMode=full',

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

                            'relatedModuleName' => $relation->get('relatedModuleName'),

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

                    if ($relation->isRelatedViewType($viewType)) {

        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 set the record instance3.

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

             * Function to get the detail view links (links, widgets, button).

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

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

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

                $recordId = $recordModel->getId();

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

                if ($recordModel->isReadOnly()) {

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

                            'linkhint' => 'LBL_INTERESTS_CONFLICT_UNLOCK',

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

                        ]);

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

                    }

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

                                'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                    }

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

                    }

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

                                    'linklabel' => $field['btn_name'],

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

                            'linklabel' => 'BTN_RECORD_EDIT',

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

                            'linktype' => 'DETAIL_VIEW_BASIC',

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

                            'linkclass' => 'js-show-modal btn-outline-dark btn-sm',

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

                    }

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

                            'linklabel' => 'LBL_ARCHIVE_RECORD',

        Line exceeds 120 characters; contains 150 characters
        Open

                            'dataUrl' => 'index.php?module=' . $recordModel->getModuleName() . '&action=State&state=Archived&record=' . $recordModel->getId(),

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

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

        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 ($relatedLinks as &$relatedLinkEntry) {

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

                    $linkModelList[$relatedLink->getType()][] = $relatedLink;

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

                if (!empty($allLinks)) {

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

                return $linkModelList;

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

             *

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

                $recordModel = $this->getRecord();

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

                        'linktype' => 'DETAILVIEWTAB',

        Line exceeds 120 characters; contains 174 characters
        Open

                if ($parentModuleModel->isCommentEnabled() && ($modCommentsModel = Vtiger_Module_Model::getInstance('ModComments')) && $modCommentsModel->isPermitted('DetailView')) {

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

                        'linklabel' => 'ModComments',

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

                        'countRelated' => App\Config::module('ModTracker', 'UNREVIEWED_COUNT') && $parentModuleModel->isPermitted('ReviewingUpdates'),

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

                    $moduleModel = $this->getModule();

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

                        foreach ($widgetCol as $widget) {

        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 getDetailViewLinks(array $linkParams): array

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

                $recordModel = $this->getRecord();

        Line exceeds 120 characters; contains 159 characters
        Open

                            'linkdata' => ['url' => "index.php?module={$moduleName}&view=InterestsConflictModal&mode=confirmation&fromView=Detail&record={$recordId}"],

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

                                'linkclass' => 'btn-outline-primary btn-sm',

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

                                'linklabel' => '',

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

                    }

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

                            $linkModelList['DETAIL_VIEW_ADDITIONAL'][] = Vtiger_Link_Model::getInstanceFromValues([

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

                        $watchdog = Vtiger_Watchdog_Model::getInstanceById($recordId, $moduleName);

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

                            'linklabel' => '',

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

                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                        && $smsModuleModel->isQuickCreateSupported()

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

                                    'linkurl' => "javascript:Vtiger_Detail_Js.runRecordChanger({$field['id']})",

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

                    if ($recordModel->privilegeToActivate()) {

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

                            'linktype' => 'DETAIL_VIEW_EXTENDED',

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

                            'linkclass' => 'entityStateBtn btn-outline-dark btn-sm js-action-confirm',

        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

                        $linkModelList['DETAIL_VIEW_EXTENDED'][] = Vtiger_Link_Model::getInstanceFromValues([

        Line exceeds 120 characters; contains 136 characters
        Open

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

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

                        ]);

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

                            'linkclass' => 'js-duplicate-btn btn-outline-dark btn-sm',

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

                    }

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

                            'linkclass' => 'btn-outline-dark btn-sm showModal js-pdf' . $additionalClass,

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

                        $linkModelList[$type] = $linkModelList[$type] ?? [];

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

                $this->set('Links', $linkModelList);

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

                        'linklabel' => 'LBL_RECORD_SUMMARY',

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

                //link which shows the summary information(generally detail of record)

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

                ];

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

                    ];

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

                if (

        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

                                    $this->widgets[$widgetObject['wcol']][] = $widgetObject;

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

             */

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

                $moduleModel = $this->getModule();

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

                    if ($moduleModel->isPermitted('WorkflowTrigger')

        Line exceeds 120 characters; contains 186 characters
        Open

                     && ($recordModel->isEditable() || ($recordModel->isPermitted('EditView') && $moduleModel->isPermitted('WorkflowTriggerWhenRecordIsBlocked') && $recordModel->isBlocked()))) {

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

                            'linkhint' => 'BTN_WATCHING_RECORD',

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

                            'linkclass' => $class,

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

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

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

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

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

                            'linkclass' => 'btn-outline-dark btn-sm',

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

                    }

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

                    ) {

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

                            'linktype' => 'DETAIL_VIEW_ADDITIONAL',

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

                                    'linkhint' => $field['btn_name'],

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

                                ]);

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

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

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

                            'linktype' => 'DETAIL_VIEW_EXTENDED',

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

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

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

                $relatedLinks = $this->getDetailViewRelatedLinks();

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

                $this->getWidgets();

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

                        'linkicon' => '',

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

                    && \App\Module::isModuleActive('Chat') && !\App\RequestUtil::getBrowserInfo()->ie

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

                            'relationId' => $relation->getId(),

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

                return $relatedLinks;

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

                            'relatedModuleName' => $relation->get('relatedModuleName'),

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

                            'relationId' => $relation->getId(),

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

                            $linkModelList[$type][] = $linkModel;

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

                if ($parentModuleModel->isTrackingEnabled() && $parentModuleModel->isPermitted('ModTracker')) {

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

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

                                $widgetInstance = new $widgetName($moduleName, $moduleModel, $recordId, $widget);

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

                                $widgetObject = $widgetInstance->getWidget();

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

                                }

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

                        'linkurl' => $recordModel->getDetailViewUrl() . '&mode=processWizard',

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

                if ($parentModuleModel->isSummaryViewSupported() && $this->widgetsList) {

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

                    'linkKey' => 'LBL_RECORD_DETAILS',

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

                if ($parentModuleModel->isCommentEnabled() && ($modCommentsModel = Vtiger_Module_Model::getInstance('ModComments')) && $modCommentsModel->isPermitted('DetailView')) {

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

                        'linklabel' => 'LBL_CHAT',

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

                foreach ($parentModuleModel->getRelations() as $relation) {

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

                        $relatedLinks[] = [

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

             *

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

                $relatedLinks = [];

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

                            'linklabel' => $relation->get('label'),

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

             * Function to get the detail view widgets.

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

            public function getWidgets()

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

                    $recordId = $this->getRecord()->getId();

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

                    }

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

             * @param <Array> $linkParams

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

                $listLinks = Vtiger_Link_Model::getAllByType($this->getModule()->getId(), $listLinkTypes);

        Line exceeds 120 characters; contains 143 characters
        Open

                        $link->linkurl = $link->linkurl . '&record=' . $this->getRecord()->getId() . '&source_module=' . $this->getModule()->getName();

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

            public function getModuleLabel()

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

                $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'DetailView', $moduleName);

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

                            continue;

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

                }

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

                ksort($headerFields);

        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 ($allLinksByType as $linkModel) {

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

            {

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

                        'linkicon' => '',

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

                    'linklabel' => 'LBL_RECORD_DETAILS',

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

                    'related' => 'Details',

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

                        'countRelated' => App\Config::relation('SHOW_RECORDS_COUNT'),

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

                }

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

                            'linklabel' => $relation->get('label'),

        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 getBlocks($viewType)

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

                    $modelWidgets = $moduleModel->getWidgets($moduleName);

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

                $linkTypes = ['SIDEBARLINK', 'SIDEBARWIDGET'];

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

                        $moduleLinks['SIDEBARLINK'][] = $link;

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

             * @return string - name of the module

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

            public function getModuleName()

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

                return $instance->setModule($moduleModel)->setRecord($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

                        'linktype' => 'DETAILVIEWTAB',

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

                        'badgeClass' => 'bgDanger',

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

                }

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

                            'linkurl' => $relation->getListUrl($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

                            if (class_exists($widgetName)) {

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

                                $this->widgetsList[] = $widget['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

             * @return Vtiger_DetailView_Model

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

            public static function getInstance($moduleName, $recordId)

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

             * Function to get the Quick Links for the Detail view of the module.

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

                    }

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

                }

        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 ($result = $instance->process($this)) {

        Line exceeds 120 characters; contains 228 characters
        Open

                $allLinks = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['DETAIL_VIEW_ADDITIONAL', 'DETAIL_VIEW_BASIC', 'DETAIL_VIEW_HEADER_WIDGET', 'DETAIL_VIEW_EXTENDED', 'DETAILVIEWTAB', 'DETAILVIEWRELATED'], $linkParams);

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

             * Function to get the detail view related links.

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

             */

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

                if (class_exists($parentModuleModel->getName() . '_ProcessWizard_Model') && $recordModel->isEditable()) {

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

                        'linktype' => 'DETAILVIEWTAB',

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

                    $relatedLinks[] = [

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

                }

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

                        'linklabel' => 'LBL_UPDATES',

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

            {

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

                            'linkurl' => $relation->getListUrl($recordModel),

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

                return $relatedLinks;

        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 module label.

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

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

                $path = 'modules' . DIRECTORY_SEPARATOR . $moduleName . DIRECTORY_SEPARATOR . 'headerfields';

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

                if (!is_dir($path)) {

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

                foreach (new DirectoryIterator($path) as $fileinfo) {

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

                }

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

                        'linktype' => 'DETAILVIEWTAB',

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

                            'linkicon' => '',

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

                        ];

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

             * @param type $viewType

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

             */

        Line exceeds 120 characters; contains 142 characters
        Open

                                if (\count($widgetObject) > 0 && (!method_exists($widgetInstance, 'isPermitted') || $widgetInstance->isPermitted())) {

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

                    foreach ($listLinks['DETAILVIEWSIDEBARLINK'] as $link) {

        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->getModule()->get('name');

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

             *

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

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

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

                $allLinks = Vtiger_Link_Model::getAllByType($moduleModel->getId(), ['DETAIL_VIEW_ADDITIONAL', 'DETAIL_VIEW_BASIC', 'DETAIL_VIEW_HEADER_WIDGET', 'DETAIL_VIEW_EXTENDED', 'DETAILVIEWTAB', 'DETAILVIEWRELATED'], $linkParams);

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

            /**

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

             * @return <array> - list of links parameters

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

                $relatedLinks = [];

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

                    ];

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

                $relatedLinks[] = [

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

                    'linktype' => 'DETAILVIEWTAB',

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

                    $relatedLinks[] = [

        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

                            $widgetName = Vtiger_Loader::getComponentClassName('Widget', $widget['type'], $moduleName);

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

                                if (\count($widgetObject) > 0 && (!method_exists($widgetInstance, 'isPermitted') || $widgetInstance->isPermitted())) {

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

                $listLinkTypes = ['DETAILVIEWSIDEBARLINK', 'DETAILVIEWSIDEBARWIDGET'];

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

                        $moduleLinks['SIDEBARWIDGET'][] = $link;

        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 [];

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

            /**

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

             */

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

            {

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

            public function getCustomHeaderFields()

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

                return $headerFields;

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

                if (isset($listLinks['DETAILVIEWSIDEBARLINK'])) {

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

             * @param string $moduleName - module name

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

             * @param string $recordId   - record id

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

                $headerFields = [];

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

                        $name = reset($filename);

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

                        if (method_exists($instance, 'checkPermission') && !$instance->checkPermission()) {

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

            }

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

                        'related' => 'Summary',

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

                        'related' => $modCommentsModel->getName(),

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

                        'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showRecentActivities&page=1',

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

                        'linkicon' => '',

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

                        'related' => 'ModTracker',

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

                ) {

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

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

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

                            'linktype' => 'DETAILVIEWRELATED',

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

                    }

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

                $recordModel = $this->getRecord();

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

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

                if (isset($listLinks['DETAILVIEWSIDEBARWIDGET'])) {

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

                        $link->linkurl = $link->linkurl . '&record=' . $this->getRecord()->getId() . '&source_module=' . $this->getModule()->getName();

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

                return $moduleLinks;

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

             * Function to get the instance.

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

             */

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

            {

        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

                    $relatedLinks[] = [

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

                            'linkicon' => '',

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

            }

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

                $moduleLinks = $this->getModule()->getSideBarLinks($linkTypes);

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

             */

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

            }

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

            }

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

                    if (!$fileinfo->isDot()) {

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

                $parentModuleModel = $this->getModule();

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

                        'linklabel' => 'LBL_RECORD_PROCESS_WIZARD',

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

                    'linkicon' => '',

        Line exceeds 120 characters; contains 142 characters
        Open

                        'countRelated' => App\Config::module('ModTracker', 'UNREVIEWED_COUNT') && $parentModuleModel->isPermitted('ReviewingUpdates'),

        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\User::getCurrentUserId() === \App\User::getCurrentUserRealId()

        Line exceeds 120 characters; contains 185 characters
        Open

                    if ($relation->isRelatedViewType('RelatedTab') && (!$relation->isDirectRelation() || !($relationField = $relation->getRelationField()) || $relationField->isActiveField())) {

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

                        $relatedLinks[] = Vtiger_Link_Model::getInstanceFromValues([

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

                    foreach ($modelWidgets as $widgetCol) {

        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 $this->getModule()->get('label');

        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

                    $relatedLinks[] = [

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

                        'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showAllComments',

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

                    $relatedLinks[] = [

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

                    && false !== \App\ModuleHierarchy::getModuleLevel($parentModuleModel->getName())

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

                        'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showChat',

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

                    if ($relation->isRelatedViewType('RelatedTab') && (!$relation->isDirectRelation() || !($relationField = $relation->getRelationField()) || $relationField->isActiveField())) {

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

                }

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

             * @return type

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

                foreach ($this->getModule()->getRelations() as $relation) {

        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($this->widgetsList)) {

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

             * @return <Array> List of Vtiger_Link_Model instances

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

                }

        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

                        $filename = explode('.', $fileinfo->getFilename());

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

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

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

                        'linkKey' => 'LBL_RECORD_PROCESS_WIZARD',

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

                        'linkicon' => '',

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

                        'linkurl' => $recordModel->getDetailViewUrl() . '&mode=showDetailViewByMode&requestMode=summary',

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

                        'related' => 'Summary',

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

                        'linktype' => 'DETAILVIEWTAB',

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

                        $link->linkurl = $link->linkurl . '&record=' . $this->getRecord()->getId() . '&source_module=' . $this->getModule()->getName();

        Line exceeds 120 characters; contains 143 characters
        Open

                        $link->linkurl = $link->linkurl . '&record=' . $this->getRecord()->getId() . '&source_module=' . $this->getModule()->getName();

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

                    foreach ($listLinks['DETAILVIEWSIDEBARWIDGET'] as $link) {

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

            {

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

                        $instance = new $modelClassName();

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

                            $headerFields[$name] = $result;

        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 module name.

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

                $instance = new $modelClassName();

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

                $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $moduleName);

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

                }

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

        class Vtiger_DetailView_Model extends \App\Base

        Space before opening parenthesis of function call prohibited
        Open

                        && array_filter($recordModel->getModule()->getFieldsByType('phone', true), fn ($fieldModel) => !$recordModel->isEmpty($fieldModel->getName()))

        Expected 0 spaces after opening bracket; newline found
        Open

                if (

        There are no issues that match your filters.

        Category
        Status