YetiForceCompany/YetiForceCRM

View on GitHub
include/Loader.php

Summary

Maintainability
B
5 hrs
Test Coverage
B
87%

Function getComponentClassName has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

    public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
    {
        $cacheKey = "$componentType|$componentName|$moduleName";
        if (isset(self::$componentClassCache[$cacheKey])) {
            return self::$componentClassCache[$cacheKey];
Severity: Minor
Found in include/Loader.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 getComponentClassName has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
    {
        $cacheKey = "$componentType|$componentName|$moduleName";
        if (isset(self::$componentClassCache[$cacheKey])) {
            return self::$componentClassCache[$cacheKey];
Severity: Minor
Found in include/Loader.php - About 1 hr to fix

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

        public static function getRealPathFile(string $filePath, string $fileExtension, array $layoutPaths): string
        {
            $realPath = '';
            $checkMin = \vtlib\Functions::getMinimizationOptions($fileExtension);
            foreach ($layoutPaths as $layoutPath) {
    Severity: Minor
    Found in include/Loader.php - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

    Function autoLoad has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function autoLoad($className)
        {
            $parts = explode('_', $className);
            $noOfParts = \count($parts);
            if ($noOfParts > 2) {
    Severity: Minor
    Found in include/Loader.php - About 55 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 getComponentClassName has a boolean flag argument $throwException, which is a certain sign of a Single Responsibility Principle violation.
    Open

        public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
    Severity: Minor
    Found in include/Loader.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 '188', column '14').
    Open

                throw new \App\Exceptions\AppException('LBL_HANDLER_NOT_FOUND');
    Severity: Minor
    Found in include/Loader.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 '\vtlib\Functions' in method 'getRealPathFile'.
    Open

            $checkMin = \vtlib\Functions::getMinimizationOptions($fileExtension);
    Severity: Minor
    Found in include/Loader.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 resolveRelativePath uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                } else {
                    $file = str_replace('.', DIRECTORY_SEPARATOR, $qualifiedName) . '.' . $fileExtension;
                }
    Severity: Minor
    Found in include/Loader.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\Log' in method 'getComponentClassName'.
    Open

                \App\Log::error("Error Vtiger_Loader::getComponentClassName($componentType, $componentName, $moduleName): Handler not found");
    Severity: Minor
    Found in include/Loader.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 '\vtlib\Deprecated' in method 'includeOnce'.
    Open

            \vtlib\Deprecated::checkFileAccessForInclusion($file);
    Severity: Minor
    Found in include/Loader.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 '32', column '7').
    Open

        public static function resolveNameToPath($qualifiedName, $fileExtension = 'php')
        {
            if ($file = self::resolveRelativePath($qualifiedName, $fileExtension)) {
                $file = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . ('php' !== $fileExtension ? 'public_html' . DIRECTORY_SEPARATOR : '') . $file;
            }
    Severity: Minor
    Found in include/Loader.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

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

            } else {
                $load = [
                    $moduleName => $moduleName,
                    'Vtiger' => 'Vtiger',
                ];
    Severity: Minor
    Found in include/Loader.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

    Define a constant instead of duplicating this literal "Vtiger" 5 times.
    Open

        public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
    Severity: Critical
    Found in include/Loader.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 method error from undeclared class \App\Log
    Open

                \App\Log::error("Error Vtiger_Loader::getComponentClassName($componentType, $componentName, $moduleName): Handler not found");
    Severity: Critical
    Found in include/Loader.php by phan

    Returning type false but getComponentClassName() is declared to return string
    Open

            return false;
    Severity: Minor
    Found in include/Loader.php by phan

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

            $componentTypeDirectory = strtolower($componentType) . 's';
    Severity: Minor
    Found in include/Loader.php by phpmd

    LongVariable

    Since: 0.2

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

    Example

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

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

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

    class Vtiger_Loader
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

    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 12 and the first side effect is on line 223.
    Open

    <?php
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

    The class Vtiger_Loader is not named in CamelCase.
    Open

    class Vtiger_Loader
    {
        protected static $includeCache = [];
        protected static $includePathCache = [];
        protected static $componentClassCache = [];
    Severity: Minor
    Found in include/Loader.php by phpmd

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

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

        protected static $includePathCache = [];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            'custom.modules.',
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param string $qualifiedName
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        protected static $loaderDirs = [
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @return string Absolute File Name
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        ];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * Static function to resolve the qualified php filename to absolute path.
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            'modules.',
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        protected static $includeCache = [];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        protected static $componentClassCache = [];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param mixed  $fileExtension
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * Static function to resolve the qualified php filename to relative path.
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        public static function resolveRelativePath(string $qualifiedName, string $fileExtension = 'php'): string
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                } else {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $realPaths[] = $completeFilePath;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                foreach ($realPaths as $path) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                return false;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if ($success) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if (isset(self::$includePathCache[$qualifiedName])) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @return string Required Class Name
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if (isset(self::$componentClassCache[$cacheKey])) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                return self::$componentClassCache[$cacheKey];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            // Change component type from view to views, action to actions to navigate to the right path.
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    $baseModule = $moduleHierarchyParts[0];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $checkMin = \vtlib\Functions::getMinimizationOptions($fileExtension);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                if ($checkMin && false === strpos($completeFilePath, '.min.')) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @return bool
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if (!file_exists($file)) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        public static function includePath($qualifiedName)
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            set_include_path($path . PATH_SEPARATOR . get_include_path());
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $moduleHierarchyParts = explode(':', $moduleName);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                        $baseModule = 'Settings:Vtiger';
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                ];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        public static function resolveNameToPath($qualifiedName, $fileExtension = 'php')
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                if (0 === strpos($qualifiedName, '~')) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            return $file;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                self::$includeCache[$qualifiedName] = $file;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $load = [
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    str_replace(':', '_', $moduleName) => str_replace(':', '.', $moduleName),
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    if (file_exists(self::resolveNameToPath("$dir$classDir.$componentTypeDirectory.$componentName"))) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

    Line exceeds 120 characters; contains 137 characters
    Open

                $file = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . ('php' !== $fileExtension ? 'public_html' . DIRECTORY_SEPARATOR : '') . $file;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if (\in_array($fileExtension, $allowedExtensions)) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param array  $layoutPaths
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    if ($path && is_file($path)) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $componentTypeDirectory = strtolower($componentType) . 's';
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                ];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $load['Vtiger'] = 'Vtiger';
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                \App\Log::error("Error Vtiger_Loader::getComponentClassName($componentType, $componentName, $moduleName): Handler not found");
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * Returns canonicalized absolute pathname for css/js files.
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param string $fileExtension
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        public static function getRealPathFile(string $filePath, string $fileExtension, array $layoutPaths): string
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            // Check file inclusion before including it
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

    Line exceeds 120 characters; contains 140 characters
    Open

            // Change the Module directory & class, along with intermediate fall back directory and class, if module names has submodule as well
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $load[$actualModule] = $actualModule;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if ($file = self::resolveRelativePath($qualifiedName, $fileExtension)) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            // Already included?
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param string $className
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @return string
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $file = '';
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    $file = str_replace('.', DIRECTORY_SEPARATOR, $qualifiedName) . '.' . $fileExtension;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

    Line exceeds 120 characters; contains 128 characters
    Open

        public static function getComponentClassName($componentType, $componentName, $moduleName = 'Vtiger', $throwException = true)
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            // Change the Module directory & class, along with intermediate fall back directory and class, if module names has submodule as well
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    $moduleName => $moduleName,
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                foreach (self::$loaderDirs as $dir) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                foreach (self::$loaderDirs as $filePath) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $file = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . ('php' !== $fileExtension ? 'public_html' . DIRECTORY_SEPARATOR : '') . $file;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $completeFilePath = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $layoutPath . self::resolveRelativePath($filePath, $fileExtension);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                        break 2;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            return $realPath;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * Function to include a given php file through qualified file name.
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * Function to get the class name of a given Component, of given Type, for a given Module.
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

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

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

            foreach ($load as $classPath => $classDir) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                        return self::$componentClassCache[$cacheKey] = "{$classPath}_{$componentName}_{$componentType}";
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

    Line exceeds 120 characters; contains 134 characters
    Open

         * Function to auto load the required class files matching the directory pattern modules/xyz/types/Abc.php for class xyz_Abc_Type.
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                        return self::includeOnce($filePath);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            return $file;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $realPath = '';
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

    Line exceeds 120 characters; contains 176 characters
    Open

                $completeFilePath = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . 'public_html' . DIRECTORY_SEPARATOR . $layoutPath . self::resolveRelativePath($filePath, $fileExtension);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $file = self::resolveNameToPath($qualifiedName);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            \vtlib\Deprecated::checkFileAccessForInclusion($file);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $status = include_once $file;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            return true;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    $filePath .= $fileComponentName . '.' . $fileName;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    if (file_exists(self::resolveNameToPath($filePath))) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            return false;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param string $qualifiedName
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param string $fileExtension
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            return $success;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param string $componentType
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @throws \App\Exceptions\AppException
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $cacheKey = "$componentType|$componentName|$moduleName";
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                if ('Users' !== $actualModule) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    $load[str_replace(':', '_', $baseModule)] = str_replace(':', '.', $baseModule);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        public static function autoLoad($className)
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                        $realPath = $path;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param string $qualifiedName
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    if ('Settings' === $baseModule) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $allowedExtensions = ['php', 'js', 'css', 'less'];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @return string
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            foreach ($layoutPaths as $layoutPath) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    $realPaths[] = substr($completeFilePath, 0, -(\strlen($fileExtension) + 1)) . ".min.{$fileExtension}";
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        public static function includeOnce($qualifiedName)
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                return true;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            self::$includePathCache[$qualifiedName] = $path;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         */
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            } else {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    // Append modules and sub modules names to the path
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $realPaths = [];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                return true;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $path = realpath(self::resolveNameToPath($qualifiedName));
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param string $componentName
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param mixed  $throwException
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $actualModule = $moduleHierarchyParts[\count($moduleHierarchyParts) - 1];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    'Vtiger' => 'Vtiger',
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if ($throwException) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if (isset(self::$includeCache[$qualifiedName])) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if (false !== strpos($moduleName, ':')) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                $load = [
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

    Line exceeds 120 characters; contains 138 characters
    Open

                \App\Log::error("Error Vtiger_Loader::getComponentClassName($componentType, $componentName, $moduleName): Handler not found");
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * Function to auto load the required class files matching the directory pattern modules/xyz/types/Abc.php for class xyz_Abc_Type.
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            if ($noOfParts > 2) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    $file = str_replace('~', '', $qualifiedName);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @param string $filePath
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         *
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $success = (0 !== $status);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

        /**
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            }
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                throw new \App\Exceptions\AppException('LBL_HANDLER_NOT_FOUND');
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $parts = explode('_', $className);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    $fileComponentName = strtolower($parts[$noOfParts - 1]) . 's';
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            return false;
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

         * @return bool
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    $fileName = $parts[$noOfParts - 2];
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

            $noOfParts = \count($parts);
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                    for ($i = 0; $i < ($noOfParts - 2); ++$i) {
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

                        $filePath .= $parts[$i] . '.';
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

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

    class Vtiger_Loader
    Severity: Minor
    Found in include/Loader.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status