bookbrainz/bookbrainz-site

View on GitHub

Showing 1,033 of 1,033 total issues

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

router.get('/:bbid/revisions/revisions', (req, res, next) => {
    const {SeriesRevision} = req.app.locals.orm;
    _setSeriesTitle(res);
    entityRoutes.updateDisplayedRevisions(req, res, next, SeriesRevision);
});
Severity: Major
Found in src/server/routes/entity/series.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 237..241
src/server/routes/entity/author.ts on lines 243..247
src/server/routes/entity/edition-group.ts on lines 231..235
src/server/routes/entity/edition-group.ts on lines 237..241
src/server/routes/entity/edition.ts on lines 376..380
src/server/routes/entity/edition.ts on lines 382..386
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/publisher.ts on lines 249..253
src/server/routes/entity/series.ts on lines 232..236
src/server/routes/entity/work.ts on lines 256..260
src/server/routes/entity/work.ts on lines 262..266

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

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

router.get('/:bbid/revisions', (req, res, next) => {
    const {SeriesRevision} = req.app.locals.orm;
    _setSeriesTitle(res);
    entityRoutes.displayRevisions(req, res, next, SeriesRevision);
});
Severity: Major
Found in src/server/routes/entity/series.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 237..241
src/server/routes/entity/author.ts on lines 243..247
src/server/routes/entity/edition-group.ts on lines 231..235
src/server/routes/entity/edition-group.ts on lines 237..241
src/server/routes/entity/edition.ts on lines 376..380
src/server/routes/entity/edition.ts on lines 382..386
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/publisher.ts on lines 249..253
src/server/routes/entity/series.ts on lines 238..242
src/server/routes/entity/work.ts on lines 256..260
src/server/routes/entity/work.ts on lines 262..266

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

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

router.get('/:bbid/revisions/revisions', (req, res, next) => {
    const {EditionRevision} = req.app.locals.orm;
    _setEditionTitle(res);
    entityRoutes.updateDisplayedRevisions(req, res, next, EditionRevision);
});
Severity: Major
Found in src/server/routes/entity/edition.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 237..241
src/server/routes/entity/author.ts on lines 243..247
src/server/routes/entity/edition-group.ts on lines 231..235
src/server/routes/entity/edition-group.ts on lines 237..241
src/server/routes/entity/edition.ts on lines 376..380
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/publisher.ts on lines 249..253
src/server/routes/entity/series.ts on lines 232..236
src/server/routes/entity/series.ts on lines 238..242
src/server/routes/entity/work.ts on lines 256..260
src/server/routes/entity/work.ts on lines 262..266

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

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

router.get('/:bbid/revisions', (req, res, next) => {
    const {WorkRevision} = req.app.locals.orm;
    _setWorkTitle(res);
    entityRoutes.displayRevisions(req, res, next, WorkRevision);
});
Severity: Major
Found in src/server/routes/entity/work.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 237..241
src/server/routes/entity/author.ts on lines 243..247
src/server/routes/entity/edition-group.ts on lines 231..235
src/server/routes/entity/edition-group.ts on lines 237..241
src/server/routes/entity/edition.ts on lines 376..380
src/server/routes/entity/edition.ts on lines 382..386
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/publisher.ts on lines 249..253
src/server/routes/entity/series.ts on lines 232..236
src/server/routes/entity/series.ts on lines 238..242
src/server/routes/entity/work.ts on lines 262..266

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

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

router.get('/:bbid/revisions', (req, res, next) => {
    const {EditionRevision} = req.app.locals.orm;
    _setEditionTitle(res);
    entityRoutes.displayRevisions(req, res, next, EditionRevision);
});
Severity: Major
Found in src/server/routes/entity/edition.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 237..241
src/server/routes/entity/author.ts on lines 243..247
src/server/routes/entity/edition-group.ts on lines 231..235
src/server/routes/entity/edition-group.ts on lines 237..241
src/server/routes/entity/edition.ts on lines 382..386
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/publisher.ts on lines 249..253
src/server/routes/entity/series.ts on lines 232..236
src/server/routes/entity/series.ts on lines 238..242
src/server/routes/entity/work.ts on lines 256..260
src/server/routes/entity/work.ts on lines 262..266

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

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

