tom-weatherhead/thaw-grammar

View on GitHub

Showing 105 of 181 total issues

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

export function isCLUPrimitiveValue(obj: unknown): obj is CLUPrimitiveValue {
    const v = obj as CLUPrimitiveValue;

    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/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/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 isCLUSelectorDefinition(obj: unknown): obj is CLUSelectorDefinition {
    const v = obj as CLUSelectorDefinition;

    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/one-part-function-name.ts on lines 7..15
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 isSmalltalkVariable(obj: unknown): obj is ISmalltalkVariable {
    const v = obj as ISmalltalkVariable;

    return (
        typeof v !== 'undefined' &&
Severity: Major
Found in src/languages/smalltalk/domain-object-model/variable.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/sasl/graph-reduction.ts on lines 60..68

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 isCLUConstructorDefinition(obj: unknown): obj is CLUConstructorDefinition {
    const v = obj as CLUConstructorDefinition;

    return (
        typeof v !== 'undefined' &&
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/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

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

export function lcaTail(options: { l?: string; h?: string; t?: string } = {}): ILCExpression {
    const ll = v(options.l, 'l');

    return l(ll, lcaTailUsage(ll, options));
}
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 449..453

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

    public Unify(otherExpr: IPrologExpression): ISubstitution | undefined {
        if (this.equals(otherExpr)) {
            // Do not use "if (this == otherExpr)", which just compares references.
            return createSubstitution();
        } else if (isIPrologVariable(otherExpr)) {
src/languages/prolog/domain-object-model/prolog-float-literal.ts on lines 67..76

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

    public Unify(otherExpr: IPrologExpression): ISubstitution | undefined {
        if (this.equals(otherExpr)) {
            // Do not use "if (this == otherExpr)", which just compares references.
            return createSubstitution();
        } else if (isIPrologVariable(otherExpr)) {
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 62..71

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

    public equals(other: unknown): boolean {
        const otherFloatLit = other as PrologFloatLiteral;

        return (
            typeof otherFloatLit !== 'undefined' &&
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 32..40

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

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

    public equals(other: unknown): boolean {
        const otherIntLit = other as PrologIntegerLiteral;

        return (
            typeof otherIntLit !== 'undefined' &&
src/languages/prolog/domain-object-model/prolog-float-literal.ts on lines 37..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 63.

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

export function isLCVariable(obj: unknown): obj is ILCVariable {
    const otherLCVariable = obj as ILCExpression;

    return (
        typeof otherLCVariable !== 'undefined' && otherLCVariable.typename === typenameLCVariable
Severity: Major
Found in src/languages/lambda-calculus/type-guards.ts and 11 other locations - About 1 hr to fix
src/languages/clu/utilities/type-guards.ts on lines 7..11
src/languages/lambda-calculus/type-guards.ts on lines 14..21
src/languages/lambda-calculus/type-guards.ts on lines 23..30
src/languages/lisp/domain-object-model/macro-definition.ts on lines 36..40
src/languages/lisp/domain-object-model/quoted-constant-with-apostrophe.ts on lines 11..15
src/languages/lisp/domain-object-model/quoted-constant-with-quote-keyword.ts on lines 11..17
src/languages/prolog/domain-object-model/prolog-goal.ts on lines 14..18
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 14..18
src/languages/scheme/domain-object-model/call-cc-usage.ts on lines 20..24
src/languages/scheme/domain-object-model/evaluable-expression.ts on lines 19..23
src/languages/scheme/domain-object-model/lambda-expression.ts on lines 15..19

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

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

export function isEvaluableExpression(obj: unknown): obj is EvaluableExpression {
    const ee = obj as EvaluableExpression;

    return typeof ee !== 'undefined' && ee.typename === typenameEvaluableExpression;
}
src/languages/clu/utilities/type-guards.ts on lines 7..11
src/languages/lambda-calculus/type-guards.ts on lines 14..21
src/languages/lambda-calculus/type-guards.ts on lines 23..30
src/languages/lambda-calculus/type-guards.ts on lines 32..38
src/languages/lisp/domain-object-model/macro-definition.ts on lines 36..40
src/languages/lisp/domain-object-model/quoted-constant-with-apostrophe.ts on lines 11..15
src/languages/lisp/domain-object-model/quoted-constant-with-quote-keyword.ts on lines 11..17
src/languages/prolog/domain-object-model/prolog-goal.ts on lines 14..18
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 14..18
src/languages/scheme/domain-object-model/call-cc-usage.ts on lines 20..24
src/languages/scheme/domain-object-model/lambda-expression.ts on lines 15..19

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

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

export function isQuotedConstantWithApostrophe(obj: unknown): obj is QuotedConstantWithApostrophe {
    const qca = obj as QuotedConstantWithApostrophe;

    return typeof qca !== 'undefined' && qca.typename === typenameQuotedConstantWithApostrophe;
}
src/languages/clu/utilities/type-guards.ts on lines 7..11
src/languages/lambda-calculus/type-guards.ts on lines 14..21
src/languages/lambda-calculus/type-guards.ts on lines 23..30
src/languages/lambda-calculus/type-guards.ts on lines 32..38
src/languages/lisp/domain-object-model/macro-definition.ts on lines 36..40
src/languages/lisp/domain-object-model/quoted-constant-with-quote-keyword.ts on lines 11..17
src/languages/prolog/domain-object-model/prolog-goal.ts on lines 14..18
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 14..18
src/languages/scheme/domain-object-model/call-cc-usage.ts on lines 20..24
src/languages/scheme/domain-object-model/evaluable-expression.ts on lines 19..23
src/languages/scheme/domain-object-model/lambda-expression.ts on lines 15..19

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

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

export function isPrologIntegerLiteral(obj: unknown): obj is PrologIntegerLiteral {
    const intlit = obj as PrologIntegerLiteral;

    return typeof intlit !== 'undefined' && intlit.typename === typenamePrologIntegerLiteral;
}
src/languages/clu/utilities/type-guards.ts on lines 7..11
src/languages/lambda-calculus/type-guards.ts on lines 14..21
src/languages/lambda-calculus/type-guards.ts on lines 23..30
src/languages/lambda-calculus/type-guards.ts on lines 32..38
src/languages/lisp/domain-object-model/macro-definition.ts on lines 36..40
src/languages/lisp/domain-object-model/quoted-constant-with-apostrophe.ts on lines 11..15
src/languages/lisp/domain-object-model/quoted-constant-with-quote-keyword.ts on lines 11..17
src/languages/prolog/domain-object-model/prolog-goal.ts on lines 14..18
src/languages/scheme/domain-object-model/call-cc-usage.ts on lines 20..24
src/languages/scheme/domain-object-model/evaluable-expression.ts on lines 19..23
src/languages/scheme/domain-object-model/lambda-expression.ts on lines 15..19

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

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

export function isLCLambdaExpression(obj: unknown): obj is ILCLambdaExpression {
    const otherLCLambdaExpression = obj as ILCLambdaExpression;

    return (
        typeof otherLCLambdaExpression !== 'undefined' &&
Severity: Major
Found in src/languages/lambda-calculus/type-guards.ts and 11 other locations - About 1 hr to fix
src/languages/clu/utilities/type-guards.ts on lines 7..11
src/languages/lambda-calculus/type-guards.ts on lines 14..21
src/languages/lambda-calculus/type-guards.ts on lines 32..38
src/languages/lisp/domain-object-model/macro-definition.ts on lines 36..40
src/languages/lisp/domain-object-model/quoted-constant-with-apostrophe.ts on lines 11..15
src/languages/lisp/domain-object-model/quoted-constant-with-quote-keyword.ts on lines 11..17
src/languages/prolog/domain-object-model/prolog-goal.ts on lines 14..18
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 14..18
src/languages/scheme/domain-object-model/call-cc-usage.ts on lines 20..24
src/languages/scheme/domain-object-model/evaluable-expression.ts on lines 19..23
src/languages/scheme/domain-object-model/lambda-expression.ts on lines 15..19

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

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

export function isLambdaExpression(obj: unknown): obj is LambdaExpression {
    const le = obj as LambdaExpression;

    return typeof le !== 'undefined' && le.typename === typenameLambdaExpression;
}
src/languages/clu/utilities/type-guards.ts on lines 7..11
src/languages/lambda-calculus/type-guards.ts on lines 14..21
src/languages/lambda-calculus/type-guards.ts on lines 23..30
src/languages/lambda-calculus/type-guards.ts on lines 32..38
src/languages/lisp/domain-object-model/macro-definition.ts on lines 36..40
src/languages/lisp/domain-object-model/quoted-constant-with-apostrophe.ts on lines 11..15
src/languages/lisp/domain-object-model/quoted-constant-with-quote-keyword.ts on lines 11..17
src/languages/prolog/domain-object-model/prolog-goal.ts on lines 14..18
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 14..18
src/languages/scheme/domain-object-model/call-cc-usage.ts on lines 20..24
src/languages/scheme/domain-object-model/evaluable-expression.ts on lines 19..23

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

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

export function isCallCCUsage(obj: unknown): obj is CallCCUsage {
    const cccu = obj as CallCCUsage;

    return typeof cccu !== 'undefined' && cccu.typename === typenameCallCCUsage;
}
Severity: Major
Found in src/languages/scheme/domain-object-model/call-cc-usage.ts and 11 other locations - About 1 hr to fix
src/languages/clu/utilities/type-guards.ts on lines 7..11
src/languages/lambda-calculus/type-guards.ts on lines 14..21
src/languages/lambda-calculus/type-guards.ts on lines 23..30
src/languages/lambda-calculus/type-guards.ts on lines 32..38
src/languages/lisp/domain-object-model/macro-definition.ts on lines 36..40
src/languages/lisp/domain-object-model/quoted-constant-with-apostrophe.ts on lines 11..15
src/languages/lisp/domain-object-model/quoted-constant-with-quote-keyword.ts on lines 11..17
src/languages/prolog/domain-object-model/prolog-goal.ts on lines 14..18
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 14..18
src/languages/scheme/domain-object-model/evaluable-expression.ts on lines 19..23
src/languages/scheme/domain-object-model/lambda-expression.ts on lines 15..19

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

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

export function isMacroDefinition(obj: unknown): obj is MacroDefinition {
    const md = obj as MacroDefinition;

    return typeof md !== 'undefined' && md.typename === typenameMacroDefinition;
}
src/languages/clu/utilities/type-guards.ts on lines 7..11
src/languages/lambda-calculus/type-guards.ts on lines 14..21
src/languages/lambda-calculus/type-guards.ts on lines 23..30
src/languages/lambda-calculus/type-guards.ts on lines 32..38
src/languages/lisp/domain-object-model/quoted-constant-with-apostrophe.ts on lines 11..15
src/languages/lisp/domain-object-model/quoted-constant-with-quote-keyword.ts on lines 11..17
src/languages/prolog/domain-object-model/prolog-goal.ts on lines 14..18
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 14..18
src/languages/scheme/domain-object-model/call-cc-usage.ts on lines 20..24
src/languages/scheme/domain-object-model/evaluable-expression.ts on lines 19..23
src/languages/scheme/domain-object-model/lambda-expression.ts on lines 15..19

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

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

export function isCluster(obj: unknown): obj is ICluster {
    const other = obj as ICluster;

    return typeof other !== 'undefined' && other.typename === typenameCluster;
}
Severity: Major
Found in src/languages/clu/utilities/type-guards.ts and 11 other locations - About 1 hr to fix
src/languages/lambda-calculus/type-guards.ts on lines 14..21
src/languages/lambda-calculus/type-guards.ts on lines 23..30
src/languages/lambda-calculus/type-guards.ts on lines 32..38
src/languages/lisp/domain-object-model/macro-definition.ts on lines 36..40
src/languages/lisp/domain-object-model/quoted-constant-with-apostrophe.ts on lines 11..15
src/languages/lisp/domain-object-model/quoted-constant-with-quote-keyword.ts on lines 11..17
src/languages/prolog/domain-object-model/prolog-goal.ts on lines 14..18
src/languages/prolog/domain-object-model/prolog-integer-literal.ts on lines 14..18
src/languages/scheme/domain-object-model/call-cc-usage.ts on lines 20..24
src/languages/scheme/domain-object-model/evaluable-expression.ts on lines 19..23
src/languages/scheme/domain-object-model/lambda-expression.ts on lines 15..19

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

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