jdalrymple/semantic-release-npmx

View on GitHub

Showing 14 of 18 total issues

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

  it('should throw error if "NPM_USERNAME" is missing', async () => {
    getAuthToken.mockReturnValueOnce(false);
    rc.mockReturnValueOnce({ configs: ['/home/.npmrc', '/temp/.npmrc'] });

    await expect(
Severity: Major
Found in test/unit/npm-utils.js and 2 other locations - About 2 hrs to fix
test/unit/npm-utils.js on lines 268..282
test/unit/npm-utils.js on lines 284..298

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

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

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

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

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

Refactorings

Further Reading

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

  it('should throw error if "NPM_PASSWORD" is missing', async () => {
    getAuthToken.mockReturnValueOnce(false);
    rc.mockReturnValueOnce({ configs: ['/home/.npmrc', '/temp/.npmrc'] });

    await expect(
Severity: Major
Found in test/unit/npm-utils.js and 2 other locations - About 2 hrs to fix
test/unit/npm-utils.js on lines 252..266
test/unit/npm-utils.js on lines 284..298

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

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

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

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

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

Refactorings

Further Reading

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

  it('should throw error if "NPM_EMAIL" is missing', async () => {
    getAuthToken.mockReturnValueOnce(false);
    rc.mockReturnValueOnce({ configs: ['/home/.npmrc', '/temp/.npmrc'] });

    await expect(
Severity: Major
Found in test/unit/npm-utils.js and 2 other locations - About 2 hrs to fix
test/unit/npm-utils.js on lines 252..266
test/unit/npm-utils.js on lines 268..282

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

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

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

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

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

Refactorings

Further Reading

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

  it('should throw SemanticReleaseError if "npmPublish" option is not a Boolean', () => {
    const npmPublish = 42;
    const error = new AggregateError([getError('EINVALIDNPMPUBLISH')]);

    try {
Severity: Major
Found in test/unit/plugin-config.js and 2 other locations - About 1 hr to fix
test/unit/plugin-config.js on lines 28..38
test/unit/plugin-config.js on lines 40..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 81.

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

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

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

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

Refactorings

Further Reading

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

  it('should throw SemanticReleaseError if "pkgRoot" option is not a String', async () => {
    const pkgRoot = 42;
    const error = new AggregateError([getError('EINVALIDPKGROOT')]);

    try {
Severity: Major
Found in test/unit/plugin-config.js and 2 other locations - About 1 hr to fix
test/unit/plugin-config.js on lines 16..26
test/unit/plugin-config.js on lines 28..38

Duplicated Code

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

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

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

Tuning

This issue has a mass of 81.

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

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

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

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

Refactorings

Further Reading

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

  it('should throw SemanticReleaseError if "tarballDir" option is not a String', async () => {
    const tarballDir = 42;
    const error = new AggregateError([getError('EINVALIDTARBALLDIR')]);

    try {
Severity: Major
Found in test/unit/plugin-config.js and 2 other locations - About 1 hr to fix
test/unit/plugin-config.js on lines 16..26
test/unit/plugin-config.js on lines 40..50

Duplicated Code

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

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

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

Tuning

This issue has a mass of 81.

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

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

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

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

Refactorings

Further Reading

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

    await expect(
      execa('npm', ['view', pkg.name, 'dist-tags.latest'], {
        cwd,
        env: { ...process.env, npm_config_registry: process.env.TEST_NPM_REGISTRY },
      }),
Severity: Major
Found in test/integration/e2e.js and 7 other locations - About 40 mins to fix
test/integration/e2e.js on lines 90..97
test/integration/e2e.js on lines 133..140
test/integration/e2e.js on lines 150..157
test/integration/publish.js on lines 49..56
test/integration/publish.js on lines 89..96
test/integration/publish.js on lines 128..135
test/integration/publish.js on lines 339..346

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

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

    await expect(
      execa('npm', ['view', pkg.name, 'dist-tags.latest'], {
        cwd,
        env: { ...process.env, npm_config_registry: process.env.TEST_NPM_REGISTRY },
      }),
Severity: Major
Found in test/integration/e2e.js and 7 other locations - About 40 mins to fix
test/integration/e2e.js on lines 49..56
test/integration/e2e.js on lines 90..97
test/integration/e2e.js on lines 133..140
test/integration/publish.js on lines 49..56
test/integration/publish.js on lines 89..96
test/integration/publish.js on lines 128..135
test/integration/publish.js on lines 339..346

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

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

    await expect(
      execa('npm', ['view', subpkg.name, 'version'], {
        cwd,
        env: { ...process.env, npm_config_registry: process.env.TEST_NPM_REGISTRY },
      }),
Severity: Major
Found in test/integration/publish.js and 7 other locations - About 40 mins to fix
test/integration/e2e.js on lines 49..56
test/integration/e2e.js on lines 90..97
test/integration/e2e.js on lines 133..140
test/integration/e2e.js on lines 150..157
test/integration/publish.js on lines 49..56
test/integration/publish.js on lines 89..96
test/integration/publish.js on lines 128..135

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

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

    await expect(
      execa('npm', ['view', pkg.name, 'version'], {
        cwd,
        env: { ...process.env, npm_config_registry: process.env.TEST_NPM_REGISTRY },
      }),
Severity: Major
Found in test/integration/publish.js and 7 other locations - About 40 mins to fix
test/integration/e2e.js on lines 49..56
test/integration/e2e.js on lines 90..97
test/integration/e2e.js on lines 133..140
test/integration/e2e.js on lines 150..157
test/integration/publish.js on lines 49..56
test/integration/publish.js on lines 128..135
test/integration/publish.js on lines 339..346

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

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

    await expect(
      execa('npm', ['view', pkg.name, 'version'], {
        cwd,
        env: { ...process.env, npm_config_registry: process.env.TEST_NPM_REGISTRY },
      }),
Severity: Major
Found in test/integration/publish.js and 7 other locations - About 40 mins to fix
test/integration/e2e.js on lines 49..56
test/integration/e2e.js on lines 90..97
test/integration/e2e.js on lines 133..140
test/integration/e2e.js on lines 150..157
test/integration/publish.js on lines 49..56
test/integration/publish.js on lines 89..96
test/integration/publish.js on lines 339..346

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

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

    await expect(
      execa('npm', ['view', pkg.name, 'dist-tags.next'], {
        cwd,
        env: { ...process.env, npm_config_registry: process.env.TEST_NPM_REGISTRY },
      }),
Severity: Major
Found in test/integration/e2e.js and 7 other locations - About 40 mins to fix
test/integration/e2e.js on lines 49..56
test/integration/e2e.js on lines 90..97
test/integration/e2e.js on lines 150..157
test/integration/publish.js on lines 49..56
test/integration/publish.js on lines 89..96
test/integration/publish.js on lines 128..135
test/integration/publish.js on lines 339..346

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

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

    await expect(
      execa('npm', ['view', pkg.name, 'version'], {
        cwd,
        env: { ...process.env, npm_config_registry: process.env.TEST_NPM_REGISTRY },
      }),
Severity: Major
Found in test/integration/publish.js and 7 other locations - About 40 mins to fix
test/integration/e2e.js on lines 49..56
test/integration/e2e.js on lines 90..97
test/integration/e2e.js on lines 133..140
test/integration/e2e.js on lines 150..157
test/integration/publish.js on lines 89..96
test/integration/publish.js on lines 128..135
test/integration/publish.js on lines 339..346

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

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

    await expect(
      execa('npm', ['view', pkg.name, 'dist-tags'], {
        cwd,
        env: { ...process.env, npm_config_registry: process.env.TEST_NPM_REGISTRY },
      }),
Severity: Major
Found in test/integration/e2e.js and 7 other locations - About 40 mins to fix
test/integration/e2e.js on lines 49..56
test/integration/e2e.js on lines 133..140
test/integration/e2e.js on lines 150..157
test/integration/publish.js on lines 49..56
test/integration/publish.js on lines 89..96
test/integration/publish.js on lines 128..135
test/integration/publish.js on lines 339..346

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

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