gopheracademy/gcon

View on GitHub
assets/admin/global/plugins/codemirror/lib/codemirror.js

Summary

Maintainability
F
1 mo
Test Coverage

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

// CodeMirror, copyright (c) by Marijn Haverbeke and others
// Distributed under an MIT license: http://codemirror.net/LICENSE

// This is CodeMirror (http://codemirror.net), a code editor
// implemented in JavaScript on top of the browser's DOM.
Severity: Major
Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 wks to fix

    Function leftButtonSelect has 128 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function leftButtonSelect(cm, e, start, type, addNew) {
        var display = cm.display, doc = cm.doc;
        e_preventDefault(e);
    
        var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges;
    Severity: Major
    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 5 hrs to fix

      Function bidiOrdering has 100 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%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";
          // Character types for codepoints 0x600 to 0x6ff
          var arabicTypes = "rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm";
      Severity: Major
      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 4 hrs to fix

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

          function registerEventHandlers(cm) {
            var d = cm.display;
            on(d.scroller, "mousedown", operation(cm, onMouseDown));
            // Older IE's will not fire a second mousedown for a double click
            if (ie && ie_version < 11)
        Severity: Major
        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 3 hrs to fix

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

              init: function(display) {
                var input = this, cm = input.cm;
                var div = input.div = display.lineDiv;
                div.contentEditable = "true";
                disableBrowserMagic(div);
          Severity: Major
          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

            Function drawSelectionRange has 66 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function drawSelectionRange(cm, range, output) {
                var display = cm.display, doc = cm.doc;
                var fragment = document.createDocumentFragment();
                var padding = paddingH(cm.display), leftSide = padding.left;
                var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;
            Severity: Major
            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

              Function init has 62 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  init: function(display) {
                    var input = this, cm = this.cm;
              
                    // Wraps and hides input textarea
                    var div = this.wrapper = hiddenTextarea();
              Severity: Major
              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

                Function insertLineContent has 60 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function insertLineContent(line, builder, styles) {
                    var spans = line.markedSpans, allText = line.text, at = 0;
                    if (!spans) {
                      for (var i = 1; i < styles.length; i+=2)
                        builder.addToken(builder, allText.slice(at, at = styles[i]), interpretTokenStyle(styles[i+1], builder.cm.options));
                Severity: Major
                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

                  Function onContextMenu has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      onContextMenu: function(e) {
                        var input = this, cm = input.cm, display = cm.display, te = input.textarea;
                        var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop;
                        if (!pos || presto) return; // Opera is difficult.
                  
                  
                  Severity: Major
                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

                    Function regChange has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function regChange(cm, from, to, lendiff) {
                        if (from == null) from = cm.doc.first;
                        if (to == null) to = cm.doc.first + cm.doc.size;
                        if (!lendiff) lendiff = 0;
                    
                    
                    Severity: Major
                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

                      Function buildToken has 55 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function buildToken(builder, text, style, startStyle, endStyle, title, css) {
                          if (!text) return;
                          var displayText = builder.splitSpaces ? text.replace(/ {3,}/g, splitSpaces) : text;
                          var special = builder.cm.state.specialChars, mustWrap = false;
                          if (!special.test(text)) {
                      Severity: Major
                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

                        Function markText has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          function markText(doc, from, to, options, type) {
                            // Shared markers (across linked documents) are handled separately
                            // (markTextShared will call out to this again, once per
                            // document).
                            if (options && options.shared) return markTextShared(doc, from, to, options, type);
                        Severity: Major
                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

                          Function measureCharInner has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            function measureCharInner(cm, prepared, ch, bias) {
                              var place = nodeAndOffsetInLineMap(prepared.map, ch, bias);
                              var node = place.node, start = place.start, end = place.end, collapse = place.collapse;
                          
                              var rect;
                          Severity: Major
                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

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

                              function CodeMirror(place, options) {
                                if (!(this instanceof CodeMirror)) return new CodeMirror(place, options);
                            
                                this.options = options = options ? copyObj(options) : {};
                                // Determine effective options based on given values and defaults.
                            Severity: Major
                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 2 hrs to fix

                              Function Display has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                function Display(place, doc, input) {
                                  var d = this;
                                  this.input = input;
                              
                                  // Covers bottom-right square when both scrollbars are present.
                              Severity: Minor
                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                Function onScrollWheel has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  function onScrollWheel(cm, e) {
                                    var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y;
                                
                                    var display = cm.display, scroll = display.scroller;
                                    // Quit if there's nothing to scroll here
                                Severity: Minor
                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                  Function locateNodeInLineView has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    function locateNodeInLineView(lineView, node, offset) {
                                      var wrapper = lineView.text.firstChild, bad = false;
                                      if (!node || !contains(wrapper, node)) return badPos(Pos(lineNo(lineView.line), 0), true);
                                      if (node == wrapper) {
                                        bad = true;
                                  Severity: Minor
                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                    Function updateDisplayIfNeeded has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      function updateDisplayIfNeeded(cm, update) {
                                        var display = cm.display, doc = cm.doc;
                                    
                                        if (update.editorIsHidden) {
                                          resetView(cm);
                                    Severity: Minor
                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                      Function stretchSpansOverChange has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        function stretchSpansOverChange(doc, change) {
                                          if (change.full) return null;
                                          var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans;
                                          var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans;
                                          if (!oldFirst && !oldLast) return null;
                                      Severity: Minor
                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                        Function indentLine has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          function indentLine(cm, n, how, aggressive) {
                                            var doc = cm.doc, state;
                                            if (how == null) how = "add";
                                            if (how == "smart") {
                                              // Fall back to "prev" when the mode doesn't have an indentation
                                        Severity: Minor
                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                          Function makeChangeSingleDocInEditor has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                                          Open

                                            function makeChangeSingleDocInEditor(cm, change, spans) {
                                              var doc = cm.doc, display = cm.display, from = change.from, to = change.to;
                                          
                                              var recomputeMaxLength = false, checkWidthStart = from.line;
                                              if (!cm.options.lineWrapping) {
                                          Severity: Minor
                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

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

                                              function makeChangeFromHistory(doc, type, allowSelectionOnly) {
                                                if (doc.cm && doc.cm.state.suppressEdits) return;
                                            
                                                var hist = doc.history, event, selAfter = doc.sel;
                                                var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done;
                                            Severity: Minor
                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                              Function fromTextArea has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                              Open

                                                CodeMirror.fromTextArea = function(textarea, options) {
                                                  options = options ? copyObj(options) : {};
                                                  options.value = textarea.value;
                                                  if (!options.tabindex && textarea.tabIndex)
                                                    options.tabindex = textarea.tabIndex;
                                              Severity: Minor
                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                Function onDrop has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                                                Open

                                                  function onDrop(e) {
                                                    var cm = this;
                                                    clearDragCursor(cm);
                                                    if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e))
                                                      return;
                                                Severity: Minor
                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                  Function pollContent has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                  Open

                                                      pollContent: function() {
                                                        var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary();
                                                        var from = sel.from(), to = sel.to();
                                                        if (from.line < display.viewFrom || to.line > display.viewTo - 1) return false;
                                                  
                                                  
                                                  Severity: Minor
                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                    Function skipAtomic has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                                    Open

                                                      function skipAtomic(doc, pos, bias, mayClear) {
                                                        var flipped = false, curPos = pos;
                                                        var dir = bias || 1;
                                                        doc.cantEdit = false;
                                                        search: for (;;) {
                                                    Severity: Minor
                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                      Function findPosH has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                        function findPosH(doc, pos, dir, unit, visually) {
                                                          var line = pos.line, ch = pos.ch, origDir = dir;
                                                          var lineObj = getLine(doc, line);
                                                          var possible = true;
                                                          function findNextLine() {
                                                      Severity: Minor
                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                        Consider simplifying this complex logical expression.
                                                        Open

                                                            if (cm.options.dragDrop && dragAndDrop && !isReadOnly(cm) &&
                                                                type == "single" && (contained = sel.contains(start)) > -1 &&
                                                                (cmp((contained = sel.ranges[contained]).from(), start) < 0 || start.xRel > 0) &&
                                                                (cmp(contained.to(), start) > 0 || start.xRel < 0))
                                                              leftButtonStartDrag(cm, e, start, modifier);
                                                        Severity: Critical
                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                          Consider simplifying this complex logical expression.
                                                          Open

                                                                    if (!(lineNo == from.line && from.ch > span.to ||
                                                                          span.from == null && lineNo != from.line||
                                                                          lineNo == to.line && span.from > to.ch) &&
                                                                        (!filter || filter(span.marker)))
                                                                      found.push(span.marker.parent || span.marker);
                                                          Severity: Critical
                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                            Function updateDoc has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                                            Open

                                                              function updateDoc(doc, change, markedSpans, estimateHeight) {
                                                                function spansFor(n) {return markedSpans ? markedSpans[n] : null;}
                                                                function update(line, text, spans) {
                                                                  updateLine(line, text, spans, estimateHeight);
                                                                  signalLater(line, "change", line, change);
                                                            Severity: Minor
                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                              Function extendTo has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                                                              Open

                                                                  function extendTo(pos) {
                                                                    if (cmp(lastPos, pos) == 0) return;
                                                                    lastPos = pos;
                                                              
                                                                    if (type == "rect") {
                                                              Severity: Minor
                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                Function clear has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                Open

                                                                  TextMarker.prototype.clear = function() {
                                                                    if (this.explicitlyCleared) return;
                                                                    var cm = this.doc.cm, withOp = cm && !cm.curOp;
                                                                    if (withOp) startOperation(cm);
                                                                    if (hasHandler(this, "clear")) {
                                                                Severity: Minor
                                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                  Function domTextBetween has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                  Open

                                                                    function domTextBetween(cm, from, to, fromLine, toLine) {
                                                                      var text = "", closing = false, lineSep = cm.doc.lineSeparator();
                                                                      function recognizeMarker(id) { return function(marker) { return marker.id == id; }; }
                                                                      function walk(node) {
                                                                        if (node.nodeType == 1) {
                                                                  Severity: Minor
                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                    Function updateLineGutter has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                    Open

                                                                      function updateLineGutter(cm, lineView, lineN, dims) {
                                                                        if (lineView.gutter) {
                                                                          lineView.node.removeChild(lineView.gutter);
                                                                          lineView.gutter = null;
                                                                        }
                                                                    Severity: Minor
                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                      Function applyTextInput has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                      Open

                                                                        function applyTextInput(cm, inserted, deleted, sel, origin) {
                                                                          var doc = cm.doc;
                                                                          cm.display.shift = false;
                                                                          if (!sel) sel = doc.sel;
                                                                      
                                                                      
                                                                      Severity: Minor
                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                        Function buildLineContent has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                        Open

                                                                          function buildLineContent(cm, lineView) {
                                                                            // The padding-right forces the element to have a 'border', which
                                                                            // is needed on Webkit to be able to get line-level bounding
                                                                            // rectangles for it (in measureChar).
                                                                            var content = elt("span", null, null, webkit ? "padding-right: .1px" : null);
                                                                        Severity: Minor
                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                          Function patchDisplay has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                          Open

                                                                            function patchDisplay(cm, updateNumbersFrom, dims) {
                                                                              var display = cm.display, lineNumbers = cm.options.lineNumbers;
                                                                              var container = display.lineDiv, cur = container.firstChild;
                                                                          
                                                                              function rm(node) {
                                                                          Severity: Minor
                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                            Function highlightWorker has 34 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.viewTo) return;
                                                                                var end = +new Date + cm.options.workTime;
                                                                            Severity: Minor
                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                              Consider simplifying this complex logical expression.
                                                                              Open

                                                                                    if (fromCmp <= 0 && (cmp(found.to, from) > 0 || (sp.marker.inclusiveRight && marker.inclusiveLeft)) ||
                                                                                        fromCmp >= 0 && (cmp(found.from, to) < 0 || (sp.marker.inclusiveLeft && marker.inclusiveRight)))
                                                                                      return true;
                                                                              Severity: Critical
                                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                Consider simplifying this complex logical expression.
                                                                                Open

                                                                                      if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to &&
                                                                                          (sp.to == null || sp.to != span.from) &&
                                                                                          (sp.marker.inclusiveLeft || span.marker.inclusiveRight) &&
                                                                                          lineIsHiddenInner(doc, line, sp)) return true;
                                                                                Severity: Critical
                                                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                  Consider simplifying this complex logical expression.
                                                                                  Open

                                                                                        if (this.contextMenuPending || !cm.state.focused ||
                                                                                            (hasSelection(input) && !prevInput && !this.composing) ||
                                                                                            isReadOnly(cm) || cm.options.disableInput || cm.state.keySeq)
                                                                                          return false;
                                                                                  Severity: Critical
                                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                    Consider simplifying this complex logical expression.
                                                                                    Open

                                                                                          if (doc.frontier >= cm.display.viewFrom) { // Visible
                                                                                            var oldStyles = line.styles, tooLong = line.text.length > cm.options.maxHighlightLength;
                                                                                            var highlighted = highlightLine(cm, line, tooLong ? copyState(doc.mode, state) : state, true);
                                                                                            line.styles = highlighted.styles;
                                                                                            var oldCls = line.styleClasses, newCls = highlighted.classes;
                                                                                    Severity: Critical
                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                      Consider simplifying this complex logical expression.
                                                                                      Open

                                                                                          if ((hist.lastOp == opId ||
                                                                                               hist.lastOrigin == change.origin && change.origin &&
                                                                                               ((change.origin.charAt(0) == "+" && doc.cm && hist.lastModTime > time - doc.cm.options.historyEventDelay) ||
                                                                                                change.origin.charAt(0) == "*")) &&
                                                                                              (cur = lastChangeEvent(hist, hist.lastOp == opId))) {
                                                                                      Severity: Critical
                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                        Function coordsCharInner has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                        Open

                                                                                          function coordsCharInner(cm, lineObj, lineNo, x, y) {
                                                                                            var innerOff = y - heightAtLine(lineObj);
                                                                                            var wrongLine = false, adjust = 2 * cm.display.wrapper.clientWidth;
                                                                                            var preparedMeasure = prepareMeasureForLine(cm, lineObj);
                                                                                        
                                                                                        
                                                                                        Severity: Minor
                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                          Function runMode has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                          Open

                                                                                            function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {
                                                                                              var flattenSpans = mode.flattenSpans;
                                                                                              if (flattenSpans == null) flattenSpans = cm.options.flattenSpans;
                                                                                              var curStart = 0, curStyle = null;
                                                                                              var stream = new StringStream(text, cm.options.tabSize), style;
                                                                                          Severity: Minor
                                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                            Function onMouseDown has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                            Open

                                                                                              function onMouseDown(e) {
                                                                                                var cm = this, display = cm.display;
                                                                                                if (display.activeTouch && display.input.supportsTouch() || signalDOMEvent(cm, e)) return;
                                                                                                display.shift = e.shiftKey;
                                                                                            
                                                                                            
                                                                                            Severity: Minor
                                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

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

                                                                                                function nodeAndOffsetInLineMap(map, ch, bias) {
                                                                                                  var node, start, end, collapse;
                                                                                                  // First, search the line map for the text node corresponding to,
                                                                                                  // or closest to, the target character.
                                                                                                  for (var i = 0; i < map.length; i += 3) {
                                                                                              Severity: Minor
                                                                                              Found in assets/admin/global/plugins/codemirror/lib/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/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

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

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

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

                                                                                                        poll: function() {
                                                                                                          var cm = this.cm, input = this.textarea, prevInput = this.prevInput;
                                                                                                          // Since this is called a *lot*, try to bail out as cheaply as
                                                                                                          // possible when it is clear that nothing happened. hasSelection
                                                                                                          // will be the case when there is a lot of text in the textarea,
                                                                                                    Severity: Minor
                                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

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

                                                                                                        function endOperation_finish(op) {
                                                                                                          var cm = op.cm, display = cm.display, doc = cm.doc;
                                                                                                      
                                                                                                          if (op.updatedDisplay) postUpdateDisplay(cm, op.update);
                                                                                                      
                                                                                                      
                                                                                                      Severity: Minor
                                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                                        Function addWidget has 31 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/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

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

                                                                                                                function onCopyCut(e) {
                                                                                                                  if (cm.somethingSelected()) {
                                                                                                                    lastCopied = cm.getSelections();
                                                                                                                    if (e.type == "cut") cm.replaceSelection("", null, "cut");
                                                                                                                  } else if (!cm.options.lineWiseCopyCut) {
                                                                                                          Severity: Minor
                                                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

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

                                                                                                                update: function(measure) {
                                                                                                                  var needsH = measure.scrollWidth > measure.clientWidth + 1;
                                                                                                                  var needsV = measure.scrollHeight > measure.clientHeight + 1;
                                                                                                                  var sWidth = measure.nativeBarWidth;
                                                                                                            
                                                                                                            
                                                                                                            Severity: Minor
                                                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

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

                                                                                                                  showPrimarySelection: function() {
                                                                                                                    var sel = window.getSelection(), prim = this.cm.doc.sel.primary();
                                                                                                                    var curAnchor = domToPos(this.cm, sel.anchorNode, sel.anchorOffset);
                                                                                                                    var curFocus = domToPos(this.cm, sel.focusNode, sel.focusOffset);
                                                                                                                    if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
                                                                                                              Severity: Minor
                                                                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

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

                                                                                                                    function walk(node) {
                                                                                                                      if (node.nodeType == 1) {
                                                                                                                        var cmText = node.getAttribute("cm-text");
                                                                                                                        if (cmText != null) {
                                                                                                                          if (cmText == "") cmText = node.textContent.replace(/\u200b/g, "");
                                                                                                                Severity: Minor
                                                                                                                Found in assets/admin/global/plugins/codemirror/lib/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], lineClasses = {};
                                                                                                                      // Compute the base array of styles
                                                                                                                  Severity: Minor
                                                                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

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

                                                                                                                      function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
                                                                                                                        lineObj = lineObj || getLine(cm.doc, pos.line);
                                                                                                                        if (!preparedMeasure) preparedMeasure = prepareMeasureForLine(cm, lineObj);
                                                                                                                        function get(ch, right) {
                                                                                                                          var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight);
                                                                                                                    Severity: Minor
                                                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                                                      Consider simplifying this complex logical expression.
                                                                                                                      Open

                                                                                                                          if (!update.force &&
                                                                                                                              update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&
                                                                                                                              (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&
                                                                                                                              display.renderedView == display.view && countDirtyView(cm) == 0)
                                                                                                                            return false;
                                                                                                                      Severity: Major
                                                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                                                        Consider simplifying this complex logical expression.
                                                                                                                        Open

                                                                                                                              if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) {
                                                                                                                                var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);
                                                                                                                                (nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh,
                                                                                                                                                                      span.to == null ? null : span.to - endCh));
                                                                                                                              }
                                                                                                                        Severity: Major
                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                                                          Consider simplifying this complex logical expression.
                                                                                                                          Open

                                                                                                                                if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) {
                                                                                                                                  var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
                                                                                                                                  (nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to));
                                                                                                                                }
                                                                                                                          Severity: Major
                                                                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 1 hr to fix

                                                                                                                            Function buildToken has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                            Open

                                                                                                                              function buildToken(builder, text, style, startStyle, endStyle, title, css) {
                                                                                                                            Severity: Major
                                                                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 50 mins to fix

                                                                                                                              Function runMode has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                              Open

                                                                                                                                function runMode(cm, text, mode, state, f, lineClasses, forceToEnd) {
                                                                                                                              Severity: Major
                                                                                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 50 mins to fix

                                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                                Open

                                                                                                                                            if (cmp(newPos, curPos) == 0) {
                                                                                                                                              newPos.ch += dir;
                                                                                                                                              if (newPos.ch < 0) {
                                                                                                                                                if (newPos.line > doc.first) newPos = clipPos(doc, Pos(newPos.line - 1));
                                                                                                                                                else newPos = null;
                                                                                                                                Severity: Major
                                                                                                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                  Open

                                                                                                                                            } else if (sp.from > pos && nextChange > sp.from) {
                                                                                                                                              nextChange = sp.from;
                                                                                                                                            }
                                                                                                                                  Severity: Major
                                                                                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                                    Open

                                                                                                                                            if (newGroup) for (var prop in change) if (m = prop.match(/^spans_(\d+)$/)) {
                                                                                                                                              if (indexOf(newGroup, Number(m[1])) > -1) {
                                                                                                                                                lst(newChanges)[prop] = change[prop];
                                                                                                                                                delete change[prop];
                                                                                                                                              }
                                                                                                                                    Severity: Major
                                                                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                                      Open

                                                                                                                                            if (cut) {
                                                                                                                                              display.view = display.view.slice(0, cut.index);
                                                                                                                                              display.viewTo = cut.lineN;
                                                                                                                                            } else {
                                                                                                                                              resetView(cm);
                                                                                                                                      Severity: Major
                                                                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                                        Open

                                                                                                                                                      if (pos < j) order.splice(at, 0, new BidiSpan(1, pos, j));
                                                                                                                                        Severity: Major
                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                                          Open

                                                                                                                                                      if (m.startStyle && sp.from == pos) spanStartStyle += " " + m.startStyle;
                                                                                                                                          Severity: Major
                                                                                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                                            Open

                                                                                                                                                        if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0))
                                                                                                                                                          collapsed = sp;
                                                                                                                                            Severity: Major
                                                                                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                              Avoid deeply nested control flow statements.
                                                                                                                                              Open

                                                                                                                                                          if (!m.atomic) continue;
                                                                                                                                              Severity: Major
                                                                                                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                                                Open

                                                                                                                                                            if (oldCur[k].marker == span.marker) continue spans;
                                                                                                                                                Severity: Major
                                                                                                                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                                  Open

                                                                                                                                                              if (mayClear) {
                                                                                                                                                                signal(m, "beforeCursorEnter");
                                                                                                                                                                if (m.explicitlyCleared) {
                                                                                                                                                                  if (!line.markedSpans) break;
                                                                                                                                                                  else {--i; continue;}
                                                                                                                                                  Severity: Major
                                                                                                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                                                    Open

                                                                                                                                                          if (cutTop && cutBot) {
                                                                                                                                                            display.view = display.view.slice(0, cutTop.index)
                                                                                                                                                              .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN))
                                                                                                                                                              .concat(display.view.slice(cutBot.index));
                                                                                                                                                            display.viewTo += lendiff;
                                                                                                                                                    Severity: Major
                                                                                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                                                      Open

                                                                                                                                                                  if (m.endStyle && sp.to == nextChange) spanEndStyle += " " + m.endStyle;
                                                                                                                                                      Severity: Major
                                                                                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                                                        Open

                                                                                                                                                                    if (sameLine) (first || (first = [])).push(span);
                                                                                                                                                        Severity: Major
                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                                                          Open

                                                                                                                                                                      if (m.title && !title) title = m.title;
                                                                                                                                                          Severity: Major
                                                                                                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                            Avoid deeply nested control flow statements.
                                                                                                                                                            Open

                                                                                                                                                                        if (sp.to != null && sp.to != pos && nextChange > sp.to) {
                                                                                                                                                                          nextChange = sp.to;
                                                                                                                                                                          spanEndStyle = "";
                                                                                                                                                                        }
                                                                                                                                                            Severity: Major
                                                                                                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                              Avoid deeply nested control flow statements.
                                                                                                                                                              Open

                                                                                                                                                                          if (m.css) css = m.css;
                                                                                                                                                              Severity: Major
                                                                                                                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                                Function cursorCoords has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                Open

                                                                                                                                                                  function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) {
                                                                                                                                                                Severity: Minor
                                                                                                                                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                                                                  Open

                                                                                                                                                                              if (m.className) spanStyle += " " + m.className;
                                                                                                                                                                  Severity: Major
                                                                                                                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                                                                    Open

                                                                                                                                                                                  for (++j; j < i && countsAsNum.test(types[j]); ++j) {}
                                                                                                                                                                    Severity: Major
                                                                                                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 45 mins to fix

                                                                                                                                                                      Consider simplifying this complex logical expression.
                                                                                                                                                                      Open

                                                                                                                                                                          if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&
                                                                                                                                                                              (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))
                                                                                                                                                                            return false;
                                                                                                                                                                      Severity: Major
                                                                                                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 40 mins to fix

                                                                                                                                                                        Consider simplifying this complex logical expression.
                                                                                                                                                                        Open

                                                                                                                                                                            if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) return;
                                                                                                                                                                        Severity: Major
                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 40 mins to fix

                                                                                                                                                                          Consider simplifying this complex logical expression.
                                                                                                                                                                          Open

                                                                                                                                                                              else if (unit == "word" || unit == "group") {
                                                                                                                                                                                var sawType = null, group = unit == "group";
                                                                                                                                                                                var helper = doc.cm && doc.cm.getHelper(pos, "wordChars");
                                                                                                                                                                                for (var first = true;; first = false) {
                                                                                                                                                                                  if (dir < 0 && !moveOnce(!first)) break;
                                                                                                                                                                          Severity: Major
                                                                                                                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 40 mins to fix

                                                                                                                                                                            Consider simplifying this complex logical expression.
                                                                                                                                                                            Open

                                                                                                                                                                                  if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad &&
                                                                                                                                                                                      cmp(minPos(curAnchor, curFocus), prim.from()) == 0 &&
                                                                                                                                                                                      cmp(maxPos(curAnchor, curFocus), prim.to()) == 0)
                                                                                                                                                                                    return;
                                                                                                                                                                            Severity: Major
                                                                                                                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 40 mins to fix

                                                                                                                                                                              Consider simplifying this complex logical expression.
                                                                                                                                                                              Open

                                                                                                                                                                                  if (opId == hist.lastSelOp ||
                                                                                                                                                                                      (origin && hist.lastSelOrigin == origin &&
                                                                                                                                                                                       (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin ||
                                                                                                                                                                                        selectionEventCanBeMerged(doc, origin, lst(hist.done), sel))))
                                                                                                                                                                                    hist.done[hist.done.length - 1] = sel;
                                                                                                                                                                              Severity: Major
                                                                                                                                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 40 mins to fix

                                                                                                                                                                                Consider simplifying this complex logical expression.
                                                                                                                                                                                Open

                                                                                                                                                                                    if (style || startStyle || endStyle || mustWrap || css) {
                                                                                                                                                                                      var fullStyle = style || "";
                                                                                                                                                                                      if (startStyle) fullStyle += startStyle;
                                                                                                                                                                                      if (endStyle) fullStyle += endStyle;
                                                                                                                                                                                      var token = elt("span", [content], fullStyle, css);
                                                                                                                                                                                Severity: Major
                                                                                                                                                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 40 mins to fix

                                                                                                                                                                                  Consider simplifying this complex logical expression.
                                                                                                                                                                                  Open

                                                                                                                                                                                            } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) {
                                                                                                                                                                                              if (sp.to != null && sp.to != pos && nextChange > sp.to) {
                                                                                                                                                                                                nextChange = sp.to;
                                                                                                                                                                                                spanEndStyle = "";
                                                                                                                                                                                              }
                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 40 mins to fix

                                                                                                                                                                                    Consider simplifying this complex logical expression.
                                                                                                                                                                                    Open

                                                                                                                                                                                          if (display.wheelStartX == null) {
                                                                                                                                                                                            display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop;
                                                                                                                                                                                            display.wheelDX = dx; display.wheelDY = dy;
                                                                                                                                                                                            setTimeout(function() {
                                                                                                                                                                                              if (display.wheelStartX == null) return;
                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 40 mins to fix

                                                                                                                                                                                      Consider simplifying this complex logical expression.
                                                                                                                                                                                      Open

                                                                                                                                                                                          if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) {
                                                                                                                                                                                            var rSpan = node.parentNode.getClientRects()[0];
                                                                                                                                                                                            if (rSpan)
                                                                                                                                                                                              rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom};
                                                                                                                                                                                            else
                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 40 mins to fix

                                                                                                                                                                                        Function calculateScrollPos has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                        Open

                                                                                                                                                                                          function calculateScrollPos(cm, x1, y1, x2, y2) {
                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                          Function gutterEvent has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                          Open

                                                                                                                                                                                            function gutterEvent(cm, e, type, prevent, signalfn) {
                                                                                                                                                                                          Severity: Minor
                                                                                                                                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                            Function findPosH has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                            Open

                                                                                                                                                                                              function findPosH(doc, pos, dir, unit, visually) {
                                                                                                                                                                                            Severity: Minor
                                                                                                                                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                              Function leftButtonSelect has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                              Open

                                                                                                                                                                                                function leftButtonSelect(cm, e, start, type, addNew) {
                                                                                                                                                                                              Severity: Minor
                                                                                                                                                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                Function replaceRange has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                Open

                                                                                                                                                                                                  function replaceRange(doc, code, from, to, origin) {
                                                                                                                                                                                                Severity: Minor
                                                                                                                                                                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                  Function markTextShared has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                  Open

                                                                                                                                                                                                    function markTextShared(doc, from, to, options, type) {
                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                    Function countColumn has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                    Open

                                                                                                                                                                                                      var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) {
                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                      Function domTextBetween has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                      Open

                                                                                                                                                                                                        function domTextBetween(cm, from, to, fromLine, toLine) {
                                                                                                                                                                                                      Severity: Minor
                                                                                                                                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                        Function markText has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                        Open

                                                                                                                                                                                                          function markText(doc, from, to, options, type) {
                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                          Function conflictingCollapsedRange has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                          Open

                                                                                                                                                                                                            function conflictingCollapsedRange(doc, lineNo, from, to, marker) {
                                                                                                                                                                                                          Severity: Minor
                                                                                                                                                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                            Function insertLineWidgetsFor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                            Open

                                                                                                                                                                                                              function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) {
                                                                                                                                                                                                            Severity: Minor
                                                                                                                                                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                              Function charCoords has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                              Open

                                                                                                                                                                                                                function charCoords(cm, pos, context, lineObj, bias) {
                                                                                                                                                                                                              Severity: Minor
                                                                                                                                                                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                                Function scrollIntoView has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                                Open

                                                                                                                                                                                                                  function scrollIntoView(cm, x1, y1, x2, y2) {
                                                                                                                                                                                                                Severity: Minor
                                                                                                                                                                                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                                  Function coordsCharInner has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                    function coordsCharInner(cm, lineObj, lineNo, x, y) {
                                                                                                                                                                                                                  Severity: Minor
                                                                                                                                                                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                                    Function addWidget has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                                    Open

                                                                                                                                                                                                                        addWidget: function(pos, node, scroll, vert, horiz) {
                                                                                                                                                                                                                    Severity: Minor
                                                                                                                                                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                                      Function applyTextInput has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                                      Open

                                                                                                                                                                                                                        function applyTextInput(cm, inserted, deleted, sel, origin) {
                                                                                                                                                                                                                      Severity: Minor
                                                                                                                                                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                                        Function measureCharPrepared has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                          function measureCharPrepared(cm, prepared, ch, bias, varHeight) {
                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 35 mins to fix

                                                                                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                                                                                          Open

                                                                                                                                                                                                                                else if (0x2000 <= code && code <= 0x200b) return "w";
                                                                                                                                                                                                                          Severity: Major
                                                                                                                                                                                                                          Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 30 mins to fix

                                                                                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                                                                                            Open

                                                                                                                                                                                                                                  else return "L";
                                                                                                                                                                                                                            Severity: Major
                                                                                                                                                                                                                            Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 30 mins to fix

                                                                                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                                                                                              Open

                                                                                                                                                                                                                                    return true;
                                                                                                                                                                                                                              Severity: Major
                                                                                                                                                                                                                              Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 30 mins to fix

                                                                                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                                                                                Open

                                                                                                                                                                                                                                      else if (code == 0x200c) return "b";
                                                                                                                                                                                                                                Severity: Major
                                                                                                                                                                                                                                Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 30 mins to fix

                                                                                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                                                                                  Open

                                                                                                                                                                                                                                          if (result) return result;
                                                                                                                                                                                                                                  Severity: Major
                                                                                                                                                                                                                                  Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 30 mins to fix

                                                                                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                                                                                    Open

                                                                                                                                                                                                                                            return badPos(Pos(found.line, found.ch + dist), bad);
                                                                                                                                                                                                                                    Severity: Major
                                                                                                                                                                                                                                    Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 30 mins to fix

                                                                                                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                                                                                                      Open

                                                                                                                                                                                                                                              if (!part) return null;
                                                                                                                                                                                                                                      Severity: Major
                                                                                                                                                                                                                                      Found in assets/admin/global/plugins/codemirror/lib/codemirror.js - About 30 mins to fix

                                                                                                                                                                                                                                        FIXME found
                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                            // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems

                                                                                                                                                                                                                                        FIXME found
                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                              } else if (!end) { // FIXME dangerously hacky

                                                                                                                                                                                                                                        FIXME found
                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                            throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME

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

                                                                                                                                                                                                                                          StringStream.prototype = {
                                                                                                                                                                                                                                            eol: function() {return this.pos >= this.string.length;},
                                                                                                                                                                                                                                            sol: function() {return this.pos == this.lineStart;},
                                                                                                                                                                                                                                            peek: function() {return this.string.charAt(this.pos) || undefined;},
                                                                                                                                                                                                                                            next: function() {
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 5 days to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/addon/runmode/runmode.node.js on lines 33..95

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          CodeMirror.getMode = function(options, spec) {
                                                                                                                                                                                                                                            var spec = CodeMirror.resolveMode(spec);
                                                                                                                                                                                                                                            var mfactory = modes[spec.name];
                                                                                                                                                                                                                                            if (!mfactory) return CodeMirror.getMode(options, "text/plain");
                                                                                                                                                                                                                                            var modeObj = mfactory(options, spec);
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 day to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/addon/runmode/runmode.node.js on lines 141..160

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          var countColumn = CodeMirror.countColumn = function(string, end, tabSize, startIndex, startValue) {
                                                                                                                                                                                                                                            if (end == null) {
                                                                                                                                                                                                                                              end = string.search(/[^\s\u00a0]/);
                                                                                                                                                                                                                                              if (end == -1) end = string.length;
                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 6 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/addon/runmode/runmode.node.js on lines 10..23

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          function elt(tag, content, className, style) {
                                                                                                                                                                                                                                            var e = document.createElement(tag);
                                                                                                                                                                                                                                            if (className) e.className = className;
                                                                                                                                                                                                                                            if (style) e.style.cssText = style;
                                                                                                                                                                                                                                            if (typeof content == "string") e.appendChild(document.createTextNode(content));
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 5 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/addon/merge/merge.js on lines 695..702

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          keyMap.emacsy = {
                                                                                                                                                                                                                                            "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown",
                                                                                                                                                                                                                                            "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd",
                                                                                                                                                                                                                                            "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore",
                                                                                                                                                                                                                                            "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars"
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 5712..5719

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          keyMap.basic = {
                                                                                                                                                                                                                                            "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown",
                                                                                                                                                                                                                                            "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown",
                                                                                                                                                                                                                                            "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore",
                                                                                                                                                                                                                                            "Tab": "defaultTab", "Shift-Tab": "indentAuto",
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 5734..5739

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

                                                                                                                                                                                                                                        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/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 4399..4405

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

                                                                                                                                                                                                                                        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/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 4335..4341

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          function copyObj(obj, target, overwrite) {
                                                                                                                                                                                                                                            if (!target) target = {};
                                                                                                                                                                                                                                            for (var prop in obj)
                                                                                                                                                                                                                                              if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop)))
                                                                                                                                                                                                                                                target[prop] = obj[prop];
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/addon/runmode/runmode.node.js on lines 125..131

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          var StringStream = CodeMirror.StringStream = function(string, tabSize) {
                                                                                                                                                                                                                                            this.pos = this.start = 0;
                                                                                                                                                                                                                                            this.string = string;
                                                                                                                                                                                                                                            this.tabSize = tabSize || 8;
                                                                                                                                                                                                                                            this.lastColumnPos = this.lastColumnValue = 0;
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/addon/runmode/runmode.node.js on lines 25..31

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

                                                                                                                                                                                                                                        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 (sizes.right && sizes.bottom) {
                                                                                                                                                                                                                                              d.scrollbarFiller.style.display = "block";
                                                                                                                                                                                                                                              d.scrollbarFiller.style.height = sizes.bottom + "px";
                                                                                                                                                                                                                                              d.scrollbarFiller.style.width = sizes.right + "px";
                                                                                                                                                                                                                                            } else d.scrollbarFiller.style.display = "";
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 536..540

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

                                                                                                                                                                                                                                        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 (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {
                                                                                                                                                                                                                                              d.gutterFiller.style.display = "block";
                                                                                                                                                                                                                                              d.gutterFiller.style.height = sizes.bottom + "px";
                                                                                                                                                                                                                                              d.gutterFiller.style.width = measure.gutterWidth + "px";
                                                                                                                                                                                                                                            } else d.gutterFiller.style.display = "";
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 2 hrs to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 531..535

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                              for (var i = 0; i < p.children.length; ++i) {
                                                                                                                                                                                                                                                var cur = p.children[i];
                                                                                                                                                                                                                                                if (cur == chunk) break;
                                                                                                                                                                                                                                                else h += cur.height;
                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 7781..7785

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                            for (var i = 0; i < chunk.lines.length; ++i) {
                                                                                                                                                                                                                                              var line = chunk.lines[i];
                                                                                                                                                                                                                                              if (line == lineObj) break;
                                                                                                                                                                                                                                              else h += line.height;
                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 7787..7791

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

                                                                                                                                                                                                                                        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 (scrollPos.scrollTop != null) {
                                                                                                                                                                                                                                                setScrollTop(cm, scrollPos.scrollTop);
                                                                                                                                                                                                                                                if (Math.abs(cm.doc.scrollTop - startTop) > 1) changed = true;
                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 4564..4567

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

                                                                                                                                                                                                                                        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 (scrollPos.scrollLeft != null) {
                                                                                                                                                                                                                                                setScrollLeft(cm, scrollPos.scrollLeft);
                                                                                                                                                                                                                                                if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) changed = true;
                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 4560..4563

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

                                                                                                                                                                                                                                        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 (top != null)
                                                                                                                                                                                                                                              cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top;
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 4616..4617

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

                                                                                                                                                                                                                                        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 (left != null)
                                                                                                                                                                                                                                              cm.curOp.scrollLeft = (cm.curOp.scrollLeft == null ? cm.doc.scrollLeft : cm.curOp.scrollLeft) + left;
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 4618..4619

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

                                                                                                                                                                                                                                        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 (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)
                                                                                                                                                                                                                                                  start = leftPos;
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 2345..2346

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10,
                                                                                                                                                                                                                                                                                    headPos.top + lineOff.top - wrapOff.top));
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 1313..1314

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

                                                                                                                                                                                                                                        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 (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)
                                                                                                                                                                                                                                                  end = rightPos;
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 2343..2344

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10,
                                                                                                                                                                                                                                                                                     headPos.left + lineOff.left - wrapOff.left));
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 1311..1312

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          CodeMirror.extendMode = function(mode, properties) {
                                                                                                                                                                                                                                            var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {});
                                                                                                                                                                                                                                            copyObj(properties, exts);
                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 1 hr to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/addon/runmode/runmode.node.js on lines 136..139

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

                                                                                                                                                                                                                                        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 (dto > 0 || !mk.inclusiveRight && !dto)
                                                                                                                                                                                                                                                  newParts.push({from: m.to, to: p.to});
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 55 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6427..6428

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

                                                                                                                                                                                                                                        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 (dfrom < 0 || !mk.inclusiveLeft && !dfrom)
                                                                                                                                                                                                                                                  newParts.push({from: p.from, to: m.from});
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 55 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6429..6430

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

                                                                                                                                                                                                                                        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 (spans) for (var i = 0; i < spans.length; ++i) {
                                                                                                                                                                                                                                              var span = spans[i];
                                                                                                                                                                                                                                              if (span.marker == marker) return span;
                                                                                                                                                                                                                                            }
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 55 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/flot/jquery.flot.pie.js on lines 719..723

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                              for (var i = 0; i < hist.undone.length; i++) if (!hist.undone[i].ranges) ++undone;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 50 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 7471..7471

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                              for (var i = 0; i < hist.done.length; i++) if (!hist.done[i].ranges) ++done;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 50 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 7472..7472

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                setScrollTop(cm, Math.max(0, Math.min(scroll.scrollTop + dy * wheelPixelsPerUnit, scroll.scrollHeight - scroll.clientHeight)));
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 3984..3984

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

                                                                                                                                                                                                                                        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 (cm.display.shift || doc.extend)
                                                                                                                                                                                                                                                ourRange = extendRange(doc, ourRange, word.anchor, word.head);
                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                ourRange = word;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 3651..3654

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                              setScrollLeft(cm, Math.max(0, Math.min(scroll.scrollLeft + dx * wheelPixelsPerUnit, scroll.scrollWidth - scroll.clientWidth)));
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 3983..3983

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          var e_stopPropagation = CodeMirror.e_stopPropagation = function(e) {
                                                                                                                                                                                                                                            if (e.stopPropagation) e.stopPropagation();
                                                                                                                                                                                                                                            else e.cancelBubble = true;
                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 8053..8056

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                          var e_preventDefault = CodeMirror.e_preventDefault = function(e) {
                                                                                                                                                                                                                                            if (e.preventDefault) e.preventDefault();
                                                                                                                                                                                                                                            else e.returnValue = false;
                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 8057..8060

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

                                                                                                                                                                                                                                        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 (cm.display.shift || doc.extend)
                                                                                                                                                                                                                                                ourRange = extendRange(doc, ourRange, line.anchor, line.head);
                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                ourRange = line;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 45 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 3645..3648

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                            var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 903..903

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                            var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 4599..4599

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                            var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 4587..4587

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                            var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 40 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 950..950

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

                                                                                                                                                                                                                                        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 ((sp.from == null || (m.inclusiveLeft ? sp.from <= curPos.ch : sp.from < curPos.ch)) &&
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 2219..2219

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                                      (sp.to == null || (m.inclusiveRight ? sp.to >= curPos.ch : sp.to > curPos.ch))) {
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 2218..2218

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

                                                                                                                                                                                                                                        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 (needsV) {
                                                                                                                                                                                                                                                this.vert.style.display = "block";
                                                                                                                                                                                                                                                this.vert.style.bottom = needsH ? sWidth + "px" : "0";
                                                                                                                                                                                                                                                var totalHeight = measure.viewHeight - (needsH ? sWidth : 0);
                                                                                                                                                                                                                                                // A bug in IE8 can cause this value to be negative, so guard it.
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 434..444

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

                                                                                                                                                                                                                                        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 (needsH) {
                                                                                                                                                                                                                                                this.horiz.style.display = "block";
                                                                                                                                                                                                                                                this.horiz.style.right = needsV ? sWidth + "px" : "0";
                                                                                                                                                                                                                                                this.horiz.style.left = measure.barLeft + "px";
                                                                                                                                                                                                                                                var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0);
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 35 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 422..432

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

                                                                                                                                                                                                                                        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 4 locations. Consider refactoring.
                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                              var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh);
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 3 other locations - About 30 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6286..6286
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6295..6295
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6297..6297

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

                                                                                                                                                                                                                                        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 4 locations. Consider refactoring.
                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                                var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh);
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 3 other locations - About 30 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6284..6284
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6295..6295
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6297..6297

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

                                                                                                                                                                                                                                        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 4 locations. Consider refactoring.
                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                              var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh);
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 3 other locations - About 30 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6284..6284
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6286..6286
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6297..6297

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

                                                                                                                                                                                                                                        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 4 locations. Consider refactoring.
                                                                                                                                                                                                                                        Open

                                                                                                                                                                                                                                                var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh);
                                                                                                                                                                                                                                        Severity: Major
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 3 other locations - About 30 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6284..6284
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6286..6286
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 6295..6295

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

                                                                                                                                                                                                                                        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 (found)
                                                                                                                                                                                                                                                return badPos(Pos(found.line, found.ch + dist), bad);
                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                dist += after.textContent.length;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 30 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 1917..1920

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

                                                                                                                                                                                                                                        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 (found)
                                                                                                                                                                                                                                                return badPos(Pos(found.line, found.ch - dist), bad);
                                                                                                                                                                                                                                              else
                                                                                                                                                                                                                                                dist += after.textContent.length;
                                                                                                                                                                                                                                        Severity: Minor
                                                                                                                                                                                                                                        Found in assets/admin/global/plugins/codemirror/lib/codemirror.js and 1 other location - About 30 mins to fix
                                                                                                                                                                                                                                        assets/admin/global/plugins/codemirror/lib/codemirror.js on lines 1924..1927

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

                                                                                                                                                                                                                                        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

                                                                                                                                                                                                                                        There are no issues that match your filters.

                                                                                                                                                                                                                                        Category
                                                                                                                                                                                                                                        Status