router.get('/:bbid/revisions', (req, res, next) => {
    const {EditionGroupRevision} = req.app.locals.orm;
    _setEditionGroupTitle(res);
    entityRoutes.displayRevisions(req, res, next, EditionGroupRevision);
});
Severity: Major
Found in src/server/routes/entity/edition-group.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 237..241
src/server/routes/entity/author.ts on lines 243..247
src/server/routes/entity/edition-group.ts on lines 237..241
src/server/routes/entity/edition.ts on lines 376..380
src/server/routes/entity/edition.ts on lines 382..386
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/publisher.ts on lines 249..253
src/server/routes/entity/series.ts on lines 232..236
src/server/routes/entity/series.ts on lines 238..242
src/server/routes/entity/work.ts on lines 256..260
src/server/routes/entity/work.ts on lines 262..266

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

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

router.get('/:bbid/revisions/revisions', (req, res, next) => {
    const {PublisherRevision} = req.app.locals.orm;
    _setPublisherTitle(res);
    entityRoutes.updateDisplayedRevisions(req, res, next, PublisherRevision);
});
Severity: Major
Found in src/server/routes/entity/publisher.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 237..241
src/server/routes/entity/author.ts on lines 243..247
src/server/routes/entity/edition-group.ts on lines 231..235
src/server/routes/entity/edition-group.ts on lines 237..241
src/server/routes/entity/edition.ts on lines 376..380
src/server/routes/entity/edition.ts on lines 382..386
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/series.ts on lines 232..236
src/server/routes/entity/series.ts on lines 238..242
src/server/routes/entity/work.ts on lines 256..260
src/server/routes/entity/work.ts on lines 262..266

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

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

router.get('/:bbid/revisions', (req, res, next) => {
    const {AuthorRevision} = req.app.locals.orm;
    _setAuthorTitle(res);
    entityRoutes.displayRevisions(req, res, next, AuthorRevision);
});
Severity: Major
Found in src/server/routes/entity/author.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 243..247
src/server/routes/entity/edition-group.ts on lines 231..235
src/server/routes/entity/edition-group.ts on lines 237..241
src/server/routes/entity/edition.ts on lines 376..380
src/server/routes/entity/edition.ts on lines 382..386
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/publisher.ts on lines 249..253
src/server/routes/entity/series.ts on lines 232..236
src/server/routes/entity/series.ts on lines 238..242
src/server/routes/entity/work.ts on lines 256..260
src/server/routes/entity/work.ts on lines 262..266

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

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

