crowbar/crowbar-core

View on GitHub
crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js

Summary

Maintainability
D
2 days
Test Coverage

File javascript.js has 311 lines of code (exceeds 250 allowed). Consider refactoring.
Open

CodeMirror.defineMode("javascript", function(config, parserConfig) {
  var indentUnit = config.indentUnit;
  var jsonMode = parserConfig.json;

  // Tokenizer
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 3 hrs to fix

Function jsTokenBase has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function jsTokenBase(stream, state) {
    var ch = stream.next();
    if (ch == '"' || ch == "'")
      return chain(stream, state, jsTokenString(ch));
    else if (/[\[\]{}\(\),;\:\.]/.test(ch))

Function JSLexical has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function JSLexical(indented, column, type, align, prev, info) {
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 45 mins to fix

Function parseJS has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  function parseJS(state, style, type, content, stream) {
Severity: Minor
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 35 mins to fix

Avoid too many return statements within this function.
Open

        return ret("operator", null, stream.current());
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "default") return cont(expect(":"));
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "operator") return cont(expression);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return cont();
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "[") return cont(pushlex("]"), expression, expect("]"), poplex, maybeoperator);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return ret("operator", null, stream.current());
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == ";") return cont();
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return chain(stream, state, jsTokenComment);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return ret("regexp", "string");
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else if (lexical.align) return lexical.column + (closing ? 0 : 1);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      return known ? ret(known.type, known.style, word) :
                     ret("variable", "variable", word);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"),
                                        statement, poplex, popcontext);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    return pass(pushlex("stat"), expression, expect(";"), poplex);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "[") return cont(pushlex("]"), commasep(expression, "]"), poplex, maybeoperator);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "{") return cont(pushlex("}"), commasep(objprop, "}"), poplex, maybeoperator);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "case") return cont(expression, expect(":"));
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

        return ret("comment", "comment");
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "variable") return cont(pushlex("stat"), maybelabel);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == ".") return cont(property, maybeoperator);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"),
                                         block, poplex, poplex);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "function") return cont(functiondef);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

    if (type == "for") return cont(pushlex("form"), expect("("), pushlex(")"), forspec1, expect(")"),
                                      poplex, statement, poplex);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

Avoid too many return statements within this function.
Open

      else return lexical.indented + (closing ? 0 : indentUnit);
Severity: Major
Found in crowbar_framework/vendor/assets/javascripts/codemirror/javascript.js - About 30 mins to fix

There are no issues that match your filters.

Category
Status