puffer/puffer_pages

View on GitHub
app/assets/javascripts/puffer/codemirror/css.js

Summary

Maintainability
D
2 days
Test Coverage

File css.js has 392 lines of code (exceeds 250 allowed). Consider refactoring.
Open

CodeMirror.defineMode("css", function(config) {
  var indentUnit = config.indentUnit, type;
  
  var atMediaTypes = keySet([
    "all", "aural", "braille", "handheld", "print", "projection", "screen",
Severity: Minor
Found in app/assets/javascripts/puffer/codemirror/css.js - About 5 hrs to fix

    Function token has 89 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        token: function(stream, state) {
          
          // Use these terms when applicable (see http://www.xanthir.com/blog/b4E50)
          // 
          // rule** or **ruleset:
    Severity: Major
    Found in app/assets/javascripts/puffer/codemirror/css.js - About 3 hrs to fix

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

        function tokenBase(stream, state) {
          var ch = stream.next();
          if (ch == "@") {stream.eatWhile(/[\w\\\-]/); return ret("def", stream.current());}
          else if (ch == "/" && stream.eat("*")) {
            state.tokenize = tokenCComment;
      Severity: Major
      Found in app/assets/javascripts/puffer/codemirror/css.js - About 2 hrs to fix

        Avoid deeply nested control flow statements.
        Open

                  if (atMediaTypes[stream.current()]) {
                    style = "attribute"; // Known attribute
                  } else if (/^(only|not)$/i.test(stream.current())) {
                    style = "keyword";
                  } else if (stream.current().toLowerCase() == "and") {
        Severity: Major
        Found in app/assets/javascripts/puffer/codemirror/css.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                  } else if (context == "@mediaType") {
                    if (atMediaTypes[stream.current()]) {
                      style = "attribute";
                    } else if (stream.current().toLowerCase() == "and") {
                      style = "operator";
          Severity: Major
          Found in app/assets/javascripts/puffer/codemirror/css.js - About 45 mins to fix

            Avoid too many return statements within this function.
            Open

                  return ret(null, ch);
            Severity: Major
            Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return ret("keyword", "important");
              Severity: Major
              Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return ret("number", "unit");
                Severity: Major
                Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                        return ret("property", "variable");
                  Severity: Major
                  Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return ret("meta", "meta");
                    Severity: Major
                    Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                            return ret("qualifier", "qualifier");
                      Severity: Major
                      Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return ret("number", "unit");
                        Severity: Major
                        Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                return ret(null, "select-op");
                          Severity: Major
                          Found in app/assets/javascripts/puffer/codemirror/css.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/puffer/codemirror/css.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                    return ret("property", "variable");
                              Severity: Major
                              Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                      return ret("operator", ch);
                                Severity: Major
                                Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                        return ret("atom", "hash");
                                  Severity: Major
                                  Found in app/assets/javascripts/puffer/codemirror/css.js - About 30 mins to fix

                                    There are no issues that match your filters.

                                    Category
                                    Status