ecoco/magento_profiler

View on GitHub
app/code/community/Ecocode/Profiler/Model/Collector/TimeDataCollector.php

Summary

Maintainability
A
0 mins
Test Coverage

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

    protected function getEventsFromProfiler()
    {
        if (@class_exists('Symfony\Component\Stopwatch\Stopwatch')) {
            return Varien_Profiler::getTimers();
        }

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 excessively long class names like Ecocode_Profiler_Model_Collector_TimeDataCollector. Keep class name length under 40.
Open

class Ecocode_Profiler_Model_Collector_TimeDataCollector
    extends Ecocode_Profiler_Model_Collector_AbstractDataCollector
    implements Ecocode_Profiler_Model_Collector_LateDataCollectorInterface
{
    public function isVarienProfiler()

LongClassName

Since: 2.9

Detects when classes or interfaces are declared with excessively long names.

Example

class ATooLongClassNameThatHintsAtADesignProblem {

}

interface ATooLongInterfaceNameThatHintsAtADesignProblem {

}

Source https://phpmd.org/rules/naming.html#longclassname

There are no issues that match your filters.

Category
Status