razum2um/lurker

View on GitHub

Showing 236 of 328 total issues

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

    function parseSwitchStatement() {
        var discriminant, cases, clause, oldInSwitch, defaultFound;

        expectKeyword('switch');

Severity: Minor
Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

    exports.relative = function(from, to) {
      from = exports.resolve(from).substr(1);
      to = exports.resolve(to).substr(1);
    
      function trim(arr) {
    Severity: Minor
    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

          function parseUnaryExpression() {
              var token, expr;
      
              if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
                  return parsePostfixExpression();
      Severity: Minor
      Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

            function uint8ToBase64 (uint8) {
                var i,
                    extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
                    output = "",
                    temp, length
        Severity: Minor
        Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

          function createState(source, rootNode, transformOptions) {
            return {
              /**
               * A tree representing the current local scope (and its lexical scope chain)
               * Useful for tracking identifiers from parent scopes, etc.
          Severity: Minor
          Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                function scanOctalLiteral(prefix, start) {
                    var number, octal;
            
                    if (isOctalDigit(prefix)) {
                        octal = true;
            Severity: Minor
            Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

              Buffer.byteLength = function (str, encoding) {
                var ret
                str = str + ''
                switch (encoding || 'utf8') {
                  case 'hex':
              Severity: Minor
              Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                    function parseImportDeclaration() {
                        var specifiers, kind, src;
                
                        expectKeyword('import');
                        specifiers = [];
                Severity: Minor
                Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                  process.nextTick = (function () {
                      var canSetImmediate = typeof window !== 'undefined'
                      && window.setImmediate;
                      var canPost = typeof window !== 'undefined'
                      && window.postMessage && window.addEventListener
                  Severity: Minor
                  Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                        function isKeyword(id) {
                            if (strict && isStrictModeReservedWord(id)) {
                                return true;
                            }
                    
                    
                    Severity: Minor
                    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                          function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
                            var context = aContext || null;
                            var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
                      
                            var mappings;
                      Severity: Minor
                      Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

                        Method example_from_schema has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def example_from_schema(schema, parent=nil)
                            if schema.nil?
                              return nil
                            end
                        
                        
                        Severity: Minor
                        Found in lib/lurker/presenters/endpoint_presenter.rb - About 1 hr to fix

                        Cognitive Complexity

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

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

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

                        Further reading

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

                        function _readUInt32 (buf, offset, littleEndian, noAssert) {
                          if (!noAssert) {
                            assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
                            assert(offset !== undefined && offset !== null, 'missing offset')
                            assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
                        Severity: Minor
                        Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                              function parseContinueStatement() {
                                  var label = null, key;
                          
                                  expectKeyword('continue');
                          
                          
                          Severity: Minor
                          Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                                function SourceMapConsumer_originalPositionFor(aArgs) {
                                  var needle = {
                                    generatedLine: util.getArg(aArgs, 'line'),
                                    generatedColumn: util.getArg(aArgs, 'column')
                                  };
                            Severity: Minor
                            Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                                  function parseBreakStatement() {
                                      var label = null, key;
                              
                                      expectKeyword('break');
                              
                              
                              Severity: Minor
                              Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                                    function b64ToByteArray (b64) {
                                        var i, j, l, tmp, placeHolders, arr
                                
                                        if (b64.length % 4 > 0) {
                                            throw new Error('Invalid string. Length must be a multiple of 4')
                                Severity: Minor
                                Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                                  function transform(visitors, source, options) {
                                    options = options || {};
                                  
                                    var ast;
                                    try {
                                  Severity: Minor
                                  Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                                    exports.read = function(buffer, offset, isLE, mLen, nBytes) {
                                      var e, m,
                                          eLen = nBytes * 8 - mLen - 1,
                                          eMax = (1 << eLen) - 1,
                                          eBias = eMax >> 1,
                                    Severity: Minor
                                    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix

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

                                          function parseParams(firstRestricted) {
                                              var options;
                                      
                                              options = {
                                                  params: [],
                                      Severity: Minor
                                      Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language