BookBrainz/bookbrainz-site

View on GitHub
src/client/components/pages/entities/author.js

Summary

Maintainability
D
2 days
Test Coverage

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

            <Row className="entity-display-background">
                <Col className="entity-display-image-box text-center" lg={2}>
                    <EntityImage
                        backupIcon={ENTITY_TYPE_ICONS.Author}
                        deleted={entity.deleted}
Severity: Major
Found in src/client/components/pages/entities/author.js and 2 other locations - About 5 hrs to fix
src/client/components/pages/entities/series.js on lines 116..133
src/client/components/pages/entities/work.js on lines 109..126

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

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

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

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

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

Refactorings

Further Reading

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

                    <Col lg={3}>
                        <dl>
                            <dt>{endDateLabel}</dt>
                            <dd>{endDate}</dd>
                            <dt>{endAreaLabel}</dt>
Severity: Major
Found in src/client/components/pages/entities/author.js and 1 other location - About 2 hrs to fix
src/client/components/pages/entities/author.js on lines 92..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 92.

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

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

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

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

Refactorings

Further Reading

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

                <Col lg={3}>
                    <dl>
                        <dt>{beginDateLabel}</dt>
                        <dd>{beginDate}</dd>
                        <dt>{beginAreaLabel}</dt>
Severity: Major
Found in src/client/components/pages/entities/author.js and 1 other location - About 2 hrs to fix
src/client/components/pages/entities/author.js on lines 102..109

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

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

            {!entity.deleted && <CBReviewModal
                entityBBID={entity.bbid}
                entityName={entity.defaultAlias.name}
                entityType={entity.type}
                handleModalToggle={handleModalToggle}
Severity: Major
Found in src/client/components/pages/entities/author.js and 3 other locations - About 2 hrs to fix
src/client/components/pages/entities/edition-group.js on lines 170..178
src/client/components/pages/entities/series.js on lines 169..177
src/client/components/pages/entities/work.js on lines 164..172

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

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

                            <Button
                                className="margin-top-d15"
                                href={`/work/create?${_kebabCase(entity.type)}=${entity.bbid}`}
                                variant="success"
                            >
Severity: Major
Found in src/client/components/pages/entities/author.js and 1 other location - About 1 hr to fix
src/client/components/pages/entities/work-table.js on lines 123..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 74.

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

            <EntityFooter
                bbid={entity.bbid}
                deleted={entity.deleted}
                entityType={entity.type}
                entityUrl={urlPrefix}
Severity: Major
Found in src/client/components/pages/entities/author.js and 5 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 162..169
src/client/components/pages/entities/edition.js on lines 188..195
src/client/components/pages/entities/publisher.js on lines 115..122
src/client/components/pages/entities/series.js on lines 161..168
src/client/components/pages/entities/work.js on lines 156..163

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

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 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 183..188
src/client/components/pages/entities/edition.js on lines 200..205
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

There are no issues that match your filters.

Category
Status