jbox-web/redmine_bootstrap_kit

View on GitHub

Showing 361 of 361 total issues

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

      moveToBottomLine: function(cm, motionArgs) {
        var line = getUserVisibleLines(cm).bottom - motionArgs.repeat +1;
        return { line: line, ch: findFirstNonWhiteSpaceCharacter(cm.getLine(line)) };
      },
Severity: Major
Found in assets/javascripts/codemirror/keymap/vim.js and 1 other location - About 1 hr to fix
assets/javascripts/codemirror/keymap/vim.js on lines 1231..1234

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

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 paste has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      paste: function(cm, actionArgs) {
        var cur = cm.getCursor();
        var register = vimGlobalState.registerController.getRegister(
            actionArgs.registerName);
        if (!register.text) {
Severity: Minor
Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

    Function buildToken has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function buildToken(builder, text, style, startStyle, endStyle, title) {
        if (!text) return;
        var special = builder.cm.options.specialChars;
        if (!special.test(text)) {
          builder.col += text.length;
    Severity: Minor
    Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

      Function moveToWord has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          function moveToWord(cm, repeat, forward, wordEnd, bigWord) {
            var cur = cm.getCursor();
            var curStart = copyCursor(cur);
            var words = [];
            if (forward && !wordEnd || !forward && wordEnd) {
      Severity: Minor
      Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

        Function destroy has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                destroy: function() {
                    $.Widget.prototype.destroy.call(this);
        
                    this.element.unbind('.tagit');
                    this.tagList.unbind('.tagit');
        Severity: Minor
        Found in assets/javascripts/bootstrap/jquery_tag_it.js - About 1 hr to fix

          Function setTagIt has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function setTagIt(){
            $('[data-toggle="tagit"]').each(function(){
          
              var data_source = $(this).data('source');
              var callback_after_add = $(this).data('after-add');
          Severity: Minor
          Found in assets/javascripts/bootstrap/jquery_tag_it_helper.js - About 1 hr to fix

            Function indentLine has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function indentLine(cm, n, how, aggressive) {
                var doc = cm.doc;
                if (how == null) how = "add";
                if (how == "smart") {
                  if (!cm.doc.mode.indent) how = "prev";
            Severity: Minor
            Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

              Function coordsCharInner has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function coordsCharInner(cm, lineObj, lineNo, x, y) {
                  var innerOff = y - heightAtLine(cm, lineObj);
                  var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;
                  var measurement = measureLine(cm, lineObj);
              
              
              Severity: Minor
              Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                Function clear has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  TextMarker.prototype.clear = function() {
                    if (this.explicitlyCleared) return;
                    var cm = this.doc.cm, withOp = cm && !cm.curOp;
                    if (withOp) startOperation(cm);
                    if (hasHandler(this, "clear")) {
                Severity: Minor
                Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                  Function CodeMirror has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function CodeMirror(place, options) {
                      if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
                  
                      this.options = options = options || {};
                      // Determine effective options based on given values and defaults.
                  Severity: Minor
                  Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                    Function repeatLastEdit has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function repeatLastEdit(cm, vim, repeat, repeatForInsert) {
                          var macroModeState = vimGlobalState.macroModeState;
                          macroModeState.inReplay = true;
                          var isAction = !!vim.lastEditActionCommand;
                          var cachedInputState = vim.inputState;
                    Severity: Minor
                    Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

                      Function pushText has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            pushText: function(registerName, operator, text, linewise) {
                              if (linewise && text.charAt(0) == '\n') {
                                text = text.slice(1) + '\n';
                              }
                              if(linewise && text.charAt(text.length - 1) !== '\n'){
                      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 (scrollPos.scrollLeft != null) {
                                setScrollLeft(cm, scrollPos.scrollLeft);
                                if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;
                              }
                        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 2676..2679

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

                        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

                            skipTo: function(ch) {
                              var found = this.string.indexOf(ch, this.pos);
                              if (found > -1) {this.pos = found; return true;}
                            },
                        Severity: Major
                        Found in assets/javascripts/codemirror/codemirror.js and 1 other location - About 1 hr to fix
                        assets/javascripts/codemirror/addon/runmode/runmode-standalone.js on lines 39..42

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

                        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

                          skipTo: function(ch) {
                            var found = this.string.indexOf(ch, this.pos);
                            if (found > -1) {this.pos = found; return true;}
                          },
                        assets/javascripts/codemirror/codemirror.js on lines 3741..3744

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

                        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 (scrollPos.scrollTop != null) {
                                setScrollTop(cm, scrollPos.scrollTop);
                                if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;
                              }
                        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 2680..2683

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

                        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

                        Consider simplifying this complex logical expression.
                        Open

                            if (cur &&
                                (hist.lastOp == opId ||
                                 hist.lastOrigin == change.origin && change.origin &&
                                 ((change.origin.charAt(0) == "+" && doc.cm && hist.lastTime > time - doc.cm.options.historyEventDelay) ||
                                  change.origin.charAt(0) == "*"))) {
                        Severity: Critical
                        Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                          Function readInput has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function readInput(cm) {
                              var input = cm.display.input, prevInput = cm.display.prevInput, doc = cm.doc, sel = doc.sel;
                              if (!cm.state.focused || hasSelection(input) || isReadOnly(cm) || cm.state.disableInput) return false;
                              if (cm.state.pasteIncoming && cm.state.fakedLastChar) {
                                input.value = input.value.substring(0, input.value.length - 1);
                          Severity: Minor
                          Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

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

                                    if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
                                      end = rightPos;
                            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 852..853

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

                            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 (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
                                      start = leftPos;
                            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 854..855

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

                            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