jbox-web/redmine_bootstrap_kit

View on GitHub

Showing 278 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

          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

                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

                          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

                                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
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language