YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
B
4 hrs
Test Coverage
F
0%

Method getRelatedModuleRecordIds has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getRelatedModuleRecordIds(App\Request $request, $recordIds, $relModData)
    {
        $basicModule = $request->getModule();
        $parentModuleModel = Vtiger_Module_Model::getInstance($basicModule);
        $relatedIds = [];
Severity: Minor
Found in modules/Vtiger/models/TransferOwnership.php - About 1 hr to fix

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

        public function getRelatedModuleRecordIds(App\Request $request, $recordIds, $relModData)
        {
            $basicModule = $request->getModule();
            $parentModuleModel = Vtiger_Module_Model::getInstance($basicModule);
            $relatedIds = [];
    Severity: Minor
    Found in modules/Vtiger/models/TransferOwnership.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 getRelationsByFields has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getRelationsByFields($privileges = true)
        {
            $module = $this->get('module');
            $moduleModel = Vtiger_Module_Model::getInstance($module);
            $relatedModelFields = $moduleModel->getFields();
    Severity: Minor
    Found in modules/Vtiger/models/TransferOwnership.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 getRelatedColumnName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getRelatedColumnName($relatedModule, $findModule)
        {
            $relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);
            $relatedModelFields = $relatedModuleModel->getFields();
            foreach ($relatedModelFields as $fieldModel) {
    Severity: Minor
    Found in modules/Vtiger/models/TransferOwnership.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 getRelationsByFields has a boolean flag argument $privileges, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public function getRelationsByFields($privileges = true)

    BooleanArgumentFlag

    Since: 1.4.0

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

    Example

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

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

    Missing class import via use statement (line '45', column '24').
    Open

                    $relatedIds = (new \App\Db\Query())->select([$tabIndex])->from($tablename)->where([$relIndex => $recordIds])->column();

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

        public function getRelationsByRelatedList($privileges = true)

    BooleanArgumentFlag

    Since: 1.4.0

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

    Example

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

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

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

                $modelClassName = Vtiger_Loader::getComponentClassName('Model', 'TransferOwnership', $module);

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

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

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

            $relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);

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

                        if (0 != $recordModel->get($field) && \App\Record::getType($recordModel->get($field)) == $relatedModule) {

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

                Vtiger_Cache::set('transferOwnership', $module, $instance);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Privilege' in method 'getRelationsByRelatedList'.
    Open

                if (\App\Privilege::isPermitted($relationModule, 'EditView')) {

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

                    $tablename = Vtiger_Relation_Model::getInstance($parentModuleModel, Vtiger_Module_Model::getInstance($relatedModule))->getRelationField()->get('table');

    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_RelationListView_Model' in method 'getRelatedModuleRecordIds'.
    Open

                        $relationListView = Vtiger_RelationListView_Model::getInstance($recordModel, $relatedModule);

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

                        $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $basicModule);

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

                $recordModel = Vtiger_Record_Model::getInstanceById($record, $module);

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

                        $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $basicModule);

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

            $parentModuleModel = Vtiger_Module_Model::getInstance($basicModule);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Privilege' in method 'getRelationsByFields'.
    Open

                        if (\App\Privilege::isPermitted($relation, 'EditView')) {

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

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

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

            $instance = Vtiger_Cache::get('transferOwnership', $module);

    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 "module" 3 times.
    Open

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

    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.

    Avoid unused parameters such as '$privileges'.
    Open

        public function getRelationsByRelatedList($privileges = true)

    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

    Avoid unused parameters such as '$privileges'.
    Open

        public function getRelationsByFields($privileges = true)

    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

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

                        $relatedIds = $relationListView->getRelationQuery()->select(['vtiger_crmentity.crmid'])

    Reference to undeclared property \CRMEntity->table_index
    Open

                    $tabIndex = CRMEntity::getInstance($relatedModule)->table_index;

    Call to undeclared method \App\Db\Query::select
    Open

                    $relatedIds = (new \App\Db\Query())->select([$tabIndex])->from($tablename)->where([$relIndex => $recordIds])->column();

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

        public function transferRecordsOwnership($module, $transferOwnerId, $relatedModuleRecordIds)

    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_TransferOwnership_Model extends \App\Base

    The class Vtiger_TransferOwnership_Model is not named in CamelCase.
    Open

    class Vtiger_TransferOwnership_Model extends \App\Base
    {
        protected $skipModules = [];
    
        public function getSkipModules()

    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

                    $relatedIds = (new \App\Db\Query())->select([$tabIndex])->from($tablename)->where([$relIndex => $recordIds])->column();

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

        }

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

            $instance = Vtiger_Cache::get('transferOwnership', $module);

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

            $relatedModules = [];

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

                }

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

                        'type' => $relation->getRelationType(),

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

        public function getRelatedColumnName($relatedModule, $findModule)

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

                    $tablename = Vtiger_Relation_Model::getInstance($parentModuleModel, Vtiger_Module_Model::getInstance($relatedModule))->getRelationField()->get('table');

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

                    $tabIndex = CRMEntity::getInstance($relatedModule)->table_index;

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

                        $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $basicModule);

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

                if ($fieldModel->isReferenceField()) {

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

            }

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

            $parentModuleModel = Vtiger_Module_Model::getInstance($basicModule);

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

            $relatedIds = [];

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

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

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

        public function getSkipModules()

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

                            $relatedIds[] = $recordModel->get($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

            foreach ($relatedModuleRecordIds as $record) {

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

            $moduleModel = Vtiger_Module_Model::getInstance($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

            $type = $relModData[1];

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

                    foreach ($referenceList as $relation) {

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

                $relationModule = $relation->getRelationModuleName();

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

                    $relatedModules[] = [

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

        {

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

                    $field = $relModData[2];

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

                    break;

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

        public static function getInstance($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

        protected $skipModules = [];

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

            return $this->skipModules;

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

            $basicModule = $request->getModule();

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

                case 0:

    Line exceeds 120 characters; contains 168 characters
    Open

                    $tablename = Vtiger_Relation_Model::getInstance($parentModuleModel, Vtiger_Module_Model::getInstance($relatedModule))->getRelationField()->get('table');

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

            return array_unique($relatedIds);

    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 $relatedModules;

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

        {

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

                            $relatedModules[] = ['name' => $relation, 'field' => $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

                        }

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

            switch ($type) {

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

                        if (0 != $recordModel->get($field) && \App\Record::getType($recordModel->get($field)) == $relatedModule) {

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

                    break;

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

                        $relationListView = Vtiger_RelationListView_Model::getInstance($recordModel, $relatedModule);

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

                            ->distinct()

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

        public function transferRecordsOwnership($module, $transferOwnerId, $relatedModuleRecordIds)

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

                    $recordModel->set('assigned_user_id', $transferOwnerId);

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

            $relatedModules = [];

    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

                    ];

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

            $relModData = explode('::', $relModData);

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

                    foreach ($recordIds as $recordId) {

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

                    $relIndex = $this->getRelatedColumnName($relatedModule, $basicModule);

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

                    break;

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

                }

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

        public function getRelationsByFields($privileges = true)

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

            }

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

                    $referenceList = $fieldModel->getReferenceList();

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

                case 1:

    Line exceeds 120 characters; contains 135 characters
    Open

                    $relatedIds = (new \App\Db\Query())->select([$tabIndex])->from($tablename)->where([$relIndex => $recordIds])->column();

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

                    foreach ($recordIds as $recordId) {

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

                        $relatedIds = $relationListView->getRelationQuery()->select(['vtiger_crmentity.crmid'])

    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 (!$instance) {

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

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

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

        public function getRelationsByRelatedList($privileges = true)

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

                        'name' => $relationModule,

    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 getRelatedModuleRecordIds(App\Request $request, $recordIds, $relModData)

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

                        }

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

                    break;

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

                            ->column();

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

                default:

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

                $recordModel = Vtiger_Record_Model::getInstanceById($record, $module);

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

                    $recordModel->save();

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

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

                Vtiger_Cache::set('transferOwnership', $module, $instance);

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

                        if (\App\Privilege::isPermitted($relation, 'EditView')) {

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

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

    Line exceeds 120 characters; contains 126 characters
    Open

                        if (0 != $recordModel->get($field) && \App\Record::getType($recordModel->get($field)) == $relatedModule) {

    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($recordModel->isEditable()){

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

            $relatedModelFields = $moduleModel->getFields();

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

            return $relatedModules;

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

                if (\App\Privilege::isPermitted($relationModule, 'EditView')) {

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

            $relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);

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

        }

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

            $relatedModule = $relModData[0];

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

                        $recordModel = Vtiger_Record_Model::getInstanceById($recordId, $basicModule);

    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 (!$relIndex) {

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

                        break;

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

                case 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

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

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

            }

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

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

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

                        return $fieldModel->get('column');

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

            return false;

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

        {

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

                if ($fieldModel->isReferenceField()) {

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

            foreach ($relatedModelFields as $fieldModel) {

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

            $relatedModelFields = $relatedModuleModel->getFields();

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

                    $referenceList = $fieldModel->getReferenceList();

    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 (\in_array($findModule, $referenceList)) {

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

                    }

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

    class Vtiger_TransferOwnership_Model extends \App\Base

    Expected 1 space after closing parenthesis; found 0
    Open

                if($recordModel->isEditable()){

    Expected 1 space after IF keyword; 0 found
    Open

                if($recordModel->isEditable()){

    There are no issues that match your filters.

    Category
    Status