ecoco/magento_profiler

View on GitHub

Showing 241 of 241 total issues

Avoid excessively long class names like Ecocode_Profiler_Model_Collector_DataCollectorInterface. Keep class name length under 40.
Open

interface Ecocode_Profiler_Model_Collector_DataCollectorInterface
{
    public function init();

    /**

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

Avoid excessively long class names like Ecocode_Profiler_Block_Collector_Request_Toolbar. Keep class name length under 40.
Open

class Ecocode_Profiler_Block_Collector_Request_Toolbar
    extends Ecocode_Profiler_Block_Collector_Base
{
    public function renderHandler($controller, $route = false, $method = false)
    {

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

Avoid excessively long class names like Ecocode_Profiler_Block_Renderer_Log_LogTable. Keep class name length under 40.
Open

class Ecocode_Profiler_Block_Renderer_Log_LogTable
    extends Ecocode_Profiler_Block_Renderer_AbstractRenderer
{
    public function _construct()
    {

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

Avoid excessively long class names like Ecocode_Profiler_Model_Collector_LateDataCollectorInterface. Keep class name length under 40.
Open

interface Ecocode_Profiler_Model_Collector_LateDataCollectorInterface
{
    /**
     * Collects data as late as possible.
     */

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

Avoid excessively long class names like Ecocode_Profiler_Model_Collector_ModelDataCollector. Keep class name length under 40.
Open

class Ecocode_Profiler_Model_Collector_ModelDataCollector
    extends Ecocode_Profiler_Model_Collector_AbstractDataCollector
{
    CONST LOAD_CALL_THRESHOLD = 20;

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

Avoid excessively long class names like Ecocode_Profiler_Block_Collector_Time_Panel. Keep class name length under 40.
Open

class Ecocode_Profiler_Block_Collector_Time_Panel
    extends Ecocode_Profiler_Block_Collector_Base
{
    public function getRequestJsonData()
    {

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

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

Avoid excessively long class names like Ecocode_Profiler_Model_Collector_RewriteDataCollector. Keep class name length under 40.
Open

class Ecocode_Profiler_Model_Collector_RewriteDataCollector
    extends Ecocode_Profiler_Model_Collector_AbstractDataCollector
{
    /**
     * @codeCoverageIgnore

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

Avoid excessively long class names like Ecocode_Profiler_Block_Collector_Log_Panel. Keep class name length under 40.
Open

class Ecocode_Profiler_Block_Collector_Log_Panel
    extends Ecocode_Profiler_Block_Collector_Base
{
    protected $logTableRenderer;
    protected $logGroups;

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

Avoid excessively long class names like Ecocode_Profiler_Model_Collector_ConfigDataCollector. Keep class name length under 40.
Open

class Ecocode_Profiler_Model_Collector_ConfigDataCollector
    extends Ecocode_Profiler_Model_Collector_AbstractDataCollector
{
    /** @var Ecocode_Profiler_Helper_Data */
    protected $helper;

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

Avoid excessively long class names like Ecocode_Profiler_Model_Http_ResponseHeaderBag. Keep class name length under 40.
Open

class Ecocode_Profiler_Model_Http_ResponseHeaderBag
    extends Ecocode_Profiler_Model_Http_HeaderBag
{
    const COOKIES_FLAT  = 'flat';
    const COOKIES_ARRAY = 'array';

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

Avoid excessively long class names like Ecocode_Profiler_Model_Profiler_FileStorage. Keep class name length under 40.
Open

class Ecocode_Profiler_Model_Profiler_FileStorage
    implements Ecocode_Profiler_Model_Profiler_StorageInterface
{
    /**
     * Folder where profiler data are stored.

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

Avoid excessively long class names like Ecocode_Profiler_Model_Profiler_StorageInterface. Keep class name length under 40.
Open

interface Ecocode_Profiler_Model_Profiler_StorageInterface
{
    /**
     * Finds profiler tokens for the given criteria.
     *

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

Avoid excessively long variable names like $configClassReflection. Keep variable name length under 20.
Open

    protected $configClassReflection;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

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

Avoid excessively long variable names like $formattedQueriesCache. Keep variable name length under 20.
Open

    protected $formattedQueriesCache = [];

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

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

Avoid excessively long class names like Ecocode_Profiler_Model_Collector_TranslationDataCollector. Keep class name length under 40.
Open

class Ecocode_Profiler_Model_Collector_TranslationDataCollector
    extends Ecocode_Profiler_Model_Collector_AbstractDataCollector
{
    protected $_currentBlock;

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

Avoid excessively long class names like Ecocode_Profiler_Model_Logger_DebugHandler. Keep class name length under 40.
Open

class Ecocode_Profiler_Model_Logger_DebugHandler extends TestHandler
    implements Ecocode_Profiler_Model_Logger_DebugHandlerInterface
{
    /**
     * {@inheritdoc}

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

Avoid excessively long class names like Ecocode_Profiler_Model_Logger_DebugHandlerInterface. Keep class name length under 40.
Open

interface Ecocode_Profiler_Model_Logger_DebugHandlerInterface
{
    /**
     * Returns an array of logs.
     *

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

Function renderNode has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function renderNode($node, $prefix = '', $sibling = false)
    {
        if (!$node['parent_id']) {
            $start = $node['name'];
        } else {

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 collectSessionData has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    protected function collectSessionData()
    {
        $namespaceData  = [];
        $storeData      = [];
        $rawSessionData = $this->getRawSession();

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

Severity
Category
Status
Source
Language