bookbrainz/bookbrainz-site

View on GitHub

Showing 1,033 of 1,033 total issues

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

AuthorDisplayPage.propTypes = {
    entity: PropTypes.object.isRequired,
    identifierTypes: PropTypes.array,
    user: PropTypes.object.isRequired,
    wikipediaExtract: PropTypes.object
Severity: Major
Found in src/client/components/pages/entities/author.js and 4 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 184..189
src/client/components/pages/entities/edition.js on lines 201..206
src/client/components/pages/entities/publisher.js on lines 127..132
src/client/components/pages/entities/work.js on lines 177..182

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

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

    const markup = ReactDOMServer.renderToString(
        <Layout {...propHelpers.extractLayoutProps(props)}>
            <IdentifierTypesPage {...propHelpers.extractChildProps(props)}/>
        </Layout>
    );
Severity: Major
Found in src/server/routes/identifier-types.tsx and 7 other locations - About 1 hr to fix
src/server/routes/adminLogs.tsx on lines 48..52
src/server/routes/entity/entity.tsx on lines 156..162
src/server/routes/entity/entity.tsx on lines 1401..1405
src/server/routes/relationship-types.tsx on lines 74..78
src/server/routes/searchAdmin.tsx on lines 44..50
src/server/routes/type-editor/identifier-type.tsx on lines 45..49
src/server/routes/type-editor/relationship-type.tsx on lines 45..49

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

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

    const markup = ReactDOMServer.renderToString(
        <Layout {...propHelpers.extractLayoutProps(props)}>
            <UserCollectionForm
                collection={props.collection}
            />
Severity: Major
Found in src/server/routes/collection.js and 1 other location - About 1 hr to fix
src/server/helpers/error.js on lines 35..41

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

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

        const markup = ReactDOMServer.renderToString(
            <Layout {...propHelpers.extractLayoutProps(props)}>
                <SearchAdminPage
                    {...propHelpers.extractChildProps(props)}
                />
Severity: Major
Found in src/server/routes/searchAdmin.tsx and 7 other locations - About 1 hr to fix
src/server/routes/adminLogs.tsx on lines 48..52
src/server/routes/entity/entity.tsx on lines 156..162
src/server/routes/entity/entity.tsx on lines 1401..1405
src/server/routes/identifier-types.tsx on lines 34..38
src/server/routes/relationship-types.tsx on lines 74..78
src/server/routes/type-editor/identifier-type.tsx on lines 45..49
src/server/routes/type-editor/relationship-type.tsx on lines 45..49

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

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

        const markup = ReactDOMServer.renderToString(
            <Layout {...propHelpers.extractLayoutProps(props)}>
                <RelationshipTypeEditor {...propHelpers.extractChildProps(props)}/>
            </Layout>
        );
Severity: Major
Found in src/server/routes/type-editor/relationship-type.tsx and 7 other locations - About 1 hr to fix
src/server/routes/adminLogs.tsx on lines 48..52
src/server/routes/entity/entity.tsx on lines 156..162
src/server/routes/entity/entity.tsx on lines 1401..1405
src/server/routes/identifier-types.tsx on lines 34..38
src/server/routes/relationship-types.tsx on lines 74..78
src/server/routes/searchAdmin.tsx on lines 44..50
src/server/routes/type-editor/identifier-type.tsx on lines 45..49

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

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

    const markup = ReactDOMServer.renderToString(
        <Layout {...propHelpers.extractLayoutProps(props)}>
            <ErrorPage
                error={props.error}
            />
Severity: Major
Found in src/server/helpers/error.js and 1 other location - About 1 hr to fix
src/server/routes/collection.js on lines 208..214

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

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

    const markup = ReactDOMServer.renderToString(
        <Layout {...propHelpers.extractLayoutProps(props)}>
            <PreviewPage {...propHelpers.extractPreviewProps(props)}/>
        </Layout>
    );
Severity: Major
Found in src/server/routes/entity/entity.tsx and 7 other locations - About 1 hr to fix
src/server/routes/adminLogs.tsx on lines 48..52
src/server/routes/entity/entity.tsx on lines 156..162
src/server/routes/identifier-types.tsx on lines 34..38
src/server/routes/relationship-types.tsx on lines 74..78
src/server/routes/searchAdmin.tsx on lines 44..50
src/server/routes/type-editor/identifier-type.tsx on lines 45..49
src/server/routes/type-editor/relationship-type.tsx on lines 45..49

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

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

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

    if (Iterable.isIterable(values)) {
        every = (object, predicate) => object.every(predicate);
    }
    else if (!_.isObject(values)) {
        return false;
Severity: Major
Found in src/client/entity-editor/validators/edition.ts and 1 other location - About 1 hr to fix
src/client/entity-editor/validators/common.ts on lines 43..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 56.

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

        const markup = ReactDOMServer.renderToString(
            <Layout {...propHelpers.extractLayoutProps(props)}>
                <IdentifierTypeEditor {...propHelpers.extractChildProps(props)}/>
            </Layout>
        );
Severity: Major
Found in src/server/routes/type-editor/identifier-type.tsx and 7 other locations - About 1 hr to fix
src/server/routes/adminLogs.tsx on lines 48..52
src/server/routes/entity/entity.tsx on lines 156..162
src/server/routes/entity/entity.tsx on lines 1401..1405
src/server/routes/identifier-types.tsx on lines 34..38
src/server/routes/relationship-types.tsx on lines 74..78
src/server/routes/searchAdmin.tsx on lines 44..50
src/server/routes/type-editor/relationship-type.tsx on lines 45..49

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

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

    const markup = ReactDOMServer.renderToString(
        <Layout {...propHelpers.extractLayoutProps(props)}>
            <RelationshipTypesPage {...propHelpers.extractChildProps(props)}/>
        </Layout>
    );
Severity: Major
Found in src/server/routes/relationship-types.tsx and 7 other locations - About 1 hr to fix
src/server/routes/adminLogs.tsx on lines 48..52
src/server/routes/entity/entity.tsx on lines 156..162
src/server/routes/entity/entity.tsx on lines 1401..1405
src/server/routes/identifier-types.tsx on lines 34..38
src/server/routes/searchAdmin.tsx on lines 44..50
src/server/routes/type-editor/identifier-type.tsx on lines 45..49
src/server/routes/type-editor/relationship-type.tsx on lines 45..49

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

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

            const markup = ReactDOMServer.renderToString(
                <Layout {...propHelpers.extractLayoutProps(props)}>
                    <EntityComponent
                        {...propHelpers.extractEntityProps(props)}
                    />
Severity: Major
Found in src/server/routes/entity/entity.tsx and 7 other locations - About 1 hr to fix
src/server/routes/adminLogs.tsx on lines 48..52
src/server/routes/entity/entity.tsx on lines 1401..1405
src/server/routes/identifier-types.tsx on lines 34..38
src/server/routes/relationship-types.tsx on lines 74..78
src/server/routes/searchAdmin.tsx on lines 44..50
src/server/routes/type-editor/identifier-type.tsx on lines 45..49
src/server/routes/type-editor/relationship-type.tsx on lines 45..49

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

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

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

    if (Iterable.isIterable(values)) {
        every = (object, predicate) => object.every(predicate);
    }
    else if (!_.isObject(values)) {
        return false;
Severity: Major
Found in src/client/entity-editor/validators/common.ts and 1 other location - About 1 hr to fix
src/client/entity-editor/validators/edition.ts on lines 58..63

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

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

                        <ListGroup.Item><b><a href="https://en.wikipedia.org/wiki/Edition_(book)#Printing,_print_run,_impression,_et_cetera">Printing, print run, impression</a></b> – A batch of identical copies of an edition of a work that is printed in a same, single production set-up.
                            <br/>One edition of a work may have any number of printings, e. g. a same Edition can have a first impression and a second impression.
                        </ListGroup.Item>
Severity: Major
Found in src/client/components/pages/help.tsx and 1 other location - About 1 hr to fix
src/client/components/pages/help.tsx on lines 137..139

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

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

        const markup = ReactDOMServer.renderToString(
            <Layout {...propHelpers.extractLayoutProps(props)}>
                <AdminLogsPage {...propHelpers.extractChildProps(props)}/>
            </Layout>
        );
Severity: Major
Found in src/server/routes/adminLogs.tsx and 7 other locations - About 1 hr to fix
src/server/routes/entity/entity.tsx on lines 156..162
src/server/routes/entity/entity.tsx on lines 1401..1405
src/server/routes/identifier-types.tsx on lines 34..38
src/server/routes/relationship-types.tsx on lines 74..78
src/server/routes/searchAdmin.tsx on lines 44..50
src/server/routes/type-editor/identifier-type.tsx on lines 45..49
src/server/routes/type-editor/relationship-type.tsx on lines 45..49

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

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 updateCreditDisplayValue(rowId: number, value: string): Action {
    return {
        payload: {
            rowId,
            value
Severity: Major
Found in src/client/entity-editor/author-credit-editor/actions.ts and 1 other location - About 1 hr to fix
src/client/entity-editor/author-credit-editor/actions.ts on lines 139..149

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

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 updateCreditJoinPhraseValue(
    rowId: number, value: string
): Action {
    return {
        payload: {
Severity: Major
Found in src/client/entity-editor/author-credit-editor/actions.ts and 1 other location - About 1 hr to fix
src/client/entity-editor/author-credit-editor/actions.ts on lines 121..129

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

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.authorSection.gender) {
                entity.authorSection.gender = utils.getIdByLabel(res.locals.genders, entity.authorSection.gender, 'name');
            }
Severity: Major
Found in src/server/routes/entity/author.ts and 1 other location - About 1 hr to fix
src/server/routes/entity/author.ts on lines 157..159

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

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.authorSection.type) {
                entity.authorSection.type = utils.getIdByLabel(res.locals.authorTypes, entity.authorSection.type, 'label');
            }
Severity: Major
Found in src/server/routes/entity/author.ts and 1 other location - About 1 hr to fix
src/server/routes/entity/author.ts on lines 154..156

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

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

                        <ListGroup.Item><b><a href="https://en.wikipedia.org/wiki/Category:Book_formats">Format</a></b> – Refers to different printing and/or binding methods, or digital distribution.
                            <br/>For example: paperback, mass-market, hardcover and e-book are all book formats
                        </ListGroup.Item>
Severity: Major
Found in src/client/components/pages/help.tsx and 1 other location - About 1 hr to fix
src/client/components/pages/help.tsx on lines 145..147

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

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 handleSubmit has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    handleSubmit() {
        const cleanedEntities = this.getCleanedEntities();
        const bbids = cleanedEntities.map(entity => entity.id);
        if (bbids.length) {
            request.post(`/collection/${this.props.collectionId}/add`)
Severity: Minor
Found in src/client/components/pages/parts/add-entity-to-collection-modal.js - About 1 hr to fix
    Severity
    Category
    Status
    Source
    Language