ahilke/js-crap-score

View on GitHub

Showing 45 of 45 total issues

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

export const multiFunctionLineTestCases: CrapReportTest[] = [
    {
        project: "esm",
        filePath: "multi-function-line.ts",
        istanbulFunctionName: "evenCubes",
Severity: Major
Found in src/crap/__tests__/esm/multi-function-line.ts and 1 other location - About 1 day to fix
src/crap/__tests__/esm/generic.ts on lines 3..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 313.

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 const genericTestCases: CrapReportTest[] = [
    {
        project: "esm",
        filePath: "generic.ts",
        istanbulFunctionName: "(anonymous_0)",
Severity: Major
Found in src/crap/__tests__/esm/generic.ts and 1 other location - About 1 day to fix
src/crap/__tests__/esm/multi-function-line.ts on lines 3..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 313.

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

export const constructorTestCases: CrapReportTest[] = [
    {
        project: "esm",
        filePath: "constructor.ts",
        istanbulFunctionName: "(anonymous_0)",
Severity: Major
Found in src/crap/__tests__/esm/constructor.ts and 3 other locations - About 4 hrs to fix
src/crap/__tests__/cjs/if-else.ts on lines 3..28
src/crap/__tests__/esm/re-export.ts on lines 3..28
src/crap/__tests__/esm/switch.ts on lines 3..28

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

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

export const ifElseTestCases: CrapReportTest[] = [
    {
        project: "cjs",
        filePath: "if-else/if-covered.ts",
        istanbulFunctionName: "ifCovered",
Severity: Major
Found in src/crap/__tests__/cjs/if-else.ts and 3 other locations - About 4 hrs to fix
src/crap/__tests__/esm/constructor.ts on lines 3..28
src/crap/__tests__/esm/re-export.ts on lines 3..28
src/crap/__tests__/esm/switch.ts on lines 3..28

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

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

export const switchTestCases: CrapReportTest[] = [
    {
        project: "esm",
        filePath: "switch.ts",
        istanbulFunctionName: "switchCase",
Severity: Major
Found in src/crap/__tests__/esm/switch.ts and 3 other locations - About 4 hrs to fix
src/crap/__tests__/cjs/if-else.ts on lines 3..28
src/crap/__tests__/esm/constructor.ts on lines 3..28
src/crap/__tests__/esm/re-export.ts on lines 3..28

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

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

export const reExportTestCases: CrapReportTest[] = [
    {
        project: "esm",
        filePath: "re-export.ts",
        istanbulFunctionName: "localAbs",
Severity: Major
Found in src/crap/__tests__/esm/re-export.ts and 3 other locations - About 4 hrs to fix
src/crap/__tests__/cjs/if-else.ts on lines 3..28
src/crap/__tests__/esm/constructor.ts on lines 3..28
src/crap/__tests__/esm/switch.ts on lines 3..28

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

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

    {
        project: "cjs",
        filePath: "class.ts",
        istanbulFunctionName: "(anonymous_2)",
        expectedReport: {
Severity: Major
Found in src/crap/__tests__/cjs/class.ts and 3 other locations - About 3 hrs to fix
src/crap/__tests__/cjs/class.ts on lines 76..99
src/crap/__tests__/cjs/nested-functions.ts on lines 4..27
src/crap/__tests__/esm/class-expression.ts on lines 4..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 104.

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

    {
        project: "esm",
        filePath: "class-expression.ts",
        istanbulFunctionName: "(anonymous_0)",
        expectedReport: {
Severity: Major
Found in src/crap/__tests__/esm/class-expression.ts and 3 other locations - About 3 hrs to fix
src/crap/__tests__/cjs/class.ts on lines 52..75
src/crap/__tests__/cjs/class.ts on lines 76..99
src/crap/__tests__/cjs/nested-functions.ts on lines 4..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 104.

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

    {
        project: "cjs",
        filePath: "class.ts",
        istanbulFunctionName: "(anonymous_3)",
        expectedReport: {
Severity: Major
Found in src/crap/__tests__/cjs/class.ts and 3 other locations - About 3 hrs to fix
src/crap/__tests__/cjs/class.ts on lines 52..75
src/crap/__tests__/cjs/nested-functions.ts on lines 4..27
src/crap/__tests__/esm/class-expression.ts on lines 4..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 104.

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

    {
        project: "cjs",
        filePath: "nested-functions.ts",
        istanbulFunctionName: "getFunction",
        expectedReport: {
Severity: Major
Found in src/crap/__tests__/cjs/nested-functions.ts and 3 other locations - About 3 hrs to fix
src/crap/__tests__/cjs/class.ts on lines 52..75
src/crap/__tests__/cjs/class.ts on lines 76..99
src/crap/__tests__/esm/class-expression.ts on lines 4..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 104.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function create has 85 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        create(context) {
            // Using a stack to store complexity per code path
            const complexities: number[] = [];

            function increaseComplexity(): void {
Severity: Major
Found in src/eslint-plugin-crap/complexity.ts - About 3 hrs to fix

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

        {
            project: "esm",
            filePath: "enum.ts",
            istanbulFunctionName: "(anonymous_0)",
            expectedReport: {
    Severity: Major
    Found in src/crap/__tests__/esm/enum.ts and 7 other locations - About 3 hrs to fix
    src/crap/__tests__/cjs/re-export.ts on lines 4..27
    src/crap/__tests__/cjs/re-export.ts on lines 52..75
    src/crap/__tests__/esm/anonymous.ts on lines 28..51
    src/crap/__tests__/esm/if-else.ts on lines 76..99
    src/crap/__tests__/esm/no-op.ts on lines 28..51
    src/crap/__tests__/esm/no-op.ts on lines 52..75
    src/crap/__tests__/esm/no-op.ts on lines 100..123

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        {
            project: "esm",
            filePath: "no-op/class.ts",
            istanbulFunctionName: "(anonymous_2)",
            expectedReport: {
    Severity: Major
    Found in src/crap/__tests__/esm/no-op.ts and 7 other locations - About 3 hrs to fix
    src/crap/__tests__/cjs/re-export.ts on lines 4..27
    src/crap/__tests__/cjs/re-export.ts on lines 52..75
    src/crap/__tests__/esm/anonymous.ts on lines 28..51
    src/crap/__tests__/esm/enum.ts on lines 4..27
    src/crap/__tests__/esm/if-else.ts on lines 76..99
    src/crap/__tests__/esm/no-op.ts on lines 28..51
    src/crap/__tests__/esm/no-op.ts on lines 100..123

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        {
            project: "cjs",
            filePath: "re-export.ts",
            istanbulFunctionName: "(anonymous_2)",
            expectedReport: {
    Severity: Major
    Found in src/crap/__tests__/cjs/re-export.ts and 7 other locations - About 3 hrs to fix
    src/crap/__tests__/cjs/re-export.ts on lines 4..27
    src/crap/__tests__/esm/anonymous.ts on lines 28..51
    src/crap/__tests__/esm/enum.ts on lines 4..27
    src/crap/__tests__/esm/if-else.ts on lines 76..99
    src/crap/__tests__/esm/no-op.ts on lines 28..51
    src/crap/__tests__/esm/no-op.ts on lines 52..75
    src/crap/__tests__/esm/no-op.ts on lines 100..123

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        {
            project: "esm",
            filePath: "anonymous/function-expression.ts",
            istanbulFunctionName: "(anonymous_0)",
            expectedReport: {
    Severity: Major
    Found in src/crap/__tests__/esm/anonymous.ts and 7 other locations - About 3 hrs to fix
    src/crap/__tests__/cjs/re-export.ts on lines 4..27
    src/crap/__tests__/cjs/re-export.ts on lines 52..75
    src/crap/__tests__/esm/enum.ts on lines 4..27
    src/crap/__tests__/esm/if-else.ts on lines 76..99
    src/crap/__tests__/esm/no-op.ts on lines 28..51
    src/crap/__tests__/esm/no-op.ts on lines 52..75
    src/crap/__tests__/esm/no-op.ts on lines 100..123

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        {
            project: "esm",
            filePath: "if-else/fully-covered.ts",
            istanbulFunctionName: "fullyCovered",
            expectedReport: {
    Severity: Major
    Found in src/crap/__tests__/esm/if-else.ts and 7 other locations - About 3 hrs to fix
    src/crap/__tests__/cjs/re-export.ts on lines 4..27
    src/crap/__tests__/cjs/re-export.ts on lines 52..75
    src/crap/__tests__/esm/anonymous.ts on lines 28..51
    src/crap/__tests__/esm/enum.ts on lines 4..27
    src/crap/__tests__/esm/no-op.ts on lines 28..51
    src/crap/__tests__/esm/no-op.ts on lines 52..75
    src/crap/__tests__/esm/no-op.ts on lines 100..123

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        {
            project: "esm",
            filePath: "no-op/class.ts",
            istanbulFunctionName: "(anonymous_1)",
            expectedReport: {
    Severity: Major
    Found in src/crap/__tests__/esm/no-op.ts and 7 other locations - About 3 hrs to fix
    src/crap/__tests__/cjs/re-export.ts on lines 4..27
    src/crap/__tests__/cjs/re-export.ts on lines 52..75
    src/crap/__tests__/esm/anonymous.ts on lines 28..51
    src/crap/__tests__/esm/enum.ts on lines 4..27
    src/crap/__tests__/esm/if-else.ts on lines 76..99
    src/crap/__tests__/esm/no-op.ts on lines 52..75
    src/crap/__tests__/esm/no-op.ts on lines 100..123

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        {
            project: "cjs",
            filePath: "re-export.ts",
            istanbulFunctionName: "(anonymous_0)",
            expectedReport: {
    Severity: Major
    Found in src/crap/__tests__/cjs/re-export.ts and 7 other locations - About 3 hrs to fix
    src/crap/__tests__/cjs/re-export.ts on lines 52..75
    src/crap/__tests__/esm/anonymous.ts on lines 28..51
    src/crap/__tests__/esm/enum.ts on lines 4..27
    src/crap/__tests__/esm/if-else.ts on lines 76..99
    src/crap/__tests__/esm/no-op.ts on lines 28..51
    src/crap/__tests__/esm/no-op.ts on lines 52..75
    src/crap/__tests__/esm/no-op.ts on lines 100..123

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

        {
            project: "esm",
            filePath: "no-op/function.ts",
            istanbulFunctionName: "noOp",
            expectedReport: {
    Severity: Major
    Found in src/crap/__tests__/esm/no-op.ts and 7 other locations - About 3 hrs to fix
    src/crap/__tests__/cjs/re-export.ts on lines 4..27
    src/crap/__tests__/cjs/re-export.ts on lines 52..75
    src/crap/__tests__/esm/anonymous.ts on lines 28..51
    src/crap/__tests__/esm/enum.ts on lines 4..27
    src/crap/__tests__/esm/if-else.ts on lines 76..99
    src/crap/__tests__/esm/no-op.ts on lines 28..51
    src/crap/__tests__/esm/no-op.ts on lines 52..75

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

    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

        private getJsonReportFile(value: unknown): string | undefined {
            if (value === undefined) {
                return "crap-report/crap-report.json";
            }
            if (value === false) {
    Severity: Major
    Found in src/test-reporter/reporter.ts and 1 other location - About 2 hrs to fix
    src/test-reporter/reporter.ts on lines 101..112

    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

    Severity
    Category
    Status
    Source
    Language