ecoco/magento_profiler

View on GitHub

Showing 84 of 241 total issues

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

    public function loadRewrites()
    {
        if ($this->_rewrites === null) {
            $files     = ['config.xml', 'development.xml'];
            $prototype = $this->_rewriteTypes;
Severity: Minor
Found in app/code/community/Ecocode/Profiler/Helper/Rewrite.php - About 1 hr to fix

    Function getLogGroups has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getLogGroups()
        {
            if ($this->logGroups === null) {
                $logGroups = [
                    'deprecation'    => [],
    Severity: Minor
    Found in app/code/community/Ecocode/Profiler/Block/Collector/Log/Panel.php - About 1 hr 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 computeErrorsCount has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

        private function computeErrorsCount()
        {
            $logger = $this->getLogger();
            $count  = [
                'total_log_count'   => count($logger->getLogs()),

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

        protected function readLineFromFile($file)
        {
            $line     = '';
            $position = ftell($file);
    
    
    Severity: Minor
    Found in app/code/community/Ecocode/Profiler/Model/Profiler/FileStorage.php - About 1 hr 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 searchAction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function searchAction()
        {
            /** @var Mage_Core_Controller_Request_Http$request */
            $request  = $this->getRequest();
    
    
    Severity: Minor
    Found in app/code/community/Ecocode/Profiler/controllers/IndexController.php - About 1 hr to fix

      Method panelAction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function panelAction()
          {
              $profiler = $this->getProfiler();
      
              /** @var Mage_Core_Controller_Request_Http $request */
      Severity: Minor
      Found in app/code/community/Ecocode/Profiler/controllers/IndexController.php - About 1 hr to fix

        Method collect has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function collect(
                Mage_Core_Controller_Request_Http $request,
                Mage_Core_Controller_Response_Http $response,
                \Exception $exception = null
            )

          Method searchResultsAction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function searchResultsAction()
              {
                  /** @var Mage_Core_Controller_Request_Http$request */
                  $request  = $this->getRequest();
                  /** @var Ecocode_Profiler_Model_Profiler $profiler */
          Severity: Minor
          Found in app/code/community/Ecocode/Profiler/controllers/IndexController.php - About 1 hr to fix

            Method collectSessionData has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

                  public function getRequestJsonData()
                  {
                      $eventList = $this->getCollector()->getEvents();
                      $events = [];
                      foreach ($eventList as $name => $event) {
              Severity: Minor
              Found in app/code/community/Ecocode/Profiler/Block/Collector/Time/Panel.php - About 1 hr to fix

                Method collectCacheCallData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function collectCacheCallData()
                    {
                        $cache = $this->getCacheInstance();
                        if (!$cache instanceof Ecocode_Profiler_Model_Core_Cache) {
                            return;

                  Method renderNode has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Function captureFlashMessages has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function captureFlashMessages()
                        {
                            $messages = [];
                            foreach ($this->getRawSession() as $namespace => $data) {
                                if (!isset($data['messages'])) {

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

                        public function collect(
                            Mage_Core_Controller_Request_Http $request,
                            Mage_Core_Controller_Response_Http $response,
                            \Exception $exception = null
                        )

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

                        public function getRewriteConflicts()
                        {
                            $conflicts = [];
                            $rewrites  = $this->loadRewrites();
                            foreach ($rewrites as $type => $data) {
                    Severity: Minor
                    Found in app/code/community/Ecocode/Profiler/Helper/Rewrite.php - About 1 hr 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 computeErrorsCount has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function computeErrorsCount()
                        {
                            $logger = $this->getLogger();
                            $count  = [
                                'total_log_count'   => count($logger->getLogs()),

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

                          public function prepareQueryData()
                          {
                              $this->queries          = [];
                              $this->identicalQueries = [];
                              $this->queriesByContext = [];
                      Severity: Minor
                      Found in app/code/community/Ecocode/Profiler/Block/Collector/Mysql/Panel.php - About 1 hr to fix

                        Method formatQuery has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function formatQuery($sql, $highlightOnly = false)
                            {
                                if (@!class_exists('SqlFormatter')) {
                                    return 'SqlFormatter is not installed';
                                }
                        Severity: Minor
                        Found in app/code/community/Ecocode/Profiler/Helper/Sql.php - About 1 hr to fix

                          Method parseController has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function parseController($controller)
                              {
                                  if (is_object($controller)) {
                                      /** @var Mage_Core_Controller_Varien_Front $controller */
                          
                          

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

                                protected function getClassNames($reload = false)
                                {
                                    if ($this->classNameCache !== null && $reload === false) {
                                        return $this->classNameCache;
                                    }
                            Severity: Minor
                            Found in app/code/community/Ecocode/Profiler/Helper/Data.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

                            Severity
                            Category
                            Status
                            Source
                            Language