BookBrainz/bookbrainz-site

View on GitHub
data/test-data.js

Summary

Maintainability
F
5 days
Test Coverage

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

export function createPublisherCreator() {
    return new AchievementType(publisherCreatorIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(publisherCreatorIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 452..467

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

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

export function createSeriesCreator() {
    return new AchievementType(seriesCreatorIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(seriesCreatorIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createLimitedEdition() {
    return new AchievementType(limitedEditionIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(limitedEditionIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createExplorer() {
    return new AchievementType(explorerIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(explorerIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450

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

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

export function createRevisionist() {
    return new AchievementType(revisionistIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(revisionistIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createWorkerBee() {
    return new AchievementType(workerBeeIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(workerBeeIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createAuthorCreator() {
    return new AchievementType(authorCreatorIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(authorCreatorIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createPublisher() {
    return new AchievementType(publisherIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(publisherIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createEditor() {
    return new EditorType(editorTypeAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new Editor(editorAttribs)
Severity: Major
Found in data/test-data.js and 5 other locations - About 1 hr to fix
data/test-data.js on lines 469..476
data/test-data.js on lines 490..497
data/test-data.js on lines 499..506
data/test-data.js on lines 508..515
data/test-data.js on lines 517..524

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

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

export function createMarathoner() {
    return new AchievementType(marathonerAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new TitleType(marathonerTitleAttribs)
Severity: Major
Found in data/test-data.js and 5 other locations - About 1 hr to fix
data/test-data.js on lines 324..331
data/test-data.js on lines 469..476
data/test-data.js on lines 490..497
data/test-data.js on lines 508..515
data/test-data.js on lines 517..524

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

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

export function createSprinter() {
    return new AchievementType(sprinterAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new TitleType(sprinterTitleAttribs)
Severity: Major
Found in data/test-data.js and 5 other locations - About 1 hr to fix
data/test-data.js on lines 324..331
data/test-data.js on lines 490..497
data/test-data.js on lines 499..506
data/test-data.js on lines 508..515
data/test-data.js on lines 517..524

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

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

export function createTimeTraveller() {
    return new AchievementType(timeTravellerAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new TitleType(timeTravellerTitleAttribs)
Severity: Major
Found in data/test-data.js and 5 other locations - About 1 hr to fix
data/test-data.js on lines 324..331
data/test-data.js on lines 469..476
data/test-data.js on lines 490..497
data/test-data.js on lines 499..506
data/test-data.js on lines 517..524

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

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

export function createFunRunner() {
    return new AchievementType(funRunnerAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new TitleType(funRunnerTitleAttribs)
Severity: Major
Found in data/test-data.js and 5 other locations - About 1 hr to fix
data/test-data.js on lines 324..331
data/test-data.js on lines 469..476
data/test-data.js on lines 499..506
data/test-data.js on lines 508..515
data/test-data.js on lines 517..524

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

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

export function createHotOffThePress() {
    return new AchievementType(hotOffThePressAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new TitleType(hotOffThePressTitleAttribs)
Severity: Major
Found in data/test-data.js and 5 other locations - About 1 hr to fix
data/test-data.js on lines 324..331
data/test-data.js on lines 469..476
data/test-data.js on lines 490..497
data/test-data.js on lines 499..506
data/test-data.js on lines 508..515

Duplicated Code

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

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

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

Tuning

This issue has a mass of 63.

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

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

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

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

Refactorings

Further Reading

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

    return (type) => {
        let rowCountPromise;
        if (type === revisionType) {
            rowCountPromise = Promise.resolve(rowcount);
        }
Severity: Major
Found in data/test-data.js and 1 other location - About 1 hr to fix
data/test-data.js on lines 540..549

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

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

    return (type, string) => {
        let rowCountPromise;
        if (string === revisionTypeString) {
            rowCountPromise = Promise.resolve(rowCount);
        }
Severity: Major
Found in data/test-data.js and 1 other location - About 1 hr to fix
data/test-data.js on lines 527..536

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

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

There are no issues that match your filters.

Category
Status