gems-uff/sapos

View on GitHub
app/assets/javascripts/codemirror.sql.custom.js

Summary

Maintainability
D
1 day
Test Coverage

Function tokenBase has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function tokenBase(stream, state) {
    var ch = stream.next();

    // call hooks from the mime type
    if (hooks[ch]) {
Severity: Major
Found in app/assets/javascripts/codemirror.sql.custom.js - About 2 hrs to fix

    Consider simplifying this complex logical expression.
    Open

        } else if ((((support.nCharCast == true && (ch == "n" || ch == "N"))
            || (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i)))
            && (stream.peek() == "'" || stream.peek() == '"'))) {
          // charset casting: _utf8'str', N'str', n'str'
          // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html
    Severity: Critical
    Found in app/assets/javascripts/codemirror.sql.custom.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

          } else if (support.binaryNumber == true &&
            (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/))
            || (ch == "0" && stream.match(/^b[01]+/)))) {
            // bitstring
            // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html
      Severity: Major
      Found in app/assets/javascripts/codemirror.sql.custom.js - About 40 mins to fix

        Consider simplifying this complex logical expression.
        Open

            if (support.hexNumber == true &&
              ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/))
              || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) {
              // hex
              // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html
        Severity: Major
        Found in app/assets/javascripts/codemirror.sql.custom.js - About 40 mins to fix

          Consider simplifying this complex logical expression.
          Open

              } else if ((support.commentHash && ch == "#")
                  || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) {
                // 1-line comments
                // ref: https://kb.askmonty.org/en/comment-syntax/
                stream.skipToEnd();
          Severity: Major
          Found in app/assets/javascripts/codemirror.sql.custom.js - About 40 mins to fix

            Avoid too many return statements within this function.
            Open

                    return "variable-2";
            Severity: Major
            Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return "comment";
              Severity: Major
              Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      if (atoms.hasOwnProperty(word)) return "atom";
                Severity: Major
                Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return null;
                  Severity: Major
                  Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return state.tokenize(stream, state);
                    Severity: Major
                    Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            if (keywords.hasOwnProperty(word)) return "keyword";
                      Severity: Major
                      Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                              return "variable-3";
                        Severity: Major
                        Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return "ruby-variable";
                          Severity: Major
                          Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return "number";
                            Severity: Major
                            Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    if (client.hasOwnProperty(word)) return "string-2";
                              Severity: Major
                              Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return "comment";
                                Severity: Major
                                Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return "number";
                                  Severity: Major
                                  Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                          if (builtin.hasOwnProperty(word)) return "builtin";
                                    Severity: Major
                                    Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                            return "keyword";
                                      Severity: Major
                                      Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                              return null;
                                        Severity: Major
                                        Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                                return state.tokenize(stream, state);
                                          Severity: Major
                                          Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                  return null;
                                            Severity: Major
                                            Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                      return "number";
                                              Severity: Major
                                              Found in app/assets/javascripts/codemirror.sql.custom.js - About 30 mins to fix

                                                There are no issues that match your filters.

                                                Category
                                                Status