YetiForceCompany/YetiForceCRM

View on GitHub
app/Exceptions/Csrf.php

Summary

Maintainability
A
0 mins
Test Coverage
F
0%

Avoid using static access to class '\App\Session' in method '__construct'.
Open

        \App\Session::init();
Severity: Minor
Found in app/Exceptions/Csrf.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\TextUtils' in method '__construct'.
Open

        $userName = empty($userName) ? '-' : \App\TextUtils::textTruncate($userName, 100, false);
Severity: Minor
Found in app/Exceptions/Csrf.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\Request' in method '__construct'.
Open

                'referer' => \App\TextUtils::textTruncate(\App\Request::_getServer('HTTP_REFERER', '-'), 300, false),
Severity: Minor
Found in app/Exceptions/Csrf.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 '__construct'.
Open

        $userName = \App\Session::get('full_user_name');
Severity: Minor
Found in app/Exceptions/Csrf.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\TextUtils' in method '__construct'.
Open

                'url' => \App\TextUtils::textTruncate(\App\RequestUtil::getBrowserInfo()->url, 300, false),
Severity: Minor
Found in app/Exceptions/Csrf.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\TextUtils' in method '__construct'.
Open

                'ip' => \App\TextUtils::textTruncate(\App\RequestUtil::getRemoteIP(), 100, false),
Severity: Minor
Found in app/Exceptions/Csrf.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 '__construct'.
Open

                'ip' => \App\TextUtils::textTruncate(\App\RequestUtil::getRemoteIP(), 100, false),
Severity: Minor
Found in app/Exceptions/Csrf.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\TextUtils' in method '__construct'.
Open

                'referer' => \App\TextUtils::textTruncate(\App\Request::_getServer('HTTP_REFERER', '-'), 300, false),
Severity: Minor
Found in app/Exceptions/Csrf.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\TextUtils' in method '__construct'.
Open

                'agent' => \App\TextUtils::textTruncate(\App\Request::_getServer('HTTP_USER_AGENT', '-'), 500, false),
Severity: Minor
Found in app/Exceptions/Csrf.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\Request' in method '__construct'.
Open

                'agent' => \App\TextUtils::textTruncate(\App\Request::_getServer('HTTP_USER_AGENT', '-'), 500, false),
Severity: Minor
Found in app/Exceptions/Csrf.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

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

        \App\Db::getInstance('log')->createCommand()
Severity: Critical
Found in app/Exceptions/Csrf.php by phan

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

        parent::__construct($message, $code, $previous);
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

        \App\Db::getInstance('log')->createCommand()
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

                'username' => $userName,
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

                'date' => date('Y-m-d H:i:s'),
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

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

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

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

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

                'agent' => \App\TextUtils::textTruncate(\App\Request::_getServer('HTTP_USER_AGENT', '-'), 500, false),
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

        $userName = \App\Session::get('full_user_name');
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

                'referer' => \App\TextUtils::textTruncate(\App\Request::_getServer('HTTP_REFERER', '-'), 300, false),
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

        \App\Session::init();
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

    public function __construct($message = '', $code = 0, \Exception $previous = null)
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

        $userName = empty($userName) ? '-' : \App\TextUtils::textTruncate($userName, 100, false);
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

            ])->execute();
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

                'url' => \App\TextUtils::textTruncate(\App\RequestUtil::getBrowserInfo()->url, 300, false),
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

            ->insert('o_#__csrf', [
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

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

                'ip' => \App\TextUtils::textTruncate(\App\RequestUtil::getRemoteIP(), 100, false),
Severity: Minor
Found in app/Exceptions/Csrf.php by phpcodesniffer

There are no issues that match your filters.

Category
Status