bookbrainz/bookbrainz-site

View on GitHub

Showing 1,033 of 1,033 total issues

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

                <Col lg={3}>
                    <dl>
                        <dt>Sort Name</dt>
                        <dd>{sortNameOfDefaultAlias}</dd>
                    </dl>
Severity: Major
Found in src/client/components/pages/entities/edition-group.js and 9 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 58..63
src/client/components/pages/entities/edition.js on lines 94..99
src/client/components/pages/entities/publisher.js on lines 49..54
src/client/components/pages/entities/publisher.js on lines 55..60
src/client/components/pages/entities/publisher.js on lines 61..66
src/client/components/pages/entities/series.js on lines 49..54
src/client/components/pages/entities/work.js on lines 54..59
src/client/components/pages/entities/work.js on lines 60..65
src/client/components/pages/entities/work.js on lines 66..71

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

                <Col lg={3}>
                    <dl>
                        <dt>Type</dt>
                        <dd>{type}</dd>
                    </dl>
Severity: Major
Found in src/client/components/pages/entities/work.js and 9 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 52..57
src/client/components/pages/entities/edition-group.js on lines 58..63
src/client/components/pages/entities/edition.js on lines 94..99
src/client/components/pages/entities/publisher.js on lines 49..54
src/client/components/pages/entities/publisher.js on lines 55..60
src/client/components/pages/entities/publisher.js on lines 61..66
src/client/components/pages/entities/series.js on lines 49..54
src/client/components/pages/entities/work.js on lines 54..59
src/client/components/pages/entities/work.js on lines 66..71

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

                <Col lg={3}>
                    <dl>
                        <dt>Sort Name</dt>
                        <dd>{sortNameOfDefaultAlias}</dd>
                    </dl>
Severity: Major
Found in src/client/components/pages/entities/series.js and 9 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 52..57
src/client/components/pages/entities/edition-group.js on lines 58..63
src/client/components/pages/entities/edition.js on lines 94..99
src/client/components/pages/entities/publisher.js on lines 49..54
src/client/components/pages/entities/publisher.js on lines 55..60
src/client/components/pages/entities/publisher.js on lines 61..66
src/client/components/pages/entities/work.js on lines 54..59
src/client/components/pages/entities/work.js on lines 60..65
src/client/components/pages/entities/work.js on lines 66..71

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

                <Col lg={3}>
                    <dl>
                        <dt>Type</dt>
                        <dd>{type}</dd>
                    </dl>
Severity: Major
Found in src/client/components/pages/entities/edition-group.js and 9 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 52..57
src/client/components/pages/entities/edition.js on lines 94..99
src/client/components/pages/entities/publisher.js on lines 49..54
src/client/components/pages/entities/publisher.js on lines 55..60
src/client/components/pages/entities/publisher.js on lines 61..66
src/client/components/pages/entities/series.js on lines 49..54
src/client/components/pages/entities/work.js on lines 54..59
src/client/components/pages/entities/work.js on lines 60..65
src/client/components/pages/entities/work.js on lines 66..71

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

