YetiForceCompany/YetiForceCRM

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

Summary

Maintainability
B
5 hrs
Test Coverage
F
0%

Function row has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function row(App\Request $request): void
    {
        $relatedModuleSkip = $request->getBoolean('relatedModuleSkip', false);
        $sourceModuleName = $request->getByType('sourceModuleName', \App\Purifier::ALNUM);
        $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModuleName);
Severity: Minor
Found in modules/Vtiger/views/ConditionBuilder.php - About 1 hr to fix

Cognitive Complexity

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

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

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

Further reading

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

    public function row(App\Request $request): void
    {
        $relatedModuleSkip = $request->getBoolean('relatedModuleSkip', false);
        $sourceModuleName = $request->getByType('sourceModuleName', \App\Purifier::ALNUM);
        $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModuleName);
Severity: Minor
Found in modules/Vtiger/views/ConditionBuilder.php - About 1 hr to fix

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

        public function builder(App\Request $request): void
        {
            $viewer = $this->getViewer($request);
            $advanceCriteria = $request->getArray('advanceCriteria', \App\Purifier::TEXT);
            $relatedModuleSkip = $request->getBoolean('relatedModuleSkip', false);
    Severity: Minor
    Found in modules/Vtiger/views/ConditionBuilder.php - About 25 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

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

                throw new \App\Exceptions\NoPermitted('ERR_PERMISSION_DENIED', 406);

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

            $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModuleName);

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

                    $fieldModel = Vtiger_Field_Model::getInstance($fieldName, Vtiger_Module_Model::getInstance($fieldModuleName));

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

            $viewer->assign('ADVANCE_CRITERIA', $advanceCriteria ? \App\Condition::getConditionsFromRequest($advanceCriteria) : []);

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

            } else {
                $selectedOperator = $request->getByType('operator', \App\Purifier::ALNUM);
            }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

            } else {
                $fieldInfo = $request->getForSql('fieldname', false);
                [$fieldName, $fieldModuleName, $sourceFieldName] = array_pad(explode(':', $fieldInfo), 3, false);
                if (!empty($sourceFieldName)) {
                    $fieldModel = Vtiger_Field_Model::getInstance($fieldName, Vtiger_Module_Model::getInstance($fieldModuleName));

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

                    $fieldModel = Vtiger_Field_Model::getInstance($fieldName, Vtiger_Module_Model::getInstance($fieldModuleName));

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

                    $fieldModel = Vtiger_Field_Model::getInstance($fieldName, $sourceModuleModel);

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

        public function process(App\Request $request)
        {
            if ($mode = $request->getMode()) {
                $this->invokeExposedMethod($mode, $request);
            } else {

    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

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

            } else {
                $this->row($request);
            }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

            $sourceModuleModel = \Vtiger_Module_Model::getInstance($sourceModuleName);

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

                        $recordStructureModulesField[$relatedModuleName][$referenceField->getFieldName()] = Vtiger_RecordStructure_Model::getInstanceForModule(Vtiger_Module_Model::getInstance($relatedModuleName))->getStructure();

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

                } else {
                    $fieldModel = Vtiger_Field_Model::getInstance($fieldName, $sourceModuleModel);
                }

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

                        $recordStructureModulesField[$relatedModuleName][$referenceField->getFieldName()] = Vtiger_RecordStructure_Model::getInstanceForModule(Vtiger_Module_Model::getInstance($relatedModuleName))->getStructure();

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

            if (!Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModulePermission($request->getByType('sourceModuleName', 2))) {

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

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

    Noncompliant Code Example

    With the default threshold of 3:

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

    Compliant Solution

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

    Exceptions

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('RECORD_STRUCTURE', Vtiger_RecordStructure_Model::getInstanceForModule($sourceModuleModel)->getStructure());
    Severity: Critical
    Found in modules/Vtiger/views/ConditionBuilder.php by phan

    Call to deprecated function \Vtiger_Field_Model::getFieldName() defined at /code/modules/Vtiger/models/Field.php:203
    Open

                        $recordStructureModulesField[$relatedModuleName][$referenceField->getFieldName()] = Vtiger_RecordStructure_Model::getInstanceForModule(Vtiger_Module_Model::getInstance($relatedModuleName))->getStructure();

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('ADVANCE_CRITERIA', $advanceCriteria ? \App\Condition::getConditionsFromRequest($advanceCriteria) : []);
    Severity: Critical
    Found in modules/Vtiger/views/ConditionBuilder.php by phan

    Argument 2 (emptyFunction) is 1 but \App\Request::isEmpty() takes bool|false defined at /code/app/Request.php:577
    Open

            $operators = $request->isEmpty('parent', 1) ? $fieldModel->getQueryOperators() : $fieldModel->getRecordOperators();

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to undeclared method \Vtiger_Viewer::assign
    Open

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

    Call to deprecated function \Vtiger_Field_Model::getFieldName() defined at /code/modules/Vtiger/models/Field.php:203
    Open

                        $recordStructureModulesField[$relatedModuleName][$referenceField->getFieldName()] = Vtiger_RecordStructure_Model::getInstanceForModule(Vtiger_Module_Model::getInstance($relatedModuleName))->getStructure();

    Call to undeclared method \Vtiger_Viewer::assign
    Open

            $viewer->assign('RECORD_STRUCTURE', Vtiger_RecordStructure_Model::getInstanceForModule($sourceModuleModel)->getStructure());
    Severity: Critical
    Found in modules/Vtiger/views/ConditionBuilder.php by phan

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

            if ($request->isEmpty('fieldname')) {
                $fieldModel = current($sourceModuleModel->getFields());
            } else {
                $fieldInfo = $request->getForSql('fieldname', false);
                [$fieldName, $fieldModuleName, $sourceFieldName] = array_pad(explode(':', $fieldInfo), 3, false);
    Severity: Major
    Found in modules/Vtiger/views/ConditionBuilder.php and 1 other location - About 1 hr to fix
    modules/Settings/PickListDependency/views/ConditionBuilder.php on lines 34..44

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 118.

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

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

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

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

    Refactorings

    Further Reading

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

            $recordStructureModulesField = [];

    LongVariable

    Since: 0.2

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

    Example

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

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

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

            $recordStructureModulesField = [];

    LongVariable

    Since: 0.2

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

    Example

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

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

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

    class Vtiger_ConditionBuilder_View extends \App\Controller\View\Page

    The class Vtiger_ConditionBuilder_View is not named in CamelCase.
    Open

    class Vtiger_ConditionBuilder_View extends \App\Controller\View\Page
    {
        use App\Controller\ClearProcess;
        use \App\Controller\ExposeMethod;
    
    

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

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

                $this->row($request);

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

         * @param App\Request $request

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

            $relatedModuleSkip = $request->getBoolean('relatedModuleSkip', false);

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

         * Display the condition builder panel.

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

         */

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

            $recordStructureModulesField = [];

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

            $viewer->view('ConditionBuilder.tpl', $sourceModuleName);

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

        }

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

        /** {@inheritdoc} */

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

            } else {

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

         * Display one condition for a field.

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

            if ($request->isEmpty('fieldname')) {

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

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

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

            $viewer->assign('RECORD_STRUCTURE', Vtiger_RecordStructure_Model::getInstanceForModule($sourceModuleModel)->getStructure());

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

                    foreach ($referenceField->getReferenceList() as $relatedModuleName) {

    Line exceeds 120 characters; contains 225 characters
    Open

                        $recordStructureModulesField[$relatedModuleName][$referenceField->getFieldName()] = Vtiger_RecordStructure_Model::getInstanceForModule(Vtiger_Module_Model::getInstance($relatedModuleName))->getStructure();

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

        /** {@inheritdoc} */

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

        /**

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

         *

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

        public function row(App\Request $request): void

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

                    $fieldModel = Vtiger_Field_Model::getInstance($fieldName, Vtiger_Module_Model::getInstance($fieldModuleName));

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

            $sourceModuleName = $request->getByType('sourceModuleName', \App\Purifier::ALNUM);

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

            $sourceModuleModel = \Vtiger_Module_Model::getInstance($sourceModuleName);

    Line exceeds 120 characters; contains 128 characters
    Open

            $viewer->assign('ADVANCE_CRITERIA', $advanceCriteria ? \App\Condition::getConditionsFromRequest($advanceCriteria) : []);

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

            $sourceModuleName = $request->getByType('sourceModuleName', \App\Purifier::ALNUM);

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

                foreach ($sourceModuleModel->getFieldsByReference() as $referenceField) {

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

                [$fieldName, $fieldModuleName, $sourceFieldName] = array_pad(explode(':', $fieldInfo), 3, false);

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

        }

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

            $viewer->assign('SELECTED_OPERATOR', $selectedOperator);

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

        /**

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

        public function process(App\Request $request)

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

            }

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

            if ($mode = $request->getMode()) {

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

         */

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

                    foreach ($referenceField->getReferenceList() as $relatedModuleName) {

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

                    $fieldModel = Vtiger_Field_Model::getInstance($fieldName, $sourceModuleModel);

    Line exceeds 120 characters; contains 132 characters
    Open

            $viewer->assign('RECORD_STRUCTURE', Vtiger_RecordStructure_Model::getInstanceForModule($sourceModuleModel)->getStructure());

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

        {

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

            }

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

        }

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

                } else {

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

            if ($request->isEmpty('operator', true)) {

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

            $viewer->assign('OPERATORS', $operators);

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

        }

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

            $advanceCriteria = $request->getArray('advanceCriteria', \App\Purifier::TEXT);

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

            parent::__construct();

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

            } else {

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

        {

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

            $viewer->assign('ADVANCE_CRITERIA', $advanceCriteria ? \App\Condition::getConditionsFromRequest($advanceCriteria) : []);

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

            $viewer->assign('RECORD_STRUCTURE', Vtiger_RecordStructure_Model::getInstanceForModule($sourceModuleModel)->getStructure());

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

        public function checkPermission(App\Request $request)

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

            }

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

            $recordStructureModulesField = [];

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

                $fieldInfo = $request->getForSql('fieldname', false);

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

        }

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

                $this->invokeExposedMethod($mode, $request);

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

         *

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

            $sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModuleName);

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

                $selectedOperator = key($operators);

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

            $viewer->assign('RECORD_STRUCTURE_RELATED_MODULES', $recordStructureModulesField);

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

            $viewer->assign('SOURCE_MODULE', $sourceModuleName);

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

                throw new \App\Exceptions\NoPermitted('ERR_PERMISSION_DENIED', 406);

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

        /** {@inheritdoc} */

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

            $this->exposeMethod('row');

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

            if (!$relatedModuleSkip) {

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

                        $recordStructureModulesField[$relatedModuleName][$referenceField->getFieldName()] = Vtiger_RecordStructure_Model::getInstanceForModule(Vtiger_Module_Model::getInstance($relatedModuleName))->getStructure();

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

                $fieldModel = current($sourceModuleModel->getFields());

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

                if (!empty($sourceFieldName)) {

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

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

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

                }

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

            $this->exposeMethod('builder');

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

                    }

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

            $fieldInfo = false;

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

                }

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

            }

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

            $relatedModuleSkip = $request->getBoolean('relatedModuleSkip', false);

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

        {

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

            }

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

         * @param App\Request $request

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

        use \App\Controller\ExposeMethod;

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

        public function __construct()

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

        {

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

        {

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

            }

    Line exceeds 120 characters; contains 132 characters
    Open

            $viewer->assign('RECORD_STRUCTURE', Vtiger_RecordStructure_Model::getInstanceForModule($sourceModuleModel)->getStructure());

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

            $viewer->assign('SOURCE_MODULE', $sourceModuleName);

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

            $viewer->view('ConditionBuilderRow.tpl', $sourceModuleName);

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

         * @return void

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

                        $recordStructureModulesField[$relatedModuleName][$referenceField->getFieldName()] = Vtiger_RecordStructure_Model::getInstanceForModule(Vtiger_Module_Model::getInstance($relatedModuleName))->getStructure();

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

                    }

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

            $viewer->assign('RECORD_STRUCTURE_RELATED_MODULES', $recordStructureModulesField);

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

            if (!Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModulePermission($request->getByType('sourceModuleName', 2))) {

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

         * @return void

    Line exceeds 120 characters; contains 225 characters
    Open

                        $recordStructureModulesField[$relatedModuleName][$referenceField->getFieldName()] = Vtiger_RecordStructure_Model::getInstanceForModule(Vtiger_Module_Model::getInstance($relatedModuleName))->getStructure();

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

            } else {

    Line exceeds 120 characters; contains 126 characters
    Open

                    $fieldModel = Vtiger_Field_Model::getInstance($fieldName, Vtiger_Module_Model::getInstance($fieldModuleName));

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

                $selectedOperator = $request->getByType('operator', \App\Purifier::ALNUM);

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

            $viewer->assign('FIELD_INFO', $fieldInfo);

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

         *

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

        public function builder(App\Request $request): void

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

            if (!$relatedModuleSkip) {

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

                }

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

            $operators = $request->isEmpty('parent', 1) ? $fieldModel->getQueryOperators() : $fieldModel->getRecordOperators();

    Line exceeds 120 characters; contains 123 characters
    Open

            $operators = $request->isEmpty('parent', 1) ? $fieldModel->getQueryOperators() : $fieldModel->getRecordOperators();

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

         *

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

                foreach ($sourceModuleModel->getFieldsByReference() as $referenceField) {

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

        use App\Controller\ClearProcess;

    Line exceeds 120 characters; contains 136 characters
    Open

            if (!Users_Privileges_Model::getCurrentUserPrivilegesModel()->hasModulePermission($request->getByType('sourceModuleName', 2))) {

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

            $viewer->assign('SELECTED_FIELD_MODEL', $fieldModel);

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

    class Vtiger_ConditionBuilder_View extends \App\Controller\View\Page

    There are no issues that match your filters.

    Category
    Status