YetiForceCompany/YetiForceCRM

View on GitHub
include/main/WebUI.php

Summary

Maintainability
D
1 day
Test Coverage
C
70%

process accesses the super-global variable $_SERVER.
Open

    public function process(App\Request $request)
    {
        if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
            header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
        }
Severity: Minor
Found in include/main/WebUI.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

The method Vtiger_WebUI::process() calls the typical debug function print_r() which is mostly only used during development.
Open

                    file_put_contents('cache/logs/request.log', print_r(apache_request_headers(), true));
Severity: Minor
Found in include/main/WebUI.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

process accesses the super-global variable $_SERVER.
Open

    public function process(App\Request $request)
    {
        if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
            header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
        }
Severity: Minor
Found in include/main/WebUI.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

The method Vtiger_WebUI::process() calls the typical debug function print_r() which is mostly only used during development.
Open

                file_put_contents('cache/logs/request.log', print_r($request->getAll(), true));
Severity: Minor
Found in include/main/WebUI.php by phpmd

DevelopmentCodeFragment

Since: 2.3.0

Functions like vardump(), printr() etc. are normally only used during development and therefore such calls in production code are a good indicator that they were just forgotten.

Example

class SuspectCode {

    public function doSomething(array $items)
    {
        foreach ($items as $i => $item) {
            // …

            if ('qafoo' == $item) var_dump($i);

            // …
        }
    }
}

Source https://phpmd.org/rules/design.html#developmentcodefragment

process accesses the super-global variable $_SERVER.
Open

    public function process(App\Request $request)
    {
        if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
            header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
        }
Severity: Minor
Found in include/main/WebUI.php by phpmd

Superglobals

Since: 0.2

Accessing a super-global variable directly is considered a bad practice. These variables should be encapsulated in objects that are provided by a framework, for instance.

Example

class Foo {
    public function bar() {
        $name = $_POST['foo'];
    }
}

Source

Function process has a Cognitive Complexity of 57 (exceeds 5 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
            header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
        }
Severity: Minor
Found in include/main/WebUI.php - About 1 day 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 process has 132 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function process(App\Request $request)
    {
        if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
            header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
        }