function mapDispatchToProps(dispatch, {submissionUrl}):ContentTabDispatchProps {
    const type = 'Work';
    return {
        bulkAddSeriesItems: (data) => dispatch(addBulkSeriesItems(data)),
        onAddSeriesItem: (data) => dispatch(addSeriesItem(data, data.rowID)),
Severity: Minor
Found in src/client/unified-form/content-tab/content-tab.tsx - About 1 hr 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 10 locations. Consider refactoring.
Open

                <Col lg={3}>
                    <dl>
                        <dt>Sort Name</dt>
                        <dd>{sortNameOfDefaultAlias}</dd>
                    </dl>
Severity: Major
Found in src/client/components/pages/entities/work.js and 9 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 52..57
src/client/components/pages/entities/edition-group.js on lines 58..63
src/client/components/pages/entities/edition.js on lines 94..99
src/client/components/pages/entities/publisher.js on lines 49..54
src/client/components/pages/entities/publisher.js on lines 55..60
src/client/components/pages/entities/publisher.js on lines 61..66
src/client/components/pages/entities/series.js on lines 49..54
src/client/components/pages/entities/work.js on lines 60..65
src/client/components/pages/entities/work.js on lines 66..71

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

                <Col lg={3}>
                    <dl>
                        <dt>Sort Name</dt>
                        <dd>{sortNameOfDefaultAlias}</dd>
                    </dl>
Severity: Major
Found in src/client/components/pages/entities/publisher.js and 9 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 52..57
src/client/components/pages/entities/edition-group.js on lines 58..63
src/client/components/pages/entities/edition.js on lines 94..99
src/client/components/pages/entities/publisher.js on lines 55..60
src/client/components/pages/entities/publisher.js on lines 61..66
src/client/components/pages/entities/series.js on lines 49..54
src/client/components/pages/entities/work.js on lines 54..59
src/client/components/pages/entities/work.js on lines 60..65
src/client/components/pages/entities/work.js on lines 66..71

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

                <Col lg={3}>
                    <dl>
                        <dt>Publishers</dt>
                        <dd>{publishers}</dd>
                    </dl>
Severity: Major
Found in src/client/components/pages/entities/edition.js and 9 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 52..57
src/client/components/pages/entities/edition-group.js on lines 58..63
src/client/components/pages/entities/publisher.js on lines 49..54
src/client/components/pages/entities/publisher.js on lines 55..60
src/client/components/pages/entities/publisher.js on lines 61..66
src/client/components/pages/entities/series.js on lines 49..54
src/client/components/pages/entities/work.js on lines 54..59
src/client/components/pages/entities/work.js on lines 60..65
src/client/components/pages/entities/work.js on lines 66..71

Duplicated Code

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

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

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

Tuning

This issue has a mass of 60.

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

                identifiers?.length > 0 ?
                    identifierTypes.sort((a, b) => a.label.localeCompare(b.label)).map((type) => {
                        const identifierValues =
                        identifiers
                            .filter(
Severity: Major
Found in src/client/components/pages/entities/identifiers.js and 1 other location - About 1 hr to fix
src/client/components/pages/entities/relationships.js on lines 28..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 60.

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

    const identifiers = author.identifierSet ?
        author.identifierSet.identifiers.map(({type, ...rest}) => ({
            type: type.id,
            ...rest
        })) : [];
Severity: Major
Found in src/server/routes/entity/author.ts and 5 other locations - About 1 hr to fix
src/server/routes/entity/edition-group.ts on lines 271..275
src/server/routes/entity/edition.ts on lines 457..461
src/server/routes/entity/publisher.ts on lines 283..287
src/server/routes/entity/series.ts on lines 270..274
src/server/routes/entity/work.ts on lines 295..299

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

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

    async componentDidMount() {
        const collections = this.props.entityType ? await this.getCollections() : [];
        // eslint-disable-next-line react/no-did-mount-set-state
        this.setState({collectionsAvailable: collections || []});
    }
src/client/components/pages/parts/add-to-collection-modal.js on lines 42..46

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

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

    const identifiers = publisher.identifierSet ?
        publisher.identifierSet.identifiers.map(({type, ...rest}) => ({
            type: type.id,
            ...rest
        })) : [];
Severity: Major
Found in src/server/routes/entity/publisher.ts and 5 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 277..281
src/server/routes/entity/edition-group.ts on lines 271..275
src/server/routes/entity/edition.ts on lines 457..461
src/server/routes/entity/series.ts on lines 270..274
src/server/routes/entity/work.ts on lines 295..299

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

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

                <Col lg={3}>
                    <dt>Created At</dt>
                    <dd>{formatDate(new Date(collection.createdAt), true)}</dd>
                </Col>
Severity: Major
Found in src/client/components/pages/collection.js and 1 other location - About 1 hr to fix
src/client/components/pages/collection.js on lines 85..88

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

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

    const identifiers = series.identifierSet ?
        series.identifierSet.identifiers.map(({type, ...rest}) => ({
            type: type.id,
            ...rest
        })) : [];
Severity: Major
Found in src/server/routes/entity/series.ts and 5 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 277..281
src/server/routes/entity/edition-group.ts on lines 271..275
src/server/routes/entity/edition.ts on lines 457..461
src/server/routes/entity/publisher.ts on lines 283..287
src/server/routes/entity/work.ts on lines 295..299

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

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

    const identifiers = editionGroup.identifierSet ?
        editionGroup.identifierSet.identifiers.map(({type, ...rest}) => ({
            type: type.id,
            ...rest
        })) : [];
Severity: Major
Found in src/server/routes/entity/edition-group.ts and 5 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 277..281
src/server/routes/entity/edition.ts on lines 457..461
src/server/routes/entity/publisher.ts on lines 283..287
src/server/routes/entity/series.ts on lines 270..274
src/server/routes/entity/work.ts on lines 295..299

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

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

    const identifiers = edition.identifierSet ?
        edition.identifierSet.identifiers.map(({type, ...rest}) => ({
            type: type.id,
            ...rest
        })) : [];
Severity: Major
Found in src/server/routes/entity/edition.ts and 5 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 277..281
src/server/routes/entity/edition-group.ts on lines 271..275
src/server/routes/entity/publisher.ts on lines 283..287
src/server/routes/entity/series.ts on lines 270..274
src/server/routes/entity/work.ts on lines 295..299

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

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

    const identifiers = work.identifierSet ?
        work.identifierSet.identifiers.map(({type, ...rest}) => ({
            type: type.id,
            ...rest
        })) : [];
Severity: Major
Found in src/server/routes/entity/work.ts and 5 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 277..281
src/server/routes/entity/edition-group.ts on lines 271..275
src/server/routes/entity/edition.ts on lines 457..461
src/server/routes/entity/publisher.ts on lines 283..287
src/server/routes/entity/series.ts on lines 270..274

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

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

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

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

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

Refactorings

Further Reading

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

export function authorsReducer(state = Immutable.Map({}), {type, payload}) {
    switch (type) {
        case ADD_AUTHOR:
            return state.set(payload.id, Immutable.fromJS(payload.value));
        case CLEAR_AUTHOR:
Severity: Major
Found in src/client/unified-form/cover-tab/reducer.ts and 1 other location - About 1 hr to fix
src/client/unified-form/content-tab/reducer.ts on lines 25..34

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

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

        if (prevProps.entityType !== this.props.entityType) {
            const collections = this.props.entityType ? await this.getCollections() : [];
            // eslint-disable-next-line react/no-did-update-set-state
            this.setState({collectionsAvailable: collections || []});
        }
src/client/components/pages/parts/add-to-collection-modal.js on lines 35..39

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

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

                <Col className="text-center" lg={{offset: 2, span: 4}}>
                    <a
                        href={CC0Link}
                        rel="license"
                    >
Severity: Major
Found in src/client/components/pages/licensing.tsx and 1 other location - About 1 hr to fix
src/client/components/pages/licensing.tsx on lines 105..118

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

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