ImpressCMS/impresscms

View on GitHub
htdocs/include/debug_functions.php

Summary

Maintainability
A
0 mins
Test Coverage

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

function icms_debug($msg, $exit=false)
Severity: Minor
Found in htdocs/include/debug_functions.php by phpmd

BooleanArgumentFlag

Since: 1.4.0

A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

Example

class Foo {
    public function bar($flag = true) {
    }
}

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

Avoid using static access to class 'icms_core_Debug' in method 'icms_debug'.
Open

    icms_core_Debug::setDeprecated('icms_core_Debug::message');
Severity: Minor
Found in htdocs/include/debug_functions.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 'icms_core_Debug' in method 'icms_debug_vardump'.
Open

    return icms_core_Debug::vardump($var);
Severity: Minor
Found in htdocs/include/debug_functions.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 'icms_core_Debug' in method 'icms_debug'.
Open

    return icms_core_Debug::message($msg, $exit);
Severity: Minor
Found in htdocs/include/debug_functions.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 'icms_core_Debug' in method 'icms_deprecated'.
Open

    return icms_core_Debug::setDeprecated($replacement, $extra);
Severity: Minor
Found in htdocs/include/debug_functions.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 'icms_core_Debug' in method 'icms_debug_vardump'.
Open

    icms_core_Debug::setDeprecated('icms_core_Debug::vardump');
Severity: Minor
Found in htdocs/include/debug_functions.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 'icms_core_Debug' in method 'icms_deprecated'.
Open

    icms_core_Debug::setDeprecated('icms_core_Debug::setDeprecated');
Severity: Minor
Found in htdocs/include/debug_functions.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 method setDeprecated from undeclared class \icms_core_Debug
Open

    return icms_core_Debug::setDeprecated($replacement, $extra);
Severity: Critical
Found in htdocs/include/debug_functions.php by phan

Call to method vardump from undeclared class \icms_core_Debug
Open

    return icms_core_Debug::vardump($var);
Severity: Critical
Found in htdocs/include/debug_functions.php by phan

Call to method setDeprecated from undeclared class \icms_core_Debug
Open

    icms_core_Debug::setDeprecated('icms_core_Debug::setDeprecated');
Severity: Critical
Found in htdocs/include/debug_functions.php by phan

Call to method setDeprecated from undeclared class \icms_core_Debug
Open

    icms_core_Debug::setDeprecated('icms_core_Debug::message');
Severity: Critical
Found in htdocs/include/debug_functions.php by phan

Call to method setDeprecated from undeclared class \icms_core_Debug
Open

    icms_core_Debug::setDeprecated('icms_core_Debug::vardump');
Severity: Critical
Found in htdocs/include/debug_functions.php by phan

Call to method message from undeclared class \icms_core_Debug
Open

    return icms_core_Debug::message($msg, $exit);
Severity: Critical
Found in htdocs/include/debug_functions.php by phan

Expected 0 spaces between opening bracket and argument "$replacement"; 1 found
Open

function icms_deprecated( $replacement='', $extra='' ) {

Incorrect spacing between argument "$exit" and equals sign; expected 1 but found 0
Open

function icms_debug($msg, $exit=false)

Incorrect spacing between default value and equals sign for argument "$exit"; expected 1 but found 0
Open

function icms_debug($msg, $exit=false)

Opening brace should be on the same line as the declaration
Open

{

Incorrect spacing between argument "$replacement" and equals sign; expected 1 but found 0
Open

function icms_deprecated( $replacement='', $extra='' ) {

Opening brace should be on the same line as the declaration
Open

{

Expected 0 spaces between argument "$extra" and closing bracket; 1 found
Open

function icms_deprecated( $replacement='', $extra='' ) {

Incorrect spacing between argument "$extra" and equals sign; expected 1 but found 0
Open

function icms_deprecated( $replacement='', $extra='' ) {

Incorrect spacing between default value and equals sign for argument "$replacement"; expected 1 but found 0
Open

function icms_deprecated( $replacement='', $extra='' ) {

Incorrect spacing between default value and equals sign for argument "$extra"; expected 1 but found 0
Open

function icms_deprecated( $replacement='', $extra='' ) {

There are no issues that match your filters.

Category
Status