BookBrainz/bookbrainz-site

View on GitHub
src/client/components/pages/entities/edition-group.js

Summary

Maintainability
D
2 days
Test Coverage

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

                <Row>
                    <Col lg={8}>
                        <EntityLinks
                            entity={entity}
                            identifierTypes={identifierTypes}
Severity: Major
Found in src/client/components/pages/entities/edition-group.js and 2 other locations - About 6 hrs to fix
src/client/components/pages/entities/series.js on lines 140..158
src/client/components/pages/entities/work.js on lines 135..153

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

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

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

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

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

Refactorings

Further Reading

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

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

Duplicated Code

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

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

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

Tuning

This issue has a mass of 109.

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

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

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

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

Refactorings

Further Reading

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/edition-group.js and 3 other locations - About 2 hrs to fix
src/client/components/pages/entities/author.js on lines 201..209
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

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/edition-group.js and 5 other locations - About 1 hr to fix
src/client/components/pages/entities/author.js on lines 193..200
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 10 locations. Consider refactoring.
Open

                <Col lg={3}>
                    <dl>
                        <dt>Type</dt>
                        <dd>{type}</dd>
                    </dl>
Severity: Major
Found in src/client/components/pages/entities/edition-group.js and 9 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 52..57
src/client/components/pages/entities/edition.js on lines 94..99
src/client/components/pages/entities/publisher.js on lines 49..54
src/client/components/pages/entities/publisher.js on lines 55..60
src/client/components/pages/entities/publisher.js on lines 61..66
src/client/components/pages/entities/series.js on lines 49..54
src/client/components/pages/entities/work.js on lines 54..59
src/client/components/pages/entities/work.js on lines 60..65
src/client/components/pages/entities/work.js on lines 66..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 60.

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

                <Col lg={3}>
                    <dl>
                        <dt>Sort Name</dt>
                        <dd>{sortNameOfDefaultAlias}</dd>
                    </dl>
Severity: Major
Found in src/client/components/pages/entities/edition-group.js and 9 other locations - About 1 hr to fix
src/client/components/pages/entities/edition-group.js on lines 58..63
src/client/components/pages/entities/edition.js on lines 94..99
src/client/components/pages/entities/publisher.js on lines 49..54
src/client/components/pages/entities/publisher.js on lines 55..60
src/client/components/pages/entities/publisher.js on lines 61..66
src/client/components/pages/entities/series.js on lines 49..54
src/client/components/pages/entities/work.js on lines 54..59
src/client/components/pages/entities/work.js on lines 60..65
src/client/components/pages/entities/work.js on lines 66..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 60.

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

EditionGroupDisplayPage.propTypes = {
    entity: PropTypes.object.isRequired,
    identifierTypes: PropTypes.array,
    user: PropTypes.object.isRequired,
    wikipediaExtract: PropTypes.object
Severity: Major
Found in src/client/components/pages/entities/edition-group.js and 4 other locations - About 1 hr to fix
src/client/components/pages/entities/author.js on lines 214..219
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

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

                <Col lg={3}>
                    <dl>
                        <AverageRating
                            averageRatings={averageRating}
                            reviewsCount={reviewsCount}
Severity: Major
Found in src/client/components/pages/entities/edition-group.js and 2 other locations - About 55 mins to fix
src/client/components/pages/entities/series.js on lines 73..80
src/client/components/pages/entities/work.js on lines 72..79

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

There are no issues that match your filters.

Category
Status