YetiForceCompany/YetiForceCRM

View on GitHub
modules/Settings/ModuleManager/models/Module.php

Summary

Maintainability
A
4 hrs
Test Coverage
C
79%

Method createModule has 68 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function createModule(array $moduleInformation)
    {
        $moduleInformation['entityfieldname'] = strtolower(self::toAlphaNumeric($moduleInformation['entityfieldname']));

        $module = new vtlib\Module();
Severity: Major
Found in modules/Settings/ModuleManager/models/Module.php - About 2 hrs to fix

    Function getBaseModuleToolsExceptions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getBaseModuleToolsExceptions()
        {
            $exceptions = [];
            $actionIds = (new \App\Db\Query())->select(['actionname', 'actionid'])->from('vtiger_actionmapping')->createCommand()->queryAllByGroup();
            foreach (static::$baseModuleToolsExceptions as $moduleName => $moduleException) {
    Severity: Minor
    Found in modules/Settings/ModuleManager/models/Module.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

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

        public static function checkModuleName($name): bool
        {
            return
                preg_match('/Settings/i', $name)
                || preg_match('/Api/i', $name)

    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

    Missing class import via use statement (line '230', column '16').
    Open

            $block = new vtlib\Block();

    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 '238', column '17').
    Open

            $field1 = new vtlib\Field();

    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 '251', column '17').
    Open

            $field2 = new vtlib\Field();

    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 getAll has a boolean flag argument $isEntityType, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function getAll($presence = [], $restrictedModulesList = [], $isEntityType = false)

    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

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

        public static function getModulesCount($onlyActive = false)

    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 '279', column '18').
    Open

            $filter1 = new vtlib\Filter();

    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 '306', column '8').
    Open

            (new \App\BatchMethod(['method' => '\App\UserPrivilegesFile::recalculateAll', 'params' => []]))->save();

    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 '234', column '18').
    Open

            $blockcf = new vtlib\Block();

    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 '187', column '20').
    Open

            $subQuery = (new \App\Db\Query())->select(['tabid'])->from('vtiger_field')->where(['uitype' => 4])->distinct('tabid');

    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 '65', column '21').
    Open

            $actionIds = (new \App\Db\Query())->select(['actionname', 'actionid'])->from('vtiger_actionmapping')->createCommand()->queryAllByGroup();

    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 '188', column '22').
    Open

            $dataReader = (new \App\Db\Query())->select(['tabid', 'name'])

    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 '222', column '17').
    Open

            $module = new vtlib\Module();

    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 '172', column '17').
    Open

            $query = (new \App\Db\Query())->from('vtiger_tab');

    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 'App\Module' in method 'getBaseModuleToolsExceptions'.
    Open

                        $exceptions[App\Module::getModuleId($moduleName)][$type] = $moduleExceptions;

    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_Field_Model' in method 'createModule'.
    Open

            $field5 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['modifiedtime']);

    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_Field_Model' in method 'createModule'.
    Open

            $field4 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['createdtime']);

    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_Field_Model' in method 'createModule'.
    Open

            $field9 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['private']);

    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_Field_Model' in method 'createModule'.
    Open

            $field8 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['shownerid']);

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'App\Module' in method 'getBaseModuleToolsExceptions'.
    Open

                        $exceptions[App\Module::getModuleId($moduleName)][$type] = false;

    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 '\vtlib\Module' in method 'disableModule'.
    Open

            \vtlib\Module::toggleModuleAccess($moduleName, false);

    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 getBaseModuleToolsExceptions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                    } else {
                        $exceptions[App\Module::getModuleId($moduleName)][$type] = false;
                    }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

            $field7 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['modifiedby']);

    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_Field_Model' in method 'createModule'.
    Open

            $field3 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['assigned_user_id']);

    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_Field_Model' in method 'createModule'.
    Open

            $field6 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['created_user_id']);

    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 '\vtlib\Module' in method 'enableModule'.
    Open

            \vtlib\Module::toggleModuleAccess($moduleName, true);

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

            $moduleInformation['entityfieldname'] = strtolower(self::toAlphaNumeric($moduleInformation['entityfieldname']));

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

            'Documents' => ['notAllowed' => ['Import']],

    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 "Import" 4 times.
    Open

        public static $baseModuleTools = ['Import', 'Export', 'Merge', 'CreateCustomFilter',

    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 "tabid" 4 times.
    Open

            $subQuery = (new \App\Db\Query())->select(['tabid'])->from('vtiger_field')->where(['uitype' => 4])->distinct('tabid');

    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 '$presence'.
    Open

        public static function getAll($presence = [], $restrictedModulesList = [], $isEntityType = false)

    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 '$restrictedModulesList'.
    Open

        public static function getAll($presence = [], $restrictedModulesList = [], $isEntityType = false)

    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 '$isEntityType'.
    Open

        public static function getAll($presence = [], $restrictedModulesList = [], $isEntityType = false)

    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

    Saw unextractable annotation for comment '* @return <array of vtiger_module_model>'</array>
    Open

         * @return <Array of Vtiger_Module_Model>

    Argument 1 (module) is false but \Vtiger_Field_Model::init() takes string defined at /code/modules/Vtiger/models/Field.php:93
    Open

            $field5 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['modifiedtime']);

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

            $query = (new \App\Db\Query())->from('vtiger_tab');

    Call to method getInstance from undeclared class \App\Fields\RecordNumber (Did you mean class \Tests\Base\RecordNumber)
    Open

            \App\Fields\RecordNumber::getInstance($module->id)->set('prefix', 'N')->set('cur_id', 1)->save();

    Argument 1 (module) is false but \Vtiger_Field_Model::init() takes string defined at /code/modules/Vtiger/models/Field.php:93
    Open

            $field9 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['private']);

    Assigning string to property but \vtlib\Field->column is false
    Open

            $field1->column = $field1->name;

    Assigning 'string\x28255\x29' to property but \vtlib\Field->columntype is false
    Open

            $field1->columntype = 'string(255)';

    Assigning 'number' to property but \vtlib\Field->column is false
    Open

            $field2->column = 'number';

    Assigning 'string\x2832\x29' to property but \vtlib\Field->columntype is false
    Open

            $field2->columntype = 'string(32)';

    Argument 1 (module) is false but \Vtiger_Field_Model::init() takes string defined at /code/modules/Vtiger/models/Field.php:93
    Open

            $field4 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['createdtime']);

    Argument 1 (module) is false but \Vtiger_Field_Model::init() takes string defined at /code/modules/Vtiger/models/Field.php:93
    Open

            $field8 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['shownerid']);

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

            $subQuery = (new \App\Db\Query())->select(['tabid'])->from('vtiger_field')->where(['uitype' => 4])->distinct('tabid');

    Argument 1 (module) is false but \Vtiger_Field_Model::init() takes string defined at /code/modules/Vtiger/models/Field.php:93
    Open

            $field6 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['created_user_id']);

    Argument 1 (module) is false but \Vtiger_Field_Model::init() takes string defined at /code/modules/Vtiger/models/Field.php:93
    Open

            $field3 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['assigned_user_id']);

    Argument 1 (moduleName) is false but \Vtiger_Inventory_Model::getInstance() takes string defined at /code/modules/Vtiger/models/Inventory.php:50
    Open

                \Vtiger_Inventory_Model::getInstance($module->name)->createInventoryTables();

    Parameter $moduleName has undeclared type \type
    Open

        public function disableModule($moduleName)

    Saw unextractable annotation for comment '* @return <array> - List of Vtiger Module Model or sub class instances'</array>
    Open

         * @return <Array> - List of Vtiger Module Model or sub class instances

    Assigning string to property but \vtlib\Module->name is false
    Open

            $module->name = ucfirst($moduleInformation['module_name']);

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

            $actionIds = (new \App\Db\Query())->select(['actionname', 'actionid'])->from('vtiger_actionmapping')->createCommand()->queryAllByGroup();

    Assigning true to property but \vtlib\Filter->isdefault is int
    Open

            $filter1->isdefault = true;

    Saw unextractable annotation for comment '* @return <integer> number of modules'</integer>
    Open

         * @return <integer> number of modules

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

            $dataReader = (new \App\Db\Query())->select(['tabid', 'name'])

    Argument 1 (module) is false but \Vtiger_Field_Model::init() takes string defined at /code/modules/Vtiger/models/Field.php:93
    Open

            $field7 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['modifiedby']);

    Parameter $moduleName has undeclared type \type
    Open

        public function enableModule($moduleName)

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

        public static $baseModuleToolsExceptions = [
            'Documents' => ['notAllowed' => ['Import']],
            'Faq' => ['notAllowed' => ['Import', 'Export']],
            'OSSMailView' => ['notAllowed' => 'all'],
            'CallHistory' => ['allowed' => ['QuickExportToExcel']],

    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

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

        public static function getAll($presence = [], $restrictedModulesList = [], $isEntityType = false)

    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 Settings_ModuleManager_Module_Model extends Vtiger_Module_Model

    The class Settings_ModuleManager_Module_Model is not named in CamelCase.
    Open

    class Settings_ModuleManager_Module_Model extends Vtiger_Module_Model
    {
        /**
         * @var string[] Base module tools.
         */

    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

        public static $baseModuleTools = ['Import', 'Export', 'Merge', 'CreateCustomFilter',

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

         */

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

            $exceptions = [];

    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 static function getUserModuleImportUrl()

    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 disableModule($moduleName)

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

            \vtlib\Module::toggleModuleAccess($moduleName, 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

        /**

    Line exceeds 120 characters; contains 130 characters
    Open

            'ReadRecord', 'WorkflowTrigger', 'Dashboard', 'CreateDashboardFilter', 'QuickExportToExcel', 'ExportPdf', 'RecordMapping',

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

        public static $maxLengthModuleLabel = 25;

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

         * @return array

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

                'ConfigEditor', 'FieldFormulas', 'VtigerBackup', 'CronTasks', 'Import', 'Tooltip',

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

         * @var string[] Base module tools.

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

            'ReadRecord', 'WorkflowTrigger', 'Dashboard', 'CreateDashboardFilter', 'QuickExportToExcel', 'ExportPdf', 'RecordMapping',

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

            'OSSMailView' => ['notAllowed' => 'all'],

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

         * @var int Max length module name based on database structure

    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 static function getBaseModuleToolsExceptions()

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

                            $moduleExceptions[$actionIds[$actionName]] = $actionName;

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

         * Function to get the url of new module import.

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

        }

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

         * Function to enable the module.

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

         */

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

        /**

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

                        foreach ($exception as $actionName) {

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

        public static function getNonVisibleModulesList()

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

            return 'index.php?module=ModuleManager&parent=Settings&view=ModuleImport';

    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 (\is_array($exception)) {

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

            return ['ModTracker', 'Portal', 'Users', 'Integration',

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

         * Function to get the url of new module import.

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

            return 'index.php?module=ModuleManager&parent=Settings&view=ModuleImport&mode=importUserModuleStep1';

    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

                || preg_match('/CustomView/i', $name)

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

                || \strlen($name) > static::$maxLengthModuleName

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

            'RecordMappingList', 'FavoriteRecords', 'WatchingRecords', 'WatchingModule', 'RemoveRelation', 'ReviewingUpdates', 'OpenRecord', 'CloseRecord', 'ReceivingMailNotifications', 'CreateDashboardChartFilter', 'TimeLineList', 'ArchiveRecord', 'ActiveRecord', 'MassTrash', 'MoveToTrash', 'RecordConventer', 'AutoAssignRecord', 'AssignToYourself', 'InterestsConflictUsers', 'RecordCollector', 'Kanban', 'CustomViewAdvCond', 'RecordActivityNotifier', 'WorkflowTriggerWhenRecordIsBlocked', 'TilesView'];

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

            'CallHistory' => ['allowed' => ['QuickExportToExcel']],

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

        /**

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

        /**

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

        public static $maxLengthModuleName = 25;

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

        /**

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

                        $exceptions[App\Module::getModuleId($moduleName)][$type] = 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

        /**

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

            //Handling events after disable module

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

                || \in_array(strtolower($name), static::$notAllowedNames)

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

         * Function that returns all those modules that support Module Sequence Numbering.

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

        {

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

            $field1->label = $moduleInformation['entityfieldlabel'];

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

            $field2->columntype = 'string(32)';

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

            $field2->maximumlength = '32';

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

            $field7 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['modifiedby']);

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

            // Create files

    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 (static::$baseModuleToolsExceptions as $moduleName => $moduleException) {

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

                        $exceptions[App\Module::getModuleId($moduleName)][$type] = $moduleExceptions;

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

                preg_match('/Settings/i', $name)

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

                || class_exists($name)

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

         * Static Function to get the instance of Vtiger Module Model for all the modules.

    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->type = (int) $moduleInformation['entitytype'];

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

            $block->label = 'LBL_BASIC_INFORMATION';

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

            $field2->table = $module->basetable;

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

            $blockcf->addField($field7);

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

        /**

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

        /**

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

                }

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

        {

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

         */

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

        }

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

         * Function to check module name.

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

                || preg_match('/Vtiger/i', $name)

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

        /**

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

        /**

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

         * Function which will get count of modules.

    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

         * Create 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

            $module->initTables();

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

            $blockcf->label = 'LBL_CUSTOM_INFORMATION';

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

            $field1->name = $moduleInformation['entityfieldname'];

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

            /** Common fields that should be in every module, linked to vtiger CRM core table */

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

            $field2->uitype = 4;

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

            $field2->typeofdata = 'V~O';

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

            $blockcf->addField($field9);

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

            if (1 === $module->type) {

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

            (new \App\BatchMethod(['method' => '\App\UserPrivilegesFile::recalculateAll', 'params' => []]))->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

         * @var array Not allowed names

    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 static $maxLengthFieldName = 30;

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

         * Get module base tools exceptions parse to ids.

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

            return $exceptions;

    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 static function getAll($presence = [], $restrictedModulesList = [], $isEntityType = false)

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

         * @param bool $onlyActive - if true get count of only active modules else all the modules

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

            $query = (new \App\Db\Query())->from('vtiger_tab');

    Line exceeds 120 characters; contains 126 characters
    Open

            $subQuery = (new \App\Db\Query())->select(['tabid'])->from('vtiger_field')->where(['uitype' => 4])->distinct('tabid');

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

                ->where(['isentitytype' => 1, 'presence' => 0, 'tabid' => $subQuery])

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

            $module = new vtlib\Module();

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

            $blockcf->addField($field8);

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

            // Initialize Webservice support

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

            return $module;

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

         */

    Line exceeds 120 characters; contains 698 characters
    Open

        public static $notAllowedNames = ['__halt_compiler', 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor', 'groups'];

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

         */

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

         *

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

         */

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

            }

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

        }

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

        public static function getNewModuleImportUrl()

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

                || preg_match('/Api/i', $name)

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

        }

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

        public static function getModulesCount($onlyActive = false)

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

            if ($onlyActive) {

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

        public static function getModulesSupportingSequenceNumbering()

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

            return $moduleModels;

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

         * Function to get restricted modules list.

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

        {

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

            $field2->displaytype = 2;

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

            $filter1 = new vtlib\Filter();

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

            $module->initWebservice();

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

         * @var array Base module tools exceptions.

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

            'Documents' => ['notAllowed' => ['Import']],

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

        public static $maxLengthFieldLabel = 50;

    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

        /**

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

        }

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

         * @param type $moduleName - name of the module

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

        {

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

        public static function checkModuleName($name): bool

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

                || preg_match('/[^A-Za-z]/i', $name)

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

        }

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

        /**

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

            $dataReader->close();

    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->premium = (int) ($moduleInformation['premium'] ?? 0);

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

            $field1 = new vtlib\Field();

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

            $field1->maximumlength = '255';

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

            $field2->column = 'number';

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

            // Create default custom filter (mandatory)

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

            $filter1->addField($field2)

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

         */

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

                        $moduleExceptions = [];

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

         */

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

                $nonVisibleModules = self::getNonVisibleModulesList();

    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 static function createModule(array $moduleInformation)

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

            $field1->columntype = 'string(255)';

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

        public static function toAlphaNumeric($value)

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

        public static $baseModuleToolsExceptions = [

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

            'Faq' => ['notAllowed' => ['Import', 'Export']],

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

         * @var int Max length main field name

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

            $actionIds = (new \App\Db\Query())->select(['actionname', 'actionid'])->from('vtiger_actionmapping')->createCommand()->queryAllByGroup();

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

        /**

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

         * @param type $moduleName -- name of the module

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

        /**

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

        {

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

            return $query->count();

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

            $dataReader = (new \App\Db\Query())->select(['tabid', 'name'])

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

                $moduleModels[$row['name']] = self::getInstanceFromArray($row);

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

         * @param array $moduleInformation

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

            $module->label = $moduleInformation['module_label'];

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

            $module->setEntityIdentifier($field1);

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

            $field3 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['assigned_user_id']);

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

            $blockcf->addField($field3);

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

            // Set sharing access of this module

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

            // Enable and Disable available tools

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

            $module->enableTools(static::$baseModuleTools);

    Line exceeds 120 characters; contains 125 characters
    Open

            'DuplicateRecord', 'MassEdit', 'MassArchived', 'MassActive', 'MassDelete', 'MassAddComment', 'MassTransferOwnership',

    Line exceeds 120 characters; contains 501 characters
    Open

            'RecordMappingList', 'FavoriteRecords', 'WatchingRecords', 'WatchingModule', 'RemoveRelation', 'ReviewingUpdates', 'OpenRecord', 'CloseRecord', 'ReceivingMailNotifications', 'CreateDashboardChartFilter', 'TimeLineList', 'ArchiveRecord', 'ActiveRecord', 'MassTrash', 'MoveToTrash', 'RecordConventer', 'AutoAssignRecord', 'AssignToYourself', 'InterestsConflictUsers', 'RecordCollector', 'Kanban', 'CustomViewAdvCond', 'RecordActivityNotifier', 'WorkflowTriggerWhenRecordIsBlocked', 'TilesView'];

    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 static $notAllowedNames = ['__halt_compiler', 'abstract', 'and', 'array', 'as', 'break', 'callable', 'case', 'catch', 'class', 'clone', 'const', 'continue', 'declare', 'default', 'die', 'do', 'echo', 'else', 'elseif', 'empty', 'enddeclare', 'endfor', 'endforeach', 'endif', 'endswitch', 'endwhile', 'eval', 'exit', 'extends', 'final', 'for', 'foreach', 'function', 'global', 'goto', 'if', 'implements', 'include', 'include_once', 'instanceof', 'insteadof', 'interface', 'isset', 'list', 'namespace', 'new', 'or', 'print', 'private', 'protected', 'public', 'require', 'require_once', 'return', 'static', 'switch', 'throw', 'trait', 'try', 'unset', 'use', 'var', 'while', 'xor', 'groups'];

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

         * @var int Max length module label based on database structure

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

         * @var int Max length main field label

    Line exceeds 120 characters; contains 145 characters
    Open

            $actionIds = (new \App\Db\Query())->select(['actionname', 'actionid'])->from('vtiger_actionmapping')->createCommand()->queryAllByGroup();

    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

            //Handling events after enable module

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

        /**

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

                        }

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

                'Home', ];

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

        {

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

         * Function to disable a module.

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

            return

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

         */

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

                $query->where(['and', ['presence' => 0], ['NOT IN', 'name', $nonVisibleModules]]);

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

                ->createCommand()->query();

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

         *

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

            $moduleInformation['entityfieldname'] = strtolower(self::toAlphaNumeric($moduleInformation['entityfieldname']));

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

            $field1->column = $field1->name;

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

            $filter1->isdefault = true;

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

            'DuplicateRecord', 'MassEdit', 'MassArchived', 'MassActive', 'MassDelete', 'MassAddComment', 'MassTransferOwnership',

    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 ($moduleException as $type => $exception) {

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

         *

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

         *

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

        public function enableModule($moduleName)

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

            \vtlib\Module::toggleModuleAccess($moduleName, true);

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

         * @param string $name

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

         * @return bool

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

                || preg_match('/PickList/i', $name)

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

                || \App\Db::getInstance()->isTableExists("u_#__{$name}");

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

            return parent::getAll([0, 1], self::getNonVisibleModulesList());

    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

            $module->addBlock($blockcf);

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

            $field1->uitype = 2;

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

            $blockcf->addField($field2);

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

            $field4 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['createdtime']);

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

                ->addField($field4, 2);

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

            $module->createFiles($field1);

    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 mixed $restrictedModulesList

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

         * @param mixed $isEntityType

    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

                ->from('vtiger_tab')

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

            $moduleModels = [];

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

         * @return array List module names

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

            $field2 = new vtlib\Field();

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

            $blockcf->addField($field5);

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

            $blockcf->addField($field6);

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

            // Add fields to the filter created

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

                \Vtiger_Inventory_Model::getInstance($module->name)->createInventoryTables();

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

            $module->addBlock($block);

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

            $field6 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['created_user_id']);

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

            $filter1->name = 'All';

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

            $filter1->presence = 0;

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

         */

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

         * @return <integer> number of modules

    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

            $blockcf = new vtlib\Block();

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

            $field1->typeofdata = 'V~M';

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

            $field2->name = 'number';

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

         * @return <Array> - List of Vtiger Module Model or sub class instances

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

         */

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

        }

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

            $module->save();

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

            $blockcf->addField($field4);

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

            $field5 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['modifiedtime']);

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

            $module->addFilter($filter1);

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

            $module->setDefaultSharing();

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

            \App\Fields\RecordNumber::getInstance($module->id)->set('prefix', 'N')->set('cur_id', 1)->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

            return preg_replace('/[^a-zA-Z0-9_]/', '', $value);

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

         * @return <Array of Vtiger_Module_Model>

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

            while ($row = $dataReader->read()) {

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

            }

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

            $block = new vtlib\Block();

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

                ->addField($field3, 2)

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

        public static function getUploadDirectory()

    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 mixed $presence

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

        {

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

            $subQuery = (new \App\Db\Query())->select(['tabid'])->from('vtiger_field')->where(['uitype' => 4])->distinct('tabid');

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

        public static function getActionsRestrictedModulesList()

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

            return ['Home'];

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

         * @return vtlib\Module

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

            $module->name = ucfirst($moduleInformation['module_name']);

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

            $block->addField($field1);

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

            $field2->label = 'FL_NUMBER';

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

            $field8 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['shownerid']);

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

            $field9 = \Vtiger_Field_Model::init($module->name, \App\Field::SYSTEM_FIELDS['private']);

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

                ->addField($field1, 1)

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

            return 'cache';

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

        {

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

    class Settings_ModuleManager_Module_Model extends Vtiger_Module_Model

    There are no issues that match your filters.

    Category
    Status