puffer/puffer_pages

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

Summary

Maintainability
C
1 day
Test Coverage

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

        token: function(stream, state) {
            var ch = stream.peek();
            var esc = state.escaped;
            state.escaped = false;
            /* comments */
Severity: Major
Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 2 hrs to fix

    Avoid too many return statements within this function.
    Open

                    return "atom";
    Severity: Major
    Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

                      if (state.inlinePairs > 0 && stream.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/)) { return 'number'; }
      Severity: Major
      Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                        return 'meta';
        Severity: Major
        Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                          return 'meta';
          Severity: Major
          Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                            if (stream.match(/\s*-\s+/)) { return 'meta'; }
            Severity: Major
            Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                              if (state.inlinePairs == 0 && stream.match(/^\s*-?[0-9\.\,]+\s?$/)) { return 'number'; }
              Severity: Major
              Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

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

                  Avoid too many return statements within this function.
                  Open

                                  return 'meta';
                  Severity: Major
                  Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                    if (stream.match(/^\s*(\||\>)\s*/)) { state.literal = true; return 'meta'; };
                    Severity: Major
                    Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                      if (stream.match(keywordRegex)) { return 'keyword'; }
                      Severity: Major
                      Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    if (state.pair && stream.match(/^:\s*/)) { state.pairStart = true; return 'meta'; }
                        Severity: Major
                        Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                          if (stream.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i)) { return 'variable-2'; }
                          Severity: Major
                          Found in app/assets/javascripts/puffer/codemirror/yaml.js - About 30 mins to fix

                            There are no issues that match your filters.

                            Category
                            Status