YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
C
1 day
Test Coverage
F
0%

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

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $recordId = $request->getInteger('record');
Severity: Minor
Found in modules/Vtiger/views/Edit.php - About 5 hrs to fix

Cognitive Complexity

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

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

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

Further reading

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

    public function process(App\Request $request)
    {
        $viewer = $this->getViewer($request);
        $moduleName = $request->getModule();
        $recordId = $request->getInteger('record');
Severity: Major
Found in modules/Vtiger/views/Edit.php - About 3 hrs to fix

    Function getDuplicate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getDuplicate()
        {
            $fromRecord = $this->record->getId();
            $this->record->set('id', '');
            foreach ($this->record->getModule()->getFields() as $fieldModel) {
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 process() has an NPath complexity of 2916. The configured NPath complexity threshold is 200.
    Open

        public function process(App\Request $request)
        {
            $viewer = $this->getViewer($request);
            $moduleName = $request->getModule();
            $recordId = $request->getInteger('record');
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 process() has a Cyclomatic Complexity of 26. The configured cyclomatic complexity threshold is 10.
    Open

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

    CyclomaticComplexity

    Since: 0.1

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

    Example

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

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

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

        public function process(App\Request $request)
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by sonar-php

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

    See

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

    class Vtiger_Edit_View extends Vtiger_Index_View
    {
        /**
         * Record model instance.
         *
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 '118', column '23').
    Open

            $eventHandler = new App\EventHandler();
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 '33', column '14').
    Open

                throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 '173', column '23').
    Open

            $eventHandler = new App\EventHandler();
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Avoid using static access to class 'Vtiger_Record_Model' in method 'checkPermission'.
    Open

                $this->record = Vtiger_Record_Model::getCleanInstance($moduleName);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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_EditView_Model' in method 'process'.
    Open

            $editModel = Vtiger_EditView_Model::getInstance($moduleName, $recordId);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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\Record' in method 'getDuplicate'.
    Open

                    || ($fieldModel->isReferenceField() && ($value = $this->record->get($fieldModel->getName())) && !\App\Record::isExists($value))
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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\Json' in method 'process'.
    Open

            $viewer->assign('MAPPING_RELATED_FIELD', \App\Json::encode(\App\ModuleHierarchy::getRelationFieldByHierarchy($moduleName)));
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 'process'.
    Open

            if ($editViewLayout = ((1 === $moduleModel->getModuleType() || (\in_array($moduleName, \App\Config::performance('MODULES_SPLITTED_EDIT_VIEW_LAYOUT', [])))) && \App\Config::performance('INVENTORY_EDIT_VIEW_LAYOUT'))) {
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 'checkPermission'.
    Open

                $this->record = Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $moduleName);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

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

            $viewer->assign('RECORD_ACTIVITY_NOTIFIER', $recordId && \App\Config::performance('recordActivityNotifier', false) && $moduleModel->isTrackingEnabled() && $moduleModel->isPermitted('RecordActivityNotifier'));
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

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

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

                    $parentRecordModel = Vtiger_Record_Model::getInstanceById($referenceId);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 'process'.
    Open

            $viewer->assign('MAPPING_RELATED_FIELD', \App\Json::encode(\App\ModuleHierarchy::getRelationFieldByHierarchy($moduleName)));
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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\Json' in method 'process'.
    Open

            $viewer->assign('LIST_FILTER_FIELDS', \App\Json::encode(\App\ModuleHierarchy::getFieldsForListFilter($moduleName)));
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 'process'.
    Open

            $viewer->assign('LIST_FILTER_FIELDS', \App\Json::encode(\App\ModuleHierarchy::getFieldsForListFilter($moduleName)));
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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 'process'.
    Open

            if ($editViewLayout = ((1 === $moduleModel->getModuleType() || (\in_array($moduleName, \App\Config::performance('MODULES_SPLITTED_EDIT_VIEW_LAYOUT', [])))) && \App\Config::performance('INVENTORY_EDIT_VIEW_LAYOUT'))) {
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

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

        public function getDuplicate()
        {
            $fromRecord = $this->record->getId();
            $this->record->set('id', '');
            foreach ($this->record->getModule()->getFields() as $fieldModel) {
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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_RecordStructure_Model' in method 'process'.
    Open

            $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($this->record, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                $pageTitle = App\Language::translate('LBL_VIEW_EDIT', $moduleName);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $referenceId = $request->getInteger('reference_id');
                if ($referenceId) {
                    $parentRecordModel = Vtiger_Record_Model::getInstanceById($referenceId);
                    $this->record->setRecordFieldValues($parentRecordModel);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $this->record = Vtiger_Record_Model::getCleanInstance($moduleName);
                $isPermitted = $this->record->isCreateable();
            }
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $pageTitle = App\Language::translate('LBL_VIEW_CREATE', $moduleName);
            }
    Severity: Minor
    Found in modules/Vtiger/views/Edit.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\RecordConverter' in method 'process'.
    Open

                $convertInstance = \App\RecordConverter::getInstanceById($request->getInteger('recordConverter'), $request->getByType('sourceModule', 2));
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                $this->record = $convertInstance->processToEdit($request->getInteger('sourceRecord'), $moduleName);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            if ($request->has('record')) {
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

                            if ($fieldModel->isEditable() && ('' === $fieldModel->get('fieldvalue') || null === $fieldModel->get('fieldvalue'))) {
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

                $isPermitted = $this->record->isEditable() || (true === $request->getBoolean('isDuplicate') && $this->record->getModule()->isPermitted('DuplicateRecord') && $this->record->isCreateable() && $this->record->isViewable());
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('MODE', $mode);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('MAPPING_RELATED_FIELD', \App\Json::encode(\App\ModuleHierarchy::getRelationFieldByHierarchy($moduleName)));
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Saw unextractable annotation for comment '* @return <array> - List of Vtiger_JsScript_Model instances'</array>
    Open

         * @return <Array> - List of Vtiger_JsScript_Model instances
    Severity: Info
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

                $viewer->assign('SOURCE_RECORD', $request->getInteger('sourceRecord'));
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Argument 2 (recordId) is int but \Vtiger_EditView_Model::getInstance() takes string defined at /code/modules/Vtiger/models/EditView.php:24
    Open

            $editModel = Vtiger_EditView_Model::getInstance($moduleName, $recordId);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('LIST_FILTER_FIELDS', \App\Json::encode(\App\ModuleHierarchy::getFieldsForListFilter($moduleName)));
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('CURRENTDATE', date('Y-n-j'));
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

                $viewer->assign('SOURCE_RECORD', $request->getInteger('sourceRecord'));
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('EDITVIEW_LINKS', $viewLinks);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

                $viewer->assign('RECORD_ID', $recordId);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

                $viewer->assign('RECORD_CONVERTER', $convertInstance->getId());
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

                $viewer->assign('RECORD_STRUCTURE_RIGHT', $recordStructureRight);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('ADDRESS_BLOCK_LABELS', ['LBL_ADDRESS_INFORMATION', 'LBL_ADDRESS_MAILING_INFORMATION', 'LBL_ADDRESS_DELIVERY_INFORMATION', 'LBL_ADDRESS_BILLING', 'LBL_ADDRESS_SHIPPING']);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

                $viewer->assign('SOURCE_MODULE', $request->getByType('sourceModule', 2));
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('RECORD_STRUCTURE', $recordStructure);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('RECORD_ACTIVITY_NOTIFIER', $recordId && \App\Config::performance('recordActivityNotifier', false) && $moduleModel->isTrackingEnabled() && $moduleModel->isPermitted('RecordActivityNotifier'));
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('EDIT_VIEW_LAYOUT', $editViewLayout);
    Severity: Critical
    Found in modules/Vtiger/views/Edit.php by phan

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

            $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($this->record, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    LongVariable

    Since: 0.2

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

    Example

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

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

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

    class Vtiger_Edit_View extends Vtiger_Index_View

    The class Vtiger_Edit_View is not named in CamelCase.
    Open

    class Vtiger_Edit_View extends Vtiger_Index_View
    {
        /**
         * Record model instance.
         *
    Severity: Minor
    Found in modules/Vtiger/views/Edit.php by phpmd

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

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

         *

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

        /**

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

         * Record model instance.

    Line exceeds 120 characters; contains 231 characters
    Open

                $isPermitted = $this->record->isEditable() || (true === $request->getBoolean('isDuplicate') && $this->record->getModule()->isPermitted('DuplicateRecord') && $this->record->isCreateable() && $this->record->isViewable());

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

                $viewer->assign('RECORD_ID', $recordId);

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

            $moduleModel = $this->record->getModule();

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

            $fieldList = $moduleModel->getFields();

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

                    $fieldModel->getUITypeModel()->setValueFromRequest($request, $this->record);

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

            $viewer->assign('MODULE_TYPE', $moduleModel->getModuleType());

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

        {

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

            $moduleName = $request->getModule();

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

        /**

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

                $pageTitle = App\Language::translate('LBL_VIEW_DUPLICATE', $moduleName);

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

            } else {

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

            }

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

            $recordStructure = $recordStructureInstance->getStructure();

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

            $isRelationOperation = $request->getBoolean('relationOperation');

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

            $viewer->assign('MAPPING_RELATED_FIELD', \App\Json::encode(\App\ModuleHierarchy::getRelationFieldByHierarchy($moduleName)));

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

            $viewer->assign('LIST_FILTER_FIELDS', \App\Json::encode(\App\ModuleHierarchy::getFieldsForListFilter($moduleName)));

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

         * @var Vtiger_Record_Model

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

         * Get breadcrumb title.

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

        {

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

            if (!empty($recordId) && true === $request->getBoolean('isDuplicate')) {

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

                $viewer->assign('SOURCE_RECORD', $request->getInteger('sourceRecord'));

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

            } else {

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

                $viewer->assign('SOURCE_MODULE', $request->getByType('sourceModule', 2));

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

                        }

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

                    }

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

            $viewer->assign('ADDRESS_BLOCK_LABELS', ['LBL_ADDRESS_INFORMATION', 'LBL_ADDRESS_MAILING_INFORMATION', 'LBL_ADDRESS_DELIVERY_INFORMATION', 'LBL_ADDRESS_BILLING', 'LBL_ADDRESS_SHIPPING']);

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

            $viewer->assign('RECORD', $this->record);

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

                $this->record = Vtiger_Record_Model::getCleanInstance($moduleName);

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

            }

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

         */

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

            return $pageTitle;

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

                $mode = 'duplicate';

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

            foreach (array_intersect($request->getKeys(), array_keys($fieldList)) as $fieldName) {

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

                            }

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

            $eventHandler->setRecordModel($this->record);

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

            $eventHandler->setModuleName($moduleName);

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

            $eventHandler->trigger('EditViewBefore');

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

                        unset($recordStructure[$field->getBlockName()]);

    Line exceeds 120 characters; contains 124 characters
    Open

            $viewer->assign('LIST_FILTER_FIELDS', \App\Json::encode(\App\ModuleHierarchy::getFieldsForListFilter($moduleName)));

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

                $isPermitted = $this->record->isCreateable();

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

            } elseif ($request->has('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

                $mode = 'edit';

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

            }

    Line exceeds 120 characters; contains 165 characters
    Open

            $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($this->record, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);

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

                            if ($fieldModel->isEditable() && ('' === $fieldModel->get('fieldvalue') || null === $fieldModel->get('fieldvalue'))) {

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

            ['viewLinks' => $viewLinks] = $eventHandler->getParams();

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

                foreach ($moduleModel->getFieldsByType('text') as $field) {

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

        public function getDuplicate()

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

            } elseif (!empty($recordId)) {

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

                if ($referenceId) {

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

                    if (isset($recordStructure[$field->getBlockName()][$field->getName()])) {

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

                    }

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

            $viewer->assign('EDITVIEW_LINKS', $viewLinks);

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

            $viewer->assign('RECORD_STRUCTURE_MODEL', $recordStructureInstance);

    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

        protected $record;

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

            $moduleName = $request->getModule();

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

            }

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

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

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

                $this->record = $convertInstance->processToEdit($request->getInteger('sourceRecord'), $moduleName);

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

                    $parentRecordModel = Vtiger_Record_Model::getInstanceById($referenceId);

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

                foreach ($recordStructure as $block) {

    Line exceeds 120 characters; contains 142 characters
    Open

                            if ($fieldModel->isEditable() && ('' === $fieldModel->get('fieldvalue') || null === $fieldModel->get('fieldvalue'))) {

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

            ]);

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

            $viewer->assign('RECORD_STRUCTURE', $recordStructure);

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

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

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

            $viewer->assign('RECORD_ACTIVITY_NOTIFIER', $recordId && \App\Config::performance('recordActivityNotifier', false) && $moduleModel->isTrackingEnabled() && $moduleModel->isPermitted('RecordActivityNotifier'));

    Line exceeds 120 characters; contains 216 characters
    Open

            $viewer->assign('RECORD_ACTIVITY_NOTIFIER', $recordId && \App\Config::performance('recordActivityNotifier', false) && $moduleModel->isTrackingEnabled() && $moduleModel->isPermitted('RecordActivityNotifier'));

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

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

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

        }

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

         * Set duplicate data.

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

                'viewInstance' => $this,

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

            $moduleName = $request->getModule();

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

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

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

                $this->record = Vtiger_Record_Model::getInstanceById($request->getInteger('record'), $moduleName);

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

         * @return string

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

            } elseif (!$request->isEmpty('recordConverter')) {

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

                if ($fieldModel->isWritable()) {

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

            if ($isRelationOperation) {

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

                'mode' => ucfirst($mode),

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

            $viewer->assign('EDIT_VIEW_LAYOUT', $editViewLayout);

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

            foreach ($this->record->getModule()->getFields() as $fieldModel) {

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

                    || ($fieldModel->isReferenceField() && ($value = $this->record->get($fieldModel->getName())) && !\App\Record::isExists($value))

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

                'fromRecord' => $fromRecord,

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

            }

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

            $eventHandler->setRecordModel($this->record);

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

                $fileNames = [

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

                $pageTitle = App\Language::translate('LBL_VIEW_EDIT', $moduleName);

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

            $moduleName = $request->getModule();

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

                $viewer->assign('RECORD_CONVERTER', $convertInstance->getId());

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

                    $this->record->setRecordFieldValues($parentRecordModel);

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

                }

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

            $viewer->assign('CURRENTDATE', date('Y-n-j'));

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

            $this->record->set('id', '');

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

                ) {

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

            $eventHandler->setParams([

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

                }

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

            $eventHandler->setModuleName($this->record->getModuleName());

    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

         * @param \App\Request $request

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

            $parentScript = parent::getFooterScripts($request);

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

                ];

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

         */

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

        {

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

            $mode = '';

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

                $referenceId = $request->getInteger('reference_id');

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

                }

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

                $this->record->initInventoryDataFromRequest($request);

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

            //if it is relation edit

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

                                $fieldModel->set('fieldvalue', $value);

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

                $recordStructureRight = [];

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

                        $recordStructureRight[$field->getBlockName()] = $recordStructure[$field->getBlockName()];

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

        public function getFooterScripts(App\Request $request)

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

        /** {@inheritdoc} */

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

                throw new \App\Exceptions\NoPermittedToRecord('ERR_NO_PERMISSIONS_FOR_THE_RECORD', 406);

    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

        /** {@inheritdoc} */

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

                'viewInstance' => $this,

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

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

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

            $viewer->assign('BLOCK_LIST', $moduleModel->getBlocks());

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

                if ((!$fieldModel->isDuplicable() && !$this->record->isEmpty($fieldModel->getName()))

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

            if (Vtiger_Module_Model::getInstance($moduleName)->isInventory()) {

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

        public function checkPermission(App\Request $request)

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

            } else {

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

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

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

                $pageTitle = App\Language::translate('LBL_VIEW_CREATE', $moduleName);

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

                $fieldModel = $fieldList[$fieldName];

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

            }

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

            $viewer->assign('IS_RELATION_OPERATION', $isRelationOperation);

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

                $viewer->assign('SOURCE_RECORD', $request->getInteger('sourceRecord'));

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

            $eventHandler = new App\EventHandler();

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

            $eventHandler->setParams([

    Line exceeds 120 characters; contains 132 characters
    Open

            $viewer->assign('MAPPING_RELATED_FIELD', \App\Json::encode(\App\ModuleHierarchy::getRelationFieldByHierarchy($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

         * @return <Array> - List of Vtiger_JsScript_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

                $this->getDuplicate();

    Line exceeds 120 characters; contains 225 characters
    Open

            if ($editViewLayout = ((1 === $moduleModel->getModuleType() || (\in_array($moduleName, \App\Config::performance('MODULES_SPLITTED_EDIT_VIEW_LAYOUT', [])))) && \App\Config::performance('INVENTORY_EDIT_VIEW_LAYOUT'))) {

    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

            $viewer->assign('RECORD_ID', '');

    Line exceeds 120 characters; contains 150 characters
    Open

                $convertInstance = \App\RecordConverter::getInstanceById($request->getInteger('recordConverter'), $request->getByType('sourceModule', 2));

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

                    foreach ($sourceRelatedField as $field => $value) {

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

                'viewLinks' => $viewLinks,

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

            if ($editViewLayout = ((1 === $moduleModel->getModuleType() || (\in_array($moduleName, \App\Config::performance('MODULES_SPLITTED_EDIT_VIEW_LAYOUT', [])))) && \App\Config::performance('INVENTORY_EDIT_VIEW_LAYOUT'))) {

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

            $fromRecord = $this->record->getId();

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

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

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

                    'modules.' . $moduleName . '.resources.Inventory',

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

                $isPermitted = $this->record->isEditable() || (true === $request->getBoolean('isDuplicate') && $this->record->getModule()->isPermitted('DuplicateRecord') && $this->record->isCreateable() && $this->record->isViewable());

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

        public function getBreadcrumbTitle(App\Request $request)

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

        public function process(App\Request $request)

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

            $recordId = $request->getInteger('record');

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

                $convertInstance = \App\RecordConverter::getInstanceById($request->getInteger('recordConverter'), $request->getByType('sourceModule', 2));

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

            $editModel = Vtiger_EditView_Model::getInstance($moduleName, $recordId);

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

            $recordStructureInstance = Vtiger_RecordStructure_Model::getInstanceFromRecordModel($this->record, Vtiger_RecordStructure_Model::RECORD_STRUCTURE_MODE_EDIT);

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

                $sourceRelatedField = $moduleModel->getValuesFromSource($request);

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

                        if (isset($block[$field]) && '' !== $value) {

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

                            $fieldModel = $block[$field];

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

            $viewer->assign('MODE', $mode);

    Line exceeds 120 characters; contains 143 characters
    Open

                    || ($fieldModel->isReferenceField() && ($value = $this->record->get($fieldModel->getName())) && !\App\Record::isExists($value))

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

            $eventHandler->trigger('EditViewDuplicate');

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

                    'modules.Vtiger.resources.Inventory',

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

                $scriptInstances = $this->checkAndConvertJsScripts($fileNames);

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

            return $parentScript;

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

            if (!$isPermitted) {

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

         * @param \App\Request $request

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

            $viewLinks = $editModel->getEditViewLinks(['MODULE' => $moduleName, 'RECORD' => $recordId]);

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

            if ($moduleModel->isInventory() && !$request->isEmpty('inventory')) {

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

                }

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

            }

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

                }

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

                $viewer->assign('RECORD_STRUCTURE_RIGHT', $recordStructureRight);

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

            }

    Line exceeds 120 characters; contains 195 characters
    Open

            $viewer->assign('ADDRESS_BLOCK_LABELS', ['LBL_ADDRESS_INFORMATION', 'LBL_ADDRESS_MAILING_INFORMATION', 'LBL_ADDRESS_DELIVERY_INFORMATION', 'LBL_ADDRESS_BILLING', 'LBL_ADDRESS_SHIPPING']);

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

                    $this->record->set($fieldModel->getName(), '');

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

            ]);

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

                $parentScript = array_merge($parentScript, $scriptInstances);

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

            $eventHandler = new App\EventHandler();

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

         */

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

    class Vtiger_Edit_View extends Vtiger_Index_View

    There are no issues that match your filters.

    Category
    Status