d4l3k/WebSync

View on GitHub
assets/lib/mathquill.js

Summary

Maintainability
F
1 mo
Test Coverage

File mathquill.js has 3762 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * MathQuill: http://mathquill.com
 * by Jay and Han (laughinghan@gmail.com)
 *
 * This Source Code Form is subject to the terms of the
Severity: Major
Found in assets/lib/mathquill.js - About 1 wk to fix

    Function matrix has 292 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    LatexCmds.matrix = P(MathCommand, function(_, super_) {
    
      var MatrixCell = P(MathBlock, function(_, super_) {
        _.init = function (column, row) {
          this.column = column;
    Severity: Major
    Found in assets/lib/mathquill.js - About 1 day to fix

      Function Cursor has 182 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var Cursor = P(Point, function(_) {
        _.init = function(initParent, options) {
          this.parent = initParent;
          this.options = options;
      
      
      Severity: Major
      Found in assets/lib/mathquill.js - About 7 hrs to fix

        Function MathCommand has 160 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        var MathCommand = P(MathElement, function(_, super_) {
          _.init = function(ctrlSeq, htmlTemplate, textTemplate) {
            var cmd = this;
            super_.init.call(cmd);
        
        
        Severity: Major
        Found in assets/lib/mathquill.js - About 6 hrs to fix

          Function Parser has 148 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          var Parser = P(function(_, super_, Parser) {
            // The Parser object is a wrapper for a parser function.
            // Externally, you use one to parse a string by calling
            //   var result = SomeParser.parse('Me Me Me! Parse Me!');
            // You should never call the constructor, rather you should
          Severity: Major
          Found in assets/lib/mathquill.js - About 5 hrs to fix

            Function TextBlock has 130 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            var TextBlock = P(Node, function(_, super_) {
              _.ctrlSeq = '\\text';
            
              _.replaces = function(replacedText) {
                if (replacedText instanceof Fragment)
            Severity: Major
            Found in assets/lib/mathquill.js - About 5 hrs to fix

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

              var Bracket = P(P(MathCommand, DelimsMixin), function(_, super_) {
                _.init = function(side, open, close, ctrlSeq, end) {
                  super_.init.call(this, '\\left'+ctrlSeq, undefined, [open, close]);
                  this.side = side;
                  this.sides = {};
              Severity: Major
              Found in assets/lib/mathquill.js - About 5 hrs to fix

                Function SupSub has 111 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                var SupSub = P(MathCommand, function(_, super_) {
                  _.ctrlSeq = '_{...}^{...}';
                  _.createLeftOf = function(cursor) {
                    if (!cursor[L] && cursor.options.supSubsRequireOperand) return;
                    return super_.createLeftOf.apply(this, arguments);
                Severity: Major
                Found in assets/lib/mathquill.js - About 4 hrs to fix

                  Function saneKeyboardEvents has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var saneKeyboardEvents = (function() {
                    // The following [key values][1] map was compiled from the
                    // [DOM3 Events appendix section on key codes][2] and
                    // [a widely cited report on cross-browser tests of key codes][3],
                    // except for 10: 'Enter', which I've empirically observed in Safari on iOS
                  Severity: Major
                  Found in assets/lib/mathquill.js - About 4 hrs to fix

                    Function keystroke has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      _.keystroke = function(key, e, ctrlr) {
                        var cursor = ctrlr.cursor;
                    
                        switch (key) {
                        case 'Ctrl-Shift-Backspace':
                    Severity: Major
                    Found in assets/lib/mathquill.js - About 3 hrs to fix

                      Function Node has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      var Node = P(function(_) {
                        _[L] = 0;
                        _[R] = 0
                        _.parent = 0;
                      
                      
                      Severity: Major
                      Found in assets/lib/mathquill.js - About 3 hrs to fix

                        Function Fragment has 86 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        var Fragment = P(function(_) {
                          _.init = function(withDir, oppDir, dir) {
                            if (dir === undefined) dir = L;
                            prayDirection(dir);
                        
                        
                        Severity: Major
                        Found in assets/lib/mathquill.js - About 3 hrs to fix

                          Function TextPiece has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          var TextPiece = P(Node, function(_, super_) {
                            _.init = function(text) {
                              super_.init.call(this);
                              this.text = text;
                            };
                          Severity: Major
                          Found in assets/lib/mathquill.js - About 3 hrs to fix

                            Function saneKeyboardEvents has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              return function saneKeyboardEvents(el, handlers) {
                                var keydown = null;
                                var keypress = null;
                            
                                var textarea = jQuery(el);
                            Severity: Major
                            Found in assets/lib/mathquill.js - About 2 hrs to fix

                              Function MathBlock has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              var MathBlock = P(MathElement, function(_, super_) {
                                _.join = function(methodName) {
                                  return this.foldChildren('', function(fold, child) {
                                    return fold + child[methodName]();
                                  });
                              Severity: Major
                              Found in assets/lib/mathquill.js - About 2 hrs to fix

                                Function Letter has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                var Letter = P(Variable, function(_, super_) {
                                  _.init = function(ch) { return super_.init.call(this, this.letter = ch); };
                                  _.createLeftOf = function(cursor) {
                                    var autoCmds = cursor.options.autoCommands, maxLength = autoCmds._maxLength;
                                    if (maxLength > 0) {
                                Severity: Major
                                Found in assets/lib/mathquill.js - About 2 hrs to fix

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

                                  var latexMathParser = (function() {
                                    function commandToBlock(cmd) {
                                      var block = MathBlock();
                                      cmd.adopt(block, 0, 0);
                                      return block;
                                  Severity: Major
                                  Found in assets/lib/mathquill.js - About 2 hrs to fix

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

                                    var EditableField = MathQuill.EditableField = P(AbstractMathQuill, function(_) {
                                      _.initRootAndEvents = function(root, el, opts) {
                                        this.initRoot(root, el, opts);
                                        this.__controller.editable = true;
                                        this.__controller.delegateMouseEvents();
                                    Severity: Major
                                    Found in assets/lib/mathquill.js - About 2 hrs to fix

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

                                      var SummationNotation = P(MathCommand, function(_, super_) {
                                        _.init = function(ch, html) {
                                          var htmlTemplate =
                                            '<span class="mq-large-operator mq-non-leaf">'
                                          +   '<span class="mq-to"><span>&1</span></span>'
                                      Severity: Minor
                                      Found in assets/lib/mathquill.js - About 1 hr to fix

                                        Function AbstractMathQuill has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        var AbstractMathQuill = P(function(_) {
                                          _.init = function() { throw "wtf don't call me, I'm 'abstract'"; };
                                          _.initRoot = function(root, el, opts) {
                                            this.__options = Options();
                                            this.config(opts);
                                        Severity: Minor
                                        Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                          var P = (function(prototype, ownProperty, undefined) {
                                            // helper functions that also help minification
                                            function isObject(o) { return typeof o === 'object'; }
                                            function isFunction(f) { return typeof f === 'function'; }
                                          
                                          
                                          Severity: Minor
                                          Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                              return function P(_superclass /* = Object */, definition) {
                                                // handle the case where no superclass is given
                                                if (definition === undefined) {
                                                  definition = _superclass;
                                                  _superclass = Object;
                                            Severity: Minor
                                            Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                _.unwrapGramp = function() {
                                                  var gramp = this.parent.parent;
                                                  var greatgramp = gramp.parent;
                                                  var rightward = gramp[R];
                                                  var cursor = this;
                                              Severity: Minor
                                              Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                  _.delegateMouseEvents = function() {
                                                    var ultimateRootjQ = this.root.jQ;
                                                    //drag-to-select event handling
                                                    this.container.bind('mousedown.mathquill', function(e) {
                                                      var rootjQ = $(e.target).closest('.mq-root-block');
                                                Severity: Minor
                                                Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                    _.deleteSide = function(side, outward, cursor) {
                                                      var parent = this.parent, sib = this[side], farEnd = parent.ends[side];
                                                  
                                                      if (side === this.side) { // deleting non-ghost of one-sided bracket, unwrap
                                                        this.unwrap();
                                                  Severity: Minor
                                                  Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                      _.relink = function () {
                                                        var allCells = this.jQ.find('td');
                                                        var firstCellBlock = Node.byId[allCells.first().attr(mqBlockId)];
                                                        var lastCellBlock = Node.byId[allCells.last().attr(mqBlockId)];
                                                        var firstRow = allCells.eq(0).closest('tr');
                                                    Severity: Minor
                                                    Found in assets/lib/mathquill.js - About 1 hr to fix

                                                      Function focusBlurEvents has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                      Open

                                                        _.focusBlurEvents = function() {
                                                          var ctrlr = this, root = ctrlr.root, cursor = ctrlr.cursor;
                                                          var blurTimeout;
                                                          ctrlr.textarea.focus(function() {
                                                            ctrlr.blurred = false;
                                                      Severity: Minor
                                                      Found in assets/lib/mathquill.js - About 1 hr to fix

                                                        Function seek has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                          _.seek = function(pageX, cursor) {
                                                            cursor.hide();
                                                            var textPc = fuseChildren(this);
                                                        
                                                            // insert cursor at approx position in DOMTextNode
                                                        Severity: Minor
                                                        Found in assets/lib/mathquill.js - About 1 hr to fix

                                                          Function seek has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                            _.seek = function(pageX, cursor) {
                                                              function getBounds(node) {
                                                                var bounds = {}
                                                                bounds[L] = node.jQ.offset().left;
                                                                bounds[R] = bounds[L] + node.jQ.outerWidth();
                                                          Severity: Minor
                                                          Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                              _.renderLatexText = function(latex) {
                                                                var root = this.root, cursor = this.cursor;
                                                            
                                                                root.jQ.children().slice(1).remove();
                                                                root.eachChild('postOrder', 'dispose');
                                                            Severity: Minor
                                                            Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                _.addBlock = function(block) {
                                                                  if (this.supsub === 'sub') {
                                                                    this.sup = this.upInto = this.sub.upOutOf = block;
                                                                    block.adopt(this, this.sub, 0).downOutOf = this.sub;
                                                                    block.jQ = $('<span class="mq-sup"/>').append(block.jQ.children())
                                                              Severity: Minor
                                                              Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                  _.parser = function() {
                                                                    var regex = Parser.regex, self = this, matrixName = this.getMatrixName(),
                                                                      rgxContents = new RegExp("^(.*?)\\\\end{" + matrixName + "}"),
                                                                      rgxEnd = new RegExp("\\\\end{" + matrixName + "}");
                                                                
                                                                
                                                                Severity: Minor
                                                                Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                    _.select = function() {
                                                                      var anticursor = this.anticursor;
                                                                      if (this[L] === anticursor[L] && this.parent === anticursor.parent) return false;
                                                                  
                                                                      // Find the lowest common ancestor (`lca`), and the ancestor of the cursor
                                                                  Severity: Minor
                                                                  Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                      _.scrollHoriz = function() {
                                                                        var cursor = this.cursor, seln = cursor.selection;
                                                                        var rootRect = this.root.jQ[0].getBoundingClientRect();
                                                                        if (!seln) {
                                                                          var x = cursor.jQ[0].getBoundingClientRect().left;
                                                                    Severity: Minor
                                                                    Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                        _.deleteCell = function (cell) {
                                                                          var row = cell.jQ.closest('tr');
                                                                          var indexInRow = cell.jQ.index();
                                                                          var indexInColumn = row.index();
                                                                          var rowCells = row.find('td').not(cell.jQ);
                                                                      Severity: Minor
                                                                      Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                          _.autoUnItalicize = function(opts) {
                                                                            var autoOps = opts.autoOperatorNames;
                                                                            if (autoOps._maxLength === 0) return;
                                                                            // want longest possible operator names, so join together entire contiguous
                                                                            // sequence of letters
                                                                        Severity: Minor
                                                                        Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                            _.createBlocks = function() {
                                                                              super_.createBlocks.call(this);
                                                                              this.ends[L].focus = function() {
                                                                                this.parent.jQ.addClass('mq-hasCursor');
                                                                                if (this.isEmpty())
                                                                          Severity: Minor
                                                                          Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                              _.contactWeld = function(cursor) {
                                                                                // Look on either side for a SupSub, if one is found compare my
                                                                                // .sub, .sup with its .sub, .sup. If I have one that it doesn't,
                                                                                // then call .addBlock() on it with my block; if I have one that
                                                                                // it also has, then insert my block's children into its block,
                                                                            Severity: Minor
                                                                            Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                                _.html = function() {
                                                                                  // Render the entire math subtree rooted at this command, as HTML.
                                                                                  // Expects .createBlocks() to have been called already, since it uses the
                                                                                  // .blocks array of child blocks.
                                                                                  //
                                                                              Severity: Minor
                                                                              Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                                  _.times = function(min, max) {
                                                                                    if (arguments.length < 2) max = min;
                                                                                    var self = this;
                                                                                
                                                                                    return Parser(function(stream, onSuccess, onFailure) {
                                                                                Severity: Minor
                                                                                Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                                  var Symbol = P(MathCommand, function(_, super_) {
                                                                                    _.init = function(ctrlSeq, html, text) {
                                                                                      if (!text) text = ctrlSeq && ctrlSeq.length > 1 ? ctrlSeq.slice(1) : ctrlSeq;
                                                                                  
                                                                                      super_.init.call(this, ctrlSeq, html, [ text ]);
                                                                                  Severity: Minor
                                                                                  Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                                      _.createLeftOf = function(cursor) {
                                                                                        if (!this.replacedFragment) { // unless wrapping seln in brackets,
                                                                                            // check if next to or inside an opposing one-sided bracket
                                                                                            // (must check both sides 'cos I might be a pipe)
                                                                                          var opts = cursor.options;
                                                                                    Severity: Minor
                                                                                    Found in assets/lib/mathquill.js - About 1 hr to fix

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

                                                                                      var RootMathCommand = P(MathCommand, function(_, super_) {
                                                                                        _.init = function(cursor) {
                                                                                          super_.init.call(this, '$');
                                                                                          this.cursor = cursor;
                                                                                        };
                                                                                      Severity: Minor
                                                                                      Found in assets/lib/mathquill.js - About 1 hr to fix

                                                                                        Consider simplifying this complex logical expression.
                                                                                        Open

                                                                                            if (!this.replacedFragment) {
                                                                                              var leftward = cursor[L];
                                                                                              while (leftward &&
                                                                                                !(
                                                                                                  leftward instanceof BinaryOperator ||
                                                                                        Severity: Major
                                                                                        Found in assets/lib/mathquill.js - About 1 hr to fix

                                                                                          Consider simplifying this complex logical expression.
                                                                                          Open

                                                                                              if (cursor.options.autoSubscriptNumerals
                                                                                                  && cursor.parent !== cursor.parent.parent.sub
                                                                                                  && ((cursor[L] instanceof Variable && cursor[L].isItalic !== false)
                                                                                                      || (cursor[L] instanceof SupSub
                                                                                                          && cursor[L][L] instanceof Variable
                                                                                          Severity: Major
                                                                                          Found in assets/lib/mathquill.js - About 1 hr to fix

                                                                                            Avoid deeply nested control flow statements.
                                                                                            Open

                                                                                                        if (dir === L) children.adopt(dest, dest.ends[R], 0);
                                                                                                        else children.adopt(dest, 0, dest.ends[L]);
                                                                                            Severity: Major
                                                                                            Found in assets/lib/mathquill.js - About 45 mins to fix

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

                                                                                                _.init = function(side, open, close, ctrlSeq, end) {
                                                                                              Severity: Minor
                                                                                              Found in assets/lib/mathquill.js - About 35 mins to fix

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

                                                                                                LatexCmds.iota =
                                                                                                LatexCmds.kappa =
                                                                                                LatexCmds.mu =
                                                                                                LatexCmds.nu =
                                                                                                LatexCmds.xi =
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 5 hrs to fix
                                                                                                assets/lib/mathquill.js on lines 4992..5006

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

                                                                                                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

                                                                                                LatexCmds.Gamma =
                                                                                                LatexCmds.Delta =
                                                                                                LatexCmds.Theta =
                                                                                                LatexCmds.Lambda =
                                                                                                LatexCmds.Xi =
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 5 hrs to fix
                                                                                                assets/lib/mathquill.js on lines 4916..4930

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

                                                                                                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

                                                                                                  _.latex = function(latex) {
                                                                                                    if (arguments.length > 0) {
                                                                                                      this.__controller.renderLatexMath(latex);
                                                                                                      if (this.__controller.blurred) this.__controller.cursor.hide().parent.blur();
                                                                                                      return this;
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 3 hrs to fix
                                                                                                assets/lib/mathquill.js on lines 3061..3068

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

                                                                                                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

                                                                                                  _.latex = function(latex) {
                                                                                                    if (arguments.length > 0) {
                                                                                                      this.__controller.renderLatexText(latex);
                                                                                                      if (this.__controller.blurred) this.__controller.cursor.hide().parent.blur();
                                                                                                      return this;
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 3 hrs to fix
                                                                                                assets/lib/mathquill.js on lines 960..967

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

                                                                                                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

                                                                                                    this.ends[L].focus = function() {
                                                                                                      this.parent.jQ.addClass('mq-hasCursor');
                                                                                                      if (this.isEmpty())
                                                                                                        this.parent.jQ.removeClass('mq-empty');
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 2 hrs to fix
                                                                                                assets/lib/mathquill.js on lines 3092..3098

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

                                                                                                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

                                                                                                    this.ends[L].blur = function() {
                                                                                                      this.parent.jQ.removeClass('mq-hasCursor');
                                                                                                      if (this.isEmpty())
                                                                                                        this.parent.jQ.addClass('mq-empty');
                                                                                                
                                                                                                
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 2 hrs to fix
                                                                                                assets/lib/mathquill.js on lines 3085..3091

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

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

                                                                                                LatexCmds.C =
                                                                                                LatexCmds.complex = LatexCmds.Complex =
                                                                                                LatexCmds.complexes = LatexCmds.Complexes =
                                                                                                LatexCmds.complexplane = LatexCmds.Complexplane = LatexCmds.ComplexPlane =
                                                                                                  bind(VanillaSymbol,'\\mathbb{C}','&#8450;');
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 2 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4406..4410
                                                                                                assets/lib/mathquill.js on lines 4654..4658

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

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

                                                                                                LatexCmds.nsube = LatexCmds.nsubeq =
                                                                                                LatexCmds.notsube = LatexCmds.notsubeq =
                                                                                                LatexCmds.nsubsete = LatexCmds.nsubseteq =
                                                                                                LatexCmds.notsubsete = LatexCmds.notsubseteq =
                                                                                                  bind(BinaryOperator,'\\not\\subseteq ','&#8840;');
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 2 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4440..4444
                                                                                                assets/lib/mathquill.js on lines 4654..4658

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

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

                                                                                                LatexCmds.o = LatexCmds.O =
                                                                                                LatexCmds.empty = LatexCmds.emptyset =
                                                                                                LatexCmds.oslash = LatexCmds.Oslash =
                                                                                                LatexCmds.nothing = LatexCmds.varnothing =
                                                                                                  bind(BinaryOperator,'\\varnothing ','&empty;');
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 2 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4406..4410
                                                                                                assets/lib/mathquill.js on lines 4440..4444

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

                                                                                                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

                                                                                                  _.finalizeTree = function() {
                                                                                                    this.downInto = this.sub = this.ends[L];
                                                                                                    this.sub.upOutOf = insLeftOfMeUnlessAtEnd;
                                                                                                    super_.finalizeTree.call(this);
                                                                                                  };
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 3467..3471

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

                                                                                                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

                                                                                                  _.finalizeTree = function() {
                                                                                                    this.upInto = this.sup = this.ends[R];
                                                                                                    this.sup.downOutOf = insLeftOfMeUnlessAtEnd;
                                                                                                    super_.finalizeTree.call(this);
                                                                                                  };
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 3450..3454

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

                                                                                                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 OPP_BRACKS = {
                                                                                                  '(': ')',
                                                                                                  ')': '(',
                                                                                                  '[': ']',
                                                                                                  ']': '[',
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/display-latex.user.js on lines 181..196

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

                                                                                                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

                                                                                                      else {
                                                                                                        if (overRight > 0) var scrollBy = overRight;
                                                                                                        else if (overLeft < 0) {
                                                                                                          if (rect.right - overLeft > rootRect.right - 20) var scrollBy = overRight;
                                                                                                          else var scrollBy = overLeft;
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 2235..2242

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

                                                                                                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 (seln.ends[L] === cursor[R]) {
                                                                                                        if (overLeft < 0) var scrollBy = overLeft;
                                                                                                        else if (overRight > 0) {
                                                                                                          if (rect.left - overRight < rootRect.left + 20) var scrollBy = overLeft;
                                                                                                          else var scrollBy = overRight;
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 2243..2250

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

                                                                                                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

                                                                                                    if (newBlock) {
                                                                                                      this.cursor = this.cursor || this.parent.cursor;
                                                                                                      this.finalizeTree();
                                                                                                      this.bubble('reflow').cursor.insAtRightEnd(newBlock);
                                                                                                    }
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4280..4284

                                                                                                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

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

                                                                                                    if (newBlock) {
                                                                                                      this.cursor = this.cursor || this.parent.cursor;
                                                                                                      this.finalizeTree();
                                                                                                      this.bubble('reflow').cursor.insAtRightEnd(newBlock);
                                                                                                    }
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4272..4276

                                                                                                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

                                                                                                  pray('rightward is properly set up', (function() {
                                                                                                    // either it's empty and `leftward` is the right end child (possibly empty)
                                                                                                    if (!rightward) return parent.ends[R] === leftward;
                                                                                                
                                                                                                    // or it's there and its [L] and .parent are properly set up
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 404..410

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

                                                                                                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

                                                                                                  pray('leftward is properly set up', (function() {
                                                                                                    // either it's empty and `rightward` is the left end child (possibly empty)
                                                                                                    if (!leftward) return parent.ends[L] === rightward;
                                                                                                
                                                                                                    // or it's there and its [R] and .parent are properly set up
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 412..418

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

                                                                                                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 VanillaSymbol = P(Symbol, function(_, super_) {
                                                                                                  _.init = function(ch, html) {
                                                                                                    super_.init.call(this, ch, '<span>'+(html || ch)+'</span>');
                                                                                                  };
                                                                                                });
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4896..4900

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

                                                                                                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 NonSymbolaSymbol = P(Symbol, function(_, super_) {
                                                                                                  _.init = function(ch, html) {
                                                                                                    super_.init.call(this, ch, '<span class="mq-nonSymbola">'+(html || ch)+'</span>');
                                                                                                  };
                                                                                                });
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 2587..2591

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

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

                                                                                                LatexCmds.nsup = LatexCmds.notsup =
                                                                                                LatexCmds.nsupset = LatexCmds.notsupset =
                                                                                                LatexCmds.nsuperset = LatexCmds.notsuperset =
                                                                                                  bind(BinaryOperator,'\\not\\supset ','&#8837;');
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 2 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4401..4404
                                                                                                assets/lib/mathquill.js on lines 4633..4635

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

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

                                                                                                LatexCmds.supe = LatexCmds.supeq =
                                                                                                LatexCmds.supsete = LatexCmds.supseteq =
                                                                                                LatexCmds.supersete = LatexCmds.superseteq =
                                                                                                  bind(BinaryOperator,'\\supseteq ','&supe;');
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 2 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4393..4396
                                                                                                assets/lib/mathquill.js on lines 4633..4635

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

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

                                                                                                LatexCmds.Im = LatexCmds.imag =
                                                                                                LatexCmds.image = LatexCmds.imagin = LatexCmds.imaginary = LatexCmds.Imaginary =
                                                                                                  bind(VanillaSymbol,'\\Im ','&image;');
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 2 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4393..4396
                                                                                                assets/lib/mathquill.js on lines 4401..4404

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

                                                                                                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

                                                                                                LatexCmds.vmatrix = P(Matrix, function(_, super_) {
                                                                                                  _.ctrlSeq = '\\vmatrix';
                                                                                                
                                                                                                  _.parentheses = {
                                                                                                    left: '|',
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 3 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4304..4311
                                                                                                assets/lib/mathquill.js on lines 4313..4320
                                                                                                assets/lib/mathquill.js on lines 4322..4329

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

                                                                                                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

                                                                                                LatexCmds.Bmatrix = P(Matrix, function(_, super_) {
                                                                                                  _.ctrlSeq = '\\Bmatrix';
                                                                                                
                                                                                                  _.parentheses = {
                                                                                                    left: '{',
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 3 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4304..4311
                                                                                                assets/lib/mathquill.js on lines 4313..4320
                                                                                                assets/lib/mathquill.js on lines 4331..4338

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

                                                                                                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

                                                                                                LatexCmds.pmatrix = P(Matrix, function(_, super_) {
                                                                                                  _.ctrlSeq = '\\pmatrix';
                                                                                                
                                                                                                  _.parentheses = {
                                                                                                    left: '(',
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 3 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4313..4320
                                                                                                assets/lib/mathquill.js on lines 4322..4329
                                                                                                assets/lib/mathquill.js on lines 4331..4338

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

                                                                                                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

                                                                                                LatexCmds.bmatrix = P(Matrix, function(_, super_) {
                                                                                                  _.ctrlSeq = '\\bmatrix';
                                                                                                
                                                                                                  _.parentheses = {
                                                                                                    left: '[',
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 3 other locations - About 1 hr to fix
                                                                                                assets/lib/mathquill.js on lines 4304..4311
                                                                                                assets/lib/mathquill.js on lines 4322..4329
                                                                                                assets/lib/mathquill.js on lines 4331..4338

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

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

                                                                                                    for (var i = 0; i < blocks.length; i += 1) {
                                                                                                      blocks[i].adopt(self, self.ends[R], 0);
                                                                                                    }
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 2 other locations - About 55 mins to fix
                                                                                                assets/lib/mathquill.js on lines 2206..2208
                                                                                                assets/lib/mathquill.js on lines 2317..2319

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

                                                                                                      for (var i = 0; i < commands.length; i += 1) {
                                                                                                        commands[i].adopt(root, root.ends[R], 0);
                                                                                                      }
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 2 other locations - About 55 mins to fix
                                                                                                assets/lib/mathquill.js on lines 2317..2319
                                                                                                assets/lib/mathquill.js on lines 3507..3509

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

                                                                                                      for (var i = 0; i < blocks.length; i += 1) {
                                                                                                        blocks[i].adopt(self, self.ends[R], 0);
                                                                                                      }
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 2 other locations - About 55 mins to fix
                                                                                                assets/lib/mathquill.js on lines 2206..2208
                                                                                                assets/lib/mathquill.js on lines 3507..3509

                                                                                                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 (leftEnd[L]) {
                                                                                                      leftEnd[L][R] = rightEnd[R];
                                                                                                    } else {
                                                                                                      parent.ends[L] = rightEnd[R];
                                                                                                    }
                                                                                                Severity: Minor
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 55 mins to fix
                                                                                                assets/lib/mathquill.js on lines 520..524

                                                                                                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

                                                                                                    if (rightEnd[R]) {
                                                                                                      rightEnd[R][L] = leftEnd[L];
                                                                                                    } else {
                                                                                                      parent.ends[R] = leftEnd[L];
                                                                                                    }
                                                                                                Severity: Minor
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 55 mins to fix
                                                                                                assets/lib/mathquill.js on lines 514..518

                                                                                                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

                                                                                                  _.init = function(parent, leftward, rightward) {
                                                                                                    this.parent = parent;
                                                                                                    this[L] = leftward;
                                                                                                    this[R] = rightward;
                                                                                                  };
                                                                                                Severity: Minor
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 50 mins to fix
                                                                                                assets/lib/MTL.js on lines 7..13

                                                                                                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

                                                                                                  _.join = function(methodName) {
                                                                                                    return this.fold('', function(fold, child) {
                                                                                                      return fold + child[methodName]();
                                                                                                    });
                                                                                                  };
                                                                                                Severity: Minor
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 45 mins to fix
                                                                                                assets/lib/mathquill.js on lines 2606..2610

                                                                                                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

                                                                                                  _.join = function(methodName) {
                                                                                                    return this.foldChildren('', function(fold, child) {
                                                                                                      return fold + child[methodName]();
                                                                                                    });
                                                                                                  };
                                                                                                Severity: Minor
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 45 mins to fix
                                                                                                assets/lib/mathquill.js on lines 840..844

                                                                                                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 (nextCell.length) {
                                                                                                        var nextCellBlock = Node.byId[nextCell.attr(mqBlockId)];
                                                                                                        cellBlock[R] = nextCellBlock;
                                                                                                        nextCellBlock[L] = cellBlock;
                                                                                                      }
                                                                                                Severity: Minor
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 40 mins to fix
                                                                                                assets/lib/mathquill.js on lines 4164..4168

                                                                                                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 (downCell.length) {
                                                                                                        var downCellBlock = Node.byId[downCell.attr(mqBlockId)];
                                                                                                        cellBlock.downOutOf = downCellBlock;
                                                                                                        downCellBlock.upOutOf = cellBlock;
                                                                                                      }
                                                                                                Severity: Minor
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 40 mins to fix
                                                                                                assets/lib/mathquill.js on lines 4151..4155

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

                                                                                                      if (block.ends[R][R].siblingCreated) block.ends[R][R].siblingCreated(cursor.options, L);
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 3 other locations - About 40 mins to fix
                                                                                                assets/lib/mathquill.js on lines 2132..2132
                                                                                                assets/lib/mathquill.js on lines 5018..5018
                                                                                                assets/lib/mathquill.js on lines 5019..5019

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

                                                                                                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

                                                                                                    if (block.ends[L][L].siblingCreated) block.ends[L][L].siblingCreated(cursor.options, R);
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 3 other locations - About 40 mins to fix
                                                                                                assets/lib/mathquill.js on lines 2131..2131
                                                                                                assets/lib/mathquill.js on lines 2132..2132
                                                                                                assets/lib/mathquill.js on lines 5018..5018

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

                                                                                                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

                                                                                                      if (block.ends[L][L].siblingCreated) block.ends[L][L].siblingCreated(cursor.options, R);
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 3 other locations - About 40 mins to fix
                                                                                                assets/lib/mathquill.js on lines 2131..2131
                                                                                                assets/lib/mathquill.js on lines 5018..5018
                                                                                                assets/lib/mathquill.js on lines 5019..5019

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

                                                                                                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

                                                                                                    if (block.ends[R][R].siblingCreated) block.ends[R][R].siblingCreated(cursor.options, L);
                                                                                                Severity: Major
                                                                                                Found in assets/lib/mathquill.js and 3 other locations - About 40 mins to fix
                                                                                                assets/lib/mathquill.js on lines 2131..2131
                                                                                                assets/lib/mathquill.js on lines 2132..2132
                                                                                                assets/lib/mathquill.js on lines 5019..5019

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

                                                                                                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

                                                                                                    case 'Shift-Up':
                                                                                                      if (cursor[L]) {
                                                                                                        while (cursor[L]) ctrlr.selectLeft();
                                                                                                      } else {
                                                                                                        ctrlr.selectLeft();
                                                                                                Severity: Minor
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 35 mins to fix
                                                                                                assets/lib/mathquill.js on lines 1763..1769

                                                                                                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

                                                                                                    case 'Shift-Down':
                                                                                                      if (cursor[R]) {
                                                                                                        while (cursor[R]) ctrlr.selectRight();
                                                                                                      }
                                                                                                      else {
                                                                                                Severity: Minor
                                                                                                Found in assets/lib/mathquill.js and 1 other location - About 35 mins to fix
                                                                                                assets/lib/mathquill.js on lines 1756..1761

                                                                                                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

                                                                                                There are no issues that match your filters.

                                                                                                Category
                                                                                                Status