ecoco/magento_profiler

View on GitHub
app/code/community/Ecocode/Profiler/overwrite/Mage.php

Summary

Maintainability
A
0 mins
Test Coverage

Missing class import via use statement (line '70', column '24').
Open

            return new Ecocode_Profiler_Model_NullLogger();

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 '77', column '20').
Open

        return new Ecocode_Profiler_Model_Logger(

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

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

    protected static function getNewLogger($channel)
    {
        if (!@class_exists('\Monolog\Logger')) {
            return new Ecocode_Profiler_Model_NullLogger();
        }

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

Missing class import via use statement (line '74', column '47').
Open

            static::$loggerDebugHandler = new Ecocode_Profiler_Model_Logger_DebugHandler();

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

There are no issues that match your filters.

Category
Status