jbox-web/redmine_bootstrap_kit

View on GitHub

Showing 278 of 361 total issues

Function drawForLine has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    function drawForLine(line, fromArg, toArg) {
      var lineObj = getLine(doc, line);
      var lineLen = lineObj.text.length;
      var start, end;
      function coords(ch, bias) {
Severity: Minor
Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

    Function searchOverlay has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function searchOverlay(query) {
          if (query.source.charAt(0) == '^') {
            var matchSol = true;
          }
          return {
    Severity: Minor
    Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

      Function findMatchingBracket has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function findMatchingBracket(cm, where, strict) {
          var state = cm.state.matchBrackets;
          var maxScanLen = (state && state.maxScanLineLength) || 10000;
          var maxScanLines = (state && state.maxScanLines) || 100;
      
      
      Severity: Minor
      Found in assets/javascripts/codemirror/addon/edit/matchbrackets.js - About 1 hr to fix

        Function update has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function update(cm) {
            var from = cm.getCursor("start"), to = cm.getCursor("end");
            if (cmp(from, to) == 0) return clear(cm);
        
            var array = cm.state.markedSelection;
        Severity: Minor
        Found in assets/javascripts/codemirror/addon/selection/mark-selection.js - About 1 hr to fix

          Function dispatch has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              function dispatch(stream, state) {
                var isPHP = state.curMode == phpMode;
                if (stream.sol() && state.pending != '"') state.pending = null;
                if (!isPHP) {
                  if (stream.match(/^<\?\w*/)) {
          Severity: Minor
          Found in assets/javascripts/codemirror/mode/php/php.js - About 1 hr to fix

            Function applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              , applyPlacement: function(offset, placement){
                  var $tip = this.tip()
                    , width = $tip[0].offsetWidth
                    , height = $tip[0].offsetHeight
                    , actualWidth
            Severity: Minor
            Found in assets/javascripts/bootstrap/bootstrap_tooltip.js - About 1 hr to fix

              Function tokenStringFactory has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function tokenStringFactory(delimiter) {
                      while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
                          delimiter = delimiter.substr(1);
                      }
                      var singleline = delimiter.length == 1;
              Severity: Minor
              Found in assets/javascripts/codemirror/mode/python/python.js - About 1 hr to fix

                Function replace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      replace: function(cm, actionArgs, vim) {
                        var replaceWith = actionArgs.selectedCharacter;
                        var curStart = cm.getCursor();
                        var replaceTo;
                        var curEnd;
                Severity: Minor
                Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

                  Function makeChangeFromHistory has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function makeChangeFromHistory(doc, type) {
                      if (doc.cm && doc.cm.state.suppressEdits) return;
                  
                      var hist = doc.history;
                      var event = (type == "undo" ? hist.done : hist.undone).pop();
                  Severity: Minor
                  Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                    Function dedent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        function dedent(stream, state, type) {
                            type = type || 'py';
                            if (state.scopes.length == 1) return;
                            if (state.scopes[0].type === 'py') {
                                var _indent = stream.indentation();
                    Severity: Minor
                    Found in assets/javascripts/codemirror/mode/python/python.js - About 1 hr to fix

                      Function jumpToMark has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                            jumpToMark: function(cm, motionArgs, vim) {
                              var best = cm.getCursor();
                              for (var i = 0; i < motionArgs.repeat; i++) {
                                var cursor = best;
                                for (var key in vim.marks) {
                      Severity: Minor
                      Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

                        Function addWidget has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            addWidget: function(pos, node, scroll, vert, horiz) {
                              var display = this.display;
                              pos = cursorCoords(this, clipPos(this.doc, pos));
                              var top = pos.bottom, left = pos.left;
                              node.style.position = "absolute";
                        Severity: Minor
                        Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                          Function map has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                map: function(lhs, rhs) {
                                  if (lhs != ':' && lhs.charAt(0) == ':') {
                                    var commandName = lhs.substring(1);
                                    if (rhs != ':' && rhs.charAt(0) == ':') {
                                      // Ex to Ex mapping
                          Severity: Minor
                          Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix

                            Function highlightLine has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function highlightLine(cm, line, state, forceToEnd) {
                                // A styles array always starts with a number identifying the
                                // mode/overlays that it is based on (for easy invalidation).
                                var st = [cm.state.modeGen];
                                // Compute the base array of styles
                            Severity: Minor
                            Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                              Function addToHistory has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function addToHistory(doc, change, selAfter, opId) {
                                  var hist = doc.history;
                                  hist.undone.length = 0;
                                  var time = +new Date, cur = lst(hist.done);
                              
                              
                              Severity: Minor
                              Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                                Function openModalBox has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function openModalBox(element, type) {
                                  var buttons = {};
                                
                                  if (type == 'modal-box') {
                                    var label_save   = $('#modal-box').data('label-save');
                                Severity: Minor
                                Found in assets/javascripts/bootstrap/bootstrap_modal.js - About 1 hr to fix

                                  Function runMode has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  CodeMirror.runMode = function(string, modespec, callback, options) {
                                    var mode = CodeMirror.getMode(CodeMirror.defaults, modespec);
                                    var ie = /MSIE \d/.test(navigator.userAgent);
                                    var ie_lt9 = ie && (document.documentMode == null || document.documentMode < 9);
                                  
                                  
                                  Severity: Minor
                                  Found in assets/javascripts/codemirror/addon/runmode/runmode.js - About 1 hr 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 cursorCoords has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function cursorCoords(cm, pos, context, lineObj, measurement) {
                                      lineObj = lineObj || getLine(cm.doc, pos.line);
                                      if (!measurement) measurement = measureLine(cm, lineObj);
                                      function get(ch, right) {
                                        var m = measureChar(cm, lineObj, ch, measurement, right ? "right" : "left");
                                  Severity: Minor
                                  Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                                    Function updateDisplay has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      function updateDisplay(cm, changes, viewPort, forced) {
                                        var oldFrom = cm.display.showingFrom, oldTo = cm.display.showingTo, updated;
                                        var visible = visibleLines(cm.display, cm.doc, viewPort);
                                        for (var first = true;; first = false) {
                                          var oldWidth = cm.display.scroller.clientWidth;
                                    Severity: Minor
                                    Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

                                      Function enterInsertMode has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                            enterInsertMode: function(cm, actionArgs, vim) {
                                              if (cm.getOption('readOnly')) { return; }
                                              vim.insertMode = true;
                                              vim.insertModeRepeat = actionArgs && actionArgs.repeat || 1;
                                              var insertAt = (actionArgs) ? actionArgs.insertAt : null;
                                      Severity: Minor
                                      Found in assets/javascripts/codemirror/keymap/vim.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language