vpietri/magento2-developer-quickdevbar

View on GitHub

Showing 45 of 169 total issues

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

    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

      Function getTabBlocks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getTabBlocks()
          {
              if ($this->_mainTabs === null) {
                  $this->_mainTabs=[];
                  foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $alias => $block) {
      Severity: Minor
      Found in Block/Tab/Wrapper.php - About 45 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 isToolbarAccessAllowed has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function isToolbarAccessAllowed($testWithRestriction=false)
          {
              $allow = false;
              $enable = $this->getQdbConfig('enable');
      
      
      Severity: Minor
      Found in Helper/Data.php - About 45 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 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function __construct(Config                $resourceConfig,
                                      Manager               $cacheManager,
                                      EventManagerInterface $eventManager,
                                      Writer                $writer,
                                      ArrayManager          $arrayManager,
      Severity: Minor
      Found in Console/Command/AbstractStatusToolbar.php - About 45 mins to fix

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

            public function __construct(Http $requestHttp,
                                        State $appState,
                                        ProductMetadataInterface $productMetadata,
                                        FrontNameResolver $frontNameResolver,
                                        Session $session
        Severity: Minor
        Found in Service/Request.php - About 35 mins to fix

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

                  \Magento\Framework\View\Element\Template\Context $context,
                  \Magento\Framework\Json\Helper\Data $jsonHelper,
                  \ADM\QuickDevBar\Helper\Data $qdbHelper,
                  \ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
                  array $data = []
          Severity: Minor
          Found in Block/Tab/Content/Log.php - About 35 mins to fix

            Method __construct has 5 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\Config\Structure $configStructure
            Severity: Minor
            Found in Controller/Action/ConfigSearch.php - About 35 mins to fix

              Method beforeSave has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      CacheInterface $subject,
                      string $data,
                      string $identifier,
                      array $tags = [],
                      $lifeTime = null
              Severity: Minor
              Found in Plugin/Framework/App/Cache.php - About 35 mins to fix

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

                        \Magento\Framework\View\Element\Template\Context $context,
                        \Magento\Framework\App\Config $appConfig,
                        \ADM\QuickDevBar\Helper\Data $qdbHelper,
                        \ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
                        array $data = []
                Severity: Minor
                Found in Block/Tab/Content/Config.php - About 35 mins to fix

                  Method computeQueryGrade has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      protected function computeQueryGrade($allQueries, $shortestQueryTime, $longestQueryTime, $totalNumQueries, $average)
                  Severity: Minor
                  Found in Service/Sql.php - About 35 mins to fix

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

                        public function __construct(\Magento\Framework\App\Action\Context $context,
                                                    \ADM\QuickDevBar\Helper\Data $qdbHelper,
                                                    \ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
                                                    \Magento\Framework\Controller\Result\RawFactory $resultRawFactory,
                                                    \Magento\Framework\View\LayoutFactory $layoutFactory)
                    Severity: Minor
                    Found in Controller/Index/Ajax.php - About 35 mins to fix

                      Method beforeSave has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              PageCache $subject,
                              string $data,
                              string $identifier,
                              array $tags = [],
                                             $lifeTime = null
                      Severity: Minor
                      Found in Plugin/PageCache/FrontController/BuiltinPlugin.php - About 35 mins to fix

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

                                Template\Context $context,
                                Translate $translate,
                                \ADM\QuickDevBar\Helper\Data $qdbHelper,
                                \ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
                                array $data = []
                        Severity: Minor
                        Found in Block/Tab/Content/Translation.php - About 35 mins to fix

                          Method __construct has 5 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\Framework\View\Asset\MergeService $mergeService
                          Severity: Minor
                          Found in Controller/Action/CacheCss.php - About 35 mins to fix

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

                                    \Magento\Framework\View\Element\Template\Context $context,
                                    \Magento\Framework\Json\Helper\Data $jsonHelper,
                                    \ADM\QuickDevBar\Helper\Data $qdbHelper,
                                    \ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
                                    array $data = []
                            Severity: Minor
                            Found in Block/Tab/Wrapper.php - About 35 mins to fix

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

                                      \Magento\Framework\View\Element\Template\Context $context,
                                      \ADM\QuickDevBar\Helper\Data $qdbHelper,
                                      \ADM\QuickDevBar\Helper\Register $qdbHelperRegister,
                                      DataObjectFactory $objectFactory,
                                      array $data = []
                              Severity: Minor
                              Found in Block/Tab/Content/Sql.php - About 35 mins to fix

                                Function _loadThemeTranslation has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    protected function _loadThemeTranslation()
                                    {
                                        $file = $this->_getThemeTranslationFile($this->getLocale());
                                        if ($file) {
                                            $relativePath = $this->_getRelativeFilePath($file);
                                Severity: Minor
                                Found in Helper/Translate.php - About 35 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 loadModuleTranslationByModulesList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    protected function loadModuleTranslationByModulesList(array $modules)
                                    {
                                        foreach ($modules as $module) {
                                            $moduleFilePath = $this->_getModuleTranslationFile($module, $this->getLocale());
                                            $relativePath = $this->_getRelativeFilePath($moduleFilePath);
                                Severity: Minor
                                Found in Helper/Translate.php - About 35 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 tailFile has a Cognitive Complexity of 7 (exceeds 5 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 35 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

                                Severity
                                Category
                                Status
                                Source
                                Language