razum2um/lurker

View on GitHub

Showing 238 of 330 total issues

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

    function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer) {
      // The SourceNode we want to fill with the generated code
      // and the SourceMap
      var node = new SourceNode();

Severity: Major
Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

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

        function wrapTrackingFunction(range, loc, preserveWhitespace) {
    
            return function (parseFunction) {
    
                function isBinary(node) {
    Severity: Major
    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

      Function SourceNode_toStringWithSourceMap has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
          var generated = {
            code: "",
            line: 1,
            column: 0
      Severity: Major
      Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

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

            function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
              var generatedLine = 1;
              var previousGeneratedColumn = 0;
              var previousOriginalLine = 0;
              var previousOriginalColumn = 0;
        Severity: Major
        Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

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

              function parseArrayInitialiser() {
                  var elements = [], blocks = [], filter = null, tmp, possiblecomprehension = true, body;
          
                  expect('[');
                  while (!match(']')) {
          Severity: Major
          Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                  else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
                           && aOriginal && 'line' in aOriginal && 'column' in aOriginal
                           && aGenerated.line > 0 && aGenerated.column >= 0
                           && aOriginal.line > 0 && aOriginal.column >= 0
                           && aSource) {
            Severity: Critical
            Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

              Function parsePrimaryExpression has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function parsePrimaryExpression() {
                      var type, token;
              
                      token = lookahead;
                      type = lookahead.type;
              Severity: Major
              Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

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

                },{"./xjs":29,"esprima-fb":6,"jstransform/src/utils":20}],28:[function(_dereq_,module,exports){
                /**
                 * Copyright 2013-2014 Facebook, Inc.
                 *
                 * Licensed under the Apache License, Version 2.0 (the "License");
                Severity: Major
                Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

                  Function traverse has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function traverse(node, path, state) {
                    // Create a scope stack entry if this is the first node we've encountered in
                    // its local scope
                    var parentNode = path[0];
                    if (!Array.isArray(node) && state.localScope.parentNode !== parentNode) {
                  Severity: Major
                  Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

                    Function 10 has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    },{"./util":16,"amdefine":17}],10:[function(_dereq_,module,exports){
                    /* -*- Mode: js; js-indent-level: 2; -*- */
                    /*
                     * Copyright 2011 Mozilla Foundation and contributors
                     * Licensed under the New BSD license. See LICENSE or:
                    Severity: Major
                    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

                      Method apply_form_for_options! has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def apply_form_for_options!(record, object, options) #:nodoc:
                              object = convert_to_model(object)
                      
                              as = options[:as]
                              action, method = object.respond_to?(:persisted?) && object.persisted? ? [:edit, :patch] : [:new, :post]
                      Severity: Minor
                      Found in templates/rails32_http_patch_support.rb - About 2 hrs to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Method filtering_block has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                      Open

                            def filtering_block
                              if options['select'].present?
                                select = /#{options['select']}/
                              end
                      
                      
                      Severity: Minor
                      Found in lib/lurker/cli.rb - About 2 hrs to fix

                      Cognitive Complexity

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

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

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

                      Further reading

                      Function binaryPrecedence has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function binaryPrecedence(token, allowIn) {
                              var prec = 0;
                      
                              if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
                                  return 0;
                      Severity: Major
                      Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

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

                        },{"./docblock":18}],21:[function(_dereq_,module,exports){
                        /**
                         * Copyright 2013 Facebook, Inc.
                         *
                         * Licensed under the Apache License, Version 2.0 (the "License");
                        Severity: Major
                        Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

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

                              function parseFunctionSourceElements() {
                                  var sourceElement, sourceElements = [], token, directive, firstRestricted,
                                      oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesizedCount;
                          
                                  expect('{');
                          Severity: Major
                          Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

                            Function write has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            Buffer.prototype.write = function (string, offset, length, encoding) {
                              // Support both (string, offset, length, encoding)
                              // and the legacy (string, encoding, offset, length)
                              if (isFinite(offset)) {
                                if (!isFinite(length)) {
                            Severity: Minor
                            Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 2 hrs to fix

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

                                  function reinterpretAsCoverFormalsList(expressions) {
                                      var i, len, param, params, defaults, defaultCount, options, rest;
                              
                                      params = [];
                                      defaults = [];
                              Severity: Minor
                              Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                                function visitClassFunctionExpression(traverse, node, path, state) {
                                  var methodNode = path[0];
                                
                                  state = utils.updateState(state, {
                                    methodFuncNode: node
                                Severity: Minor
                                Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                                      function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile) {
                                        // If aSourceFile is omitted, we will use the file property of the SourceMap
                                        if (!aSourceFile) {
                                          aSourceFile = aSourceMapConsumer.file;
                                        }
                                  Severity: Minor
                                  Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                                    },{"./source-map/source-map-consumer":13,"./source-map/source-map-generator":14,"./source-map/source-node":15}],9:[function(_dereq_,module,exports){
                                    /* -*- Mode: js; js-indent-level: 2; -*- */
                                    /*
                                     * Copyright 2011 Mozilla Foundation and contributors
                                     * Licensed under the New BSD license. See LICENSE or:
                                    Severity: Minor
                                    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language