kalenjordan/magehero

View on GitHub

Showing 75 of 125 total issues

Avoid deeply nested control flow statements.
Open

                                if(areEqual(p.offset, self.elProxyPosition.offset)) 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 (deviceHasTouchCapability) {
                                        // timeout 0 : explanation below in click section
                                        setTimeout(function() {
                                            // we don't want to bind on click here because the initial touchstart event has not yet triggered its click event, which is thus about to happen
                                            $('body').on('touchstart.'+ self.namespace, function() {
    Severity: Major
    Found in skin/js/src/lib/jquery.tooltipster.js - About 45 mins to fix

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

          protected function _get($userId)
          {
              if (! $this->_getUsername()) {
                  throw new Exception("You have to be logged in to vote.");
              }
      Severity: Minor
      Found in code/Controller/UserUpvote.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 post has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          public function post()
          {
              $imageUrl = isset($_POST['image_url']) ? $_POST['image_url'] : null;
              $subject  = isset($_POST['subject'])   ? $_POST['subject']   : null;
              $body     = isset($_POST['body'])      ? $_POST['body']      : null;
      Severity: Minor
      Found in code/Controller/PostNew.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 post has a Cognitive Complexity of 7 (exceeds 5 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 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

      Avoid too many return statements within this function.
      Open

            return '<'
              + type
              + '>\n'
              + body
              + '</'
      Severity: Major
      Found in epiceditor/js/epiceditor.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

              return '<li>'
                + body
                + '</li>\n';
        Severity: Major
        Found in epiceditor/js/epiceditor.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return !this.token.pre && !this.options.pedantic
                  ? this.inline.output(this.token.text)
                  : this.token.text;
          Severity: Major
          Found in epiceditor/js/epiceditor.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            if (multiple) return instances;
            Severity: Major
            Found in skin/js/src/lib/jquery.tooltipster.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              else return this;
              Severity: Major
              Found in skin/js/src/lib/jquery.tooltipster.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return '<li>'
                        + body
                        + '</li>\n';
                Severity: Major
                Found in epiceditor/js/epiceditor.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return '<p>'
                          + this.inline.output(this.token.text)
                          + '</p>\n';
                  Severity: Major
                  Found in epiceditor/js/epiceditor.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return '<table>\n'
                            + body
                            + '</table>\n';
                    Severity: Major
                    Found in epiceditor/js/epiceditor.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return '<p>'
                              + this.parseText()
                              + '</p>\n';
                      Severity: Major
                      Found in epiceditor/js/epiceditor.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return '<blockquote>\n'
                                + body
                                + '</blockquote>\n';
                        Severity: Major
                        Found in epiceditor/js/epiceditor.js - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language