tom-weatherhead/thaw-grammar

View on GitHub

Showing 105 of 181 total issues

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

export const falseClass = new SmalltalkClass(
    falseClassName,
    objectClassName,
    [],
    [stringValueVar],
src/languages/smalltalk/domain-object-model/object-instance.ts on lines 154..172

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

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

export function createPairUsage(
    first: ILCExpression,
    second: ILCExpression,
    options: { f?: string } = {}
): ILCExpression {
Severity: Major
Found in src/languages/lambda-calculus/operators.ts and 1 other location - About 2 hrs to fix
src/languages/lambda-calculus/operators.ts on lines 377..385

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

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

export function lcaConsUsage(
    h: ILCExpression,
    t: ILCExpression,
    options: { f?: string } = {}
): ILCExpression {
Severity: Major
Found in src/languages/lambda-calculus/operators.ts and 1 other location - About 2 hrs to fix
src/languages/lambda-calculus/operators.ts on lines 225..233

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

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

export function createOperatorIncrement(
    options: { n?: string; f?: string; x?: string } = {}
): ILCExpression {
    // ++ (successor) : λn.λf.λx.(f ((n f) x))
    const n = v(options.n, 'n');
Severity: Major
Found in src/languages/lambda-calculus/operators.ts and 1 other location - About 2 hrs to fix
src/languages/lambda-calculus/operators.ts on lines 154..161

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

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

export function createOperatorDecrement(
    options: { n?: string; f?: string; x?: string } = {}
): ILCExpression {
    // -- (predecessor) : λn.λf.λx.(((n λg.λh.(h (g f))) λu.x) λu.u)
    const n = v(options.n, 'n');
Severity: Major
Found in src/languages/lambda-calculus/operators.ts and 1 other location - About 2 hrs to fix
src/languages/lambda-calculus/operators.ts on lines 131..138

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

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

export function isLetUsage<T>(obj: unknown): obj is LetUsage<T> {
    const letUsage = obj as LetUsage<T>;

    return typeof letUsage !== 'undefined' && letUsage.typename === typenameLetUsage;
}
Severity: Major
Found in src/common/domain-object-model/let-usage.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/common/domain-object-model/while-usage.ts on lines 9..13
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isLetStarUsage<T>(obj: unknown): obj is LetStarUsage<T> {
    const letStarUsage = obj as LetStarUsage<T>;

    return typeof letStarUsage !== 'undefined' && letStarUsage.typename === typenameLetStarUsage;
}
Severity: Major
Found in src/common/domain-object-model/let-star-usage.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/common/domain-object-model/while-usage.ts on lines 9..13
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isVariableT<T>(obj: unknown): obj is Variable<T> {
    const otherVariable = obj as Variable<T>;

    return typeof otherVariable !== 'undefined' && otherVariable.typename === typenameVariableT;
}
Severity: Major
Found in src/common/domain-object-model/variable.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/while-usage.ts on lines 9..13
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isIfUsage<T>(obj: unknown): obj is IfUsage<T> {
    const ifUsage = obj as IfUsage<T>;

    return typeof ifUsage !== 'undefined' && ifUsage.typename === typenameIfUsage;
}
Severity: Major
Found in src/common/domain-object-model/if-usage.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/common/domain-object-model/while-usage.ts on lines 9..13
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isFunctionDefinition<T>(obj: unknown): obj is FunctionDefinition<T> {
    const str = obj as FunctionDefinition<T>;

    return typeof str !== 'undefined' && str.typename === typenameFunctionDefinition;
}
Severity: Major
Found in src/common/domain-object-model/function-definition.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/common/domain-object-model/while-usage.ts on lines 9..13
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isBeginUsage<T>(obj: unknown): obj is BeginUsage<T> {
    const beginUsage = obj as BeginUsage<T>;

    return typeof beginUsage !== 'undefined' && beginUsage.typename === typenameBeginUsage;
}
Severity: Major
Found in src/common/domain-object-model/begin-usage.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/common/domain-object-model/while-usage.ts on lines 9..13
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isLetRecUsage<T>(obj: unknown): obj is LetRecUsage<T> {
    const lru = obj as LetRecUsage<T>;

    return typeof lru !== 'undefined' && lru.typename === typenameLetRecUsage;
}
Severity: Major
Found in src/languages/scheme/domain-object-model/let-rec-usage.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/common/domain-object-model/while-usage.ts on lines 9..13

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

export function isOperatorUsage<T>(obj: unknown): obj is OperatorUsage<T> {
    const operatorUsage = obj as OperatorUsage<T>;

    return typeof operatorUsage !== 'undefined' && operatorUsage.typename === typenameOperatorUsage;
}
Severity: Major
Found in src/common/domain-object-model/operator-usage.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/common/domain-object-model/while-usage.ts on lines 9..13
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isCondUsage<T>(obj: unknown): obj is CondUsage<T> {
    const condUsage = obj as CondUsage<T>;

    return typeof condUsage !== 'undefined' && condUsage.typename === typenameCondUsage;
}
Severity: Major
Found in src/common/domain-object-model/cond-usage.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/common/domain-object-model/while-usage.ts on lines 9..13
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isSetUsage<T>(obj: unknown): obj is SetUsage<T> {
    const setUsage = obj as SetUsage<T>;

    return typeof setUsage !== 'undefined' && setUsage.typename === typenameSetUsage;
}
Severity: Major
Found in src/common/domain-object-model/set-usage.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/common/domain-object-model/while-usage.ts on lines 9..13
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isWhileUsage<T>(obj: unknown): obj is WhileUsage<T> {
    const whileUsage = obj as WhileUsage<T>;

    return typeof whileUsage !== 'undefined' && whileUsage.typename === typenameWhileUsage;
}
Severity: Major
Found in src/common/domain-object-model/while-usage.ts and 10 other locations - About 2 hrs to fix
src/common/domain-object-model/begin-usage.ts on lines 9..13
src/common/domain-object-model/cond-usage.ts on lines 9..13
src/common/domain-object-model/function-definition.ts on lines 12..16
src/common/domain-object-model/if-usage.ts on lines 9..13
src/common/domain-object-model/let-star-usage.ts on lines 12..16
src/common/domain-object-model/let-usage.ts on lines 10..14
src/common/domain-object-model/operator-usage.ts on lines 12..16
src/common/domain-object-model/set-usage.ts on lines 12..16
src/common/domain-object-model/variable.ts on lines 16..20
src/languages/scheme/domain-object-model/let-rec-usage.ts on lines 13..17

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

export function isCLUSettorDefinition(obj: unknown): obj is CLUSettorDefinition {
    const v = obj as CLUSettorDefinition;

    return (
        typeof v !== 'undefined' &&
Severity: Major
Found in src/languages/clu/domain-object-model/settor-definition.ts and 8 other locations - About 2 hrs to fix
src/languages/clu/domain-object-model/constructor-definition.ts on lines 21..29
src/languages/clu/domain-object-model/data-types/primitive-value.ts on lines 13..21
src/languages/clu/domain-object-model/data-types/user-value.ts on lines 15..23
src/languages/clu/domain-object-model/normal-function-definition.ts on lines 22..30
src/languages/clu/domain-object-model/one-part-function-name.ts on lines 7..15
src/languages/clu/domain-object-model/selector-definition.ts on lines 21..29
src/languages/sasl/graph-reduction.ts on lines 60..68
src/languages/smalltalk/domain-object-model/variable.ts on lines 18..26

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

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

export function isOnePartFunctionName(obj: unknown): obj is OnePartFunctionName {
    const v = obj as OnePartFunctionName;

    return (
        typeof v !== 'undefined' &&
src/languages/clu/domain-object-model/constructor-definition.ts on lines 21..29
src/languages/clu/domain-object-model/data-types/primitive-value.ts on lines 13..21
src/languages/clu/domain-object-model/data-types/user-value.ts on lines 15..23
src/languages/clu/domain-object-model/normal-function-definition.ts on lines 22..30
src/languages/clu/domain-object-model/selector-definition.ts on lines 21..29
src/languages/clu/domain-object-model/settor-definition.ts on lines 21..29
src/languages/sasl/graph-reduction.ts on lines 60..68
src/languages/smalltalk/domain-object-model/variable.ts on lines 18..26

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

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

export function isCLUUserValue(obj: unknown): obj is CLUUserValue {
    const v = obj as CLUUserValue;

    return (
        typeof v !== 'undefined' &&
src/languages/clu/domain-object-model/constructor-definition.ts on lines 21..29
src/languages/clu/domain-object-model/data-types/primitive-value.ts on lines 13..21
src/languages/clu/domain-object-model/normal-function-definition.ts on lines 22..30
src/languages/clu/domain-object-model/one-part-function-name.ts on lines 7..15
src/languages/clu/domain-object-model/selector-definition.ts on lines 21..29
src/languages/clu/domain-object-model/settor-definition.ts on lines 21..29
src/languages/sasl/graph-reduction.ts on lines 60..68
src/languages/smalltalk/domain-object-model/variable.ts on lines 18..26

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

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

export function isGraphReductionNode(obj: unknown): obj is GraphReductionNode {
    const otherNode = obj as GraphReductionNode;

    return (
        typeof otherNode !== 'undefined' &&
Severity: Major
Found in src/languages/sasl/graph-reduction.ts and 8 other locations - About 2 hrs to fix
src/languages/clu/domain-object-model/constructor-definition.ts on lines 21..29
src/languages/clu/domain-object-model/data-types/primitive-value.ts on lines 13..21
src/languages/clu/domain-object-model/data-types/user-value.ts on lines 15..23
src/languages/clu/domain-object-model/normal-function-definition.ts on lines 22..30
src/languages/clu/domain-object-model/one-part-function-name.ts on lines 7..15
src/languages/clu/domain-object-model/selector-definition.ts on lines 21..29
src/languages/clu/domain-object-model/settor-definition.ts on lines 21..29
src/languages/smalltalk/domain-object-model/variable.ts on lines 18..26

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

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