jbox-web/redmine_bootstrap_kit

View on GitHub

Showing 361 of 361 total issues

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

  function highlightWorker(cm) {
    var doc = cm.doc;
    if (doc.frontier < doc.first) doc.frontier = doc.first;
    if (doc.frontier >= cm.display.showingTo) return;
    var end = +new Date + cm.options.workTime;
Severity: Minor
Found in assets/javascripts/codemirror/codemirror.js - About 1 hr to fix

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

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

                                      if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
                              Severity: Major
                              Found in assets/javascripts/jquery_file_tree/jquery_easing.js and 1 other location - About 1 hr to fix
                              assets/javascripts/jquery_file_tree/jquery_easing.js on lines 124..124

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

                              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

                                      return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
                              Severity: Major
                              Found in assets/javascripts/jquery_file_tree/jquery_easing.js and 1 other location - About 1 hr to fix
                              assets/javascripts/jquery_file_tree/jquery_easing.js on lines 138..138

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

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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language