angelakuo/citydogshare

View on GitHub
public/assets/coffee-script-fa18d8dbf4c27c69f9d47bba7692b38a18dc2ce3fe2f10421cf4950551851c62.js

Summary

Maintainability
F
2 mos
Test Coverage

Function CoffeeScript has 5948 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var CoffeeScript = function() {
    function require(path){ return require[path]; }
    require['./helpers'] = (function() {
  var exports = {}, module = {exports: exports};
  // Generated by CoffeeScript 1.10.0

    File coffee-script-fa18d8dbf4c27c69f9d47bba7692b38a18dc2ce3fe2f10421cf4950551851c62.js has 5972 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * CoffeeScript Compiler v1.10.0
     * http://coffeescript.org
     *
     * Copyright 2011, Jeremy Ashkenas

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

      var parser = (function(){
      var o=function(k,v,o,l){for(o=o||{},l=k.length;l--;o[k[l]]=v);return o},$V0=[1,20],$V1=[1,75],$V2=[1,71],$V3=[1,76],$V4=[1,77],$V5=[1,73],$V6=[1,74],$V7=[1,50],$V8=[1,52],$V9=[1,53],$Va=[1,54],$Vb=[1,55],$Vc=[1,45],$Vd=[1,46],$Ve=[1,27],$Vf=[1,60],$Vg=[1,61],$Vh=[1,70],$Vi=[1,43],$Vj=[1,26],$Vk=[1,58],$Vl=[1,59],$Vm=[1,57],$Vn=[1,38],$Vo=[1,44],$Vp=[1,56],$Vq=[1,65],$Vr=[1,66],$Vs=[1,67],$Vt=[1,68],$Vu=[1,42],$Vv=[1,64],$Vw=[1,29],$Vx=[1,30],$Vy=[1,31],$Vz=[1,32],$VA=[1,33],$VB=[1,34],$VC=[1,35],$VD=[1,78],$VE=[1,6,26,34,109],$VF=[1,88],$VG=[1,81],$VH=[1,80],$VI=[1,79],$VJ=[1,82],$VK=[1,83],$VL=[1,84],$VM=[1,85],$VN=[1,86],$VO=[1,87],$VP=[1,91],$VQ=[1,6,25,26,34,56,61,64,80,85,93,98,100,109,111,112,113,117,118,133,136,137,142,143,144,145,146,147,148],$VR=[1,97],$VS=[1,98],$VT=[1,99],$VU=[1,100],$VV=[1,102],$VW=[1,103],$VX=[1,96],$VY=[2,115],$VZ=[1,6,25,26,34,56,61,64,73,74,75,76,78,80,81,85,91,92,93,98,100,109,111,112,113,117,118,133,136,137,142,143,144,145,146,147,148],$V_=[2,82],$V$=[1,108],$V01=[2,61],$V11=[1,112],$V21=[1,117],$V31=[1,118],$V41=[1,120],$V51=[1,6,25,26,34,46,56,61,64,73,74,75,76,78,80,81,85,91,92,93,98,100,109,111,112,113,117,118,133,136,137,142,143,144,145,146,147,148],$V61=[2,79],$V71=[1,6,26,34,56,61,64,80,85,93,98,100,109,111,112,113,117,118,133,136,137,142,143,144,145,146,147,148],$V81=[1,155],$V91=[1,157],$Va1=[1,152],$Vb1=[1,6,25,26,34,46,56,61,64,73,74,75,76,78,80,81,85,87,91,92,93,98,100,109,111,112,113,117,118,133,136,137,140,141,142,143,144,145,146,147,148,149],$Vc1=[2,98],$Vd1=[1,6,25,26,34,49,56,61,64,73,74,75,76,78,80,81,85,91,92,93,98,100,109,111,112,113,117,118,133,136,137,142,143,144,145,146,147,148],$Ve1=[1,6,25,26,34,46,49,56,61,64,73,74,75,76,78,80,81,85,87,91,92,93,98,100,109,111,112,113,117,118,124,125,133,136,137,140,141,142,143,144,145,146,147,148,149],$Vf1=[1,207],$Vg1=[1,206],$Vh1=[1,6,25,26,34,38,56,61,64,73,74,75,76,78,80,81,85,91,92,93,98,100,109,111,112,113,117,118,133,136,137,142,143,144,145,146,147,148],$Vi1=[2,59],$Vj1=[1,217],$Vk1=[6,25,26,56,61],$Vl1=[6,25,26,46,56,61,64],$Vm1=[1,6,25,26,34,56,61,64,80,85,93,98,100,109,111,112,113,117,118,133,136,137,143,145,146,147,148],$Vn1=[1,6,25,26,34,56,61,64,80,85,93,98,100,109,111,112,113,117,118,133],$Vo1=[73,74,75,76,78,81,91,92],$Vp1=[1,236],$Vq1=[2,136],$Vr1=[1,6,25,26,34,46,56,61,64,73,74,75,76,78,80,81,85,91,92,93,98,100,109,111,112,113,117,118,124,125,133,136,137,142,143,144,145,146,147,148],$Vs1=[1,245],$Vt1=[6,25,26,61,93,98],$Vu1=[1,6,25,26,34,56,61,64,80,85,93,98,100,109,118,133],$Vv1=[1,6,25,26,34,56,61,64,80,85,93,98,100,109,112,118,133],$Vw1=[124,125],$Vx1=[61,124,125],$Vy1=[1,256],$Vz1=[6,25,26,61,85],$VA1=[6,25,26,49,61,85],$VB1=[6,25,26,46,49,61,85],$VC1=[1,6,25,26,34,56,61,64,80,85,93,98,100,109,111,112,113,117,118,133,136,137,145,146,147,148],$VD1=[11,28,30,32,33,36,37,40,41,42,43,44,52,53,54,58,59,80,83,86,90,95,96,97,103,107,108,111,113,115,117,126,132,134,135,136,137,138,140,141],$VE1=[2,125],$VF1=[6,25,26],$VG1=[2,60],$VH1=[1,270],$VI1=[1,271],$VJ1=[1,6,25,26,34,56,61,64,80,85,93,98,100,105,106,109,111,112,113,117,118,128,130,133,136,137,142,143,144,145,146,147,148],$VK1=[26,128,130],$VL1=[1,6,26,34,56,61,64,80,85,93,98,100,109,112,118,133],$VM1=[2,74],$VN1=[1,293],$VO1=[1,294],$VP1=[1,6,25,26,34,56,61,64,80,85,93,98,100,109,111,112,113,117,118,128,133,136,137,142,143,144,145,146,147,148],$VQ1=[1,6,25,26,34,56,61,64,80,85,93,98,100,109,111,113,117,118,133],$VR1=[1,305],$VS1=[1,306],$VT1=[6,25,26,61],$VU1=[1,6,25,26,34,56,61,64,80,85,93,98,100,105,109,111,112,113,117,118,133,136,137,142,143,144,145,146,147,148],$VV1=[25,61];
      var parser = {trace: function trace() { },
      yy: {},
      symbols_: {"error":2,"Root":3,"Body":4,"Line":5,"TERMINATOR":6,"Expression":7,"Statement":8,"Return":9,"Comment":10,"STATEMENT":11,"Value":12,"Invocation":13,"Code":14,"Operation":15,"Assign":16,"If":17,"Try":18,"While":19,"For":20,"Switch":21,"Class":22,"Throw":23,"Block":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"String":31,"STRING":32,"STRING_START":33,"STRING_END":34,"Regex":35,"REGEX":36,"REGEX_START":37,"REGEX_END":38,"Literal":39,"JS":40,"DEBUGGER":41,"UNDEFINED":42,"NULL":43,"BOOL":44,"Assignable":45,"=":46,"AssignObj":47,"ObjAssignable":48,":":49,"SimpleObjAssignable":50,"ThisProperty":51,"RETURN":52,"HERECOMMENT":53,"PARAM_START":54,"ParamList":55,"PARAM_END":56,"FuncGlyph":57,"->":58,"=>":59,"OptComma":60,",":61,"Param":62,"ParamVar":63,"...":64,"Array":65,"Object":66,"Splat":67,"SimpleAssignable":68,"Accessor":69,"Parenthetical":70,"Range":71,"This":72,".":73,"?.":74,"::":75,"?::":76,"Index":77,"INDEX_START":78,"IndexValue":79,"INDEX_END":80,"INDEX_SOAK":81,"Slice":82,"{":83,"AssignList":84,"}":85,"CLASS":86,"EXTENDS":87,"OptFuncExist":88,"Arguments":89,"SUPER":90,"FUNC_EXIST":91,"CALL_START":92,"CALL_END":93,"ArgList":94,"THIS":95,"@":96,"[":97,"]":98,"RangeDots":99,"..":100,"Arg":101,"SimpleArgs":102,"TRY":103,"Catch":104,"FINALLY":105,"CATCH":106,"THROW":107,"(":108,")":109,"WhileSource":110,"WHILE":111,"WHEN":112,"UNTIL":113,"Loop":114,"LOOP":115,"ForBody":116,"FOR":117,"BY":118,"ForStart":119,"ForSource":120,"ForVariables":121,"OWN":122,"ForValue":123,"FORIN":124,"FOROF":125,"SWITCH":126,"Whens":127,"ELSE":128,"When":129,"LEADING_WHEN":130,"IfBlock":131,"IF":132,"POST_IF":133,"UNARY":134,"UNARY_MATH":135,"-":136,"+":137,"YIELD":138,"FROM":139,"--":140,"++":141,"?":142,"MATH":143,"**":144,"SHIFT":145,"COMPARE":146,"LOGIC":147,"RELATION":148,"COMPOUND_ASSIGN":149,"$accept":0,"$end":1},

        Function anonymous has 480 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
        /* this == yyval */
        
        var $0 = $$.length - 1;
        switch (yystate) {

          Function Rewriter has 434 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            exports.Rewriter = (function() {
              function Rewriter() {}
          
              Rewriter.prototype.rewrite = function(tokens1) {
                this.tokens = tokens1;

            Function addImplicitBracesAndParens has 178 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                Rewriter.prototype.addImplicitBracesAndParens = function() {
                  var stack, start;
                  stack = [];
                  start = null;
                  return this.scanTokens(function(token, i, tokens) {

              Function parse has 135 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              parse: function parse(input) {
                  var self = this, stack = [0], tstack = [], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
                  var args = lstack.slice.call(arguments, 1);
                  var lexer = Object.create(this.lexer);
                  var sharedState = { yy: {} };

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

                    Assign.prototype.compilePatternMatch = function(o) {
                      var acc, assigns, code, defaultValue, expandedIdx, fragments, i, idx, isObject, ivar, j, len1, name, obj, objects, olen, ref, ref3, ref4, ref5, ref6, ref7, rest, top, val, value, vvar, vvarText;
                      top = o.level === LEVEL_TOP;
                      value = this.value;
                      objects = this.variable.base.objects;

                  Function compileNode has 124 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      Code.prototype.compileNode = function(o) {
                        var answer, boundfunc, code, exprs, i, j, k, l, len1, len2, len3, len4, len5, len6, lit, m, p, param, params, q, r, ref, ref3, ref4, ref5, ref6, ref7, ref8, splats, uniqs, val, wasEmpty, wrapper;
                        if (this.bound && ((ref3 = o.scope.method) != null ? ref3.bound : void 0)) {
                          this.context = o.scope.method.context;
                        }

                    Function compileNode has 115 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        For.prototype.compileNode = function(o) {
                          var body, bodyFragments, compare, compareDown, declare, declareDown, defPart, defPartFragments, down, forPartFragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, last, lvar, name, namePart, ref, ref3, ref4, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart;
                          body = Block.wrap([this.body]);
                          ref3 = body.expressions, last = ref3[ref3.length - 1];
                          if ((last != null ? last.jumps() : void 0) instanceof Return) {

                      Function identifierToken has 91 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          Lexer.prototype.identifierToken = function() {
                            var alias, colon, colonOffset, forcedIdentifier, id, idLength, input, match, poppedToken, prev, ref2, ref3, ref4, ref5, tag, tagToken;
                            if (!(match = IDENTIFIER.exec(this.chunk))) {
                              return 0;
                            }

                        Function compileNode has 85 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            Obj.prototype.compileNode = function(o) {
                              var answer, dynamicIndex, hasDynamic, i, idt, indent, j, join, k, key, l, lastNoncom, len1, len2, len3, node, oref, prop, props, ref3, value;
                              props = this.properties;
                              if (this.generated) {
                                for (j = 0, len1 = props.length; j < len1; j++) {

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

                              Lexer.prototype.stringToken = function() {
                                var $, attempt, delimiter, doc, end, heredoc, i, indent, indentRegex, match, quote, ref2, ref3, regex, token, tokens;
                                quote = (STRING_START.exec(this.chunk) || [])[0];
                                if (!quote) {
                                  return 0;

                            Function literalToken has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                Lexer.prototype.literalToken = function() {
                                  var match, prev, ref2, ref3, ref4, ref5, ref6, tag, token, value;
                                  if (match = OPERATOR.exec(this.chunk)) {
                                    value = match[0];
                                    if (CODE.test(value)) {

                              Function regexToken has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  Lexer.prototype.regexToken = function() {
                                    var body, closed, end, flags, index, match, origin, prev, ref2, ref3, ref4, regex, tokens;
                                    switch (false) {
                                      case !(match = REGEX_ILLEGAL.exec(this.chunk)):
                                        this.error("regular expressions cannot begin with " + match[2], {

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

                                    Lexer.prototype.mergeInterpolationTokens = function(tokens, options, fn) {
                                      var converted, firstEmptyStringIndex, firstIndex, i, j, lastToken, len, locationToken, lparen, plusToken, ref2, rparen, tag, token, tokensToPush, value;
                                      if (tokens.length > 1) {
                                        lparen = this.token('STRING_START', '(', 0, 0);
                                      }

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

                                      Assign.prototype.compileNode = function(o) {
                                        var answer, compiledName, isValue, j, name, properties, prototype, ref3, ref4, ref5, ref6, ref7, val, varBase;
                                        if (isValue = this.variable instanceof Value) {
                                          if (this.variable.isArray() || this.variable.isObject()) {
                                            return this.compilePatternMatch(o);

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

                                        SourceMap.prototype.generate = function(options, code) {
                                          var buffer, i, j, lastColumn, lastSourceColumn, lastSourceLine, len, len1, lineMap, lineNumber, mapping, needComma, ref, ref1, v3, writingline;
                                          if (options == null) {
                                            options = {};
                                          }

                                      Function matchWithInterpolations has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          Lexer.prototype.matchWithInterpolations = function(regex, delimiter) {
                                            var close, column, firstToken, index, lastToken, line, nested, offsetInChunk, open, ref2, ref3, ref4, str, strPart, tokens;
                                            tokens = [];
                                            offsetInChunk = delimiter.length;
                                            if (this.chunk.slice(0, offsetInChunk) !== delimiter) {

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

                                            Call.prototype.unfoldSoak = function(o) {
                                              var call, ifn, j, left, len1, list, ref3, ref4, rite;
                                              if (this.soak) {
                                                if (this.variable) {
                                                  if (ifn = unfoldSoak(o, this, 'variable')) {

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

                                              Rewriter.prototype.normalizeLines = function() {
                                                var action, condition, indent, outdent, starter;
                                                starter = indent = outdent = null;
                                                condition = function(token, i) {
                                                  var ref, ref1, ref2, ref3;

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

                                                Block.prototype.compileWithDeclarations = function(o) {
                                                  var assigns, declars, exp, fragments, i, j, len1, post, ref3, ref4, ref5, rest, scope, spaced;
                                                  fragments = [];
                                                  post = [];
                                                  ref3 = this.expressions;

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

                                                  Lexer.prototype.lineToken = function() {
                                                    var diff, indent, match, noNewlines, size;
                                                    if (!(match = MULTI_DENT.exec(this.chunk))) {
                                                      return 0;
                                                    }

                                                Consider simplifying this complex logical expression.
                                                Open

                                                        if ((indexOf.call(IMPLICIT_FUNC, tag) >= 0 && token.spaced || tag === '?' && i > 0 && !tokens[i - 1].spaced) && (indexOf.call(IMPLICIT_CALL, nextTag) >= 0 || indexOf.call(IMPLICIT_UNSPACED_CALL, nextTag) >= 0 && !((ref = tokens[i + 1]) != null ? ref.spaced : void 0) && !((ref1 = tokens[i + 1]) != null ? ref1.newLine : void 0))) {
                                                          if (tag === '?') {
                                                            tag = token[0] = 'FUNC_EXIST';
                                                          }
                                                          startImplicitCall(i + 1);

                                                  Consider simplifying this complex logical expression.
                                                  Open

                                                            if (prevTag !== '=>' && prevTag !== '->' && prevTag !== '[' && prevTag !== '(' && prevTag !== ',' && prevTag !== '{' && prevTag !== 'TRY' && prevTag !== 'ELSE' && prevTag !== '=') {
                                                              while (inImplicitCall()) {
                                                                endImplicitCall();
                                                              }
                                                            }

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

                                                        Class.prototype.addProperties = function(node, name, o) {
                                                          var acc, assign, base, exprs, func, props;
                                                          props = node.base.properties.slice(0);
                                                          exprs = (function() {
                                                            var results;

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

                                                          Splat.compileSplattedArray = function(o, list, apply) {
                                                            var args, base, compiledNode, concatPart, fragments, i, index, j, last, len1, node;
                                                            index = -1;
                                                            while ((node = list[++index]) && !(node instanceof Splat)) {
                                                              continue;

                                                        Function compileRoot has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                        Open

                                                            Block.prototype.compileRoot = function(o) {
                                                              var exp, fragments, i, j, len1, name, prelude, preludeExps, ref3, ref4, rest;
                                                              o.indent = o.bare ? '' : TAB;
                                                              o.level = LEVEL_TOP;
                                                              this.spaced = true;

                                                          Function compileNode has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                                          Open

                                                              Block.prototype.compileNode = function(o) {
                                                                var answer, compiledNodes, fragments, index, j, len1, node, ref3, top;
                                                                this.tab = o.indent;
                                                                top = o.level === LEVEL_TOP;
                                                                compiledNodes = [];

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

                                                                Op.prototype.compileNode = function(o) {
                                                                  var answer, isChain, lhs, ref3, ref4, rhs;
                                                                  isChain = this.isChainable() && this.first.isChainable();
                                                                  if (!isChain) {
                                                                    this.first.front = this.front;

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

                                                                  Lexer.prototype.makeDelimitedLiteral = function(body, options) {
                                                                    var regex;
                                                                    if (options == null) {
                                                                      options = {};
                                                                    }

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

                                                                    Lexer.prototype.tokenize = function(code, opts) {
                                                                      var consumed, end, i, ref2;
                                                                      if (opts == null) {
                                                                        opts = {};
                                                                      }

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

                                                                      Class.prototype.compileNode = function(o) {
                                                                        var args, argumentsNode, func, jumpNode, klass, lname, name, ref3, superClass;
                                                                        if (jumpNode = this.body.jumps()) {
                                                                          jumpNode.error('Class bodies cannot contain pure statements');
                                                                        }

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

                                                                        Param.prototype.eachName = function(iterator, name) {
                                                                          var atParam, j, len1, node, obj, ref3;
                                                                          if (name == null) {
                                                                            name = this.name;
                                                                          }

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

                                                                          Arr.prototype.compileNode = function(o) {
                                                                            var answer, compiledObjs, fragments, index, j, len1, obj;
                                                                            if (!this.objects.length) {
                                                                              return [this.makeCode('[]')];
                                                                            }

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

                                                                            Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) {
                                                                              var decreasedIndent, dent, lastIndent, ref2;
                                                                              decreasedIndent = this.indent - moveOut;
                                                                              while (moveOut > 0) {
                                                                                lastIndent = this.indents[this.indents.length - 1];

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

                                                                              Call.prototype.compileNode = function(o) {
                                                                                var arg, argIndex, compiledArgs, compiledArray, fragments, j, len1, preface, ref3, ref4;
                                                                                if ((ref3 = this.variable) != null) {
                                                                                  ref3.front = this.front;
                                                                                }

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

                                                                                Range.prototype.compileArray = function(o) {
                                                                                  var args, body, cond, hasArgs, i, idt, j, post, pre, range, ref3, ref4, result, results, vars;
                                                                                  if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) {
                                                                                    range = (function() {
                                                                                      results = [];

                                                                              Consider simplifying this complex logical expression.
                                                                              Open

                                                                                if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null) && (typeof unescape !== "undefined" && unescape !== null) && (typeof encodeURIComponent !== "undefined" && encodeURIComponent !== null)) {
                                                                                  compile = function(code, options) {
                                                                                    var js, ref, v3SourceMap;
                                                                                    if (options == null) {
                                                                                      options = {};

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

                                                                                    Switch.prototype.compileNode = function(o) {
                                                                                      var block, body, cond, conditions, expr, fragments, i, idt1, idt2, j, k, len1, len2, ref3, ref4, ref5;
                                                                                      idt1 = o.indent + TAB;
                                                                                      idt2 = o.indent = idt1 + TAB;
                                                                                      fragments = [].concat(this.makeCode(this.tab + "switch ("), (this.subject ? this.subject.compileToFragments(o, LEVEL_PAREN) : this.makeCode("false")), this.makeCode(") {\n"));

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

                                                                                      Op.prototype.invert = function() {
                                                                                        var allInvertable, curr, fst, op, ref3;
                                                                                        if (this.isChainable() && this.first.isChainable()) {
                                                                                          allInvertable = true;
                                                                                          curr = this;

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

                                                                                        Lexer.prototype.numberToken = function() {
                                                                                          var binaryLiteral, lexedLength, match, number, octalLiteral;
                                                                                          if (!(match = NUMBER.exec(this.chunk))) {
                                                                                            return 0;
                                                                                          }

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

                                                                                          If.prototype.compileStatement = function(o) {
                                                                                            var answer, body, child, cond, exeq, ifPart, indent;
                                                                                            child = del(o, 'chainChild');
                                                                                            exeq = del(o, 'isExistentialEquals');
                                                                                            if (exeq) {

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

                                                                                            Assign.prototype.compileSplice = function(o) {
                                                                                              var answer, exclusive, from, fromDecl, fromRef, name, ref3, ref4, ref5, to, valDef, valRef;
                                                                                              ref3 = this.variable.properties.pop().range, from = ref3.from, to = ref3.to, exclusive = ref3.exclusive;
                                                                                              name = this.variable.compile(o);
                                                                                              if (from) {

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

                                                                                            CoffeeScript.load = function(url, callback, options, hold) {
                                                                                              var xhr;
                                                                                              if (options == null) {
                                                                                                options = {};
                                                                                              }

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

                                                                                                Range.prototype.compileNode = function(o) {
                                                                                                  var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, ref3, ref4, stepPart, to, varPart;
                                                                                                  if (!this.fromVar) {
                                                                                                    this.compileVariables(o);
                                                                                                  }

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

                                                                                                  Value.prototype.unfoldSoak = function(o) {
                                                                                                    return this.unfoldedSoak != null ? this.unfoldedSoak : this.unfoldedSoak = (function(_this) {
                                                                                                      return function() {
                                                                                                        var fst, i, ifn, j, len1, prop, ref, ref3, ref4, snd;
                                                                                                        if (ifn = _this.base.unfoldSoak(o)) {

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

                                                                                                    While.prototype.compileNode = function(o) {
                                                                                                      var answer, body, rvar, set;
                                                                                                      o.indent += TAB;
                                                                                                      set = '';
                                                                                                      body = this.body;

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

                                                                                                      Call.prototype.superReference = function(o) {
                                                                                                        var accesses, base, bref, klass, method, name, nref, variable;
                                                                                                        method = o.scope.namedMethod();
                                                                                                        if (method != null ? method.klass : void 0) {
                                                                                                          klass = method.klass, name = method.name, variable = method.variable;

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

                                                                                                        Call.prototype.compileSplat = function(o, splatArgs) {
                                                                                                          var answer, base, fun, idt, name, ref;
                                                                                                          if (this.isSuper) {
                                                                                                            return [].concat(this.makeCode((this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", "), splatArgs, this.makeCode(")"));
                                                                                                          }

                                                                                                      Function unfoldedSoak has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                      Open

                                                                                                            return this.unfoldedSoak != null ? this.unfoldedSoak : this.unfoldedSoak = (function(_this) {
                                                                                                              return function() {
                                                                                                                var fst, i, ifn, j, len1, prop, ref, ref3, ref4, snd;
                                                                                                                if (ifn = _this.base.unfoldSoak(o)) {
                                                                                                                  (ref3 = ifn.body.properties).push.apply(ref3, _this.properties);

                                                                                                        Function tagParameters has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                        Open

                                                                                                            Lexer.prototype.tagParameters = function() {
                                                                                                              var i, stack, tok, tokens;
                                                                                                              if (this.tag() !== ')') {
                                                                                                                return this;
                                                                                                              }

                                                                                                          Function prepareStackTrace has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                                                                                          Open

                                                                                                            Error.prepareStackTrace = function(err, stack) {
                                                                                                              var frame, frames, getSourceMapping;
                                                                                                              getSourceMapping = function(filename, line, column) {
                                                                                                                var answer, sourceMap;
                                                                                                                sourceMap = getSourceMap(filename);

                                                                                                            Consider simplifying this complex logical expression.
                                                                                                            Open

                                                                                                                    if (inImplicitCall() && (tag === 'IF' || tag === 'TRY' || tag === 'FINALLY' || tag === 'CATCH' || tag === 'CLASS' || tag === 'SWITCH')) {
                                                                                                                      stack.push([
                                                                                                                        'CONTROL', i, {
                                                                                                                          ours: true
                                                                                                                        }

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

                                                                                                              performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {

                                                                                                                Avoid deeply nested control flow statements.
                                                                                                                Open

                                                                                                                            if (!hasProp.call(ref2, k)) continue;

                                                                                                                  Avoid deeply nested control flow statements.
                                                                                                                  Open

                                                                                                                                  if (func instanceof Code && func.bound) {
                                                                                                                                    this.boundFuncs.push(base);
                                                                                                                                    func.bound = false;
                                                                                                                                  }

                                                                                                                    Avoid deeply nested control flow statements.
                                                                                                                    Open

                                                                                                                                if (obj instanceof Assign) {
                                                                                                                                  defaultValue = obj.value;
                                                                                                                                  obj = obj.variable;
                                                                                                                                }

                                                                                                                      Avoid deeply nested control flow statements.
                                                                                                                      Open

                                                                                                                                  if (rest === 1) {
                                                                                                                                    expandedIdx = vvarText + ".length - 1";
                                                                                                                                  } else {
                                                                                                                                    ivar = o.scope.freeVariable('i', {
                                                                                                                                      single: true

                                                                                                                        Avoid deeply nested control flow statements.
                                                                                                                        Open

                                                                                                                                    if (obj instanceof Assign) {
                                                                                                                                      defaultValue = obj.value;
                                                                                                                                      obj = obj.variable;
                                                                                                                                    }

                                                                                                                          Avoid deeply nested control flow statements.
                                                                                                                          Open

                                                                                                                                        if (down) {
                                                                                                                                          compare = compareDown;
                                                                                                                                          declare = declareDown;
                                                                                                                                        }

                                                                                                                            Consider simplifying this complex logical expression.
                                                                                                                            Open

                                                                                                                                        if ((stackTag === '{' || stackTag === 'INDENT' && this.tag(stackIdx - 1) === '{') && (startsLine || this.tag(s - 1) === ',' || this.tag(s - 1) === '{')) {
                                                                                                                                          return forward(1);
                                                                                                                                        }

                                                                                                                              Consider simplifying this complex logical expression.
                                                                                                                              Open

                                                                                                                                      if (!((val instanceof Code) || (val instanceof Value && ((ref5 = val.base) != null ? ref5.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((ref6 = (ref7 = val.properties[0].name) != null ? ref7.value : void 0) === 'call' || ref6 === 'apply')))) {
                                                                                                                                        continue;
                                                                                                                                      }

                                                                                                                                Consider simplifying this complex logical expression.
                                                                                                                                Open

                                                                                                                                        if (tag === ',' && !this.looksObjectish(i + 1) && inImplicitObject() && !this.insideForDeclaration && (nextTag !== 'TERMINATOR' || !this.looksObjectish(i + 2))) {
                                                                                                                                          offset = nextTag === 'OUTDENT' ? 1 : 0;
                                                                                                                                          while (inImplicitObject()) {
                                                                                                                                            endImplicitObject(i + offset);
                                                                                                                                          }

                                                                                                                                  Consider simplifying this complex logical expression.
                                                                                                                                  Open

                                                                                                                                        if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) {
                                                                                                                                          parts.push([this.makeCode(' ')]);
                                                                                                                                        }

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

                                                                                                                                        Lexer.prototype.token = function(tag, value, offsetInChunk, length, origin) {

                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                      Open

                                                                                                                                                    return forward(1);

                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                        Open

                                                                                                                                                    return this.wrapInBraces(answer);

                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                          Open

                                                                                                                                                    return forward(3);

                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                            Open

                                                                                                                                                      return forward(2);

                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                              Open

                                                                                                                                                      return 1;

                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                Open

                                                                                                                                                      return indent.length;

                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                  Open

                                                                                                                                                          return new Op('!', this);

                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                    Open

                                                                                                                                                            return fst;

                                                                                                                                                      Avoid too many return statements within this function.
                                                                                                                                                      Open

                                                                                                                                                                      return forward(1);

                                                                                                                                                        Avoid too many return statements within this function.
                                                                                                                                                        Open

                                                                                                                                                              return [].concat(list[0].makeCode("["), base, list[index].makeCode("].concat("), concatPart, last.makeCode(")"));

                                                                                                                                                          Avoid too many return statements within this function.
                                                                                                                                                          Open

                                                                                                                                                                return fileLocation;

                                                                                                                                                            Avoid too many return statements within this function.
                                                                                                                                                            Open

                                                                                                                                                                    return this.wrapInBraces(answer);

                                                                                                                                                              Avoid too many return statements within this function.
                                                                                                                                                              Open

                                                                                                                                                                      return forward(1);

                                                                                                                                                                Avoid too many return statements within this function.
                                                                                                                                                                Open

                                                                                                                                                                        return compiledName.concat(this.makeCode(": "), val);

                                                                                                                                                                  Avoid too many return statements within this function.
                                                                                                                                                                  Open

                                                                                                                                                                          return answer;

                                                                                                                                                                    Avoid too many return statements within this function.
                                                                                                                                                                    Open

                                                                                                                                                                            return this.wrapInBraces(fragments);

                                                                                                                                                                      Function compile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                                                                                                      Open

                                                                                                                                                                      }(this));      ;function compile(script, options) {
                                                                                                                                                                              try {
                                                                                                                                                                                return CoffeeScript.compile(script, options);
                                                                                                                                                                              } catch (err) {
                                                                                                                                                                                if (err instanceof SyntaxError && err.location) {

                                                                                                                                                                      Cognitive Complexity

                                                                                                                                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                                                                                                                      A method's cognitive complexity is based on a few simple rules:

                                                                                                                                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                                                                                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                                                                                                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                                                                                                                                      Further reading

                                                                                                                                                                      There are no issues that match your filters.

                                                                                                                                                                      Category
                                                                                                                                                                      Status