puffer/puffer_pages

View on GitHub

Showing 219 of 219 total issues

Consider simplifying this complex logical expression.
Open

      if ((sp.from == null || sp.from < ch) &&
          (sp.to == null || sp.to > ch) &&
          (!found || found.width < sp.marker.width))
        found = sp.marker;
Severity: Major
Found in app/assets/javascripts/puffer/codemirror.js - About 40 mins to fix

    Consider simplifying this complex logical expression.
    Open

        if (!cm.options.lineNumbers && !markers && !line.bgClass && !line.wrapClass &&
            (!line.widgets || !line.widgets.length)) return lineElement;
    Severity: Major
    Found in app/assets/javascripts/puffer/codemirror.js - About 40 mins to fix

      Consider simplifying this complex logical expression.
      Open

          if (cur &&
              (history.lastOp == cm.curOp.id ||
               history.lastOrigin == origin && (origin == "input" || origin == "delete") &&
               history.lastTime > time - 600)) {
            // Merge this change into the last event
      Severity: Major
      Found in app/assets/javascripts/puffer/codemirror.js - About 40 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 app/assets/javascripts/puffer/codemirror/javascript.js - About 35 mins to fix

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

            function setSelection(cm, anchor, head, bias, checkAtomic) {
          Severity: Minor
          Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

              function buildToken(builder, text, style, startStyle, endStyle) {
            Severity: Minor
            Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                function cursorCoords(cm, pos, context, lineObj, measurement) {
              Severity: Minor
              Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                  function runMode(cm, text, mode, state, f) {
                Severity: Minor
                Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                    function patchDisplay(cm, from, to, intact, updateNumbersFrom) {
                  Severity: Minor
                  Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                        addWidget: function(pos, node, scroll, vert, horiz) {
                    Severity: Minor
                    Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                        function updateMarkedSpans(oldFirst, oldLast, startCh, endCh, newText) {
                      Severity: Minor
                      Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                          function replaceRange(cm, code, from, to, origin) {
                        Severity: Minor
                        Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                            function calculateScrollPos(cm, x1, y1, x2, y2) {
                          Severity: Minor
                          Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                              function markText(cm, from, to, options, type) {
                            Severity: Minor
                            Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                                function coordsCharInner(cm, lineObj, lineNo, x, y) {
                              Severity: Minor
                              Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                                  function scrollIntoView(cm, x1, y1, x2, y2) {
                                Severity: Minor
                                Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

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

                                    function buildTokenMeasure(builder, text, style, startStyle, endStyle) {
                                  Severity: Minor
                                  Found in app/assets/javascripts/puffer/codemirror.js - About 35 mins to fix

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                state.inner = CodeMirror.startState(other.mode, outer.indent ? outer.indent(state.outer, "") : 0);
                                    Severity: Minor
                                    Found in app/assets/javascripts/puffer/multiplex.js and 1 other location - About 35 mins to fix
                                    app/assets/javascripts/puffer/multiplex.js on lines 81..81

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 47.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                          else if (/^style$/i.test(state.htmlState.context.tagName)) {
                                            state.token = css;
                                            state.localState = cssMode.startState(htmlMode.indent(state.htmlState, ""));
                                          }
                                    Severity: Minor
                                    Found in app/assets/javascripts/puffer/codemirror/htmlmixed.js and 1 other location - About 35 mins to fix
                                    app/assets/javascripts/puffer/codemirror/htmlmixed.js on lines 9..16

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 47.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 2 locations. Consider refactoring.
                                    Open

                                                state.inner = CodeMirror.startState(other.mode, mode.indent ? mode.indent(state.outer, "") : 0);
                                    Severity: Minor
                                    Found in app/assets/javascripts/puffer/multiplex.js and 1 other location - About 35 mins to fix
                                    app/assets/javascripts/puffer/multiplex.js on lines 38..38

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 47.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language