jbox-web/redmine_bootstrap_kit

View on GitHub

Showing 361 of 361 total issues

Function matchCommand has 56 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      matchCommand: function(key, keyMap, vim) {
        var inputState = vim.inputState;
        var keys = inputState.keyBuffer.concat(key);
        var matchedCommands = [];
        var selectedCharacter;
Severity: Major
Found in assets/javascripts/codemirror/keymap/vim.js - About 2 hrs to fix

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

      function patchDisplay(cm, from, to, intact, updateNumbersFrom) {
        var dims = getDimensions(cm);
        var display = cm.display, lineNumbers = cm.options.lineNumbers;
        if (!intact.length && (!webkit || !cm.display.currentWheelTarget))
          removeChildren(display.lineDiv);
    Severity: Major
    Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

      File bootstrap_tooltip.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* ===========================================================
       * bootstrap-tooltip.js v2.3.2
       * http://getbootstrap.com/2.3.2/javascript.html#tooltips
       * Inspired by the original jQuery.tipsy by Jason Frame
       * ===========================================================
      Severity: Minor
      Found in assets/javascripts/bootstrap/bootstrap_tooltip.js - About 2 hrs to fix

        Function insertLineContent has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function insertLineContent(line, builder, styles) {
            var spans = line.markedSpans, allText = line.text, at = 0;
            if (!spans) {
              for (var i = 1; i < styles.length; i+=2)
                builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder));
        Severity: Major
        Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

          Function markText has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function markText(doc, from, to, options, type) {
              if (options && options.shared) return markTextShared(doc, from, to, options, type);
              if (doc.cm && !doc.cm.curOp) return operation(doc.cm, markText)(doc, from, to, options, type);
          
              var marker = new TextMarker(doc, type);
          Severity: Major
          Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

            Function token has 54 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 assets/javascripts/codemirror/mode/yaml/yaml.js - About 2 hrs to fix

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

                function indexOf(collection, elt) {
                  if (collection.indexOf) return collection.indexOf(elt);
                  for (var i = 0, e = collection.length; i < e; ++i)
                    if (collection[i] == elt) return i;
                  return -1;
              Severity: Major
              Found in assets/javascripts/codemirror/codemirror.js and 1 other location - About 2 hrs to fix
              assets/javascripts/codemirror/addon/edit/closetag.js on lines 83..88

              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 78.

              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

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

                function indexOf(collection, elt) {
                  if (collection.indexOf) return collection.indexOf(elt);
                  for (var i = 0, e = collection.length; i < e; ++i)
                    if (collection[i] == elt) return i;
                  return -1;
              Severity: Major
              Found in assets/javascripts/codemirror/addon/edit/closetag.js and 1 other location - About 2 hrs to fix
              assets/javascripts/codemirror/codemirror.js on lines 5470..5475

              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 78.

              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

                    do {
                      match = (/<\w+-.+?>|<\w+>|./).exec(text);
                      if(match === null)break;
                      key = match[0];
                      text = text.substring(match.index + key.length);
              Severity: Major
              Found in assets/javascripts/codemirror/keymap/vim.js and 1 other location - About 2 hrs to fix
              assets/javascripts/codemirror/keymap/vim.js on lines 3082..3088

              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 77.

              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

                    while (str) {
                      match = (/<\w+-.+?>|<\w+>|./).exec(str);
                      if(match === null)break;
                      key = match[0];
                      str = str.substring(match.index + key.length);
              Severity: Major
              Found in assets/javascripts/codemirror/keymap/vim.js and 1 other location - About 2 hrs to fix
              assets/javascripts/codemirror/keymap/vim.js on lines 3526..3532

              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 77.

              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

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

                function endOperation(cm) {
                  var op = cm.curOp, doc = cm.doc, display = cm.display;
                  cm.curOp = null;
              
                  if (op.updateMaxLine) computeMaxLength(cm);
              Severity: Major
              Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

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

                    function findWord(cm, cur, forward, bigWord, emptyLineIsWord) {
                      var lineNum = cur.line;
                      var pos = cur.ch;
                      var line = cm.getLine(lineNum);
                      var dir = forward ? 1 : -1;
                Severity: Major
                Found in assets/javascripts/codemirror/keymap/vim.js - About 2 hrs to fix

                  Function onContextMenu has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function onContextMenu(cm, e) {
                      if (signalDOMEvent(cm, e, "contextmenu")) return;
                      var display = cm.display, sel = cm.doc.sel;
                      if (eventInWidget(display, e) || contextMenuInGutter(cm, e)) return;
                  
                  
                  Severity: Major
                  Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

                    Function stretchSpansOverChange has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function stretchSpansOverChange(doc, change) {
                        var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;
                        var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;
                        if (!oldFirst && !oldLast) return null;
                    
                    
                    Severity: Major
                    Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

                      Function onScrollWheel has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function onScrollWheel(cm, e) {
                          var dx = e.wheelDeltaX, dy = e.wheelDeltaY;
                          if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) dx = e.detail;
                          if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) dy = e.detail;
                          else if (dy == null) dy = e.wheelDelta;
                      Severity: Minor
                      Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                        Function buildVimKeyMap has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function buildVimKeyMap() {
                              /**
                               * Handle the raw key event from CodeMirror. Translate the
                               * Shift + key modifier to the resulting letter, while preserving other
                               * modifers.
                        Severity: Minor
                        Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

                          Function makeDisplay has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function makeDisplay(place, docStart) {
                              var d = {};
                          
                              var input = d.input = elt("textarea", null, null, "position: absolute; padding: 0; width: 1px; height: 1em; outline: none; font-size: 4px;");
                              if (webkit) input.style.width = "1000px";
                          Severity: Minor
                          Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                            Function substitute has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  substitute: function(cm, params) {
                                    if (!cm.getSearchCursor) {
                                      throw new Error('Search feature not available. Requires searchcursor.js or ' +
                                          'any other getSearchCursor implementation.');
                                    }
                            Severity: Minor
                            Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

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

                                      if (posLess(p.from, m.from) || !mk.inclusiveLeft && posEq(p.from, m.from))
                                        newParts.push({from: p.from, to: m.from});
                              Severity: Major
                              Found in assets/javascripts/codemirror/codemirror.js and 1 other location - About 1 hr to fix
                              assets/javascripts/codemirror/codemirror.js on lines 4122..4123

                              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 74.

                              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

                                      if (posLess(m.to, p.to) || !mk.inclusiveRight && posEq(p.to, m.to))
                                        newParts.push({from: m.to, to: p.to});
                              Severity: Major
                              Found in assets/javascripts/codemirror/codemirror.js and 1 other location - About 1 hr to fix
                              assets/javascripts/codemirror/codemirror.js on lines 4120..4121

                              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 74.

                              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