vpietri/magento2-developer-quickdevbar

View on GitHub

Showing 169 of 169 total issues

Method pullData has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function pullData()
    {
        if ($this->pluginsByTypes === null) {
            $this->pluginsByTypes =  [];

Severity: Minor
Found in Service/Plugin.php - About 1 hr to fix

    Avoid using undefined variables such as '$cacheEvents' which will lead to PHP notices.
    Open

            if(empty($cacheEvents[$identifier])) {
    Severity: Minor
    Found in Service/App/Cache.php by phpmd

    UndefinedVariable

    Since: 2.8.0

    Detects when a variable is used that has not been defined before.

    Example

    class Foo
    {
        private function bar()
        {
            // $message is undefined
            echo $message;
        }
    }

    Source https://phpmd.org/rules/cleancode.html#undefinedvariable

    Method execute has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function execute(InputInterface $input, OutputInterface $output)
        {
    
            $this->resourceConfig->saveConfig('dev/quickdevbar/enable', $this->status);
            $output->writeln("<info>" . $this->message . "</info>");
    Severity: Minor
    Found in Console/Command/AbstractStatusToolbar.php - About 1 hr to fix

      Method tailFile has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function tailFile($filepath, $lines = 1, $adaptive = true)
          {
              // Open file
              $f = @fopen($filepath, "rb");
              if ($f === false) {
      Severity: Minor
      Found in Helper/Data.php - About 1 hr to fix

        Method pullData has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function pullData()
            {
                $request = $this->requestHttp;
                $requestData = [];
                $requestData[] = ['name' => 'Date sys', 'value' => date("Y-m-d H:i:s")];
        Severity: Minor
        Found in Service/Request.php - About 1 hr to fix

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

              public function getTreeBlocksHierarchy($layout)
              {
                  //$layout = $this->getLayout();
          
                  $reflection = new \ReflectionClass($layout);
          Severity: Minor
          Found in Observer/LayoutGenerateBlocksAfterObserver.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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

              public function execute()
              {
                  $fileKey = $this->getRequest()->getParam('log_key', '');
                  $output = '';
          
          
          Severity: Minor
          Found in Controller/Log/Reset.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 __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  \Magento\Framework\App\Action\Context $context,
                  \ADM\QuickDevBar\Helper\Data $qdbHelper,
                  \Magento\Framework\Controller\Result\RawFactory $resultRawFactory,
                  \Magento\Framework\View\LayoutFactory $layoutFactory,
                  \Magento\Config\Model\ResourceModel\Config $resourceConfig,
          Severity: Major
          Found in Controller/Action/ConfigUpdate.php - About 50 mins to fix

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

                    \Magento\Framework\App\Helper\Context $context,
                    \Magento\Framework\App\Cache\Frontend\Pool $cacheFrontendPool,
                    \Magento\Framework\Module\ModuleListInterface $moduleList,
                    \Magento\Framework\Filesystem $filesystem,
                    array $ideList,
            Severity: Major
            Found in Helper/Data.php - About 50 mins to fix

              The property $_mainTabs is not named in camelCase.
              Open

              class Wrapper extends Panel
              {
                  protected $_mainTabs;
              
                  protected $_jsonHelper;
              Severity: Minor
              Found in Block/Tab/Wrapper.php by phpmd

              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 $_qdnHelper is not named in camelCase.
              Open

              class Toolbar extends \Magento\Framework\View\Element\Template
              {
                  protected $_mainTabs;
              
                  protected $_qdnHelper;
              Severity: Minor
              Found in Block/Toolbar.php by phpmd

              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 $_qdbHelperRegister is not named in camelCase.
              Open

              class Response
              {
                  /**
                   *
                   * @var \ADM\QuickDevBar\Helper\Register
              Severity: Minor
              Found in Plugin/Framework/Http/Response.php by phpmd

              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 $_tabs is not named in camelCase.
              Open

              class ConfigSearch extends \ADM\QuickDevBar\Controller\Index
              {
              
                  /**
                   * Tabs
              Severity: Minor
              Found in Controller/Action/ConfigSearch.php by phpmd

              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 $_configStructure is not named in camelCase.
              Open

              class ConfigSearch extends \ADM\QuickDevBar\Controller\Index
              {
              
                  /**
                   * Tabs
              Severity: Minor
              Found in Controller/Action/ConfigSearch.php by phpmd

              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 $_layoutFactory is not named in camelCase.
              Open

              abstract class Index extends \Magento\Backend\App\Action
              {
              
                  /**
                   * @var \Magento\Framework\View\LayoutFactory
              Severity: Minor
              Found in Controller/Adminhtml/Index.php by phpmd

              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 $_resultRawFactory is not named in camelCase.
              Open

              abstract class Index extends \Magento\Backend\App\Action
              {
              
                  /**
                   * @var \Magento\Framework\View\LayoutFactory
              Severity: Minor
              Found in Controller/Adminhtml/Index.php by phpmd

              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 $_storeManager is not named in camelCase.
              Open

              class ConfigUpdate extends \ADM\QuickDevBar\Controller\Index
              {
                  /**
                   * @var \Magento\Config\Model\Resource\Config
                   */
              Severity: Minor
              Found in Controller/Action/ConfigUpdate.php by phpmd

              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 $_resultForwardFactory is not named in camelCase.
              Open

              class ConfigUpdate extends \ADM\QuickDevBar\Controller\Index
              {
                  /**
                   * @var \Magento\Config\Model\Resource\Config
                   */
              Severity: Minor
              Found in Controller/Action/ConfigUpdate.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              Avoid variables with short names like $id. Configured minimum length is 3.
              Open

                      $id = ($this->getData('id')) ? $this->getData('id') : $this->getNameInLayout();
              Severity: Minor
              Found in Block/Tab/Panel.php by phpmd

              ShortVariable

              Since: 0.2

              Detects when a field, local, or parameter has a very short name.

              Example

              class Something {
                  private $q = 15; // VIOLATION - Field
                  public static function main( array $as ) { // VIOLATION - Formal
                      $r = 20 + $this->q; // VIOLATION - Local
                      for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                          $r += $this->q;
                      }
                  }
              }

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

              The property $_layoutFactory is not named in camelCase.
              Open

              class Index extends \Magento\Framework\App\Action\Action
              {
                  /**
                   * @var \ADM\QuickDevBar\Helper\Data
                   */
              Severity: Minor
              Found in Controller/Index.php by phpmd

              CamelCasePropertyName

              Since: 0.2

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

              Example

              class ClassName {
                  protected $property_name;
              }

              Source

              Severity
              Category
              Status
              Source
              Language