jbox-web/redmine_bootstrap_kit

View on GitHub

Showing 361 of 361 total issues

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

    eatSpace: function() {
      var start = this.pos;
      while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
      return this.pos > start;
    },
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 33..37

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

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

  eatSpace: function() {
    var start = this.pos;
    while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) ++this.pos;
    return this.pos > start;
  },
assets/javascripts/codemirror/codemirror.js on lines 3735..3739

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

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

  , show: function () {
      var $tip
        , pos
        , actualWidth
        , actualHeight
Severity: Minor
Found in assets/javascripts/bootstrap/bootstrap_tooltip.js - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                if (opts) {
                  opts = opts[0];
                  ignoreCase = opts.indexOf('i') != -1;
                  unique = opts.indexOf('u') != -1;
                  var decimal = opts.indexOf('d') != -1 && 1;
    Severity: Critical
    Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

            if (startsBefore ||
                (marker.inclusiveLeft && marker.inclusiveRight || marker.type == "bookmark") &&
                span.from == startCh && (!isInsert || !span.marker.insertLeft)) {
              var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
              (nw || (nw = [])).push({from: span.from,
      Severity: Critical
      Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

        Consider simplifying this complex logical expression.
        Open

            if (tok.type == "string" && (tok.end != pos.ch || !/[\"\']/.test(tok.string.charAt(tok.string.length - 1)) || tok.string.length == 1) ||
                tok.type == "tag" && state.type == "closeTag" ||
                tok.string.indexOf("/") == (tok.string.length - 1) || // match something like <someTagName />
                dontCloseTags && indexOf(dontCloseTags, lowerTagName) > -1)
              return CodeMirror.Pass;
        Severity: Critical
        Found in assets/javascripts/codemirror/addon/edit/closetag.js - About 1 hr to fix

          Function delmarks has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                delmarks: function(cm, params) {
                  if (!params.argString || !params.argString.trim()) {
                    showConfirm(cm, 'Argument required');
                    return;
                  }
          Severity: Minor
          Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

            Function findPosH has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function findPosH(doc, pos, dir, unit, visually) {
                var line = pos.line, ch = pos.ch, origDir = dir;
                var lineObj = getLine(doc, line);
                var possible = true;
                function findNextLine() {
            Severity: Minor
            Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

              Function makeChangeSingleDocInEditor has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function makeChangeSingleDocInEditor(cm, change, spans, selAfter) {
                  var doc = cm.doc, display = cm.display, from = change.from, to = change.to;
              
                  var recomputeMaxLength = false, checkWidthStart = from.line;
                  if (!cm.options.lineWrapping) {
              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

                    for (var i = 0; i < chunk.lines.length; ++i) {
                      var line = chunk.lines[i];
                      if (line == lineObj) break;
                      else h += line.height;
                    }
                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 5137..5141

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

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

                  function buildKeymap(pairs) {
                    var map = {
                      name : "autoCloseBrackets",
                      Backspace: function(cm) {
                        if (cm.somethingSelected()) return CodeMirror.Pass;
                Severity: Minor
                Found in assets/javascripts/codemirror/addon/edit/closebrackets.js - About 1 hr to fix

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

                        for (var i = 0; i < p.children.length; ++i) {
                          var cur = p.children[i];
                          if (cur == chunk) break;
                          else h += cur.height;
                        }
                  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 5131..5135

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

                  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

                          afterTagRemoved: function(event, ui) {
                            var value = ui.tag.children('input:hidden').val();
                            data_source.push(value);
                            if (callback_after_del != undefined) { eval(callback_after_del); }
                          },
                  Severity: Major
                  Found in assets/javascripts/bootstrap/jquery_tag_it_helper.js and 1 other location - About 1 hr to fix
                  assets/javascripts/bootstrap/jquery_tag_it_helper.js on lines 35..39

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

                  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

                          afterTagAdded: function(event, ui) {
                            var value = ui.tag.children('input:hidden').val();
                            data_source.remove(value);
                            if (callback_after_add != undefined) { eval(callback_after_add); }
                          },
                  Severity: Major
                  Found in assets/javascripts/bootstrap/jquery_tag_it_helper.js and 1 other location - About 1 hr to fix
                  assets/javascripts/bootstrap/jquery_tag_it_helper.js on lines 40..44

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

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

                    function buildLineContent(cm, realLine, measure, copyWidgets) {
                      var merged, line = realLine, empty = true;
                      while (merged = collapsedSpanAtStart(line))
                        line = getLine(cm.doc, merged.find().from.line);
                  
                  
                  Severity: Minor
                  Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                    Function onDrop has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function onDrop(e) {
                        var cm = this;
                        if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e) || (cm.options.onDragEvent && cm.options.onDragEvent(cm, addStop(e))))
                          return;
                        e_preventDefault(e);
                    Severity: Minor
                    Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                      Function updateScrollbars has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function updateScrollbars(cm) {
                          var d = cm.display, docHeight = cm.doc.height;
                          var totalHeight = docHeight + paddingVert(d);
                          d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + "px";
                          d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + "px";
                      Severity: Minor
                      Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                        Function findBeginningAndEnd has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            function findBeginningAndEnd(cm, symb, inclusive) {
                              var cur = cm.getCursor();
                              var line = cm.getLine(cur.line);
                              var chars = line.split('');
                              var start, end, i, len;
                        Severity: Minor
                        Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

                          Function updateDoc has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function updateDoc(doc, change, markedSpans, selAfter, estimateHeight) {
                              function spansFor(n) {return markedSpans ? markedSpans[n] : null;}
                              function update(line, text, spans) {
                                updateLine(line, text, spans, estimateHeight);
                                signalLater(line, "change", line, change);
                          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

                                  moveToTopLine: function(cm, motionArgs) {
                                    var line = getUserVisibleLines(cm).top + 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 1240..1243

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language