dockyard/es6_module_transpiler-rails

View on GitHub

Showing 225 of 225 total issues

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

        return op === '=' ||
            op === '*=' ||
            op === '/=' ||
            op === '%=' ||
            op === '+=' ||
Severity: Major
Found in lib/es6_module_transpiler/support/es6-module-transpiler.js and 1 other location - About 1 hr to fix
lib/es6_module_transpiler/support/es6-module-transpiler.js on lines 915..917

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 61.

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

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

        if (matchKeyword('extends')) {
            expectKeyword('extends');
            previousYieldAllowed = state.yieldAllowed;
            state.yieldAllowed = false;
            superClass = parseAssignmentExpression();
Severity: Major
Found in lib/es6_module_transpiler/support/es6-module-transpiler.js and 1 other location - About 1 hr to fix
lib/es6_module_transpiler/support/es6-module-transpiler.js on lines 5036..5042

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 61.

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

            return (id === 'while') || (id === 'break') || (id === 'catch') ||
                (id === 'throw') || (id === 'const') || (id === 'yield') ||
                (id === 'class') || (id === 'super');
Severity: Major
Found in lib/es6_module_transpiler/support/es6-module-transpiler.js and 1 other location - About 1 hr to fix
lib/es6_module_transpiler/support/es6-module-transpiler.js on lines 2692..2699

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 61.

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

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

        if (matchKeyword('extends')) {
            expectKeyword('extends');
            previousYieldAllowed = state.yieldAllowed;
            state.yieldAllowed = false;
            superClass = parseAssignmentExpression();
Severity: Major
Found in lib/es6_module_transpiler/support/es6-module-transpiler.js and 1 other location - About 1 hr to fix
lib/es6_module_transpiler/support/es6-module-transpiler.js on lines 5014..5020

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 61.

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

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

    function parseBinaryExpression() {
        var expr, token, prec, previousAllowIn, stack, right, operator, left, i;

        previousAllowIn = state.allowIn;
        state.allowIn = true;
Severity: Minor
Found in lib/es6_module_transpiler/support/es6-module-transpiler.js - About 1 hr to fix

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

        walk: function(node) {
          if (node.type) {
            var processor = this['process' + node.type];
            if (processor) {
              var result = processor.call(this, node);
    Severity: Minor
    Found in lib/es6_module_transpiler/support/es6-module-transpiler.js - About 1 hr to fix

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

          function reinterpretAsAssignmentBindingPattern(expr) {
              var i, len, property, element;
      
              if (expr.type === Syntax.ObjectExpression) {
                  expr.type = Syntax.ObjectPattern;
      Severity: Minor
      Found in lib/es6_module_transpiler/support/es6-module-transpiler.js - About 1 hr to fix

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

            function collectRegex() {
                var pos, loc, regex, token;
        
                skipComment();
        
        
        Severity: Minor
        Found in lib/es6_module_transpiler/support/es6-module-transpiler.js - About 1 hr to fix

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

              function parseProgramElements() {
                  var sourceElement, sourceElements = [], token, directive, firstRestricted;
          
                  while (index < length) {
                      token = lookahead;
          Severity: Minor
          Found in lib/es6_module_transpiler/support/es6-module-transpiler.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/es6_module_transpiler/support/es6-module-transpiler.js - About 1 hr to fix

              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/es6_module_transpiler/support/es6-module-transpiler.js - About 1 hr to fix

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

                  function elementDelete(object, name) {
                    if (traceur.options.trapMemberLookup &&
                        hasPrivateNameProperty(object, elementDeleteName)) {
                      return getProperty(object, elementDeleteName).call(object, name);
                    }
                Severity: Major
                Found in lib/es6_module_transpiler/support/es6-module-transpiler.js and 1 other location - About 1 hr to fix
                lib/es6_module_transpiler/support/es6-module-transpiler.js on lines 176..182

                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 59.

                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 elementGet(object, name) {
                    if (traceur.options.trapMemberLookup &&
                        hasPrivateNameProperty(object, elementGetName)) {
                      return getProperty(object, elementGetName).call(object, name);
                    }
                Severity: Major
                Found in lib/es6_module_transpiler/support/es6-module-transpiler.js and 1 other location - About 1 hr to fix
                lib/es6_module_transpiler/support/es6-module-transpiler.js on lines 168..174

                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 59.

                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

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

                    function parseVariableDeclaration(kind) {
                        var id,
                            init = null;
                        if (match('{')) {
                            id = parseObjectInitialiser();
                Severity: Minor
                Found in lib/es6_module_transpiler/support/es6-module-transpiler.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/es6_module_transpiler/support/es6-module-transpiler.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/es6_module_transpiler/support/es6-module-transpiler.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/es6_module_transpiler/support/es6-module-transpiler.js - About 1 hr to fix

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

                                if (length > 0) {
                                    if (typeof source[0] === 'undefined') {
                                        // Try first to convert to a string. This is good as fast path
                                        // for old IE which understands string indexing for string
                                        // literals only and not for string object.
                        Severity: Major
                        Found in lib/es6_module_transpiler/support/es6-module-transpiler.js and 1 other location - About 1 hr to fix
                        lib/es6_module_transpiler/support/es6-module-transpiler.js on lines 6025..6034

                        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 57.

                        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

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

                                if (length > 0) {
                                    if (typeof source[0] === 'undefined') {
                                        // Try first to convert to a string. This is good as fast path
                                        // for old IE which understands string indexing for string
                                        // literals only and not for string object.
                        Severity: Major
                        Found in lib/es6_module_transpiler/support/es6-module-transpiler.js and 1 other location - About 1 hr to fix
                        lib/es6_module_transpiler/support/es6-module-transpiler.js on lines 5919..5928

                        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 57.

                        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

                        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/es6_module_transpiler/support/es6-module-transpiler.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language