kalenjordan/magehero

View on GitHub

Showing 75 of 125 total issues

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(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

                                      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

        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

        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

        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

                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 '<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 '<blockquote>\n'
                      + body
                      + '</blockquote>\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 '<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

                                    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 '<'
                              + 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

                                        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

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