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

    eat: function(match) {
      var ch = this.string.charAt(this.pos);
      if (typeof match == "string") var ok = ch == match;
      else var ok = ch && (match.test ? match.test(ch) : match(ch));
      if (ok) {++this.pos; return ch;}
Severity: Major
Found in assets/javascripts/codemirror/codemirror.js and 1 other location - About 3 hrs to fix
assets/javascripts/codemirror/addon/runmode/runmode-standalone.js on lines 22..27

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

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

  function tokenBase(stream, state) {
    curPunc = null;
    if (stream.sol() && stream.match("=begin") && stream.eol()) {
      state.tokenize.push(readBlockComment);
      return "comment";
Severity: Major
Found in assets/javascripts/codemirror/mode/ruby/ruby.js - About 3 hrs to fix

    File python.js has 307 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    CodeMirror.defineMode("python", function(conf, parserConf) {
        var ERRORCLASS = 'error';
    
        function wordRegexp(words) {
            return new RegExp("^((" + words.join(")|(") + "))\\b");
    Severity: Minor
    Found in assets/javascripts/codemirror/mode/python/python.js - About 3 hrs to fix

      Function processSearch has 77 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            processSearch: function(cm, vim, command) {
              if (!cm.getSearchCursor) {
                // Search depends on SearchCursor.
                return;
              }
      Severity: Major
      Found in assets/javascripts/codemirror/keymap/vim.js - About 3 hrs to fix

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

              if (style) {
                var sp = node.appendChild(document.createElement("span"));
                sp.className = "cm-" + style.replace(/ +/g, " cm-");
                sp.appendChild(document.createTextNode(content));
              } else {
        assets/javascripts/codemirror/addon/runmode/runmode.js on lines 36..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 96.

        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

              if (style) {
                var sp = node.appendChild(document.createElement("span"));
                sp.className = "cm-" + style.replace(/ +/g, " cm-");
                sp.appendChild(document.createTextNode(content));
              } else {
        Severity: Major
        Found in assets/javascripts/codemirror/addon/runmode/runmode.js and 1 other location - About 3 hrs to fix
        assets/javascripts/codemirror/addon/runmode/runmode-standalone.js on lines 115..121

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

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

            function tokenBase(stream, state) {
                // Handle scope changes
                if (stream.sol()) {
                    var scopeOffset = state.scopes[0].offset;
                    if (stream.eatSpace()) {
        Severity: Major
        Found in assets/javascripts/codemirror/mode/python/python.js - About 3 hrs to fix

          Function doReplace has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function doReplace(cm, confirm, lineStart, lineEnd, searchCursor, query,
                  replaceWith) {
                // Set up all the functions.
                cm.state.vim.exMode = true;
                var done = false;
          Severity: Major
          Found in assets/javascripts/codemirror/keymap/vim.js - About 2 hrs to fix

            Function createTag has 70 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    createTag: function(value, additionalClass, duringInitialization) {
                        var that = this;
            
                        value = $.trim(value);
            
            
            Severity: Major
            Found in assets/javascripts/bootstrap/jquery_tag_it.js - About 2 hrs to fix

              Function updateDisplayInner has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function updateDisplayInner(cm, changes, visible, forced) {
                  var display = cm.display, doc = cm.doc;
                  if (!display.wrapper.clientWidth) {
                    display.showingFrom = display.showingTo = doc.first;
                    display.viewOffset = 0;
              Severity: Major
              Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

                Function sort has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      sort: function(cm, params) {
                        var reverse, ignoreCase, unique, number;
                        function parseArgs() {
                          if (params.argString) {
                            var args = new CodeMirror.StringStream(params.argString);
                Severity: Major
                Found in assets/javascripts/codemirror/keymap/vim.js - About 2 hrs to fix

                  Function buildLineElement has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function buildLineElement(cm, line, lineNo, dims, reuse) {
                      var built = buildLineContent(cm, line), lineElement = built.pre;
                      var markers = line.gutterMarkers, display = cm.display, wrap;
                  
                      var bgClass = built.bgClass ? built.bgClass + " " + (line.bgClass || "") : line.bgClass;
                  Severity: Major
                  Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

                    Function measureLineInner has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function measureLineInner(cm, line) {
                        if (!cm.options.lineWrapping && line.text.length >= cm.options.crudeMeasuringFrom)
                          return crudelyMeasureLine(cm, line);
                    
                        var display = cm.display, measure = emptyArray(line.text.length);
                    Severity: Major
                    Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

                      Function updateSelectionRange has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function updateSelectionRange(cm) {
                          var display = cm.display, doc = cm.doc, sel = cm.doc.sel;
                          var fragment = document.createDocumentFragment();
                          var clientWidth = display.lineSpace.offsetWidth, pl = paddingLeft(cm.display);
                      
                      
                      Severity: Major
                      Found in assets/javascripts/codemirror/codemirror.js - About 2 hrs to fix

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

                            linkedDocs(doc, function(doc, sharedHist) {
                              if (!sharedHist && indexOf(rebased, doc.history) == -1) {
                                rebaseHist(doc.history, change);
                                rebased.push(doc.history);
                              }
                        Severity: Major
                        Found in assets/javascripts/codemirror/codemirror.js and 1 other location - About 2 hrs to fix
                        assets/javascripts/codemirror/codemirror.js on lines 2394..2400

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

                        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 (!forward && wordEnd) {
                                // ge
                                if (!shortCircuit && (firstWord.to != curStart.ch || firstWord.line != curStart.line)) {
                                  // We did not start in the middle of a word. Discard the extra word at the end.
                                  lastWord = words.pop();
                        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 2433..2452

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

                        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 (forward && !wordEnd) {
                                // w
                                if (!shortCircuit && (firstWord.from != curStart.ch || firstWord.line != curStart.line)) {
                                  // We did not start in the middle of a word. Discard the extra word at the end.
                                  lastWord = words.pop();
                        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 2442..2452

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

                        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

                              linkedDocs(doc, function(doc, sharedHist) {
                                if (!sharedHist && indexOf(rebased, doc.history) == -1) {
                                  rebaseHist(doc.history, change);
                                  rebased.push(doc.history);
                                }
                        Severity: Major
                        Found in assets/javascripts/codemirror/codemirror.js and 1 other location - About 2 hrs to fix
                        assets/javascripts/codemirror/codemirror.js on lines 2355..2361

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

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

                            var createCircularJumpList = function() {
                              var size = 100;
                              var pointer = -1;
                              var head = 0;
                              var tail = 0;
                        Severity: Major
                        Found in assets/javascripts/codemirror/keymap/vim.js - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                              if (
                                                  (event.which === $.ui.keyCode.COMMA && event.shiftKey === false) ||
                                                  event.which === $.ui.keyCode.ENTER ||
                                                  (
                                                      event.which == $.ui.keyCode.TAB &&
                          Severity: Critical
                          Found in assets/javascripts/bootstrap/jquery_tag_it.js - About 2 hrs to fix
                            Severity
                            Category
                            Status
                            Source
                            Language