razum2um/lurker

View on GitHub

Showing 236 of 328 total issues

Avoid deeply nested control flow statements.
Open

            } else if (isWhiteSpace(ch)) {
                ++index;
            } else if (isLineTerminator(ch)) {
                ++index;
                if (ch === 13 && source.charCodeAt(index) === 10) {
Severity: Major
Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                            if (!((operator.value === 'in' || init.kind !== 'var') && init.declarations[0].init)) {
                                lex();
                                left = init;
                                right = parseExpression();
                                init = null;
    Severity: Major
    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                  if (expr.argument.type === Syntax.ObjectPattern) {
                      throwError({}, Messages.ObjectPatternAsSpread);
                  }
      Severity: Major
      Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                            switch (ch) {
                            case 'n':
                                cooked += '\n';
                                break;
                            case 'r':
        Severity: Major
        Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                          if (ch ===  '\r' && source[index] === '\n') {
                              ++index;
                          }
          Severity: Major
          Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                        } else if (isWhiteSpace(ch.charCodeAt(0))) {
                            ++index;
                        } else if (isLineTerminator(ch.charCodeAt(0))) {
                            ++index;
                            if (ch ===  '\r' && source[index] === '\n') {
            Severity: Major
            Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

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

                  performRequest: function(host, method, template, values, payload, contentType) {
              Severity: Minor
              Found in lib/lurker/templates/javascripts/lurker.js - About 45 mins to fix

                Method items_html has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                  def items_html
                    return unless items = @schema["items"]
                    return if items.size == 0
                
                    html = ""
                Severity: Minor
                Found in lib/lurker/presenters/schema_presenter.rb - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                                if (ch === '/') {
                                    loc = {
                                        start: {
                                            line: lineNumber,
                                            column: index - lineStart
                Severity: Major
                Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if (ch === '*') {
                                          ch = source[index];
                                          if (ch === '/') {
                                              comment = comment.substr(0, comment.length - 1);
                                              blockComment = false;
                  Severity: Major
                  Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if (index >= length) {
                                            throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                                        }
                    Severity: Major
                    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                for (var i = 0; i < parentNode.params.length; i++) {
                                  param = parentNode.params[i];
                                  if (param.type === Syntax.Identifier) {
                                    state.localScope.identifiers[param.name] = true;
                                  }
                      Severity: Major
                      Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

                        Method properties_html has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                          def properties_html
                            properties = if (props = @schema["properties"]).present?
                              props
                            elsif (ref_path = @schema["$ref"]).present?
                              ref = Lurker::RefObject.new(ref_path, options[:root_path])
                        Severity: Minor
                        Found in lib/lurker/presenters/schema_presenter.rb - About 45 mins 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

                        Avoid deeply nested control flow statements.
                        Open

                                            if (index >= length) {
                                                throwError({}, Messages.UnexpectedToken, 'ILLEGAL');
                                            }
                        Severity: Major
                        Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

                          Consider simplifying this complex logical expression.
                          Open

                                          if (checkToken &&
                                                  checkToken.type === 'Keyword' &&
                                                  (checkToken.value === 'if' ||
                                                   checkToken.value === 'while' ||
                                                   checkToken.value === 'for' ||
                          Severity: Major
                          Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 40 mins to fix

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

                            function _writeUInt32 (buf, value, offset, littleEndian, noAssert) {
                            Severity: Minor
                            Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 35 mins to fix

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

                              function _writeInt16 (buf, value, offset, littleEndian, noAssert) {
                              Severity: Minor
                              Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 35 mins to fix

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

                                  function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
                                Severity: Minor
                                Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 35 mins to fix

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

                                  function _writeInt32 (buf, value, offset, littleEndian, noAssert) {
                                  Severity: Minor
                                  Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 35 mins to fix

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

                                      function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
                                    Severity: Minor
                                    Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 35 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language