Severity: Major
Found in include/main/WebUI.php - About 5 hrs to fix

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

    class Vtiger_WebUI extends Vtiger_EntryPoint
    {
        /**
         * User privileges model instance.
         *
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

    The method process() has an NPath complexity of 68588370. The configured NPath complexity threshold is 200.
    Open

        public function process(App\Request $request)
        {
            if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
                header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
            }
    Severity: Minor
    Found in include/main/WebUI.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 process() has 137 lines of code. Current threshold is set to 100. Avoid really long methods.
    Open

        public function process(App\Request $request)
        {
            if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
                header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
            }
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

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

        public function process(App\Request $request)
        {
            if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
                header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
            }
    Severity: Minor
    Found in include/main/WebUI.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 68 to the 15 allowed.
    Open

        public function process(App\Request $request)
    Severity: Critical
    Found in include/main/WebUI.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 class Vtiger_WebUI has a coupling between objects value of 27. Consider to reduce the number of dependencies under 13.
    Open

    class Vtiger_WebUI extends Vtiger_EntryPoint
    {
        /**
         * User privileges model instance.
         *
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

    CouplingBetweenObjects

    Since: 1.1.0

    A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

    Example

    class Foo {
        /**
         * @var \foo\bar\X
         */
        private $x = null;
    
        /**
         * @var \foo\bar\Y
         */
        private $y = null;
    
        /**
         * @var \foo\bar\Z
         */
        private $z = null;
    
        public function setFoo(\Foo $foo) {}
        public function setBar(\Bar $bar) {}
        public function setBaz(\Baz $baz) {}
    
        /**
         * @return \SplObjectStorage
         * @throws \OutOfRangeException
         * @throws \InvalidArgumentException
         * @throws \ErrorException
         */
        public function process(\Iterator $it) {}
    
        // ...
    }

    Source https://phpmd.org/rules/design.html#couplingbetweenobjects

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

                throw new \App\Exceptions\AppException('ERR_MODULE_DOES_NOT_EXIST||' . $moduleName, 405);
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

    Missing class import via use statement (line '249', column '13').
    Open

            throw new \App\Exceptions\NoPermitted('ERR_NOT_ACCESSIBLE', 403);
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                    throw new \App\Exceptions\Unauthorized('LBL_LOGIN_IS_REQUIRED', 401);
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

    MissingImport

    Since: 2.7.0

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

    Example

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

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

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

                    throw new \App\Exceptions\AppException('LBL_HANDLER_NOT_FOUND', 405);
    Severity: Minor
    Found in include/main/WebUI.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 assigning values to variables in if clauses and the like (line '109', column '90').
    Open

        public function process(App\Request $request)
        {
            if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
                header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
            }
    Severity: Minor
    Found in include/main/WebUI.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\RequestUtil' in method 'process'.
    Open

            if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
    Severity: Minor
    Found in include/main/WebUI.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\Session' in method 'process'.
    Open

                    if (!\App\Session::has('CSP_TOKEN')) {
    Severity: Minor
    Found in include/main/WebUI.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\Log' in method 'triggerCheckPermission'.
    Open

            \App\Log::error("No permissions to the module: $moduleName", 'NoPermitted');
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                    \App\Config::setJsEnv('view', $view);
    Severity: Minor
    Found in include/main/WebUI.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\Session' in method 'process'.
    Open

                    \App\Session::set('last_activity', \App\Process::$startTime);
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                    \App\Config::setJsEnv('action', $action);
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                    if (App\Config::debug('DISPLAY_EXCEPTION_BACKTRACE')) {
    Severity: Minor
    Found in include/main/WebUI.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 process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                        } else {
                            $qualifiedModuleName = $moduleName = 'Home';
                            $view = 'DashBoard';
                        }
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                \App\Config::setJsEnv('mode', $request->getMode());
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'getLogin'.
    Open

                if ($userId && App\Config::main('application_unique_key') === App\Session::get('app_unique_key') && \App\User::isExists($userId)) {
    Severity: Minor
    Found in include/main/WebUI.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\RequestUtil' in method 'process'.
    Open

                $requestUrl = (\App\RequestUtil::isHttps() ? 'https' : 'http') . '://' . $request->getServer('HTTP_HOST') . $request->getServer('REQUEST_URI');
    Severity: Minor
    Found in include/main/WebUI.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\Session' in method 'process'.
    Open

                App\Session::init();
    Severity: Minor
    Found in include/main/WebUI.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\Log' in method 'process'.
    Open

                \App\Log::error($e->getMessage() . PHP_EOL . $e->__toString());
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                if ('test' === App\Config::main('systemMode')) {
    Severity: Minor
    Found in include/main/WebUI.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\Log' in method 'triggerCheckPermission'.
    Open

                \App\Log::error('HandlerModule: ' . $moduleName, 'Loader');
    Severity: Minor
    Found in include/main/WebUI.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\Session' in method 'getLogin'.
    Open

                $userId = App\Session::get('authenticated_user_id');
    Severity: Minor
    Found in include/main/WebUI.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\Functions' in method 'process'.
    Open

                \vtlib\Functions::throwNewException($e, false, $messageHeader);
    Severity: Minor
    Found in include/main/WebUI.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 'Users_Privileges_Model' in method 'triggerCheckPermission'.
    Open

            $this->userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
    Severity: Minor
    Found in include/main/WebUI.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 'process'.
    Open

                        if (!empty($defaultModule) && 'Home' !== $defaultModule && \App\Privilege::isPermitted($defaultModule)) {
    Severity: Minor
    Found in include/main/WebUI.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\User' in method 'getLogin'.
    Open

                if ($userId && App\Config::main('application_unique_key') === App\Session::get('app_unique_key') && \App\User::isExists($userId)) {
    Severity: Minor
    Found in include/main/WebUI.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\Process' in method 'process'.
    Open

                App\Process::init();
    Severity: Minor
    Found in include/main/WebUI.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\Controller\Headers' in method 'process'.
    Open

                        \App\Controller\Headers::generateCspToken();
    Severity: Minor
    Found in include/main/WebUI.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\User' in method 'process'.
    Open

                if ($qualifiedModuleName && 0 === stripos($qualifiedModuleName, 'Settings') && empty(\App\User::getCurrentUserId())) {
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                if (0 !== stripos($requestUrl, App\Config::main('site_URL'))) {
    Severity: Minor
    Found in include/main/WebUI.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\Debuger' in method 'process'.
    Open

                App\Debuger::initConsole();
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                \App\Config::setJsEnv('module', $moduleName);
    Severity: Minor
    Found in include/main/WebUI.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\Log' in method 'process'.
    Open

                    \App\Log::error("HandlerClass: $handlerClass", 'Loader');
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                    if (App\Config::debug('DISPLAY_EXCEPTION_LOGS')) {
    Severity: Minor
    Found in include/main/WebUI.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\Session' in method 'getLogin'.
    Open

            if (!$user && App\Session::has('authenticated_user_id')) {
    Severity: Minor
    Found in include/main/WebUI.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\Session' in method 'getLogin'.
    Open

                if ($userId && App\Config::main('application_unique_key') === App\Session::get('app_unique_key') && \App\User::isExists($userId)) {
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                    header('location: ' . App\Config::main('site_URL'), true, 301);
    Severity: Minor
    Found in include/main/WebUI.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 process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                } else {
                    $componentType = 'View';
                    if (empty($view)) {
                        $view = 'Index';
                    }
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

                        echo '<pre class="my-5 mx-auto card p-3 u-w-fit shadow js-exception-backtrace">' . App\Purifier::encodeHtml(str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', $e->__toString())) . '</pre>';
    Severity: Minor
    Found in include/main/WebUI.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\User' in method 'getLogin'.
    Open

                    \App\User::setCurrentUserId($userId);
    Severity: Minor
    Found in include/main/WebUI.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\Session' in method 'process'.
    Open

                    \App\Session::set('return_params', str_replace('&amp;', '&', $returnUrl));
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                        $defaultModule = App\Config::main('default_module');
    Severity: Minor
    Found in include/main/WebUI.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 process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                    } else {
                        $qualifiedModuleName = $moduleName = 'Users';
                        $view = 'Login';
                    }
    Severity: Minor
    Found in include/main/WebUI.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 process uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

                } else {
                    $handlerClass = Vtiger_Loader::getComponentClassName($componentType, $componentName, $qualifiedModuleName);
                }
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

    ElseExpression

    Since: 1.4.0

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

    Example

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

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

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

                        echo '<pre class="my-5 mx-auto card p-3 u-w-fit shadow js-exception-logs">' . App\Purifier::encodeHtml(str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', \App\Log::getlastLogs())) . '</pre>';
    Severity: Minor
    Found in include/main/WebUI.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\Log' in method 'process'.
    Open

                        echo '<pre class="my-5 mx-auto card p-3 u-w-fit shadow js-exception-logs">' . App\Purifier::encodeHtml(str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', \App\Log::getlastLogs())) . '</pre>';
    Severity: Minor
    Found in include/main/WebUI.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 '119', column '17').
    Open

        public function process(App\Request $request)
        {
            if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
                header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
            }
    Severity: Minor
    Found in include/main/WebUI.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\Session' in method 'process'.
    Open

                if (!$hasLogin && 'GET' === $_SERVER['REQUEST_METHOD'] && 'Users' !== $moduleName && ($returnUrl = $request->getServer('QUERY_STRING')) && !\App\Session::has('return_params')) {
    Severity: Minor
    Found in include/main/WebUI.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\Config' in method 'process'.
    Open

                    header('location: ' . App\Config::main('site_URL'), true);
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

    Avoid using static access to class 'Vtiger_Loader' in method 'process'.
    Open

                    $handlerClass = Vtiger_Loader::getComponentClassName($componentType, $componentName, $qualifiedModuleName);
    Severity: Minor
    Found in include/main/WebUI.php by phpmd

    StaticAccess

    Since: 1.4.0

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

    Example

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

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

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

            $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
    Severity: Minor
    Found in include/main/WebUI.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 "Users" 4 times.
    Open

                if (!$hasLogin && 'GET' === $_SERVER['REQUEST_METHOD'] && 'Users' !== $moduleName && ($returnUrl = $request->getServer('QUERY_STRING')) && !\App\Session::has('return_params')) {
    Severity: Critical
    Found in include/main/WebUI.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 "Settings" 3 times.
    Open

                if ($qualifiedModuleName && 0 === stripos($qualifiedModuleName, 'Settings') && empty(\App\User::getCurrentUserId())) {
    Severity: Critical
    Found in include/main/WebUI.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 "site_URL" 3 times.
    Open

                if (0 !== stripos($requestUrl, App\Config::main('site_URL'))) {
    Severity: Critical
    Found in include/main/WebUI.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("HandlerClass: $handlerClass", 'Loader');
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Call to method error from undeclared class \App\Log
    Open

                \App\Log::error($e->getMessage() . PHP_EOL . $e->__toString());
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Reference to static property logToProfile from undeclared class \App\Log
    Open

    App\Log::$logToProfile = Yii::$logToProfile = App\Config::debug('LOG_TO_PROFILE');
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Call to method error from undeclared class \App\Log
    Open

                \App\Log::error('HandlerModule: ' . $moduleName, 'Loader');
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Suspicious type bool of a variable or expression used to build a string. (Expected type to be able to cast to a string)
    Open

                $requestUrl = (\App\RequestUtil::isHttps() ? 'https' : 'http') . '://' . $request->getServer('HTTP_HOST') . $request->getServer('REQUEST_URI');
    Severity: Minor
    Found in include/main/WebUI.php by phan

    Returning type false but getLogin() is declared to return \Users
    Open

            return $user;
    Severity: Minor
    Found in include/main/WebUI.php by phan

    Call to method getlastLogs from undeclared class \App\Log
    Open

                        echo '<pre class="my-5 mx-auto card p-3 u-w-fit shadow js-exception-logs">' . App\Purifier::encodeHtml(str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', \App\Log::getlastLogs())) . '</pre>';
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Checking instanceof against undeclared class \yii\db\Exception (Did you mean class \Exception)
    Open

                } elseif ($e instanceof \yii\db\Exception) {
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Reference to static property logToFile from undeclared class \App\Log
    Open

    App\Log::$logToFile = App\Config::debug('LOG_TO_FILE');
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Argument 3 (subject) is true but \str_replace() takes array|string
    Open

                    \App\Session::set('return_params', str_replace('&amp;', '&', $returnUrl));
    Severity: Minor
    Found in include/main/WebUI.php by phan

    Call to method setCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                    \App\User::setCurrentUserId($userId);
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Call to method getCurrentUserId from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                if ($qualifiedModuleName && 0 === stripos($qualifiedModuleName, 'Settings') && empty(\App\User::getCurrentUserId())) {
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Reference to static property logToConsole from undeclared class \App\Log
    Open

    App\Log::$logToConsole = App\Config::debug('DISPLAY_LOGS_IN_CONSOLE');
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Argument 1 (mixed) is string but \Users_Privileges_Model::hasModulePermission() takes int defined at /code/modules/Users/models/Privileges.php:101
    Open

            if ($this->userPrivilegesModel->hasModulePermission($moduleName)) {
    Severity: Minor
    Found in include/main/WebUI.php by phan

    Call to method error from undeclared class \App\Log
    Open

            \App\Log::error("No permissions to the module: $moduleName", 'NoPermitted');
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Call to method isExists from undeclared class \App\User (Did you mean class \Tests\App\User)
    Open

                if ($userId && App\Config::main('application_unique_key') === App\Session::get('app_unique_key') && \App\User::isExists($userId)) {
    Severity: Critical
    Found in include/main/WebUI.php by phan

    Call to method __toString from undeclared class \yii\db\Exception (Did you mean class \Exception)
    Open

                        echo '<pre class="my-5 mx-auto card p-3 u-w-fit shadow js-exception-backtrace">' . App\Purifier::encodeHtml(str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', $e->__toString())) . '</pre>';
    Severity: Critical
    Found in include/main/WebUI.php by phan

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

    class Vtiger_WebUI extends Vtiger_EntryPoint
    Severity: Minor
    Found in include/main/WebUI.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 32 and the first side effect is on line 11.
    Open

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

    The class Vtiger_WebUI is not named in CamelCase.
    Open

    class Vtiger_WebUI extends Vtiger_EntryPoint
    {
        /**
         * User privileges model instance.
         *
    Severity: Minor
    Found in include/main/WebUI.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

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

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

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

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

         * @param \App\Request $request
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            if (!$this->hasLogin()) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                App\Debuger::initConsole();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                        $defaultModule = App\Config::main('default_module');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                    $handlerClass = "App\\Controller\\Components\\{$componentType}\\{$componentName}";
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if (!$handler) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    header('location: index.php?module=Home&view=DashBoard');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $this->triggerPreProcess($handler, $request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if (!($request->isAjax() && $request->isJSON())) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    Line exceeds 120 characters; contains 212 characters
    Open

                        echo '<pre class="my-5 mx-auto card p-3 u-w-fit shadow js-exception-backtrace">' . App\Purifier::encodeHtml(str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', $e->__toString())) . '</pre>';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    if (App\Config::debug('DISPLAY_EXCEPTION_LOGS')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if ('test' === App\Config::main('systemMode')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                if ($request->isAjax()) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $this->setLogin();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $action = $request->getByType('action', 2);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

                    $componentName = $view;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                        header('location: index.php');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

                $requestUrl = (\App\RequestUtil::isHttps() ? 'https' : 'http') . '://' . $request->getServer('HTTP_HOST') . $request->getServer('REQUEST_URI');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if (0 !== stripos($requestUrl, App\Config::main('site_URL'))) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            try {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $this->getLogin();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $hasLogin = $this->hasLogin();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $request->set('module', $moduleName);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $handlerClass = Vtiger_Loader::getComponentClassName($componentType, $componentName, $qualifiedModuleName);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if ($handler->isSessionExtend($request)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    Line exceeds 120 characters; contains 137 characters
    Open

                if ($handler->loginRequired() && !\in_array($moduleName, $skipList) && false === stripos($qualifiedModuleName, 'Settings')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                        $response = false;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    file_put_contents('cache/logs/request.log', print_r($request->getAll(), true));
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

            $this->userPrivilegesModel = Users_Privileges_Model::getCurrentUserPrivilegesModel();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * @param \App\Controller\Base $handler
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

            $handler->preProcess($request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                    throw new \App\Exceptions\Unauthorized('LBL_LOGIN_IS_REQUIRED', 401);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            if (!$user && App\Session::has('authenticated_user_id')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            return $user;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

        public function process(App\Request $request)
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                App\Process::init();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $view = $request->getByType('view', 2);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                        if (!empty($defaultModule) && 'Home' !== $defaultModule && \App\Privilege::isPermitted($defaultModule)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                    $request->set('view', $view);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                \App\Process::$processType = $componentType;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                \App\Config::setJsEnv('module', $moduleName);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    Line exceeds 120 characters; contains 130 characters
    Open

                if ($qualifiedModuleName && 0 === stripos($qualifiedModuleName, 'Settings') && empty(\App\User::getCurrentUserId())) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            } catch (Throwable $e) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

         * Function to get the instance of the logged in User.
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

                    if ($hasLogin) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    \App\Config::setJsEnv('action', $action);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if ($handler->loginRequired() && $this->checkLogin($request)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $this->triggerPostProcess($handler, $request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $messageHeader = 'LBL_ERROR';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $messageHeader = 'LBL_ERROR';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

            \App\Log::error("No permissions to the module: $moduleName", 'NoPermitted');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

        protected function triggerPreProcess(App\Controller\Base $handler, App\Request $request)
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * @param \App\Request         $request
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

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

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

                                $view = 'List';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                if ('Login' === $view && 'Users' === $moduleName) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

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

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

                if ($handler->loginRequired() && !\in_array($moduleName, $skipList) && false === stripos($qualifiedModuleName, 'Settings')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                \App\Log::error($e->getMessage() . PHP_EOL . $e->__toString());
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                        echo '<pre class="my-5 mx-auto card p-3 u-w-fit shadow js-exception-logs">' . App\Purifier::encodeHtml(str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', \App\Log::getlastLogs())) . '</pre>';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

        protected function triggerCheckPermission(App\Controller\Base $handler, App\Request $request)
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * Trigger post process.
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

        protected $userPrivilegesModel;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * @throws \App\Exceptions\Unauthorized
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    Line exceeds 120 characters; contains 155 characters
    Open

                $requestUrl = (\App\RequestUtil::isHttps() ? 'https' : 'http') . '://' . $request->getServer('HTTP_HOST') . $request->getServer('REQUEST_URI');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                            if (empty($view = Vtiger_Module_Model::getInstance($moduleName)->getDefaultViewName())) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    Line exceeds 120 characters; contains 123 characters
    Open

                    $handlerClass = Vtiger_Loader::getComponentClassName($componentType, $componentName, $qualifiedModuleName);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    \App\Session::set('last_activity', \App\Process::$startTime);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    if (\function_exists('apache_request_headers')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                        file_put_contents('cache/logs/request.log', print_r(apache_request_headers(), true));
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    throw $e;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                header("location: https://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]", true, 301);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $qualifiedModuleName = $request->getModule(false);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    //Take the url that user would like to redirect after they have successfully logged in.
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                        $view = 'Login';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                    $messageHeader = 'LBL_PERMISSION_DENIED';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                } elseif ($e instanceof \yii\db\Exception) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                    if (App\Config::debug('DISPLAY_EXCEPTION_BACKTRACE')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

            throw new \App\Exceptions\NoPermitted('ERR_NOT_ACCESSIBLE', 403);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * User privileges model instance.
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * Function to check if the User has logged in.
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

         * @return Users object
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $userId = App\Session::get('authenticated_user_id');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                            $qualifiedModuleName = $moduleName = 'Home';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $handler = new $handlerClass();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    Line exceeds 120 characters; contains 139 characters
    Open

                } elseif (0 === stripos($qualifiedModuleName, 'Settings') || \in_array($moduleName, $skipList) || !$handler->loginRequired()) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if ($e instanceof \App\Exceptions\NoPermittedToRecord || $e instanceof WebServiceException) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                $response->emit();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

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

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

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

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

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

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

                header('location: index.php');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                App\Session::init();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $moduleName = $request->getModule();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    Line exceeds 120 characters; contains 125 characters
    Open

                        if (!empty($defaultModule) && 'Home' !== $defaultModule && \App\Privilege::isPermitted($defaultModule)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

                    header('location: ' . App\Config::main('site_URL'), true);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

                } elseif ($e instanceof \App\Exceptions\Security) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                throw new \App\Exceptions\AppException('ERR_MODULE_DOES_NOT_EXIST||' . $moduleName, 405);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

            if ($request->isAjax()) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

        public function getLogin()
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if ($userId && App\Config::main('application_unique_key') === App\Session::get('app_unique_key') && \App\User::isExists($userId)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * Process.
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * @param \App\Request $request
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

            if (\Config\Security::$forceUrlRedirection) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                        $view = 'Index';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    \App\Config::setJsEnv('view', $view);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

         * @param \App\Request         $request
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

        protected function checkLogin(App\Request $request)
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

                    header('location: ' . App\Config::main('site_URL'), true, 301);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if (empty($moduleName)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $componentType = 'Action';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $componentType = 'View';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                        \App\Controller\Headers::generateCspToken();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                    \App\Log::error("HandlerClass: $handlerClass", 'Loader');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                } elseif (0 === stripos($qualifiedModuleName, 'Settings') || \in_array($moduleName, $skipList) || !$handler->loginRequired()) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

        protected function triggerPostProcess(App\Controller\Base $handler, App\Request $request)
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * @var Users_Privileges_Model
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

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

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

         * @throws Exception
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if (!$hasLogin && 'GET' === $_SERVER['REQUEST_METHOD'] && 'Users' !== $moduleName && ($returnUrl = $request->getServer('QUERY_STRING')) && !\App\Session::has('return_params')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    Line exceeds 120 characters; contains 189 characters
    Open

                if (!$hasLogin && 'GET' === $_SERVER['REQUEST_METHOD'] && 'Users' !== $moduleName && ($returnUrl = $request->getServer('QUERY_STRING')) && !\App\Session::has('return_params')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $componentName = $action;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    if (empty($view)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if ($qualifiedModuleName && 0 === stripos($qualifiedModuleName, 'Settings') && empty(\App\User::getCurrentUserId())) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                $response = $handler->process($request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            if (isset($response) && \is_object($response)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * @param \App\Controller\Base $handler
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            if ($this->userPrivilegesModel->hasModulePermission($moduleName)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $handler->checkPermission($request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

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

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

            $user = parent::getLogin();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                            $qualifiedModuleName = $defaultModule;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $this->triggerCheckPermission($handler, $request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * @throws \App\Exceptions\NoPermitted
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            if (empty($moduleModel)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                \App\Log::error('HandlerModule: ' . $moduleName, 'Loader');
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

         * Trigger pre process.
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

    Line exceeds 120 characters; contains 143 characters
    Open

                if ($userId && App\Config::main('application_unique_key') === App\Session::get('app_unique_key') && \App\User::isExists($userId)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    \App\User::setCurrentUserId($userId);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

                // common utils api called, depend on this variable right now
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $response = false;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    \App\Session::set('return_params', str_replace('&amp;', '&', $returnUrl));
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                        $qualifiedModuleName = $moduleName = 'Users';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                if (!empty($action)) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    if ($hasLogin) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                if ('ModComments' === $moduleName && 'List' === $view) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $skipList = ['Users', 'Home', 'CustomView', 'Import', 'Export', 'Install', 'ModTracker', 'AppComponents'];
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $messageHeader = 'LBL_BAD_REQUEST';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                \vtlib\Functions::throwNewException($e, false, $messageHeader);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                        $response = false;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * Trigger check permission.
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                $handler->postProcessAjax($request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            $handler->postProcess($request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            if (\Config\Security::$forceHttpsRedirection && !\App\RequestUtil::isHttps()) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                            $moduleName = $defaultModule;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                            $view = 'DashBoard';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    if (!\App\Session::has('CSP_TOKEN')) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                \App\Process::$processName = $componentName;
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                \App\Config::setJsEnv('mode', $request->getMode());
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                if ('AppComponents' === $moduleName) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                $handler->validateRequest($request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                    $handler->checkPermission($request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

                        echo '<pre class="my-5 mx-auto card p-3 u-w-fit shadow js-exception-backtrace">' . App\Purifier::encodeHtml(str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', $e->__toString())) . '</pre>';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    Line exceeds 120 characters; contains 214 characters
    Open

                        echo '<pre class="my-5 mx-auto card p-3 u-w-fit shadow js-exception-logs">' . App\Purifier::encodeHtml(str_replace(ROOT_DIRECTORY . DIRECTORY_SEPARATOR, '', \App\Log::getlastLogs())) . '</pre>';
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

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

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

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

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

         * @param \App\Request         $request
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            $moduleName = $request->getModule();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            $moduleModel = Vtiger_Module_Model::getInstance($moduleName);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

            $handler->sendHeaders();
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

         * @param \App\Controller\Base $handler
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

                $handler->preProcessAjax($request);
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

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

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

            if ($request->isAjax()) {
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

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

    class Vtiger_WebUI extends Vtiger_EntryPoint
    Severity: Minor
    Found in include/main/WebUI.php by phpcodesniffer

    There are no issues that match your filters.

    Category
    Status