MichaReiser/speedy.js

View on GitHub

Showing 216 of 322 total issues

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

class ExpressionStatementCodeGenerator implements SyntaxCodeGenerator<ts.ExpressionStatement, void> {
    syntaxKind = ts.SyntaxKind.ExpressionStatement;

    generate(node: ts.ExpressionStatement, context: CodeGenerationContext): void {
        context.generate(node.expression);
packages/compiler/src/code-generation/code-generators/variable-statement-code-generator.ts on lines 5..12

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

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

    getClass(symbol: ts.Symbol): ClassReference {
        assert(symbol, "symbol is undefined");

        const cls = this.classes.get(symbol);
        assert(cls, `Class ${symbol.name} is not defined in scope`);
Severity: Major
Found in packages/compiler/src/code-generation/scope.ts and 1 other location - About 2 hrs to fix
packages/compiler/src/code-generation/scope.ts on lines 144..150

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

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

    getFunction(symbol: ts.Symbol): FunctionReference {
        assert(symbol, "symbol is undefined");

        const fun = this.functions.get(symbol);
        assert(fun, `function ${symbol.name} is not defined in scope`);
Severity: Major
Found in packages/compiler/src/code-generation/scope.ts and 1 other location - About 2 hrs to fix
packages/compiler/src/code-generation/scope.ts on lines 160..166

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

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 operatorToken.kind === ts.SyntaxKind.EqualsToken ||
        operatorToken.kind === ts.SyntaxKind.PlusEqualsToken ||
        operatorToken.kind === ts.SyntaxKind.MinusEqualsToken ||
        operatorToken.kind === ts.SyntaxKind.AsteriskAsteriskEqualsToken ||
packages/compiler/src/code-generation/code-generators/return-statement-code-generator.ts on lines 42..42

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

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

        if (current.kind === ts.SyntaxKind.FunctionExpression || current.kind === ts.SyntaxKind.FunctionDeclaration || current.kind === ts.SyntaxKind.ArrowFunction || current.kind === ts.SyntaxKind.MethodDeclaration) {
packages/compiler/src/code-generation/code-generators/binary-expression-code-generator.ts on lines 12..15

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

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 4 locations. Consider refactoring.
Open

    visitNumberKeyword(keyword: ts.Token<ts.SyntaxKind.NumberKeyword>, context: TransformVisitorContext): ts.Token<ts.SyntaxKind.NumberKeyword> {
        return context.visitEachChild(keyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 19..21
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 43..45
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 55..58

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

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 4 locations. Consider refactoring.
Open

    visitStringLiteral(stringLiteral: ts.Token<ts.SyntaxKind.StringLiteral>, context: TransformVisitorContext): ts.Token<ts.SyntaxKind.StringLiteral> {
        return context.visitEachChild(stringLiteral);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 19..21
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 31..33
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 55..58

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

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 4 locations. Consider refactoring.
Open

    visitExportKeyword(exportKeyword: ts.Token<ts.SyntaxKind.ExportKeyword>, context: TransformVisitorContext): ts.Token<ts.SyntaxKind.ExportKeyword> {
        return context.visitEachChild(exportKeyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 31..33
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 43..45
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 55..58

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

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 4 locations. Consider refactoring.
Open

    visitFirstLiteralToken(firstLiteralToken: ts.Token<ts.SyntaxKind.FirstLiteralToken>,
                           context: TransformVisitorContext): ts.Token<ts.SyntaxKind.FirstLiteralToken> {
        return context.visitEachChild(firstLiteralToken);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 19..21
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 31..33
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 43..45

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

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 3 locations. Consider refactoring.
Open

        it("calls the constructor of the instance", async (cb) => {
            const instance = await callsInstanceConstructor(10, 20);
            expect(instance.x).toBe(10);
            expect(instance.y).toBe(20);
            cb();
Severity: Major
Found in packages/compiler/__integrationtests__/classes.spec.ts and 2 other locations - About 1 hr to fix
packages/compiler/__integrationtests__/classes.spec.ts on lines 212..217
packages/compiler/__integrationtests__/classes.spec.ts on lines 350..356

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

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 3 locations. Consider refactoring.
Open

        it("assigns values to the properties", async (cb) => {
            const instance = await createInstanceAndAssignValuesToAttributes(10, 20);

            expect(instance.x).toBe(10);
            expect(instance.y).toBe(20);
Severity: Major
Found in packages/compiler/__integrationtests__/classes.spec.ts and 2 other locations - About 1 hr to fix
packages/compiler/__integrationtests__/classes.spec.ts on lines 205..210
packages/compiler/__integrationtests__/classes.spec.ts on lines 212..217

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

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 3 locations. Consider refactoring.
Open

        it("initializes the field with the argument values for fields declared in the constructor", async (cb) => {
            const instance = await createInstanceOfClassWithFieldsDeclaredInConstructor(10, 20);
            expect(instance.x).toBe(10);
            expect(instance.y).toBe(20);
            cb();
Severity: Major
Found in packages/compiler/__integrationtests__/classes.spec.ts and 2 other locations - About 1 hr to fix
packages/compiler/__integrationtests__/classes.spec.ts on lines 205..210
packages/compiler/__integrationtests__/classes.spec.ts on lines 350..356

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

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 8 locations. Consider refactoring.
Open

    visitThisKeyword?(thisKeyword: ts.Token<ts.SyntaxKind.ThisKeyword>, context: TransformVisitorContext): ts.VisitResult<ts.Node> {
        return context.visitEachChild(thisKeyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 68..70
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 72..74
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 100..102
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 108..110
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 124..126
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 140..142
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 168..170

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

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 8 locations. Consider refactoring.
Open

    visitPublicKeyword?(publicKeyword: ts.Token<ts.SyntaxKind.PublicKeyword>, context: TransformVisitorContext): ts.VisitResult<ts.Node> {
        return context.visitEachChild(publicKeyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 68..70
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 72..74
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 100..102
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 108..110
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 124..126
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 132..134
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 140..142

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

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 8 locations. Consider refactoring.
Open

    visitAsyncKeyword(asyncKeyword: ts.Token<ts.SyntaxKind.AsyncKeyword>, context: TransformVisitorContext): ts.VisitResult<ts.Node> {
        return context.visitEachChild(asyncKeyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 72..74
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 100..102
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 108..110
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 124..126
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 132..134
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 140..142
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 168..170

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

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 8 locations. Consider refactoring.
Open

    visitPrivateKeyword?(privateKeyword: ts.Token<ts.SyntaxKind.PrivateKeyword>, context: TransformVisitorContext): ts.VisitResult<ts.Node> {
        return context.visitEachChild(privateKeyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 68..70
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 72..74
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 100..102
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 108..110
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 124..126
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 132..134
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 168..170

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

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 8 locations. Consider refactoring.
Open

    visitBooleanKeyword(booleanKeyword: ts.Token<ts.SyntaxKind.BooleanKeyword>, context: TransformVisitorContext): ts.VisitResult<ts.Node> {
        return context.visitEachChild(booleanKeyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 68..70
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 72..74
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 108..110
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 124..126
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 132..134
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 140..142
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 168..170

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

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 8 locations. Consider refactoring.
Open

    visitIntKeyword(intKeyword: ts.Token<ts.SyntaxKind.IntKeyword>, context: TransformVisitorContext): ts.VisitResult<ts.Node> {
        return context.visitEachChild(intKeyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 68..70
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 100..102
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 108..110
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 124..126
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 132..134
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 140..142
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 168..170

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

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 8 locations. Consider refactoring.
Open

    visitTrueKeyword(trueKeyword: ts.Token<ts.SyntaxKind.TrueKeyword>, context: TransformVisitorContext): ts.VisitResult<ts.Node> {
        return context.visitEachChild(trueKeyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 68..70
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 72..74
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 100..102
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 124..126
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 132..134
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 140..142
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 168..170

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

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 8 locations. Consider refactoring.
Open

    visitFalseKeyword(falseKeyword: ts.Token<ts.SyntaxKind.FalseKeyword>, context: TransformVisitorContext): ts.VisitResult<ts.Node> {
        return context.visitEachChild(falseKeyword);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 68..70
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 72..74
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 100..102
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 108..110
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 132..134
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 140..142
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 168..170

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

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

Severity
Category
Status
Source
Language