aureooms/rejuvenate

View on GitHub

Showing 178 of 178 total issues

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

export async function precondition({read, assert}) {
    const text = await read(filename);
    assert(text !== format(text));
}
Severity: Major
Found in src/transforms/esdoc:format-config-file.js and 3 other locations - About 50 mins to fix
src/transforms/codeclimate:format-config-file.js on lines 14..17
src/transforms/codeclimate:format-config-file.js on lines 19..22
src/transforms/esdoc:format-config-file.js on lines 15..18

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

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

export async function postcondition({readYAML, assert}) {
    const config = await readYAML(configFile);
    assert(config.languages === undefined);
}
Severity: Major
Found in src/transforms/codeclimate:remove-obsolete-languages-key.js and 4 other locations - About 50 mins to fix
src/transforms/codeclimate:remove-obsolete-languages-key.js on lines 18..21
src/transforms/codeclimate:rename-exclude-paths-to-exclude-patterns.js on lines 13..16
src/transforms/renovate:remove-custom-automerge-key.js on lines 14..17
src/transforms/renovate:remove-custom-automerge-key.js on lines 19..22

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

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

export async function postcondition({readYAML, assert}) {
    const config = await readYAML(configFile);
    assert(config.exclude_paths === undefined);
}
src/transforms/codeclimate:remove-obsolete-languages-key.js on lines 13..16
src/transforms/codeclimate:remove-obsolete-languages-key.js on lines 18..21
src/transforms/renovate:remove-custom-automerge-key.js on lines 14..17
src/transforms/renovate:remove-custom-automerge-key.js on lines 19..22

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

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

export async function precondition({readJSON, assert}) {
    const config = await readJSON(filename);
    assert(config[key] !== undefined);
}
Severity: Major
Found in src/transforms/renovate:remove-custom-automerge-key.js and 4 other locations - About 50 mins to fix
src/transforms/codeclimate:remove-obsolete-languages-key.js on lines 13..16
src/transforms/codeclimate:remove-obsolete-languages-key.js on lines 18..21
src/transforms/codeclimate:rename-exclude-paths-to-exclude-patterns.js on lines 13..16
src/transforms/renovate:remove-custom-automerge-key.js on lines 14..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 51.

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 async function postcondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson.xo !== undefined);
}
Severity: Major
Found in src/transforms/xo:config.js and 10 other locations - About 45 mins to fix
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 10..13
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 15..18

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

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 whole has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const whole = (current, [pattern, replacement]) => {
    if (pattern instanceof RegExp) {
        const regexp = new RegExp('^' + pattern.source + '$', pattern.flags);
        return current.replace(regexp, replacement);
    }
Severity: Minor
Found in src/lib/lines/replace.js - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

export async function postcondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson[key] !== undefined);
}
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 10..13
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 10..13
src/transforms/xo:config.js on lines 15..18

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

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 async function postcondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson.prettier !== undefined);
}
Severity: Major
Found in src/transforms/prettier:config.js and 10 other locations - About 45 mins to fix
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 10..13
src/transforms/xo:config.js on lines 15..18

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

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 async function postcondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson[key] !== undefined);
}
Severity: Major
Found in src/transforms/build:microbundle-configure-outputs-module.js and 10 other locations - About 45 mins to fix
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 10..13
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 10..13
src/transforms/xo:config.js on lines 15..18

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

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 async function postcondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson[key] === expected);
}
Severity: Major
Found in src/transforms/package.json:set-type-module.js and 10 other locations - About 45 mins to fix
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/prettier:config.js on lines 10..13
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 10..13
src/transforms/xo:config.js on lines 15..18

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

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 async function precondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson.xo === undefined);
}
Severity: Major
Found in src/transforms/xo:config.js and 10 other locations - About 45 mins to fix
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 10..13
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 10..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 50.

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 async function precondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson[key] === undefined);
}
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 10..13
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 10..13
src/transforms/xo:config.js on lines 15..18

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

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 async function precondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson.prettier === undefined);
}
Severity: Major
Found in src/transforms/prettier:config.js and 10 other locations - About 45 mins to fix
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 10..13
src/transforms/xo:config.js on lines 10..13
src/transforms/xo:config.js on lines 15..18

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

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 checkStatus has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

function checkStatus(status, options, globals) {
    globals.debug({status});
    const {tracking, current, behind} = status;
    if (!current) throw new Error('No current branch');
    if (!tracking) throw new Error('Not tracking any remote branch');
Severity: Minor
Found in src/main.js - About 45 mins to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

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

export async function postcondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson[key] !== undefined);
}
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 10..13
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 10..13
src/transforms/xo:config.js on lines 15..18

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

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 async function precondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson[key] === undefined);
}
Severity: Major
Found in src/transforms/build:microbundle-configure-outputs-module.js and 10 other locations - About 45 mins to fix
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 10..13
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 10..13
src/transforms/xo:config.js on lines 15..18

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

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 async function precondition({readPkg, assert}) {
    const pkgjson = await readPkg();
    assert(pkgjson[key] === undefined);
}
src/transforms/build:microbundle-configure-outputs-esmodule.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-module.js on lines 18..21
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 13..16
src/transforms/build:microbundle-configure-outputs-umd:main.js on lines 18..21
src/transforms/package.json:set-type-module.js on lines 15..18
src/transforms/prettier:config.js on lines 10..13
src/transforms/prettier:config.js on lines 15..18
src/transforms/xo:config.js on lines 10..13
src/transforms/xo:config.js on lines 15..18

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

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

    await contains({
        assert,
        read: () => readYAML(filename),
        test: (contents) => assert.deepStrictEqual(contents, parseYAML(config)),
    });
Severity: Minor
Found in src/transforms/github:workflow-configure-gh-pages.js and 1 other location - About 40 mins to fix
src/transforms/github:workflow-configure-ci:test.js on lines 44..48

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

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

    await contains({
        assert,
        read: () => readYAML(newFilename),
        test: (contents) => assert.deepStrictEqual(contents, parseYAML(newConfig)),
    });
Severity: Minor
Found in src/transforms/github:workflow-configure-ci:test.js and 1 other location - About 40 mins to fix
src/transforms/github:workflow-configure-gh-pages.js 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 49.

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

    await update({
        read: readPkg,
        write: writePkg,
        edit(pkgjson) {
            pkgjson.scripts[key] = expected;
Severity: Minor
Found in src/transforms/release:customize-commit-message.js and 1 other location - About 35 mins to fix
src/transforms/travis:define-custom-script.js on lines 35..42

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 47.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language