Kylob/BootPress

View on GitHub

Showing 16,700 of 16,700 total issues

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

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

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

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

        class AdminerObject extends Adminer

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

            if ($data = $this->users($platforms)) {
                $html .= '<br>'.$bp->row('sm', array(
                    $bp->col('6 vcenter', '<div class="canvas-container"><canvas id="platformsChart" height="250"></canvas></div>'),
                    $bp->col('5 vcenter', '<p class="lead">Platforms</p><div id="platformsChartLegend"></div>'),
                )).'<br>';
Severity: Minor
Found in src/Admin/Pages/Analytics.php and 1 other location - About 55 mins to fix
src/Admin/Pages/Analytics.php on lines 513..523

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 99.

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 ($data = $this->users($browsers)) {
                $html .= '<br>'.$bp->row('sm', array(
                    $bp->col('6 vcenter', '<div class="canvas-container"><canvas id="browsersChart" height="250"></canvas></div>'),
                    $bp->col('5 vcenter', '<p class="lead">Browsers</p><div id="browsersChartLegend"></div>'),
                )).'<br>';
Severity: Minor
Found in src/Admin/Pages/Analytics.php and 1 other location - About 55 mins to fix
src/Admin/Pages/Analytics.php on lines 493..503

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 99.

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

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

    private static function resource($path)
    {
        if (preg_match('/\.(jpg|jpeg|gif|png|ico)$/i', $path) && is_file($path) && ($dimensions = getimagesize($path))) {
            list($width, $height, $type) = $dimensions;
            switch ($type) {
Severity: Minor
Found in src/Admin/Files.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 editUser has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    private static function editUser($user_id)
    {
        extract(Admin::params('bp', 'page', 'auth', 'website'));
        $page->title = 'Edit User at '.$website;
        $html = '';
Severity: Minor
Found in src/Admin/Pages/Users.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

Method getCookieHeader has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    private function getCookieHeader($name, $value, $expires, $path, $domain, $secure, $httponly)
Severity: Major
Found in src/DebugBar/Collector/BootPress.php - About 50 mins to fix

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

    The class Min_Result is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The class Min_Result is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The class Min_Result is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The class Min_Result is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The class Min_DB is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The class Min_SQLite is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The class Min_Driver is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The class Min_PDO is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The class Min_DB is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    The class Min_SQLite is not named in CamelCase.
    Open

    CamelCaseClassName

    Since: 0.2

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

    Example

    class class_name {
    }

    Source

    Severity
    Category
    Status
    Source
    Language