ImpressCMS/impresscms

View on GitHub
htdocs/install/class/IcmsInstallWizard.php

Summary

Maintainability
D
2 days
Test Coverage

xoInit accesses the super-global variable $_COOKIE.
Open

    public function xoInit(): bool {
        if (!$this->checkAccess()) {
            return false;
        }
        if (@empty($_SERVER['REQUEST_URI'])) {

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

checkAccess accesses the super-global variable $_SERVER.
Open

    public function checkAccess(): bool {
        if (INSTALL_USER && INSTALL_PASSWORD) {
            if (!isset($_SERVER['PHP_AUTH_USER'])) {
                header('WWW-Authenticate: Basic realm="ImpressCMS Installer"');
                header('HTTP/1.0 401 Unauthorized');

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

xoInit accesses the super-global variable $_SERVER.
Open

    public function xoInit(): bool {
        if (!$this->checkAccess()) {
            return false;
        }
        if (@empty($_SERVER['REQUEST_URI'])) {

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

redirectToPage accesses the super-global variable $_SERVER.
Open

    public function redirectToPage($page, $status = 303, $message = 'See other') {
        $location = $this->pageURI($page);
        $proto = !@empty($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
        header("$proto $status $message");
        // header( "Status: $status $message" );

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

baseLocation accesses the super-global variable $_SERVER.
Open

    public function baseLocation(): string {
        $proto = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on')) ? 'https' : 'http';
        $host = htmlentities($_SERVER['HTTP_HOST']);
        $server_php_self = htmlentities($_SERVER['PHP_SELF']);
        $base = substr($server_php_self, 0, strrpos($server_php_self, '/'));

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

baseLocation accesses the super-global variable $_SERVER.
Open

    public function baseLocation(): string {
        $proto = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on')) ? 'https' : 'http';
        $host = htmlentities($_SERVER['HTTP_HOST']);
        $server_php_self = htmlentities($_SERVER['PHP_SELF']);
        $base = substr($server_php_self, 0, strrpos($server_php_self, '/'));

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

checkAccess accesses the super-global variable $_SERVER.
Open

    public function checkAccess(): bool {
        if (INSTALL_USER && INSTALL_PASSWORD) {
            if (!isset($_SERVER['PHP_AUTH_USER'])) {
                header('WWW-Authenticate: Basic realm="ImpressCMS Installer"');
                header('HTTP/1.0 401 Unauthorized');

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

checkAccess accesses the super-global variable $_SERVER.
Open

    public function checkAccess(): bool {
        if (INSTALL_USER && INSTALL_PASSWORD) {
            if (!isset($_SERVER['PHP_AUTH_USER'])) {
                header('WWW-Authenticate: Basic realm="ImpressCMS Installer"');
                header('HTTP/1.0 401 Unauthorized');

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

xoInit accesses the super-global variable $_SERVER.
Open

    public function xoInit(): bool {
        if (!$this->checkAccess()) {
            return false;
        }
        if (@empty($_SERVER['REQUEST_URI'])) {

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

xoInit accesses the super-global variable $_COOKIE.
Open

    public function xoInit(): bool {
        if (!$this->checkAccess()) {
            return false;
        }
        if (@empty($_SERVER['REQUEST_URI'])) {

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

xoInit accesses the super-global variable $_SERVER.
Open

    public function xoInit(): bool {
        if (!$this->checkAccess()) {
            return false;
        }
        if (@empty($_SERVER['REQUEST_URI'])) {

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

redirectToPage accesses the super-global variable $_SERVER.
Open

    public function redirectToPage($page, $status = 303, $message = 'See other') {
        $location = $this->pageURI($page);
        $proto = !@empty($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
        header("$proto $status $message");
        // header( "Status: $status $message" );

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

baseLocation accesses the super-global variable $_SERVER.
Open

    public function baseLocation(): string {
        $proto = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on')) ? 'https' : 'http';
        $host = htmlentities($_SERVER['HTTP_HOST']);
        $server_php_self = htmlentities($_SERVER['PHP_SELF']);
        $base = substr($server_php_self, 0, strrpos($server_php_self, '/'));

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

baseLocation accesses the super-global variable $_SERVER.
Open

    public function baseLocation(): string {
        $proto = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on')) ? 'https' : 'http';
        $host = htmlentities($_SERVER['HTTP_HOST']);
        $server_php_self = htmlentities($_SERVER['PHP_SELF']);
        $base = substr($server_php_self, 0, strrpos($server_php_self, '/'));

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

Method xoInit has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function xoInit(): bool {
        if (!$this->checkAccess()) {
            return false;
        }
        if (@empty($_SERVER['REQUEST_URI'])) {
Severity: Major
Found in htdocs/install/class/IcmsInstallWizard.php - About 2 hrs to fix

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

        public function xoInit(): bool {
            if (!$this->checkAccess()) {
                return false;
            }
            if (@empty($_SERVER['REQUEST_URI'])) {
    Severity: Minor
    Found in htdocs/install/class/IcmsInstallWizard.php - About 1 hr to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        public function checkAccess(): bool {
            if (INSTALL_USER && INSTALL_PASSWORD) {
                if (!isset($_SERVER['PHP_AUTH_USER'])) {
                    header('WWW-Authenticate: Basic realm="ImpressCMS Installer"');
                    header('HTTP/1.0 401 Unauthorized');
    Severity: Minor
    Found in htdocs/install/class/IcmsInstallWizard.php - About 55 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

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

        public function setPage($page): string {
            /**
             * If server is PHP 4, display the php4 page and stop the install
             */
            if ($this->no_php5 && $page != 'no_php5') {
    Severity: Minor
    Found in htdocs/install/class/IcmsInstallWizard.php - About 25 mins to fix

    Cognitive Complexity

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

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

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

    Further reading

    The method xoInit() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
    Open

        public function xoInit(): bool {
            if (!$this->checkAccess()) {
                return false;
            }
            if (@empty($_SERVER['REQUEST_URI'])) {

    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 xoInit() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
    Open

        public function xoInit(): bool {
            if (!$this->checkAccess()) {
                return false;
            }
            if (@empty($_SERVER['REQUEST_URI'])) {

    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

    Remove error control operator '@' on line 20.
    Open

        public function xoInit(): bool {
            if (!$this->checkAccess()) {
                return false;
            }
            if (@empty($_SERVER['REQUEST_URI'])) {

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

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

    Remove error control operator '@' on line 196.
    Open

        public function redirectToPage($page, $status = 303, $message = 'See other') {
            $location = $this->pageURI($page);
            $proto = !@empty($_SERVER['SERVER_PROTOCOL']) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
            header("$proto $status $message");
            // header( "Status: $status $message" );

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

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

    Remove error control operator '@' on line 34.
    Open

        public function xoInit(): bool {
            if (!$this->checkAccess()) {
                return false;
            }
            if (@empty($_SERVER['REQUEST_URI'])) {

    ErrorControlOperator

    Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.

    Example

    function foo($filePath) {
        $file = @fopen($filPath); // hides exceptions
        $key = @$array[$notExistingKey]; // assigns null to $key
    }

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

    Avoid assigning values to variables in if clauses and the like (line '163', column '24').
    Open

        public function setPage($page): string {
            /**
             * If server is PHP 4, display the php4 page and stop the install
             */
            if ($this->no_php5 && $page != 'no_php5') {

    IfStatementAssignment

    Since: 2.7.0

    Assignments in if clauses and the like are considered a code smell. Assignments in PHP return the right operand as their result. In many cases, this is an expected behavior, but can lead to many difficult to spot bugs, especially when the right operand could result in zero, null or an empty string and the like.

    Example

    class Foo
    {
        public function bar($flag)
        {
            if ($foo = 'bar') { // possible typo
                // ...
            }
            if ($baz = 0) { // always false
                // ...
            }
        }
    }

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

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

                } else {
                    $page = (int) array_search($page, $this->pages, false);
                }

    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 setPage uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                return false;
            }

    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 xoInit uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            else {
                $this->pages[] = 'langselect';
                $this->pages[] = 'start';
                $this->pages[] = 'modcheck';
                $this->pages[] = 'pathsettings';

    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 xoInit uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $this->pagesNames[] = LANGUAGE_SELECTION;
                $this->pagesNames[] = INTRODUCTION;
                $this->pagesNames[] = CONFIGURATION_CHECK;
                $this->pagesNames[] = PATHS_SETTINGS;

    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 xoInit uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                $this->pagesTitles[] = LANGUAGE_SELECTION_TITLE;
                $this->pagesTitles[] = INTRODUCTION_TITLE;
                $this->pagesTitles[] = CONFIGURATION_CHECK_TITLE;
                $this->pagesTitles[] = PATHS_SETTINGS_TITLE;

    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 loadLangFile uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
    Open

            } else {
                include_once "./language/english/$file.php";
            }

    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 setPage() contains an exit expression.
    Open

                exit();

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

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

    The method setPage() contains an exit expression.
    Open

                exit();

    ExitExpression

    Since: 0.2

    An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

    Example

    class Foo {
        public function bar($param)  {
            if ($param === 42) {
                exit(23);
            }
        }
    }

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

    syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)
    Open

        public array $pages = array();
    Severity: Critical
    Found in htdocs/install/class/IcmsInstallWizard.php by phan

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            if ($this->no_php5) {
                $this->pagesTitles[] = NO_PHP5_TITLE;
            } elseif ($this->safe_mode) {
                $this->pagesTitles[] = SAFE_MODE_TITLE;
            } else {
    Severity: Major
    Found in htdocs/install/class/IcmsInstallWizard.php and 1 other location - About 6 hrs to fix
    htdocs/install/class/IcmsInstallWizard.php on lines 60..77

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 212.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Similar blocks of code found in 2 locations. Consider refactoring.
    Open

            if ($this->no_php5) {
                $this->pagesNames[] = NO_PHP5;
            } elseif ($this->safe_mode) {
                $this->pagesNames[] = SAFE_MODE;
            } else {
    Severity: Major
    Found in htdocs/install/class/IcmsInstallWizard.php and 1 other location - About 6 hrs to fix
    htdocs/install/class/IcmsInstallWizard.php on lines 79..96

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 212.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    class IcmsInstallWizard {

    The property $safe_mode is not named in camelCase.
    Open

    class IcmsInstallWizard {
        public array $pages = array();
        public array $pagesNames = array();
        public array $pagesTitles = array();
        public array $titles = array();

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The property $no_php5 is not named in camelCase.
    Open

    class IcmsInstallWizard {
        public array $pages = array();
        public array $pagesNames = array();
        public array $pagesTitles = array();
        public array $titles = array();

    CamelCasePropertyName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name attributes.

    Example

    class ClassName {
        protected $property_name;
    }

    Source

    The variable $server_php_self is not named in camelCase.
    Open

        public function baseLocation(): string {
            $proto = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on')) ? 'https' : 'http';
            $host = htmlentities($_SERVER['HTTP_HOST']);
            $server_php_self = htmlentities($_SERVER['PHP_SELF']);
            $base = substr($server_php_self, 0, strrpos($server_php_self, '/'));

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $server_php_self is not named in camelCase.
    Open

        public function baseLocation(): string {
            $proto = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on')) ? 'https' : 'http';
            $host = htmlentities($_SERVER['HTTP_HOST']);
            $server_php_self = htmlentities($_SERVER['PHP_SELF']);
            $base = substr($server_php_self, 0, strrpos($server_php_self, '/'));

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    The variable $server_php_self is not named in camelCase.
    Open

        public function baseLocation(): string {
            $proto = (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] === 'on')) ? 'https' : 'http';
            $host = htmlentities($_SERVER['HTTP_HOST']);
            $server_php_self = htmlentities($_SERVER['PHP_SELF']);
            $base = substr($server_php_self, 0, strrpos($server_php_self, '/'));

    CamelCaseVariableName

    Since: 0.2

    It is considered best practice to use the camelCase notation to name variables.

    Example

    class ClassName {
        public function doSomething() {
            $data_module = new DataModule();
        }
    }

    Source

    There are no issues that match your filters.

    Category
    Status