jbox-web/redmine_bootstrap_kit

View on GitHub

Showing 361 of 361 total issues

Function CodeMirror has a Cognitive Complexity of 3567 (exceeds 5 allowed). Consider refactoring.
Open

window.CodeMirror = (function() {
  "use strict";

  // BROWSER SNIFFING

Severity: Minor
Found in assets/javascripts/codemirror/codemirror.js - About 2 mos to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

window.CodeMirror = (function() {
  "use strict";

  // BROWSER SNIFFING

Severity: Major
Found in assets/javascripts/codemirror/codemirror.js - About 3 wks to fix

    File codemirror.js has 4958 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // CodeMirror version 3.20
    //
    // CodeMirror is the only global var we claim
    window.CodeMirror = (function() {
      "use strict";
    Severity: Major
    Found in assets/javascripts/codemirror/codemirror.js - About 2 wks to fix

      Function Vim has 2825 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var Vim = function() {
          CodeMirror.defineOption('vimMode', false, function(cm, val) {
            if (val) {
              cm.setOption('keyMap', 'vim');
              CodeMirror.signal(cm, "vim-mode-change", {mode: "normal"});
      Severity: Major
      Found in assets/javascripts/codemirror/keymap/vim.js - About 2 wks to fix

        File vim.js has 3082 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * Supported keybindings:
         *
         *   Motion:
         *   h, j, k, l
        Severity: Major
        Found in assets/javascripts/codemirror/keymap/vim.js - About 1 wk to fix

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

            match: function(pattern, consume, caseInsensitive) {
              if (typeof pattern == "string") {
                var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
                var substr = this.string.substr(this.pos, pattern.length);
                if (cased(substr) == cased(pattern)) {
          assets/javascripts/codemirror/codemirror.js on lines 3754..3768

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

          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

              match: function(pattern, consume, caseInsensitive) {
                if (typeof pattern == "string") {
                  var cased = function(str) {return caseInsensitive ? str.toLowerCase() : str;};
                  var substr = this.string.substr(this.pos, pattern.length);
                  if (cased(substr) == cased(pattern)) {
          Severity: Major
          Found in assets/javascripts/codemirror/codemirror.js and 1 other location - About 1 day to fix
          assets/javascripts/codemirror/addon/runmode/runmode-standalone.js on lines 46..60

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

          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

                for (var pos = 0;;) {
                  var idx = text.indexOf("\t", pos);
                  if (idx == -1) {
                    content += text.slice(pos);
                    col += text.length - pos;
          Severity: Major
          Found in assets/javascripts/codemirror/addon/runmode/runmode.js and 1 other location - About 6 hrs to fix
          assets/javascripts/codemirror/addon/runmode/runmode-standalone.js on lines 99..113

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

          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

                for (var pos = 0; ;) {
                  var idx = text.indexOf("\t", pos);
                  if (idx == -1) {
                    content += text.slice(pos);
                    col += text.length - pos;
          assets/javascripts/codemirror/addon/runmode/runmode.js on lines 20..34

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

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

                  _create: function() {
                      // for handling static scoping inside callbacks
                      var that = this;
          
                      // There are 2 kinds of DOM nodes this widget can be instantiated on:
          Severity: Major
          Found in assets/javascripts/bootstrap/jquery_tag_it.js - About 5 hrs to fix

            File jquery_tag_it.js has 396 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
            * jQuery UI Tag-it!
            *
            * @version v2.0 (06/2011)
            *
            Severity: Minor
            Found in assets/javascripts/bootstrap/jquery_tag_it.js - About 5 hrs to fix

              Function evalInput has 127 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    evalInput: function(cm, vim) {
                      // If the motion comand is set, execute both the operator and motion.
                      // Otherwise return.
                      var inputState = vim.inputState;
                      var motion = inputState.motion;
              Severity: Major
              Found in assets/javascripts/codemirror/keymap/vim.js - About 5 hrs to fix

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

                  for (var i = 0, e = lines.length; i < e; ++i) {
                    if (i) callback("\n");
                    var stream = new CodeMirror.StringStream(lines[i]);
                    while (!stream.eol()) {
                      var style = mode.token(stream, state);
                Severity: Major
                Found in assets/javascripts/codemirror/addon/runmode/runmode.js and 1 other location - About 4 hrs to fix
                assets/javascripts/codemirror/addon/runmode/runmode-standalone.js on lines 126..134

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

                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

                  for (var i = 0, e = lines.length; i < e; ++i) {
                    if (i) callback("\n");
                    var stream = new CodeMirror.StringStream(lines[i]);
                    while (!stream.eol()) {
                      var style = mode.token(stream, state);
                assets/javascripts/codemirror/addon/runmode/runmode.js on lines 47..55

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

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

                  function onMouseDown(e) {
                    if (signalDOMEvent(this, e)) return;
                    var cm = this, display = cm.display, doc = cm.doc, sel = doc.sel;
                    sel.shift = e.shiftKey;
                
                
                Severity: Major
                Found in assets/javascripts/codemirror/codemirror.js - About 4 hrs to fix

                  Function registerEventHandlers has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function registerEventHandlers(cm) {
                      var d = cm.display;
                      on(d.scroller, "mousedown", operation(cm, onMouseDown));
                      if (ie)
                        on(d.scroller, "dblclick", operation(cm, function(e) {
                  Severity: Major
                  Found in assets/javascripts/codemirror/codemirror.js - About 4 hrs to fix

                    `` has 31 functions (exceeds 20 allowed). Consider refactoring.
                    Open

                    {
                        def: 'easeOutQuad',
                        swing: function (x, t, b, c, d) {
                            //alert(jQuery.easing.default);
                            return jQuery.easing[jQuery.easing.def](x, t, b, c, d);
                    Severity: Minor
                    Found in assets/javascripts/jquery_file_tree/jquery_easing.js - About 3 hrs to fix

                      File emacs.js has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      (function() {
                        "use strict";
                      
                        var Pos = CodeMirror.Pos;
                        function posEq(a, b) { return a.line == b.line && a.ch == b.ch; }
                      Severity: Minor
                      Found in assets/javascripts/codemirror/keymap/emacs.js - About 3 hrs to fix

                        Function bidiOrdering has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          var bidiOrdering = (function() {
                            // Character types for codepoints 0 to 0xff
                            var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLL";
                            // Character types for codepoints 0x600 to 0x6ff
                            var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmmrrrrrrrrrrrrrrrrrr";
                        Severity: Major
                        Found in assets/javascripts/codemirror/codemirror.js - About 3 hrs to fix

                          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;}
                          assets/javascripts/codemirror/codemirror.js on lines 3724..3729

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language