bookbrainz/bookbrainz-site

View on GitHub

Showing 1,033 of 1,033 total issues

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

                    <Row>
                        <Col className="text-center margin-top-d5" lg={lgCol}>
                            <Button type="submit">Submit</Button>
                        </Col>
                    </Row>
src/client/components/forms/type-editor/identifier-type.tsx on lines 377..381

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

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

        catch (error) {
            const message =
                        _.get(error, ['response', 'body', 'error'], null) ||
                        error.message;
            dispatch(setSubmitted(false));
Severity: Major
Found in src/client/entity-editor/submission-section/actions.ts and 1 other location - About 1 hr to fix
src/client/entity-editor/submission-section/actions.ts on lines 241..247

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

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

                    <Button onClick={() => { indexEntity('Edition'); }}>
                        <FontAwesomeIcon
                            icon={ENTITY_TYPE_ICONS.Edition}
                            size="2x"
                        />
Severity: Major
Found in src/client/components/pages/searchAdmin.tsx and 7 other locations - About 1 hr to fix
src/client/components/pages/searchAdmin.tsx on lines 51..56
src/client/components/pages/searchAdmin.tsx on lines 58..63
src/client/components/pages/searchAdmin.tsx on lines 70..75
src/client/components/pages/searchAdmin.tsx on lines 76..81
src/client/components/pages/searchAdmin.tsx on lines 82..87
src/client/components/pages/searchAdmin.tsx on lines 88..93
src/client/components/pages/searchAdmin.tsx on lines 94..99

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

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

                    <Button onClick={() => { indexEntity('Collection'); }}>
                        <FontAwesomeIcon
                            icon={ENTITY_TYPE_ICONS.Collection}
                            size="2x"
                        />
Severity: Major
Found in src/client/components/pages/searchAdmin.tsx and 7 other locations - About 1 hr to fix
src/client/components/pages/searchAdmin.tsx on lines 51..56
src/client/components/pages/searchAdmin.tsx on lines 58..63
src/client/components/pages/searchAdmin.tsx on lines 64..69
src/client/components/pages/searchAdmin.tsx on lines 70..75
src/client/components/pages/searchAdmin.tsx on lines 76..81
src/client/components/pages/searchAdmin.tsx on lines 82..87
src/client/components/pages/searchAdmin.tsx on lines 88..93

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

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

                        <a
                            href={`/editor/${revision.author.id}`}
                            title={editorTitle}
                        >
                            {revision.author.name}
Severity: Major
Found in src/client/components/pages/revision.js and 1 other location - About 1 hr to fix
src/client/components/pages/revision.js on lines 231..236

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

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 (aliasSetChanged) {
        if (change.kind === 'A') {
            // Alias added to or deleted from set
            return formatAliasAddOrDelete(change);
        }
Severity: Major
Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 1 hr to fix
src/server/helpers/diffFormatters/entity.js on lines 234..244

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

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

                    <Button onClick={() => { indexEntity('Series'); }}>
                        <FontAwesomeIcon
                            icon={ENTITY_TYPE_ICONS.Series}
                            size="2x"
                        />
Severity: Major
Found in src/client/components/pages/searchAdmin.tsx and 7 other locations - About 1 hr to fix
src/client/components/pages/searchAdmin.tsx on lines 51..56
src/client/components/pages/searchAdmin.tsx on lines 58..63
src/client/components/pages/searchAdmin.tsx on lines 64..69
src/client/components/pages/searchAdmin.tsx on lines 70..75
src/client/components/pages/searchAdmin.tsx on lines 76..81
src/client/components/pages/searchAdmin.tsx on lines 88..93
src/client/components/pages/searchAdmin.tsx on lines 94..99

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

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 debouncedUpdatePages(value: number | null | undefined): Action {
    return {
        meta: {debounce: 'keystroke'},
        payload: value,
        type: UPDATE_PAGES
Severity: Major
Found in src/client/entity-editor/edition-section/actions.ts and 3 other locations - About 1 hr to fix
src/client/entity-editor/edition-section/actions.ts on lines 210..216
src/client/entity-editor/edition-section/actions.ts on lines 242..248
src/client/entity-editor/edition-section/actions.ts on lines 258..264

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

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

                    <Button onClick={() => { indexEntity('Area'); }}>
                        <FontAwesomeIcon
                            icon={ENTITY_TYPE_ICONS.Area}
                            size="2x"
                        />
Severity: Major
Found in src/client/components/pages/searchAdmin.tsx and 7 other locations - About 1 hr to fix
src/client/components/pages/searchAdmin.tsx on lines 51..56
src/client/components/pages/searchAdmin.tsx on lines 58..63
src/client/components/pages/searchAdmin.tsx on lines 64..69
src/client/components/pages/searchAdmin.tsx on lines 70..75
src/client/components/pages/searchAdmin.tsx on lines 76..81
src/client/components/pages/searchAdmin.tsx on lines 82..87
src/client/components/pages/searchAdmin.tsx on lines 94..99

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

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

                    <Row>
                        <Col className="text-center margin-top-d5" lg={lgCol}>
                            <Button type="submit">Submit</Button>
                        </Col>
                    </Row>
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 460..464

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

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 debouncedUpdateWeight(value: number | null | undefined): Action {
    return {
        meta: {debounce: 'keystroke'},
        payload: value,
        type: UPDATE_WEIGHT
Severity: Major
Found in src/client/entity-editor/edition-section/actions.ts and 3 other locations - About 1 hr to fix
src/client/entity-editor/edition-section/actions.ts on lines 226..232
src/client/entity-editor/edition-section/actions.ts on lines 242..248
src/client/entity-editor/edition-section/actions.ts on lines 258..264

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

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

                    <Button onClick={() => { indexEntity('EditionGroup'); }}>
                        <FontAwesomeIcon
                            icon={ENTITY_TYPE_ICONS.EditionGroup}
                            size="2x"
                        />
Severity: Major
Found in src/client/components/pages/searchAdmin.tsx and 7 other locations - About 1 hr to fix
src/client/components/pages/searchAdmin.tsx on lines 51..56
src/client/components/pages/searchAdmin.tsx on lines 58..63
src/client/components/pages/searchAdmin.tsx on lines 64..69
src/client/components/pages/searchAdmin.tsx on lines 76..81
src/client/components/pages/searchAdmin.tsx on lines 82..87
src/client/components/pages/searchAdmin.tsx on lines 88..93
src/client/components/pages/searchAdmin.tsx on lines 94..99

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

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

                            <a
                                href={`/editor/${note.author.id}`}
                                title={noteAuthorTitle}
                            >
                                {note.author.name}
Severity: Major
Found in src/client/components/pages/revision.js and 1 other location - About 1 hr to fix
src/client/components/pages/revision.js on lines 275..280

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

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 (identifierSetChanged) {
        if (change.kind === 'A') {
            // Identifier added to or deleted from set
            return formatIdentifierAddOrDelete(change);
        }
Severity: Major
Found in src/server/helpers/diffFormatters/entity.js and 1 other location - About 1 hr to fix
src/server/helpers/diffFormatters/entity.js on lines 154..164

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

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

                    <Button onClick={() => { indexEntity('Publisher'); }}>
                        <FontAwesomeIcon
                            icon={ENTITY_TYPE_ICONS.Publisher}
                            size="2x"
                        />
Severity: Major
Found in src/client/components/pages/searchAdmin.tsx and 7 other locations - About 1 hr to fix
src/client/components/pages/searchAdmin.tsx on lines 51..56
src/client/components/pages/searchAdmin.tsx on lines 58..63
src/client/components/pages/searchAdmin.tsx on lines 64..69
src/client/components/pages/searchAdmin.tsx on lines 70..75
src/client/components/pages/searchAdmin.tsx on lines 82..87
src/client/components/pages/searchAdmin.tsx on lines 88..93
src/client/components/pages/searchAdmin.tsx on lines 94..99

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

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

                    <Button onClick={() => { indexEntity('Author'); }}>
                        <FontAwesomeIcon
                            icon={ENTITY_TYPE_ICONS.Author}
                            size="2x"
                        />
Severity: Major
Found in src/client/components/pages/searchAdmin.tsx and 7 other locations - About 1 hr to fix
src/client/components/pages/searchAdmin.tsx on lines 58..63
src/client/components/pages/searchAdmin.tsx on lines 64..69
src/client/components/pages/searchAdmin.tsx on lines 70..75
src/client/components/pages/searchAdmin.tsx on lines 76..81
src/client/components/pages/searchAdmin.tsx on lines 82..87
src/client/components/pages/searchAdmin.tsx on lines 88..93
src/client/components/pages/searchAdmin.tsx on lines 94..99

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

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

                    (error: {message: string}) => {
                        const message =
                        _.get(error, ['response', 'body', 'error'], null) ||
                        error.message;
                        dispatch(setSubmitted(false));
Severity: Major
Found in src/client/entity-editor/submission-section/actions.ts and 1 other location - About 1 hr to fix
src/client/entity-editor/submission-section/actions.ts on lines 295..301

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

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

                                <div>
                                    <Button
                                        className="btn btn-sm"
                                        href={`/relationship-type/${relType.id}/edit`}
                                        size="sm"
src/client/components/pages/parts/identifier-types-tree.tsx on lines 82..90

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

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

                                <div>
                                    <Button
                                        className="btn btn-sm"
                                        href={`/identifier-type/${idenType.id}/edit`}
                                        size="sm"
Severity: Major
Found in src/client/components/pages/parts/identifier-types-tree.tsx and 1 other location - About 1 hr to fix
src/client/components/pages/parts/relationship-types-tree.tsx on lines 87..95

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

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

    if (_.isEqual(change.path, ['authorType']) ||
            _.isEqual(change.path, ['authorType', 'label'])) {
        return baseFormatter.formatTypeChange(change, 'Author Type');
    }
Severity: Major
Found in src/server/routes/revision.js and 8 other locations - About 55 mins to fix
src/server/routes/revision.js on lines 67..70
src/server/routes/revision.js on lines 72..75
src/server/routes/revision.js on lines 110..113
src/server/routes/revision.js on lines 115..118
src/server/routes/revision.js on lines 135..138
src/server/routes/revision.js on lines 149..152
src/server/routes/revision.js on lines 163..166
src/server/routes/revision.js on lines 172..175

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

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