MichaReiser/speedy.js

View on GitHub

Showing 216 of 322 total issues

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

    static unsupportedImplicitCastOfArgument(elementNotMatchingArrayElementType: ts.Expression, parameterType: string, argumentType: string) {
        return CodeGenerationDiagnostics.createException(
            elementNotMatchingArrayElementType,
            diagnostics.UnsupportedImplicitCastOfArgument,
            argumentType,
Severity: Major
Found in packages/compiler/src/code-generation-diagnostic.ts and 3 other locations - About 40 mins to fix
packages/compiler/src/code-generation-diagnostic.ts on lines 188..196
packages/compiler/src/code-generation-diagnostic.ts on lines 206..214
packages/compiler/src/code-generation-diagnostic.ts on lines 216..218

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

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

    static unsupportedImplicitCastOfReturnValue(returnStatement: ts.ReturnStatement, declaredReturnType: string, returnStatementExpressionType: string) {
        return CodeGenerationDiagnostics.createException(
            returnStatement,
            diagnostics.UnsupportedImplicitCastOfReturnValue,
            returnStatementExpressionType,
Severity: Major
Found in packages/compiler/src/code-generation-diagnostic.ts and 3 other locations - About 40 mins to fix
packages/compiler/src/code-generation-diagnostic.ts on lines 178..186
packages/compiler/src/code-generation-diagnostic.ts on lines 188..196
packages/compiler/src/code-generation-diagnostic.ts on lines 216..218

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

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

    static unsupportedImplicitCastOfConditionalResult(conditionalResult: ts.Expression, typeOfConditional: string, typeOfConditionResult: string) {
        return CodeGenerationDiagnostics.createException(
            conditionalResult,
            diagnostics.UnsupportedImplicitCastOfConditionalResult,
            typeOfConditionResult,
Severity: Major
Found in packages/compiler/src/code-generation-diagnostic.ts and 3 other locations - About 40 mins to fix
packages/compiler/src/code-generation-diagnostic.ts on lines 178..186
packages/compiler/src/code-generation-diagnostic.ts on lines 206..214
packages/compiler/src/code-generation-diagnostic.ts on lines 216..218

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

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

    static unsupportedImplicitCast(node: ts.Node, castTargetType: string, actualValueType: string) {
        return CodeGenerationDiagnostics.createException(node, diagnostics.UnsupportedImplicitCast, actualValueType, castTargetType, castTargetType);
    }
Severity: Major
Found in packages/compiler/src/code-generation-diagnostic.ts and 3 other locations - About 40 mins to fix
packages/compiler/src/code-generation-diagnostic.ts on lines 178..186
packages/compiler/src/code-generation-diagnostic.ts on lines 188..196
packages/compiler/src/code-generation-diagnostic.ts on lines 206..214

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

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

    visitSourceFile(sourceFile: ts.SourceFile, context: TransformVisitorContext): ts.SourceFile {
        return context.visitEachChild(sourceFile);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 15..17
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 23..25
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 27..29
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 35..37
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 39..41
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 47..49
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 51..53
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 60..62
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 64..66

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

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

    visitParameter(parameter: ts.ParameterDeclaration, context: TransformVisitorContext): ts.ParameterDeclaration {
        return context.visitEachChild(parameter);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 11..13
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 15..17
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 23..25
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 35..37
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 39..41
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 47..49
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 51..53
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 60..62
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 64..66

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

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

    visitExpressionStatement(expressionStatement: ts.ExpressionStatement, context: TransformVisitorContext): ts.ExpressionStatement {
        return context.visitEachChild(expressionStatement);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 11..13
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 15..17
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 23..25
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 27..29
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 35..37
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 47..49
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 51..53
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 60..62
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 64..66

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

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

    static unsupportedCast(node: ts.AsExpression, sourceType: string, targetType: string) {
        return CodeGenerationDiagnostics.createException(node, diagnostics.UnsupportedCast, sourceType, targetType);
    }
Severity: Major
Found in packages/compiler/src/code-generation-diagnostic.ts and 3 other locations - About 35 mins to fix
packages/compiler/src/code-generation-diagnostic.ts on lines 73..75
packages/compiler/src/code-generation-diagnostic.ts on lines 160..167
packages/compiler/src/code-generation-diagnostic.ts on lines 169..176

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

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

    visitFunctionDeclaration(functionDeclaration: ts.FunctionDeclaration, context: TransformVisitorContext): ts.FunctionDeclaration {
        return context.visitEachChild(functionDeclaration);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 11..13
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 23..25
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 27..29
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 35..37
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 39..41
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 47..49
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 51..53
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 60..62
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 64..66

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

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

    visitIdentifier(identifier: ts.Identifier, context: TransformVisitorContext): ts.Identifier {
        return context.visitEachChild(identifier);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 11..13
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 15..17
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 27..29
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 35..37
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 39..41
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 47..49
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 51..53
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 60..62
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 64..66

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

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

    visitCallExpression(callExpression: ts.CallExpression, context: TransformVisitorContext): ts.CallExpression {
        return context.visitEachChild(callExpression);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 11..13
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 15..17
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 23..25
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 27..29
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 35..37
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 39..41
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 47..49
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 51..53
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 60..62

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

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

    static implicitArrayElementCast(element: ts.Expression, arrayElementType: string, typeOfElementRequiringImplicitCast: string) {
        return CodeGenerationDiagnostics.createException(
            element,
            diagnostics.UnsupportedImplicitArrayElementCast,
            typeOfElementRequiringImplicitCast,
Severity: Major
Found in packages/compiler/src/code-generation-diagnostic.ts and 3 other locations - About 35 mins to fix
packages/compiler/src/code-generation-diagnostic.ts on lines 73..75
packages/compiler/src/code-generation-diagnostic.ts on lines 156..158
packages/compiler/src/code-generation-diagnostic.ts on lines 169..176

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

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

    visitIfStatement(ifStatement: ts.IfStatement, context: TransformVisitorContext): ts.IfStatement {
        return context.visitEachChild(ifStatement);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 11..13
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 15..17
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 23..25
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 27..29
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 35..37
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 39..41
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 51..53
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 60..62
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 64..66

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

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

    static builtInMethodNotSupported(propertyAccessExpression: ts.PropertyAccessExpression, objectName: string, methodName: string) {
        return CodeGenerationDiagnostics.createException(propertyAccessExpression, diagnostics.BuiltInMethodNotSupported, methodName, objectName);
    }
Severity: Major
Found in packages/compiler/src/code-generation-diagnostic.ts and 3 other locations - About 35 mins to fix
packages/compiler/src/code-generation-diagnostic.ts on lines 156..158
packages/compiler/src/code-generation-diagnostic.ts on lines 160..167
packages/compiler/src/code-generation-diagnostic.ts on lines 169..176

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

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

    visitBlock(block: ts.Block, context: TransformVisitorContext): ts.Block {
        return context.visitEachChild(block);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 11..13
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 15..17
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 23..25
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 27..29
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 39..41
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 47..49
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 51..53
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 60..62
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 64..66

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

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

    visitReturnStatement(returnStatement: ts.ReturnStatement, context: TransformVisitorContext): ts.ReturnStatement {
        return context.visitEachChild(returnStatement);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 11..13
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 15..17
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 23..25
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 27..29
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 35..37
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 39..41
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 47..49
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 51..53
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 64..66

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

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

    static unsupportedImplicitCastOfBinaryExpressionOperands(binaryExpression: ts.BinaryExpression, leftOperandType: string, rightOperandType: string) {
        return CodeGenerationDiagnostics.createException(
            binaryExpression,
            diagnostics.UnsupportedImplicitCastOfBinaryExpressionOperands,
            leftOperandType,
Severity: Major
Found in packages/compiler/src/code-generation-diagnostic.ts and 3 other locations - About 35 mins to fix
packages/compiler/src/code-generation-diagnostic.ts on lines 73..75
packages/compiler/src/code-generation-diagnostic.ts on lines 156..158
packages/compiler/src/code-generation-diagnostic.ts on lines 160..167

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

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

    visitBinaryExpression(binaryExpression: ts.BinaryExpression, context: TransformVisitorContext): ts.BinaryExpression {
        return context.visitEachChild(binaryExpression);
    }
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 11..13
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 15..17
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 23..25
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 27..29
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 35..37
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 39..41
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 47..49
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 60..62
packages/compiler/src/transform/log-unknown-transform-visitor.ts on lines 64..66

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

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

            if (!casted) {
                throw CodeGenerationDiagnostics.unsupportedImplicitCastOfReturnValue(
                    returnStatement,
                    context.typeChecker.typeToString(returnType),
                    context.typeChecker.typeToString(expressionType)
packages/compiler/src/code-generation/code-generators/binary-expression-code-generator.ts on lines 397..403
packages/compiler/src/code-generation/code-generators/variable-declaration-code-generator.ts on lines 21..27

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

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

            if (!castedInitializer) {
                throw CodeGenerationDiagnostics.unsupportedImplicitCast(
                    variableDeclaration,
                    context.typeChecker.typeToString(type),
                    context.typeChecker.typeToString(initializerType)
packages/compiler/src/code-generation/code-generators/binary-expression-code-generator.ts on lines 397..403
packages/compiler/src/code-generation/code-generators/return-statement-code-generator.ts on lines 23..29

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

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