razum2um/lurker

View on GitHub

Showing 328 of 328 total issues

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

    if (sourceLines.length > 1) {
      state.g.sourceLine += sourceLines.length - 1;
      state.g.sourceColumn = 0;
    }
Severity: Minor
Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 55 mins to fix
lib/lurker/templates/javascripts/JSXTransformer.js on lines 10719..10722

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 53.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Method verify! has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  def verify!(verb, path, request_params,
              extensions, response_status, response_params, successful=true)
Severity: Major
Found in lib/lurker/service.rb - About 50 mins to fix

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

        function expect(value) {
            var token = lex();
            if (token.type !== Token.Punctuator || token.value !== value) {
                throwUnexpected(token);
            }
    Severity: Minor
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 50 mins to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 3840..3845

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        function expectKeyword(keyword) {
            var token = lex();
            if (token.type !== Token.Keyword || token.value !== keyword) {
                throwUnexpected(token);
            }
    Severity: Minor
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 50 mins to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 3830..3835

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 52.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            case 6:
                return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
                    (id === 'switch') || (id === 'export') || (id === 'import');
    Severity: Minor
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 50 mins to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 2000..2002

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 51.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

            case 4:
                return (id === 'this') || (id === 'else') || (id === 'case') ||
                    (id === 'void') || (id === 'with') || (id === 'enum');
    Severity: Minor
    Found in lib/lurker/templates/javascripts/JSXTransformer.js and 1 other location - About 50 mins to fix
    lib/lurker/templates/javascripts/JSXTransformer.js on lines 2007..2009

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 51.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    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

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

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

          exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
          Severity: Minor
          Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                    if (isOctalDigit(ch)) {
                                        code = '01234567'.indexOf(ch);
            
                                        // \0 is not octal escape sequence
                                        if (code !== 0) {
            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 (str += '\\u'; restore < index; ++restore) {
                                            str += source[restore];
                                        }
                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 + 1] === '\n') {
                                          ++index;
                                          comment += '\r\n';
                                      } else {
                                          comment += ch;
                  Severity: Major
                  Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                        if (ch === 42) {
                                            ch = source.charCodeAt(index);
                                            if (ch === 47) {
                                                ++index;
                                                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 (ch === 13 && source.charCodeAt(index + 1) === 10) {
                                              ++index;
                                          }
                      Severity: Major
                      Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                    if (expr.type !== Syntax.MemberExpression && expr.type !== Syntax.CallExpression && expr.type !== Syntax.NewExpression) {
                                        throwError({}, Messages.InvalidLHSInAssignment);
                                    }
                        Severity: Major
                        Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                          if (tmp && tmp.type === Syntax.SpreadElement) {
                                              if (!match(']')) {
                                                  throwError({}, Messages.ElementAfterSpreadElement);
                                              }
                                          } else if (!(match(']') || matchKeyword('for') || matchKeyword('if'))) {
                          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 (ch !== '0' && ch !== '1') {
                                                          break;
                                                      }
                              Severity: Major
                              Found in lib/lurker/templates/javascripts/JSXTransformer.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language