BookBrainz/bookbrainz-site

View on GitHub

Showing 826 of 826 total issues

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Label</Form.Label>
                                <Form.Control
Severity: Major
Found in src/client/components/forms/type-editor/identifier-type.tsx and 8 other locations - About 4 hrs to fix
src/client/components/forms/type-editor/identifier-type.tsx on lines 227..240
src/client/components/forms/type-editor/identifier-type.tsx on lines 241..254
src/client/components/forms/type-editor/identifier-type.tsx on lines 255..268
src/client/components/forms/type-editor/identifier-type.tsx on lines 269..282
src/client/components/forms/type-editor/relationship-type.tsx on lines 266..279
src/client/components/forms/type-editor/relationship-type.tsx on lines 280..293
src/client/components/forms/type-editor/relationship-type.tsx on lines 294..307
src/client/components/forms/type-editor/relationship-type.tsx on lines 308..321

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Display Template</Form.Label>
                                <Form.Control
Severity: Major
Found in src/client/components/forms/type-editor/identifier-type.tsx and 8 other locations - About 4 hrs to fix
src/client/components/forms/type-editor/identifier-type.tsx on lines 213..226
src/client/components/forms/type-editor/identifier-type.tsx on lines 227..240
src/client/components/forms/type-editor/identifier-type.tsx on lines 241..254
src/client/components/forms/type-editor/identifier-type.tsx on lines 255..268
src/client/components/forms/type-editor/relationship-type.tsx on lines 266..279
src/client/components/forms/type-editor/relationship-type.tsx on lines 280..293
src/client/components/forms/type-editor/relationship-type.tsx on lines 294..307
src/client/components/forms/type-editor/relationship-type.tsx on lines 308..321

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Description</Form.Label>
                                <Form.Control
src/client/components/forms/type-editor/identifier-type.tsx on lines 213..226
src/client/components/forms/type-editor/identifier-type.tsx on lines 227..240
src/client/components/forms/type-editor/identifier-type.tsx on lines 241..254
src/client/components/forms/type-editor/identifier-type.tsx on lines 255..268
src/client/components/forms/type-editor/identifier-type.tsx on lines 269..282
src/client/components/forms/type-editor/relationship-type.tsx on lines 266..279
src/client/components/forms/type-editor/relationship-type.tsx on lines 294..307
src/client/components/forms/type-editor/relationship-type.tsx on lines 308..321

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Detection RegEx</Form.Label>
                                <Form.Control
Severity: Major
Found in src/client/components/forms/type-editor/identifier-type.tsx and 8 other locations - About 4 hrs to fix
src/client/components/forms/type-editor/identifier-type.tsx on lines 213..226
src/client/components/forms/type-editor/identifier-type.tsx on lines 227..240
src/client/components/forms/type-editor/identifier-type.tsx on lines 255..268
src/client/components/forms/type-editor/identifier-type.tsx on lines 269..282
src/client/components/forms/type-editor/relationship-type.tsx on lines 266..279
src/client/components/forms/type-editor/relationship-type.tsx on lines 280..293
src/client/components/forms/type-editor/relationship-type.tsx on lines 294..307
src/client/components/forms/type-editor/relationship-type.tsx on lines 308..321

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