router.get('/:bbid/revisions/revisions', (req, res, next) => {
    const {AuthorRevision} = req.app.locals.orm;
    _setAuthorTitle(res);
    entityRoutes.updateDisplayedRevisions(req, res, next, AuthorRevision);
});
Severity: Major
Found in src/server/routes/entity/author.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 237..241
src/server/routes/entity/edition-group.ts on lines 231..235
src/server/routes/entity/edition-group.ts on lines 237..241
src/server/routes/entity/edition.ts on lines 376..380
src/server/routes/entity/edition.ts on lines 382..386
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/publisher.ts on lines 249..253
src/server/routes/entity/series.ts on lines 232..236
src/server/routes/entity/series.ts on lines 238..242
src/server/routes/entity/work.ts on lines 256..260
src/server/routes/entity/work.ts on lines 262..266

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

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 handleModalSubmit = useCallback(() => {
        if (selectedParentType !== null) {
            setFormData((prevFormData) => ({
                ...prevFormData,
                childOrder, parentId: selectedParentType
src/client/components/forms/type-editor/identifier-type.tsx on lines 92..100

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

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

router.get('/:bbid/revisions/revisions', (req, res, next) => {
    const {EditionGroupRevision} = req.app.locals.orm;
    _setEditionGroupTitle(res);
    entityRoutes.updateDisplayedRevisions(req, res, next, EditionGroupRevision);
});
Severity: Major
Found in src/server/routes/entity/edition-group.ts and 11 other locations - About 1 hr to fix
src/server/routes/entity/author.ts on lines 237..241
src/server/routes/entity/author.ts on lines 243..247
src/server/routes/entity/edition-group.ts on lines 231..235
src/server/routes/entity/edition.ts on lines 376..380
src/server/routes/entity/edition.ts on lines 382..386
src/server/routes/entity/publisher.ts on lines 243..247
src/server/routes/entity/publisher.ts on lines 249..253
src/server/routes/entity/series.ts on lines 232..236
src/server/routes/entity/series.ts on lines 238..242
src/server/routes/entity/work.ts on lines 256..260
src/server/routes/entity/work.ts on lines 262..266

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

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 const RelationshipTypeEditorIcon = (
    <span className="fa-layers fa-fw margin-right-0-3">
        <FontAwesomeIcon icon={faLink} transform="left-3"/>
        <FontAwesomeIcon icon={faPlus} transform="shrink-8 right-5 down-5"/>
    </span>
Severity: Major
Found in src/client/helpers/utils.tsx and 1 other location - About 1 hr to fix
src/client/helpers/utils.tsx on lines 271..276

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

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 handleModalSubmit = useCallback(() => {
        if (selectedParentType !== null) {
            setFormData((prevFormData) => ({
                ...prevFormData,
                childOrder, parentId: selectedParentType
Severity: Major
Found in src/client/components/forms/type-editor/identifier-type.tsx and 1 other location - About 1 hr to fix
src/client/components/forms/type-editor/relationship-type.tsx on lines 134..142

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

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>{genEntityIconHTMLElement('Work')}Work</b> – a distinct intellectual or artistic creation expressed in words and/or images.
                            Here we are not talking, for example, about a physical book, but the introduction, story, illustrations, etc. it contains.
                            <ul>
                                <li>Examples: novel, poem, translation, introduction & foreword, article, research paper, etc.</li>
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 72..77

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

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 const IdentifierTypeEditorIcon = (
    <span className="fa-layers fa-fw margin-right-0-3">
        <FontAwesomeIcon icon={faBarcode} transform="shrink-3 left-5"/>
        <FontAwesomeIcon icon={faPlus} transform="shrink-8 right-5 down-2"/>
    </span>
Severity: Major
Found in src/client/helpers/utils.tsx and 1 other location - About 1 hr to fix
src/client/helpers/utils.tsx on lines 264..269

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

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>{genEntityIconHTMLElement('Series')}Series</b> – a set or sequence of related works, editions, authors, publishers or edition-groups.
                            <ul>
                                <li>Examples: a series of novels, a series of comics, etc.</li>
                            </ul>
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 65..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 66.

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

    render() {
        const {baseUrl, sourceUrl, originalUrl, formBody} = this.props;
        const formInputs = [];
        for (const field in formBody) {
            if (Object.hasOwnProperty.call(formBody, field)) {
Severity: Minor
Found in src/client/components/forms/preview.js - About 1 hr to fix

    Function makeEntityLoader has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function makeEntityLoader(modelName: string, additionalRels: Array<string>, errMessage: string) {
        const relations = [
            'aliasSet.aliases.language',
            'annotation.lastRevision',
            'defaultAlias',
    Severity: Minor
    Found in src/server/helpers/middleware.ts - About 1 hr to fix

      Function mapDispatchToProps has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function mapDispatchToProps(dispatch):ISBNDispatchProps {
          let autoAddedISBN:dispatchResultProps|null;
          function onChange(value:string, autoISBN = false) {
              const isbn10rgx = new
              RegExp('^(?:ISBN(?:-10)?:?●)?(?=[0-9X]{10}$|(?=(?:[0-9]+[-●]){3})[-●0-9X]{13}$)[0-9]{1,5}[-●]?[0-9]+[-●]?[0-9]+[-●]?[0-9X]$');
      Severity: Minor
      Found in src/client/unified-form/cover-tab/isbn-field.tsx - About 1 hr to fix

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

        SeriesDisplayPage.propTypes = {
            entity: PropTypes.object.isRequired,
            genderOptions: PropTypes.array,
            identifierTypes: PropTypes.array,
            user: PropTypes.object.isRequired,
        Severity: Major
        Found in src/client/components/pages/entities/series.js and 1 other location - About 1 hr to fix
        src/client/components/pages/entities/editionGroup-table.js on lines 62..68

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

        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