YetiForceCompany/YetiForceCRM

View on GitHub
app/ModuleHierarchy.php

Summary

Maintainability
D
2 days
Test Coverage
F
28%

Function getRelatedRecords has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getRelatedRecords($record, $hierarchy)
    {
        $moduleName = Record::getType($record);
        $records = $recordsLevel1 = $recordsLevel2 = [];
        if (\in_array(0, $hierarchy)) {
Severity: Minor
Found in app/ModuleHierarchy.php - About 4 hrs to fix

Cognitive Complexity

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

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

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

Further reading

File ModuleHierarchy.php has 318 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace App;

/**
Severity: Minor
Found in app/ModuleHierarchy.php - About 3 hrs to fix

    The class ModuleHierarchy has an overall complexity of 91 which is very high. The configured complexity threshold is 50.
    Open

    class ModuleHierarchy
    {
        protected static $hierarchy;
        protected static $modulesByLevels = [];
    
    
    Severity: Minor
    Found in app/ModuleHierarchy.php by phpmd

    Function getChildModules has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function getChildModules($moduleName, $hierarchy = [1])
        {
            $modules = [];
            switch (static::getModuleLevel($moduleName)) {
                case 0:
    Severity: Minor
    Found in app/ModuleHierarchy.php - About 2 hrs to fix

    Cognitive Complexity

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

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

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

    Further reading

    Method getRelatedRecords has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function getRelatedRecords($record, $hierarchy)
        {
            $moduleName = Record::getType($record);
            $records = $recordsLevel1 = $recordsLevel2 = [];
            if (\in_array(0, $hierarchy)) {
    Severity: Minor
    Found in app/ModuleHierarchy.php - About 1 hr to fix

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

          private static function getQueriesForRelatedRecords(int $record, string $moduleName, array $hierarchy, Db\Query $subQuery = null): array
          {
              $modules = static::getChildModules($moduleName, $hierarchy);
              $queries = [];
              if ($modules) {
      Severity: Minor
      Found in app/ModuleHierarchy.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 getChildModules has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function getChildModules($moduleName, $hierarchy = [1])
          {
              $modules = [];
              switch (static::getModuleLevel($moduleName)) {
                  case 0:
      Severity: Minor
      Found in app/ModuleHierarchy.php - About 1 hr to fix

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

            public static function getModulesByUitype($uitype)
            {
                switch ($uitype) {
                    case 67:
                        $level = 0;
        Severity: Minor
        Found in app/ModuleHierarchy.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

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

            public static function getUitypeByModule($moduleName)
            {
                switch (static::getModuleLevel($moduleName)) {
                    case 0:
                        $return = 67;
        Severity: Minor
        Found in app/ModuleHierarchy.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

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

            public static function getMappingRelatedField($moduleName)
            {
                $return = false;
                switch ((string) static::getModuleLevel($moduleName)) {
                    case '0':
        Severity: Minor
        Found in app/ModuleHierarchy.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

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

            public static function getFieldsForListFilter(string $moduleName): array
            {
                $fields = [];
                $moduleId = \App\Module::getModuleId($moduleName);
                foreach (static::getHierarchyByRelation() as $relations) {
        Severity: Minor
        Found in app/ModuleHierarchy.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

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

            public static function accessModulesByLevel($level = 0, $actionName = 'EditView')
            {
                $modules = [];
                if (isset(static::$modulesByLevels[$level])) {
                    foreach (static::$modulesByLevels[$level] as $module => &$details) {
        Severity: Minor
        Found in app/ModuleHierarchy.php - About 25 mins to fix

        Cognitive Complexity

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

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

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

        Further reading

        The method getRelatedRecords() has an NPath complexity of 456. The configured NPath complexity threshold is 200.
        Open

            public static function getRelatedRecords($record, $hierarchy)
            {
                $moduleName = Record::getType($record);
                $records = $recordsLevel1 = $recordsLevel2 = [];
                if (\in_array(0, $hierarchy)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpmd

        NPathComplexity

        Since: 0.1

        The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

        Example

        class Foo {
            function bar() {
                // lots of complicated code
            }
        }

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

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

            public static function getRelatedRecords($record, $hierarchy)
            {
                $moduleName = Record::getType($record);
                $records = $recordsLevel1 = $recordsLevel2 = [];
                if (\in_array(0, $hierarchy)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpmd

        CyclomaticComplexity

        Since: 0.1

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

        Example

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

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

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

            public static function getChildModules($moduleName, $hierarchy = [1])
            {
                $modules = [];
                switch (static::getModuleLevel($moduleName)) {
                    case 0:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpmd

        CyclomaticComplexity

        Since: 0.1

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

        Example

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

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

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

            public static function getRelatedRecords($record, $hierarchy)
        Severity: Critical
        Found in app/ModuleHierarchy.php by sonar-php

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

        See

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

            public static function getChildModules($moduleName, $hierarchy = [1])
        Severity: Critical
        Found in app/ModuleHierarchy.php by sonar-php

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

        See

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

            public static function getRelationFieldByHierarchy($moduleName, $field = false)
        Severity: Minor
        Found in app/ModuleHierarchy.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 '405', column '23').
        Open

                    $dataReader = (new \App\Db\Query())
        Severity: Minor
        Found in app/ModuleHierarchy.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\Field' in method 'getRelatedRecords'.
        Open

                    $fields = Field::getRelatedFieldForModule(false, $moduleName);
        Severity: Minor
        Found in app/ModuleHierarchy.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\Privilege' in method 'accessModulesByParent'.
        Open

                    if (Privilege::isPermitted($module, $actionName) && isset($details['parentModule'])) {
        Severity: Minor
        Found in app/ModuleHierarchy.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\Module' in method 'getFieldsForListFilter'.
        Open

                            $fields[$relation['field_name']][\App\Module::getModuleName($relation['tabid'])] = [$relation['rel_field_name'] => \App\Module::getModuleName($relation['rel_tabid'])];
        Severity: Minor
        Found in app/ModuleHierarchy.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\Module' in method 'init'.
        Open

                    if (Module::isModuleActive($module) && Privilege::isPermitted($module)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

        Avoid using static access to class 'App\Record' in method 'getRelatedRecords'.
        Open

                $moduleName = Record::getType($record);
        Severity: Minor
        Found in app/ModuleHierarchy.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 'getHierarchyByRelation'.
        Open

                    Cache::save('HierarchyByRelation', '', $data, Cache::LONG);
        Severity: Minor
        Found in app/ModuleHierarchy.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\Field' in method 'getQueriesForRelatedRecords'.
        Open

                    $fields = Field::getRelatedFieldForModule(false, $moduleName);
        Severity: Minor
        Found in app/ModuleHierarchy.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\Privilege' in method 'init'.
        Open

                    if (Module::isModuleActive($module) && Privilege::isPermitted($module)) {
        Severity: Minor
        Found in app/ModuleHierarchy.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 getHierarchyByRelation uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
        Open

                } else {
                    $data = [];
                    $dataReader = (new \App\Db\Query())
                        ->select(['SR.tabid', 'SR.field_name', 'SR.related_tabid', 'rel_field_name' => 'RR.field_name', 'rel_tabid' => 'RR.tabid', 'a_yf_record_list_filter.*'])
                        ->from('a_yf_record_list_filter')
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpmd

        ElseExpression

        Since: 1.4.0

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

        Example

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

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

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

                            } else {
                                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $record]);
                            }
        Severity: Minor
        Found in app/ModuleHierarchy.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 'getHierarchyByRelation'.
        Open

                if (Cache::has('HierarchyByRelation', '')) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpmd

        StaticAccess

        Since: 1.4.0

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

        Example

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

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

        Avoid using static access to class 'App\Record' in method 'getQueryRelatedRecords'.
        Open

                $moduleName = Record::getType($record);
        Severity: Minor
        Found in app/ModuleHierarchy.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\Module' in method 'getFieldsForListFilter'.
        Open

                            $fields[$relation['field_name']][\App\Module::getModuleName($relation['tabid'])] = [$relation['rel_field_name'] => \App\Module::getModuleName($relation['rel_tabid'])];
        Severity: Minor
        Found in app/ModuleHierarchy.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 'getHierarchyByRelation'.
        Open

                    $data = Cache::get('HierarchyByRelation', '');
        Severity: Minor
        Found in app/ModuleHierarchy.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\Field' in method 'getRelatedRecords'.
        Open

                            $fields = Field::getRelatedFieldForModule(false, $moduleName);
        Severity: Minor
        Found in app/ModuleHierarchy.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\Module' in method 'getFieldsForListFilter'.
        Open

                $moduleId = \App\Module::getModuleId($moduleName);
        Severity: Minor
        Found in app/ModuleHierarchy.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 '225', column '9').
        Open

            public static function getChildModules($moduleName, $hierarchy = [1])
            {
                $modules = [];
                switch (static::getModuleLevel($moduleName)) {
                    case 0:
        Severity: Minor
        Found in app/ModuleHierarchy.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\Privilege' in method 'accessModulesByLevel'.
        Open

                        if (Privilege::isPermitted($module, $actionName)) {
        Severity: Minor
        Found in app/ModuleHierarchy.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 "rel_field_name" 3 times.
        Open

                        if ($relation['related_tabid'] === $moduleId && !empty($relation['rel_field_name'])) {
        Severity: Critical
        Found in app/ModuleHierarchy.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 "tablename" 3 times.
        Open

                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $record]);
        Severity: Critical
        Found in app/ModuleHierarchy.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 "HierarchyByRelation" 3 times.
        Open

                if (Cache::has('HierarchyByRelation', '')) {
        Severity: Critical
        Found in app/ModuleHierarchy.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 "parentModule" 3 times.
        Open

                    if (Privilege::isPermitted($module, $actionName) && isset($details['parentModule'])) {
        Severity: Critical
        Found in app/ModuleHierarchy.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 "columnname" 3 times.
        Open

                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $record]);
        Severity: Critical
        Found in app/ModuleHierarchy.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 "modulesMapRelatedFields" 4 times.
        Open

                if (false !== $field && isset(static::$hierarchy['modulesMapRelatedFields'][$moduleName][$field])) {
        Severity: Critical
        Found in app/ModuleHierarchy.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 "modulesHierarchy" 5 times.
        Open

                foreach (static::$hierarchy['modulesHierarchy'] as $module => $details) {
        Severity: Critical
        Found in app/ModuleHierarchy.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

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

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

                return $queryGenerator->createQuery()->column();
        Severity: Critical
        Found in app/ModuleHierarchy.php by phan

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

                            $queryGenerator->setFields(['id']);
        Severity: Critical
        Found in app/ModuleHierarchy.php by phan

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

                $queryGenerator->setFields(['id']);
        Severity: Critical
        Found in app/ModuleHierarchy.php by phan

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

                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $record]);
        Severity: Critical
        Found in app/ModuleHierarchy.php by phan

        Doc-block of $subQuery in getQueriesForRelatedRecords is phpdoc param type \App\Db\Query which is not a permitted replacement of the nullable param type ?\App\Db\Query declared in the signature ('?T' should be documented as 'T|null' or '?T')
        Open

             * @param Db\Query $subQuery
        Severity: Minor
        Found in app/ModuleHierarchy.php by phan

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

                            $queryGenerator = new QueryGenerator($field['name']);
        Severity: Critical
        Found in app/ModuleHierarchy.php by phan

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

                            $tempQuery = $queryGenerator->createQuery();
        Severity: Critical
        Found in app/ModuleHierarchy.php by phan

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

                                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $record]);
        Severity: Critical
        Found in app/ModuleHierarchy.php by phan

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

                $queryGenerator = new QueryGenerator($field['name']);
        Severity: Critical
        Found in app/ModuleHierarchy.php by phan

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

                                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $subQuery]);
        Severity: Critical
        Found in app/ModuleHierarchy.php by phan

        A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 15 and the first side effect is on line 424.
        Open

        <?php
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                foreach (static::$hierarchy['modulesHierarchy'] as $module => $details) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

            public static function getModulesMapMMCustom($moduleName)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                    case '1':
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                if (isset(static::$hierarchy['modulesMap1M'][$moduleName])) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getModulesByLevel($level = null)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    foreach (static::$modulesByLevels[$level] as $module => &$details) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                foreach (static::$hierarchy['modulesHierarchy'] as $module => &$details) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

            public static function init()
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getModulesHierarchy()
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @param int $uitype
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $level = 4;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

            protected static $hierarchy;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (isset(static::$hierarchy)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    if (Module::isModuleActive($module) && Privilege::isPermitted($module)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    return static::$hierarchy['modulesMap1M'][$moduleName];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                return false;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                switch ((string) static::getModuleLevel($moduleName)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case '3':
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

        Line exceeds 120 characters; contains 145 characters
        Open

                return isset(static::$hierarchy['modulesHierarchy'][$moduleName]) ? static::$hierarchy['modulesHierarchy'][$moduleName]['level'] : false;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                if (isset(static::$hierarchy['modulesMapMMBase'])) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $level = 0;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                $modules = [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $return = 'subprocess_sl';
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getModuleLevel($moduleName)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * @return array
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getModulesByUitype($uitype)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 66:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 68:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $level = 3;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $return = 'subprocess';
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            protected static $modulesByLevels = [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (isset(static::$hierarchy['modulesMapMMCustom'][$moduleName])) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    return static::$modulesByLevels;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * Get modules list by uitype field.
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                switch ($uitype) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    return true;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return $modules;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    if (Privilege::isPermitted($module, $actionName) && isset($details['parentModule'])) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $modules[$details['parentModule']][$module] = $details;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case '4':
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (isset(static::$modulesByLevels[$level])) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    return static::$modulesByLevels[$level];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                        $level = 1;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 65:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                return $modules[$parent];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                        $return = 'process';
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return static::$hierarchy['modulesHierarchy'];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                return isset(static::$hierarchy['modulesHierarchy'][$moduleName]) ? static::$hierarchy['modulesHierarchy'][$moduleName]['level'] : false;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

            public static function getModulesMapMMBase()
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 64:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    case '0':
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $return = 'link';
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    return static::$hierarchy['modulesMapMMCustom'][$moduleName];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                return static::getModulesByLevel($level);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

            public static function accessModulesByParent($parent, $actionName = 'EditView')
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                $modules = [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case '2':
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $return = 'linkextend';
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                static::$hierarchy = require ROOT_DIRECTORY . '/app_data/moduleHierarchy.php';
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    return static::$hierarchy['modulesMapMMBase'];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (null === $level) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 67:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $level = 2;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                if (isset(static::$modulesByLevels[$level])) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $modules[$module] = $details;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getMappingRelatedField($moduleName)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        static::$modulesByLevels[$details['level']][$module] = $details;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getModulesMap1M($moduleName)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                $return = false;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                return false;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    default:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        if (Privilege::isPermitted($module, $actionName)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

            public static function accessModulesByLevel($level = 0, $actionName = 'EditView')
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return $return;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                $modules = static::getChildModules($moduleName, $hierarchy);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @param int   $record
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                switch (static::getModuleLevel($moduleName)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $modules = array_keys(static::getModulesByLevel(4));
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                                if ($moduleName === $details['parentModule']) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    $fields = Field::getRelatedFieldForModule(false, $moduleName);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * Get related records by field.
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @return array
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $return = 67;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $return = 64;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @param int   $record
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getRelatedRecords($record, $hierarchy)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    $records = array_merge($records, $recordsLevel1);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            foreach ($fields as $field) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                switch (static::getModuleLevel($moduleName)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * @return string[]
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        if ($is1Level && $isLevel4) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 2:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        if (\in_array(3, $hierarchy)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * Get related records by hierarchy.
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                    case 0:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 2:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $modules = array_keys(array_merge(static::getModulesByLevel(1), static::getModulesByLevel(4)));
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $modules = array_keys(static::getModulesByLevel(3));
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $modules = static::getChildModules($moduleName, [1]);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                                if (\in_array($field['name'], $modules)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                                    $recordsLevel2 = array_merge($recordsLevel2, $recordsByField);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            protected static function getRelatedRecordsByField($record, $field)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getUitypeByModule($moduleName)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 4:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * Get child modules.
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                if (\in_array(0, $hierarchy)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @param bool   $field
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return $return;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $is1Level = \in_array(1, $hierarchy);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * @return int[]
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (0 === $level) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                            $records = array_merge($records, $recordsByHierarchy);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $records = array_merge($records, $recordsLevel1);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * The function takes a hierarchy relationship.
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    return static::$hierarchy['modulesMapRelatedFields'][$moduleName];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                        $return = 68;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                            $modules = array_keys(static::getModulesByLevel(1));
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getRelationFieldByHierarchy($moduleName, $field = false)
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        if (\in_array($field['name'], $modules)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 1:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        if ($modules) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

             * @return int[]
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                                    $modules[] = $mod;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                            $recordsLevel1 = array_merge($recordsLevel1, $recordsByField);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                if (isset(static::$hierarchy['modulesMapRelatedFields'][$moduleName])) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 3:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $return = 65;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * @param int[]  $hierarchy
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    case 0:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        } elseif ($is1Level) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    foreach ($fields as $field) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                $level = static::getModuleLevel($moduleName);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $recordsByHierarchy = static::getRelatedRecords($record, $hierarchy);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return array_unique($records);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    return static::$hierarchy['modulesMapRelatedFields'][$moduleName][$field];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        } elseif ($isLevel4) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    default:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        foreach ($recordsLevel2 as $record) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    default:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    if (\in_array(3, $hierarchy)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (false !== $field && isset(static::$hierarchy['modulesMapRelatedFields'][$moduleName][$field])) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                        if ($levelMod = static::getModulesByLevel(2)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @param array $hierarchy
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if ($modules) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $recordsByField = static::getRelatedRecordsByField($record, $field);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                        $return = 66;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                $modules = [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        $isLevel4 = \in_array(4, $hierarchy);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                            foreach ($levelMod as $mod => $details) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                $records = $recordsLevel1 = $recordsLevel2 = [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    if (\in_array(2, $hierarchy)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $fields = Field::getRelatedFieldForModule(false, $moduleName);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                                    $recordsByField = static::getRelatedRecordsByField($record, $field);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    default:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getChildModules($moduleName, $hierarchy = [1])
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    case 1:
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        break;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

                return $modules;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                $moduleName = Record::getType($record);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    $records[] = $record;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (!(0 == $level && !\in_array(1, $hierarchy))) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

             * @param array $field
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                $queryGenerator->setFields(['id']);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                            if ($subQuery) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * @return Db\Query|null
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                unset($queries[0]);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                foreach (static::getHierarchyByRelation() as $relations) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                $queryGenerator = new QueryGenerator($field['name']);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if ($modules) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    $fields = Field::getRelatedFieldForModule(false, $moduleName);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * @param int   $record
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (0 === \count($queries)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    foreach ($relations as $relation) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        ->select(['SR.tabid', 'SR.field_name', 'SR.related_tabid', 'rel_field_name' => 'RR.field_name', 'rel_tabid' => 'RR.tabid', 'a_yf_record_list_filter.*'])
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                        $data[$row['relationid']][] = $row;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    return null;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                foreach ($queries as $query) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * @return array
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

            public static function getHierarchyByRelation(int $relationId = null): array
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $record]);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @param int      $record
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * @return array
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            private static function getQueriesForRelatedRecords(int $record, string $moduleName, array $hierarchy, Db\Query $subQuery = null): array
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    $subQuery->union($query);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @param int|null $relationId
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $subQuery]);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

        Line exceeds 120 characters; contains 125 characters
        Open

                                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $subQuery]);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $queries[] = $tempQuery;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

        Line exceeds 120 characters; contains 145 characters
        Open

                            $queries = array_merge($queries, static::getQueriesForRelatedRecords($record, $field['name'], $hierarchy, clone $tempQuery));
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

        Line exceeds 120 characters; contains 187 characters
        Open

                            $fields[$relation['field_name']][\App\Module::getModuleName($relation['tabid'])] = [$relation['rel_field_name'] => \App\Module::getModuleName($relation['rel_tabid'])];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @param Db\Query $subQuery
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                    foreach ($fields as $field) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $tempQuery = $queryGenerator->createQuery();
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return $queries;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

             * @param array $hierarchy
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        if ($relation['related_tabid'] === $moduleId && !empty($relation['rel_field_name'])) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

                $modules = static::getChildModules($moduleName, $hierarchy);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * Get related query by hierarchy.
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

                    Cache::save('HierarchyByRelation', '', $data, Cache::LONG);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $record]);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                $fields = [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $fields[$relation['field_name']][\App\Module::getModuleName($relation['tabid'])] = [$relation['rel_field_name'] => \App\Module::getModuleName($relation['rel_tabid'])];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * @param array    $hierarchy
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

                return $fields;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                $queries = [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                            $queries = array_merge($queries, static::getQueriesForRelatedRecords($record, $field['name'], $hierarchy, clone $tempQuery));
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                $moduleId = \App\Module::getModuleId($moduleName);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    $data = [];
        Severity: Minor
        Found in app/ModuleHierarchy.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/ModuleHierarchy.php by phpcodesniffer

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

                        ->leftJoin(['RR' => 'vtiger_relatedlists'], 'RR.relation_id=a_yf_record_list_filter.rel_relationid')
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

             * Get hierarchy info by relation.
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        ->from('a_yf_record_list_filter')
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                return $queryGenerator->createQuery()->column();
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

        Line exceeds 120 characters; contains 140 characters
        Open

            private static function getQueriesForRelatedRecords(int $record, string $moduleName, array $hierarchy, Db\Query $subQuery = null): array
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        if (\in_array($field['name'], $modules)) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $queryGenerator->setFields(['id']);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

                $moduleName = Record::getType($record);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                $queries = static::getQueriesForRelatedRecords($record, $moduleName, $hierarchy);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (null === $relationId) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * Function to get array of queries. Quries are used to create union.
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                            $queryGenerator = new QueryGenerator($field['name']);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

                $subQuery = $queries[0];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return $subQuery;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

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

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

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

             * @return array
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    $data = Cache::get('HierarchyByRelation', '');
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

        Line exceeds 120 characters; contains 168 characters
        Open

                        ->select(['SR.tabid', 'SR.field_name', 'SR.related_tabid', 'rel_field_name' => 'RR.field_name', 'rel_tabid' => 'RR.tabid', 'a_yf_record_list_filter.*'])
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                return $data[$relationId] ?? [];
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

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

        Line exceeds 120 characters; contains 123 characters
        Open

                                $queryGenerator->addNativeCondition([$field['tablename'] . '.' . $field['columnname'] => $record]);
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

             * Get fields for list filter.
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

            public static function getFieldsForListFilter(string $moduleName): array
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                if (Cache::has('HierarchyByRelation', '')) {
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                        ->leftJoin(['SR' => 'vtiger_relatedlists'], 'SR.relation_id=a_yf_record_list_filter.relationid')
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

                    return $data;
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

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

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

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

            public static function getQueryRelatedRecords(int $record, array $hierarchy): ?Db\Query
        Severity: Minor
        Found in app/ModuleHierarchy.php by phpcodesniffer

        There are no issues that match your filters.

        Category
        Status