kalenjordan/magehero

View on GitHub

Showing 75 of 125 total issues

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

    public function post()
    {
        if (! isset($_POST['profile'])) {
            throw new Exception("Missing profile data");
        }
Severity: Minor
Found in code/Controller/Profile.php - About 1 hr to fix

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

        protected function _getDevelopers()
        {
            $query = $this->_getContainer()->User()->selectAll();
            $userRows = $this->_getContainer()->LocalConfig()->database()->fetchAll($query);
            $users = array();
    Severity: Minor
    Found in code/Controller/MapUsers.php - About 1 hr to fix

      Function checkInterval has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  self.checkInterval = setInterval(function() {
                      
                      // if the tooltip and/or its interval should be stopped
                      if (
                              // if the origin has been removed
      Severity: Minor
      Found in skin/js/src/lib/jquery.tooltipster.js - About 1 hr to fix

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

            public function loadByUsername($username)
            {
                $query = $this->_localConfig->database()->select()
                    ->from("users")
                    ->joinLeft(
        Severity: Minor
        Found in code/Model/User.php - About 1 hr to fix

          Function add_option has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
                if (option.nodeName.toUpperCase() === "OPTION") {
                  if (option.text !== "") {
                    if (group_position != null) {
                      this.parsed[group_position].children += 1;
          Severity: Minor
          Found in skin/js/src/lib/chosen.jquery.js - About 1 hr to fix

            Function getFiles has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              EpicEditor.prototype.getFiles = function (name, excludeContent) {
                var file
                  , data = this._getFileStore(name);
                
                if (name) {
            Severity: Minor
            Found in epiceditor/js/epiceditor.js - About 1 hr to fix

              Avoid deeply nested control flow statements.
              Open

                                          if (arrayAlternate == 'even') {
                                              if (areaNumber > areaGreatestX) {
                                                  areaGreatestX = areaNumber;
                                                  if (i === 0) {
                                                      areaSmallestX = areaGreatestX;
              Severity: Major
              Found in skin/js/src/lib/jquery.tooltipster.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                                if (self.options.interactive) {
                                                    
                                                    // touch events inside the tooltip must not close it
                                                    if (deviceHasTouchCapability) {
                                                        self.$tooltip.on('touchstart.'+ self.namespace, function(event) {
                Severity: Major
                Found in skin/js/src/lib/jquery.tooltipster.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                                  if (self.options.speed > 0) self.$tooltip.delay(self.options.speed);
                  Severity: Major
                  Found in skin/js/src/lib/jquery.tooltipster.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                                    if(areEqual(p.position, self.elProxyPosition.position)) identical = true;
                    Severity: Major
                    Found in skin/js/src/lib/jquery.tooltipster.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                                      if(self.Status != 'hidden'){
                                                          
                                                          self.$tooltip.removeClass('tooltipster-content-changing');
                                                          
                                                          // after the changing animation has completed, reset the CSS transitions
                      Severity: Major
                      Found in skin/js/src/lib/jquery.tooltipster.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                        if(self.Status != 'hidden'){
                                                            self.$tooltip.fadeTo(self.options.speed, 1);
                                                        }
                        Severity: Major
                        Found in skin/js/src/lib/jquery.tooltipster.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                      else if(self.options.trigger == 'click'){
                                                          
                                                          // use a timeout to prevent immediate closing if the method was called on a click event and if options.delay == 0 (because of bubbling)
                                                          setTimeout(function() {
                                                              $('body').on('click.'+ self.namespace +' touchstart.'+ self.namespace, function() {
                          Severity: Major
                          Found in skin/js/src/lib/jquery.tooltipster.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                      if (!loose) loose = next;
                            Severity: Major
                            Found in epiceditor/js/epiceditor.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            if (searchText.length) {
                                              startpos = option.search_text.search(zregex);
                                              text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
                                              option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
                                            }
                              Severity: Major
                              Found in skin/js/src/lib/chosen.jquery.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                              if (results_group != null) {
                                                results_group.group_match = true;
                                              }
                                Severity: Major
                                Found in skin/js/src/lib/chosen.jquery.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                              } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
                                                option.search_match = true;
                                              }
                                  Severity: Major
                                  Found in skin/js/src/lib/chosen.jquery.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                if (target === copy) {
                                                  continue;
                                                }
                                    Severity: Major
                                    Found in epiceditor/js/epiceditor.js - About 45 mins to fix

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

                                          public function post($postId)
                                          {
                                              $imageUrl = isset($_POST['image_url']) ? $_POST['image_url'] : null;
                                      
                                              $subject  = isset($_POST['subject'])   ? $_POST['subject']   : null;
                                      Severity: Minor
                                      Found in code/Controller/PostEdit.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

                                      Avoid deeply nested control flow statements.
                                      Open

                                                  if (deep && copy && typeof copy === "object" && !copy.nodeType) {
                                                    target[name] = _mergeObjs(deep,
                                                      // Never move original objects, clone them
                                                      src || (copy.length != null ? [] : {})
                                                      , copy);
                                      Severity: Major
                                      Found in epiceditor/js/epiceditor.js - About 45 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language