wahyd4/ocelots

View on GitHub

Showing 52 of 98 total issues

Avoid deeply nested control flow statements.
Open

                                for (var r = 0; r < q.length - 1; r++) {
                                    var s = q[r];
                                    typeof o[s] != "object" && (o[s] = {}), o = o[s]
                                }
Severity: Major
Found in include.js - About 45 mins to fix

    Consider simplifying this complex logical expression.
    Open

                if (g)try {
                    g.focus()
                } catch (d) {
                } else {
                    if (!b.isSupported()) {
    Severity: Major
    Found in include.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

                      if (a.onlogin && typeof a.onlogin != "function" || a.onlogout && typeof a.onlogout != "function" || a.onready && typeof a.onready != "function")throw new Error("non-function where function expected in parameters to navigator.id.watch()");
      Severity: Major
      Found in include.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

                        if (!(e.ctrlKey || e.altKey || e.shiftKey || e.metaKey) && !what.is('.fancybox-wrap')) {
                            relType = options.groupAttr || 'data-fancybox-group';
                            relVal  = what.attr(relType);
        
                            if (!relVal) {
        Severity: Major
        Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

                      if (c === "*")for (var h in b) {
                          if (!b.hasOwnProperty(h))continue;
                          if (h === "*")continue;
                          if (typeof b[h][d] == "object") {
                              g = f(b[h][d]);
          Severity: Major
          Found in include.js - About 40 mins to fix

            Avoid too many return statements within this function.
            Open

                return this;
            Severity: Major
            Found in public/jquery.form.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                                      return;
              Severity: Major
              Found in public/jquery.form.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return this;
                Severity: Major
                Found in public/jquery.form.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return $(el).val();
                  Severity: Major
                  Found in public/jquery.form.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                        return F._error( 'content' );
                    Severity: Major
                    Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      return F._error( 'href' );
                      Severity: Major
                      Found in public/fancyapps-fancyBox-2bb0da9/source/jquery.fancybox.js - About 30 mins to fix

                        Method process_sc_embed_code has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def process_sc_embed_code object, owner
                            return unless object
                            return unless owner == current_person
                            object.track = $1 if params[:sc_embed_code] =~ /tracks%2F(\d+)/
                            object.secret = $1 if params[:sc_embed_code] =~ /secret_token%3D(s-[0-9a-zA-Z]+)/
                        Severity: Minor
                        Found in lib/soundcloudvalidate.rb - About 25 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