export function validateForm(
    formData: any, identifierTypes?: Array<_IdentifierType> | null | undefined
): boolean {
    const conditions = [
        validateAliases(get(formData, 'aliasEditor', {})),
Severity: Major
Found in src/client/entity-editor/validators/publisher.ts and 3 other locations - About 4 hrs to fix
src/client/entity-editor/validators/author.ts on lines 97..111
src/client/entity-editor/validators/series.ts on lines 50..64
src/client/entity-editor/validators/work.ts on lines 48..62

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Validation RegEx</Form.Label>
                                <Form.Control
Severity: Major
Found in src/client/components/forms/type-editor/identifier-type.tsx and 8 other locations - About 4 hrs to fix
src/client/components/forms/type-editor/identifier-type.tsx on lines 213..226
src/client/components/forms/type-editor/identifier-type.tsx on lines 227..240
src/client/components/forms/type-editor/identifier-type.tsx on lines 241..254
src/client/components/forms/type-editor/identifier-type.tsx on lines 269..282
src/client/components/forms/type-editor/relationship-type.tsx on lines 266..279
src/client/components/forms/type-editor/relationship-type.tsx on lines 280..293
src/client/components/forms/type-editor/relationship-type.tsx on lines 294..307
src/client/components/forms/type-editor/relationship-type.tsx on lines 308..321

Duplicated Code

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

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

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

Tuning

This issue has a mass of 117.

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

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

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

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

Refactorings

Further Reading

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

            <Row>
                <Col lg={lgCol}>
                    <Form.Group>
                        <Form.Label>Type</Form.Label>
                        <Select
Severity: Major
Found in src/client/entity-editor/author-section/author-section.tsx and 1 other location - About 4 hrs to fix
src/client/entity-editor/publisher-section/publisher-section.tsx on lines 144..158

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

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

            <Row>
                <Col lg={lgCol}>
                    <Form.Group>
                        <Form.Label>Type</Form.Label>
                        <Select
src/client/entity-editor/author-section/author-section.tsx on lines 188..202

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

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 combineReducers({
            Authors: authorsReducer,
            EditionGroups: editionGroupsReducer,
            Editions: newEditionReducer,
            ISBN: ISBNReducer,
Severity: Major
Found in src/client/unified-form/helpers.ts and 1 other location - About 4 hrs to fix
src/client/entity-editor/author-section/author-section.tsx on lines 137..161

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

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

function AuthorSection({
    beginAreaLabel,
    beginDateLabel,
    beginDateValue,
    beginAreaValue,
Severity: Major
Found in src/client/entity-editor/author-section/author-section.tsx and 1 other location - About 4 hrs to fix
src/client/unified-form/helpers.ts on lines 255..279

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

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

    for (let i = 0; i < bbids.length; i++) {
        const bbid = bbids[i];
        const isBbidInCollection = collection.items.find(item => item.bbid === bbid);
        if (!isBbidInCollection) {
            return next(new error.BadRequestError(`Entity ${bbid} is not in collection ${collection.id}`, req));
Severity: Major
Found in src/server/helpers/middleware.ts and 1 other location - About 3 hrs to fix
src/server/helpers/middleware.ts on lines 444..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 111.

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

    for (let i = 0; i < collaboratorIds.length; i++) {
        const collaboratorId = collaboratorIds[i];
        const isCollaborator = collection.collaborators.find(collaborator => collaborator.id === collaboratorId);
        if (!isCollaborator) {
            return next(new error.BadRequestError(`User ${collaboratorId} is not a collaborator of collection ${collection.id}`, req));
Severity: Major
Found in src/server/helpers/middleware.ts and 1 other location - About 3 hrs to fix
src/server/helpers/middleware.ts on lines 427..433

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

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

                        <PagerElement
                            from={this.props.from}
                            nextEnabled={this.props.nextEnabled}
                            paginationUrl={this.paginationUrl}
                            querySearchParams={querySearchParams}
Severity: Major
Found in src/client/components/pages/admin-panel-search.tsx and 1 other location - About 3 hrs to fix
src/client/components/pages/search.tsx on lines 161..171

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

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

                <PagerElement
                    from={this.props.from}
                    nextEnabled={this.props.nextEnabled}
                    paginationUrl={this.paginationUrl}
                    querySearchParams={querySearchParams}
Severity: Major
Found in src/client/components/pages/search.tsx and 1 other location - About 3 hrs to fix
src/client/components/pages/admin-panel-search.tsx on lines 157..167

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

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 (entity.authorCredit) {
        authorCreditSection = (
            <AuthorCreditDisplay
                names={entity.authorCredit.names}
            />
Severity: Major
Found in src/client/components/pages/entities/edition-group.js and 1 other location - About 3 hrs to fix
src/client/components/pages/entities/edition.js on lines 118..132

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

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 (entity.authorCredit) {
        authorCreditSection = (
            <AuthorCreditDisplay
                names={entity.authorCredit.names}
            />
Severity: Major
Found in src/client/components/pages/entities/edition.js and 1 other location - About 3 hrs to fix
src/client/components/pages/entities/edition-group.js on lines 97..112

Duplicated Code

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

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

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

Tuning

This issue has a mass of 109.

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 (!_.get(data, ['editionSection', 'authorCreditEnable'], true)) {
        authorCredit = null;
    }
    else if (!_.isNil(data.authorCredit)) {
        // When merging entities, we use a separate reducer "authorCredit"
Severity: Major
Found in src/server/routes/entity/edition.ts and 1 other location - About 3 hrs to fix
src/server/routes/entity/edition-group.ts on lines 67..76

Duplicated Code

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

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

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

Tuning

This issue has a mass of 109.

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 (!_.get(data, ['editionGroupSection', 'authorCreditEnable'], true)) {
        authorCredit = null;
    }
    else if (!_.isNil(data.authorCredit)) {
        // When merging entities, we use a separate reducer "authorCredit"
Severity: Major
Found in src/server/routes/entity/edition-group.ts and 1 other location - About 3 hrs to fix
src/server/routes/entity/edition.ts on lines 87..96

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

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

    toggleRow(bbid) {
        const oldSelected = this.state.selectedEntities;
        let newSelected;
        if (oldSelected.find(selectedBBID => selectedBBID === bbid)) {
            newSelected = oldSelected.filter(selectedBBID => selectedBBID !== bbid);
Severity: Major
Found in src/client/components/pages/collection.js and 1 other location - About 3 hrs to fix
src/client/components/pages/parts/add-to-collection-modal.js on lines 49..61

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

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

    toggleRow(collectionId) {
        const oldSelected = this.state.selectedCollections;
        let newSelected;
        if (oldSelected.find(selectedId => selectedId === collectionId)) {
            newSelected = oldSelected.filter(selectedId => selectedId !== collectionId);
Severity: Major
Found in src/client/components/pages/parts/add-to-collection-modal.js and 1 other location - About 3 hrs to fix
src/client/components/pages/collection.js on lines 129..141

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

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