YetiForceCompany/YetiForceCRM

View on GitHub
app/Fields/Picklist.php

Summary

Maintainability
A
1 hr
Test Coverage
F
45%

Method getDependencyForModule has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getDependencyForModule(string $moduleName)
    {
        if (\App\Cache::has('Picklist::getDependencyForModule', $moduleName)) {
            return \App\Cache::get('Picklist::getDependencyForModule', $moduleName);
        }
Severity: Minor
Found in app/Fields/Picklist.php - About 1 hr to fix

    Function getDependencyForModule has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getDependencyForModule(string $moduleName)
        {
            if (\App\Cache::has('Picklist::getDependencyForModule', $moduleName)) {
                return \App\Cache::get('Picklist::getDependencyForModule', $moduleName);
            }
    Severity: Minor
    Found in app/Fields/Picklist.php - About 35 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

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

            $dataReader = (new \App\Db\Query())->from(['s_#__picklist_dependency'])->where(['tabid' => $moduleModel->getId()])->createCommand()->query();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

            $dataReader = (new \App\Db\Query())->select([$primaryKey, $fieldName])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

            $dataReader = (new \App\Db\Query())
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

            return (new \App\Db\Query())->select(['vtiger_tab.tabid', 'vtiger_tab.tablabel', 'tabname' => 'vtiger_tab.name'])->from('vtiger_field')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '198', column '17').
    Open

            $query = (new \App\Db\Query())->select(['vtiger_tab.name', 'vtiger_field.fieldname'])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                throw new \App\Exceptions\AppException('Incorrect picklist name');
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

        public static function getColors($fieldName, bool $numericKey = true)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

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

            return (int) (new \App\Db\Query())->select(['picklistid'])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '233', column '30').
    Open

                $dataReaderPDValue = (new \App\Db\Query())
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

            $dataReader = (new \App\Db\Query())->select([$primaryKey, $fieldName])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                $allValues = (new \App\Db\Query())->select([$fieldName, 'roleid'])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

            $dataReader = (new \App\Db\Query())->select(['s_#__picklist_dependency_data.*'])->from('s_#__picklist_dependency')->innerJoin('s_#__picklist_dependency_data', 's_#__picklist_dependency_data.id = s_#__picklist_dependency.id')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getValuesName'.
    Open

            \App\Cache::save('Picklist::getValuesName', $fieldName, $values);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getDependencyForModule'.
    Open

            if (\App\Cache::has('Picklist::getDependencyForModule', $moduleName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getValues'.
    Open

                return \App\Cache::get('Picklist::getValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

        public static function getIcon(string $fieldName, string $value): array
        {
            $icon = [];
            if (self::isPicklistExist($fieldName) && ($iconValue = array_column(self::getValues($fieldName), 'icon', $fieldName)[$value] ?? [])) {
                $icon = \App\Json::isJson($iconValue) ? \App\Json::decode($iconValue) : ['type' => 'icon', 'name' => $iconValue];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    IfStatementAssignment

    Since: 2.7.0

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

    Example

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

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

    Avoid using static access to class '\App\Json' in method 'getIcon'.
    Open

                $icon = \App\Json::isJson($iconValue) ? \App\Json::decode($iconValue) : ['type' => 'icon', 'name' => $iconValue];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Json' in method 'removeDependencyConditionField'.
    Open

                    $dbCommand->update('s_#__picklist_dependency_data', ['conditions' => \App\Json::encode($conditions)], ['id' => $row['id'], 'source_id' => $row['source_id']])->execute();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'clearCache'.
    Open

            \App\Cache::delete("RecordStatus::getLockStatus::$moduleName", true);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getRoleBasedValues'.
    Open

                \App\Cache::save('Picklist::getRoleBasedValues', $fieldName, $allValues);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getNonEditableValues'.
    Open

            if (\App\Cache::has('Picklist::getNonEditableValues', $fieldName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getModulesByName'.
    Open

            if (\App\Cache::has('Picklist::getPicklistModulesByName', $moduleName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getModulesByName'.
    Open

            \App\Cache::save('Picklist::getPicklistModulesByName', $moduleName, $result);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Colors' in method 'getColors'.
    Open

                    $color = \App\Colors::getRandomColor($id);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $allValues = (new \App\Db\Query())->select([$fieldName, 'roleid'])
                    ->from("vtiger_$fieldName")
                    ->innerJoin('vtiger_role2picklist', "vtiger_role2picklist.picklistvalueid = vtiger_$fieldName.picklist_valueid")
                    ->innerJoin('vtiger_picklist', 'vtiger_picklist.picklistid = vtiger_role2picklist.picklistid')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Purifier' in method 'getNonEditableValues'.
    Open

                $values[$row[$primaryKey]] = \App\Purifier::decodeHtml(\App\Purifier::decodeHtml($row[$fieldName]));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getRoleBasedValues'.
    Open

                $allValues = \App\Cache::get('Picklist::getRoleBasedValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Purifier' in method 'getValuesName'.
    Open

                $values[$row[$primaryKey]] = \App\Purifier::decodeHtml(\App\Purifier::decodeHtml($row[$fieldName]));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $result = $query->orderBy(['vtiger_tab.tabid' => SORT_ASC])->createCommand()->queryAllByGroup(2);
            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getValuesName'.
    Open

            if (\App\Cache::has('Picklist::getValuesName', $fieldName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Condition' in method 'removeDependencyConditionField'.
    Open

                $conditions = \App\Condition::removeFieldFromCondition($moduleName, $conditions, $moduleName, $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'clearCache'.
    Open

            \App\Cache::delete('Picklist::getDependencyForModule', $moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Condition' in method 'getDependencyForModule'.
    Open

    }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getRoleBasedValues'.
    Open

            if (\App\Cache::has('Picklist::getRoleBasedValues', $fieldName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getValues'.
    Open

            if (\App\Cache::has('Picklist::getValues', $fieldName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Json' in method 'getIcon'.
    Open

                $icon = \App\Json::isJson($iconValue) ? \App\Json::decode($iconValue) : ['type' => 'icon', 'name' => $iconValue];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'clearCache'.
    Open

            \App\Cache::delete("RecordStatus::getLockStatus::$moduleName", false);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Purifier' in method 'getValuesName'.
    Open

                $values[$row[$primaryKey]] = \App\Purifier::decodeHtml(\App\Purifier::decodeHtml($row[$fieldName]));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getModulesByName'.
    Open

                return \App\Cache::get('Picklist::getPicklistModulesByName', $moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getDependencyForModule'.
    Open

                return \App\Cache::get('Picklist::getDependencyForModule', $moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'clearCache'.
    Open

            \App\Cache::delete('Picklist::getRoleBasedValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getValuesName'.
    Open

                return \App\Cache::get('Picklist::getValuesName', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Purifier' in method 'getValues'.
    Open

                $row['picklistValue'] = \App\Purifier::decodeHtml(\App\Purifier::decodeHtml($row[$fieldName]));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                } else {
                    $color = '#' . $value['color'];
                }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

            $tabId = \App\Module::getModuleId($moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'clearCache'.
    Open

            \App\Cache::delete('Picklist::getNonEditableValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                } else {
                    $dbCommand->delete('s_#__picklist_dependency_data', ['id' => $row['id'], 'source_id' => $row['source_id']])->execute();
                }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Purifier' in method 'getNonEditableValues'.
    Open

                $values[$row[$primaryKey]] = \App\Purifier::decodeHtml(\App\Purifier::decodeHtml($row[$fieldName]));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getDependencyForModule'.
    Open

            \App\Cache::save('Picklist::getDependencyForModule', $moduleName, $result);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'clearCache'.
    Open

            \App\Cache::delete('Picklist::getValuesName', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Purifier' in method 'getRoleBasedValues'.
    Open

                    $fldVal[] = \App\Purifier::decodeHtml($row[$fieldName]);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getNonEditableValues'.
    Open

                return \App\Cache::get('Picklist::getNonEditableValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getNonEditableValues'.
    Open

            \App\Cache::save('Picklist::getNonEditableValues', $fieldName, $values);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Json' in method 'getDependencyForModule'.
    Open

                        $conditions = \App\Json::decode($plRow['conditions']);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Json' in method 'removeDependencyConditionField'.
    Open

                $conditions = \App\Json::decode($row['conditions']);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Purifier' in method 'getValues'.
    Open

                $row['picklistValue'] = \App\Purifier::decodeHtml(\App\Purifier::decodeHtml($row[$fieldName]));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'getValues'.
    Open

            \App\Cache::save('Picklist::getValues', $fieldName, $values);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class '\App\Cache' in method 'clearCache'.
    Open

            \App\Cache::delete('Picklist::getValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Define a constant instead of duplicating this literal "Picklist::getPicklistModulesByName" 3 times.
    Open

            if (\App\Cache::has('Picklist::getPicklistModulesByName', $moduleName)) {
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            return (new \App\Db\Query())->select(['vtiger_tab.tabid', 'vtiger_tab.tablabel', 'tabname' => 'vtiger_tab.name'])->from('vtiger_field')
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Define a constant instead of duplicating this literal "Picklist::getValuesName" 4 times.
    Open

            if (\App\Cache::has('Picklist::getValuesName', $fieldName)) {
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Define a constant instead of duplicating this literal "Picklist::getValues" 4 times.
    Open

            if (\App\Cache::has('Picklist::getValues', $fieldName)) {
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Define a constant instead of duplicating this literal "conditions" 7 times.
    Open

                    if ($plRow['conditions']) {
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

                $value['color'] = trim($value['color'] ?? '', " #\\s\t\n\r");
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Define a constant instead of duplicating this literal "s_#__picklist_dependency_data" 4 times.
    Open

                    ->leftJoin('s_#__picklist_dependency_data', "$picklistTable.$primaryKey = s_#__picklist_dependency_data.source_id AND s_#__picklist_dependency_data.id = :pdd", [':pdd' => $row['id']])
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            return (new \App\Db\Query())->select(['vtiger_tab.tabid', 'vtiger_tab.tablabel', 'tabname' => 'vtiger_tab.name'])->from('vtiger_field')
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Define a constant instead of duplicating this literal "Picklist::getDependencyForModule" 4 times.
    Open

            if (\App\Cache::has('Picklist::getDependencyForModule', $moduleName)) {
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

                    $dbCommand->update('s_#__picklist_dependency_data', ['conditions' => \App\Json::encode($conditions)], ['id' => $row['id'], 'source_id' => $row['source_id']])->execute();
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Define a constant instead of duplicating this literal "Picklist::getNonEditableValues" 4 times.
    Open

            if (\App\Cache::has('Picklist::getNonEditableValues', $fieldName)) {
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Define a constant instead of duplicating this literal "Picklist::getRoleBasedValues" 4 times.
    Open

            if (\App\Cache::has('Picklist::getRoleBasedValues', $fieldName)) {
    Severity: Critical
    Found in app/Fields/Picklist.php by sonar-php

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

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

            return (int) (new \App\Db\Query())->select(['picklistid'])
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

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

            $dataReader = (new \App\Db\Query())->select([$primaryKey, $fieldName])
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

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

            $dataReader = (new \App\Db\Query())->from(['s_#__picklist_dependency'])->where(['tabid' => $moduleModel->getId()])->createCommand()->query();
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

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

                $dataReaderPDValue = (new \App\Db\Query())
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

    Call to undeclared method \App\Db::createCommand
    Open

            $dbCommand = \App\Db::getInstance()->createCommand();
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

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

                $allValues = (new \App\Db\Query())->select([$fieldName, 'roleid'])
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

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

            $query = (new \App\Db\Query())->select(['vtiger_tab.name', 'vtiger_field.fieldname'])
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

    Argument 2 (key) is false but \App\Cache::delete() takes string defined at /code/app/Cache.php:105
    Open

            \App\Cache::delete("RecordStatus::getLockStatus::$moduleName", false);
    Severity: Minor
    Found in app/Fields/Picklist.php by phan

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

            $dataReader = (new \App\Db\Query())
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

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

            return (new \App\Db\Query())->select(['vtiger_tab.tabid', 'vtiger_tab.tablabel', 'tabname' => 'vtiger_tab.name'])->from('vtiger_field')
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

    Argument 2 (key) is true but \App\Cache::delete() takes string defined at /code/app/Cache.php:105
    Open

            \App\Cache::delete("RecordStatus::getLockStatus::$moduleName", true);
    Severity: Minor
    Found in app/Fields/Picklist.php by phan

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

            $dataReader = (new \App\Db\Query())->select([$primaryKey, $fieldName])
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

    Suspicious array access to nullable ?array{color:string}|?mixed
    Open

                $colors[$numericKey ? $id : $value[$fieldName]] = $color;
    Severity: Minor
    Found in app/Fields/Picklist.php by phan

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

            $dataReader = (new \App\Db\Query())->select(['s_#__picklist_dependency_data.*'])->from('s_#__picklist_dependency')->innerJoin('s_#__picklist_dependency_data', 's_#__picklist_dependency_data.id = s_#__picklist_dependency.id')
    Severity: Critical
    Found in app/Fields/Picklist.php by phan

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

                $allValues = (new \App\Db\Query())->select([$fieldName, 'roleid'])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array list of role based picklist values
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    ->from("vtiger_$fieldName")
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array -- array of values
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Function to get role based picklist values.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getRoleBasedValues(string $fieldName, string $roleId)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if (\App\Cache::has('Picklist::getRoleBasedValues', $fieldName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Function which will give the picklist values for a field.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                return \App\Cache::get('Picklist::getValuesName', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Check if the value exists in the picklist.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $dataReader = (new \App\Db\Query())->select([$primaryKey, $fieldName])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return \App\Db::getInstance()->isTableExists("vtiger_{$fieldName}");
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            foreach ($allValues as $row) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                if ($row['roleid'] === $roleId) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getValuesName($fieldName)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $values[$row[$primaryKey]] = \App\Purifier::decodeHtml(\App\Purifier::decodeHtml($row[$fieldName]));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::save('Picklist::getValuesName', $fieldName, $values);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Function which will give the editable picklist values for a field.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    ->innerJoin('vtiger_role2picklist', "vtiger_role2picklist.picklistvalueid = vtiger_$fieldName.picklist_valueid")
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    ->all();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $primaryKey = static::getPickListId($fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $value
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            } else {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    $fldVal[] = \App\Purifier::decodeHtml($row[$fieldName]);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function isExists(string $fieldName, string $value): bool
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $roleId
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $allValues = \App\Cache::get('Picklist::getRoleBasedValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 128 characters
    Open

                    ->innerJoin('vtiger_role2picklist', "vtiger_role2picklist.picklistvalueid = vtiger_$fieldName.picklist_valueid")
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $fldVal = [];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array -- array of values
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $values;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $values = [];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return bool
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    ->innerJoin('vtiger_picklist', 'vtiger_picklist.picklistid = vtiger_role2picklist.picklistid')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                \App\Cache::save('Picklist::getRoleBasedValues', $fieldName, $allValues);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if (\App\Cache::has('Picklist::getValuesName', $fieldName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName -- string
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->from("vtiger_$fieldName")
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->createCommand()->query();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function isPicklistExist(string $fieldName): bool
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName -- string
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    ->orderBy("vtiger_{$fieldName}.sortorderid")
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $fldVal;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->orderBy('sortorderid')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            while ($row = $dataReader->read()) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return \in_array($value, static::getValuesName($fieldName));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Check if picklist exist.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return bool
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            while ($row = $dataReader->read()) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getModulesByName(string $moduleName = '')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $moduleName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 199 characters
    Open

                    ->leftJoin('s_#__picklist_dependency_data', "$picklistTable.$primaryKey = s_#__picklist_dependency_data.source_id AND s_#__picklist_dependency_data.id = :pdd", [':pdd' => $row['id']])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $pickListIds = [
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'rating' => 'rating_id',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'payment_duration' => 'payment_duration_id',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 143 characters
    Open

            return (new \App\Db\Query())->select(['vtiger_tab.tabid', 'vtiger_tab.tablabel', 'tabname' => 'vtiger_tab.name'])->from('vtiger_field')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 181 characters
    Open

                ->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')->where(['uitype' => [15, 16, 33, 115], 'vtiger_field.presence' => [0, 2], 'vtiger_tab.presence' => 0])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $sourceFieldName = $fields[$row['source_field']]->getName();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    $conditions = [];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                if ('--None--' === $value || isset($nonEditableValues[$key])) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if (isset($pickListIds[$fieldName])) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array associative array [$moduleName=>[...$fieldNames]]
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    if ($plRow['conditions']) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $moduleName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $values;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array -- array of values
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $fieldName . 'id';
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->distinct('vtiger_tab.tabid')->orderBy(['vtiger_tab.tabid' => SORT_ASC])->createCommand()->queryAllByGroup(1);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if (\App\Cache::has('Picklist::getPicklistModulesByName', $moduleName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->where(['uitype' => [15, 16, 33, 115]]);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Function to get picklist dependency data source.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    ->select(['value' => "{$picklistTable}.{$sourceFieldName}", 's_#__picklist_dependency_data.conditions'])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'recurring_frequency' => 'recurring_frequency_id',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            } else {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    ->leftJoin('s_#__picklist_dependency_data', "$picklistTable.$primaryKey = s_#__picklist_dependency_data.source_id AND s_#__picklist_dependency_data.id = :pdd", [':pdd' => $row['id']])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getNonEditableValues($fieldName)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->createCommand()->query();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $values;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Function to get modules which has picklist values.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if ($moduleName) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Check if field is dependent.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    unset($values[$key]);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'ticketseverities' => 'ticketseverities_id',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'ticketstatus' => 'ticketstatus_id',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $query = (new \App\Db\Query())->select(['vtiger_tab.name', 'vtiger_field.fieldname'])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $result = $modules[$moduleName] ?? [];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $fields = $moduleModel->getFieldsById();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Function which will give the non editable picklist values for a field.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')->where(['uitype' => [15, 16, 33, 115], 'vtiger_field.presence' => [0, 2], 'vtiger_tab.presence' => 0])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->from('vtiger_field')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $conditionsByFields = $listenFields = [];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                        $listenFields = array_merge($listenFields, \App\Condition::getFieldsFromConditions($conditions)['baseModule']);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            foreach ($values as $key => &$value) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $primaryKey = static::getPickListId($fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getPickListId($fieldName)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'language' => 'id',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getModules()
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return (new \App\Db\Query())->select(['vtiger_tab.tabid', 'vtiger_tab.tablabel', 'tabname' => 'vtiger_tab.name'])->from('vtiger_field')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 149 characters
    Open

            $dataReader = (new \App\Db\Query())->from(['s_#__picklist_dependency'])->where(['tabid' => $moduleModel->getId()])->createCommand()->query();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::save('Picklist::getDependencyForModule', $moduleName, $result);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getEditableValues($fieldName)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $nonEditableValues = static::getNonEditableValues($fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->where(['presence' => 0])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName -- string
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::save('Picklist::getNonEditableValues', $fieldName, $values);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Function to get picklist key for a picklist.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            ];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Get modules with field names which are picklists.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if (\App\Cache::has('Picklist::getDependencyForModule', $moduleName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $dataReader = (new \App\Db\Query())->from(['s_#__picklist_dependency'])->where(['tabid' => $moduleModel->getId()])->createCommand()->query();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $moduleName if you want only one module picklist fieldnames
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    ->from([$picklistTable])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $picklistTable = "vtiger_$sourceFieldName";
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $result;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    $conditionsByFields[$sourceFieldName][$plRow['value']] = $conditions;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return string
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'ticketpriorities' => 'ticketpriorities_id',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                return \App\Cache::get('Picklist::getPicklistModulesByName', $moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::save('Picklist::getPicklistModulesByName', $moduleName, $result);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $result;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $moduleModel = \Vtiger_Module_Model::getInstance($moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                return \App\Cache::get('Picklist::getNonEditableValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $values[$row[$primaryKey]] = \App\Purifier::decodeHtml(\App\Purifier::decodeHtml($row[$fieldName]));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'sales_stage' => 'sales_stage_id',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'faqstatus' => 'faqstatus_id',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->innerJoin('vtiger_tab', 'vtiger_field.tabid = vtiger_tab.tabid')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $result = $query->orderBy(['vtiger_tab.tabid' => SORT_ASC])->createCommand()->queryAllByGroup(2);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getDependencyForModule(string $moduleName)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            while ($row = $dataReader->read()) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $dataReaderPDValue = (new \App\Db\Query())
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                while ($plRow = $dataReaderPDValue->read()) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return !empty(array_filter(array_column(static::getValues($fieldName), 'prefix')));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getPicklistIdNr(string $fieldName): int
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $dataReader = (new \App\Db\Query())->select(['s_#__picklist_dependency_data.*'])->from('s_#__picklist_dependency')->innerJoin('s_#__picklist_dependency_data', 's_#__picklist_dependency_data.id = s_#__picklist_dependency.id')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->where(['tabid' => $tabId])->andWhere(['like', 'conditions', $fullFieldName])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            while ($row = $dataReader->read()) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->from("vtiger_$fieldName")
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'duration_minutes' => 'minutesid',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                return $pickListIds[$fieldName];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 123 characters
    Open

                ->distinct('vtiger_tab.tabid')->orderBy(['vtiger_tab.tabid' => SORT_ASC])->createCommand()->queryAllByGroup(1);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $modules = $query->andWhere(['vtiger_tab.name' => $moduleName])->createCommand()->queryAllByGroup(2);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    ->createCommand()->query();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 131 characters
    Open

                        $listenFields = array_merge($listenFields, \App\Condition::getFieldsFromConditions($conditions)['baseModule']);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $dataReader = (new \App\Db\Query())
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->from("vtiger_$fieldName")
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->createCommand()->query();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $colors = [];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Check if the prefix exists in given picklist name.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function prefixExist(string $fieldName): bool
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return void
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $fullFieldName = "{$fieldName}:{$moduleName}";
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $conditions = \App\Condition::removeFieldFromCondition($moduleName, $conditions, $moduleName, $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if (\App\Cache::has('Picklist::getNonEditableValues', $fieldName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $dataReader = (new \App\Db\Query())->select([$primaryKey, $fieldName])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $primaryKey = static::getPickListId($sourceFieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $result = ['listener' => array_unique($listenFields), 'conditions' => $conditionsByFields];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param bool  $numericKey
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array [$id=>'#FF00FF']
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Remove dependency condition field.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            ['listener' => $listener, 'conditions' => $conditions] = self::getDependencyForModule($moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $values[$row[$primaryKey]] = $row;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Get colors for all fields or generate it if not exists.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param mixed $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getColors($fieldName, bool $numericKey = true)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    $color = '#' . $value['color'];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Function which will give the picklist values rows for a field.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $value['color'] = trim($value['color'] ?? '', " #\\s\t\n\r");
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getPickListTableName(string $fieldName)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Get picklist ID number.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $values = static::getValuesName($fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $values = [];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'opportunity_type' => 'opptypeid',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                'salutationtype' => 'salutationtypeid',
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                return \App\Cache::get('Picklist::getDependencyForModule', $moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                        $conditions = \App\Json::decode($plRow['conditions']);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Get icon data for picklist value.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getIcon(string $fieldName, string $value): array
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $colors[$numericKey ? $id : $value[$fieldName]] = $color;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 185 characters
    Open

                    $dbCommand->update('s_#__picklist_dependency_data', ['conditions' => \App\Json::encode($conditions)], ['id' => $row['id'], 'source_id' => $row['source_id']])->execute();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function getValues($fieldName)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $icon;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                } else {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $colors;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                throw new \App\Exceptions\AppException('Incorrect picklist name');
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->where(['name' => $fieldName])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $dbCommand = \App\Db::getInstance()->createCommand();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $conditions = \App\Json::decode($row['conditions']);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    $dbCommand->update('s_#__picklist_dependency_data', ['conditions' => \App\Json::encode($conditions)], ['id' => $row['id'], 'source_id' => $row['source_id']])->execute();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if (\App\Cache::has('Picklist::getValues', $fieldName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $icon = \App\Json::isJson($iconValue) ? \App\Json::decode($iconValue) : ['type' => 'icon', 'name' => $iconValue];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 125 characters
    Open

                $icon = \App\Json::isJson($iconValue) ? \App\Json::decode($iconValue) : ['type' => 'icon', 'name' => $iconValue];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    $color = \App\Colors::getRandomColor($id);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Get picklist table name.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return (int) (new \App\Db\Query())->select(['picklistid'])
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $moduleName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return bool
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $row['picklistValueId'] = $row[static::getPickListId($fieldName)];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $icon = [];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if (empty($fieldName) || !preg_match('/^[_a-zA-Z0-9]+$/', $fieldName)) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->scalar();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * Clear cache.
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return \in_array($fieldName, $listener) || isset($conditions[$fieldName]);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->orderBy('sortorderid')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return $values;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 142 characters
    Open

            if (self::isPicklistExist($fieldName) && ($iconValue = array_column(self::getValues($fieldName), 'icon', $fieldName)[$value] ?? [])) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return bool
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->from('vtiger_picklist')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 135 characters
    Open

                    $dbCommand->delete('s_#__picklist_dependency_data', ['id' => $row['id'], 'source_id' => $row['source_id']])->execute();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function isDependentField(string $moduleName, string $fieldName): bool
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            while ($row = $dataReader->read()) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::save('Picklist::getValues', $fieldName, $values);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            foreach (static::getValues($fieldName) as $id => &$value) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function clearCache(string $fieldName, string $moduleName)
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                $row['picklistValue'] = \App\Purifier::decodeHtml(\App\Purifier::decodeHtml($row[$fieldName]));
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return string
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                } else {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                return \App\Cache::get('Picklist::getValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $primaryKey = static::getPickListId($fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $values = [];
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        public static function removeDependencyConditionField(string $moduleName, string $fieldName): void
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $tabId = \App\Module::getModuleId($moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    Line exceeds 120 characters; contains 232 characters
    Open

            $dataReader = (new \App\Db\Query())->select(['s_#__picklist_dependency_data.*'])->from('s_#__picklist_dependency')->innerJoin('s_#__picklist_dependency_data', 's_#__picklist_dependency_data.id = s_#__picklist_dependency.id')
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::delete('Picklist::getRoleBasedValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return array -- array of values
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @return int
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                if ($conditions) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::delete('Picklist::getDependencyForModule', $moduleName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::delete('Picklist::getValuesName', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::delete('Picklist::getValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::delete("RecordStatus::getLockStatus::$moduleName", true);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $fieldName -- string
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $value
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                if (empty($value['color'])) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            return 'vtiger_' . $fieldName;
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         * @param string $moduleName
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            $dataReader->close();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            if (self::isPicklistExist($fieldName) && ($iconValue = array_column(self::getValues($fieldName), 'icon', $fieldName)[$value] ?? [])) {
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                ->createCommand()->query();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

                    $dbCommand->delete('s_#__picklist_dependency_data', ['id' => $row['id'], 'source_id' => $row['source_id']])->execute();
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::delete('Picklist::getNonEditableValues', $fieldName);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

            \App\Cache::delete("RecordStatus::getLockStatus::$moduleName", false);
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in app/Fields/Picklist.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status