BookBrainz/bookbrainz-site

View on GitHub

Showing 666 of 837 total issues

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

export function createSeriesCreator() {
    return new AchievementType(seriesCreatorIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(seriesCreatorIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createLimitedEdition() {
    return new AchievementType(limitedEditionIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(limitedEditionIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createExplorer() {
    return new AchievementType(explorerIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(explorerIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450

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

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

export function createRevisionist() {
    return new AchievementType(revisionistIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(revisionistIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createWorkerBee() {
    return new AchievementType(workerBeeIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(workerBeeIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createAuthorCreator() {
    return new AchievementType(authorCreatorIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(authorCreatorIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 367..382
data/test-data.js on lines 384..399
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

export function createPublisher() {
    return new AchievementType(publisherIAttribs)
        .save(null, {method: 'insert'})
        .then(
            () => new AchievementType(publisherIIAttribs)
Severity: Major
Found in data/test-data.js and 7 other locations - About 4 hrs to fix
data/test-data.js on lines 333..348
data/test-data.js on lines 350..365
data/test-data.js on lines 367..382
data/test-data.js on lines 401..416
data/test-data.js on lines 418..433
data/test-data.js on lines 435..450
data/test-data.js on lines 452..467

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

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

    publisher.relationships.forEach((relationship) => (
        relationshipSection.relationships[`n${relationship.id}`] = {
            attributeSetId: relationship.attributeSetId,
            attributes: relationship.attributeSet ? relationship.attributeSet.relationshipAttributes : [],
            relationshipType: relationship.type,
Severity: Major
Found in src/server/routes/entity/publisher.ts and 4 other locations - About 4 hrs to fix
src/server/routes/entity/author.ts on lines 306..315
src/server/routes/entity/edition-group.ts on lines 293..302
src/server/routes/entity/edition.ts on lines 507..516
src/server/routes/entity/work.ts on lines 321..330

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

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

    edition.relationships.forEach((relationship) => (
        relationshipSection.relationships[`n${relationship.id}`] = {
            attributeSetId: relationship.attributeSetId,
            attributes: relationship.attributeSet ? relationship.attributeSet.relationshipAttributes : [],
            relationshipType: relationship.type,
Severity: Major
Found in src/server/routes/entity/edition.ts and 4 other locations - About 4 hrs to fix
src/server/routes/entity/author.ts on lines 306..315
src/server/routes/entity/edition-group.ts on lines 293..302
src/server/routes/entity/publisher.ts on lines 309..318
src/server/routes/entity/work.ts on lines 321..330

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

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

    editionGroup.relationships.forEach((relationship) => (
        relationshipSection.relationships[`n${relationship.id}`] = {
            attributeSetId: relationship.attributeSetId,
            attributes: relationship.attributeSet ? relationship.attributeSet.relationshipAttributes : [],
            relationshipType: relationship.type,
Severity: Major
Found in src/server/routes/entity/edition-group.ts and 4 other locations - About 4 hrs to fix
src/server/routes/entity/author.ts on lines 306..315
src/server/routes/entity/edition.ts on lines 507..516
src/server/routes/entity/publisher.ts on lines 309..318
src/server/routes/entity/work.ts on lines 321..330

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

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

    work.relationships.forEach((relationship) => (
        relationshipSection.relationships[`n${relationship.id}`] = {
            attributeSetId: relationship.attributeSetId,
            attributes: relationship.attributeSet ? relationship.attributeSet.relationshipAttributes : [],
            relationshipType: relationship.type,
Severity: Major
Found in src/server/routes/entity/work.ts and 4 other locations - About 4 hrs to fix
src/server/routes/entity/author.ts on lines 306..315
src/server/routes/entity/edition-group.ts on lines 293..302
src/server/routes/entity/edition.ts on lines 507..516
src/server/routes/entity/publisher.ts on lines 309..318

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

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

    author.relationships.forEach((relationship) => (
        relationshipSection.relationships[`n${relationship.id}`] = {
            attributeSetId: relationship.attributeSetId,
            attributes: relationship.attributeSet ? relationship.attributeSet.relationshipAttributes : [],
            relationshipType: relationship.type,
Severity: Major
Found in src/server/routes/entity/author.ts and 4 other locations - About 4 hrs to fix
src/server/routes/entity/edition-group.ts on lines 293..302
src/server/routes/entity/edition.ts on lines 507..516
src/server/routes/entity/publisher.ts on lines 309..318
src/server/routes/entity/work.ts on lines 321..330

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

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

        function relationshipsFilterMethod(relatedEntity) {
            let workTypeMatched = true;
            let workLanguageMatched = true;
            if (req.query.type) {
                workTypeMatched = toLower(relatedEntity.workType) === toLower(req.query.type);
Severity: Major
Found in src/api/routes/work.js and 1 other location - About 4 hrs to fix
src/api/routes/edition.js on lines 370..380

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

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

        function relationshipsFilterMethod(relatedEntity) {
            let editionFormatMatched = true;
            let editionLanguageMatched = true;
            if (req.query.format) {
                editionFormatMatched = toLower(relatedEntity.editionFormat) === toLower(req.query.format);
Severity: Major
Found in src/api/routes/edition.js and 1 other location - About 4 hrs to fix
src/api/routes/work.js on lines 331..341

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

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Link Phrase</Form.Label>
                                <Form.Control
src/client/components/forms/type-editor/identifier-type.tsx on lines 213..226
src/client/components/forms/type-editor/identifier-type.tsx on lines 227..240
src/client/components/forms/type-editor/identifier-type.tsx on lines 241..254
src/client/components/forms/type-editor/identifier-type.tsx on lines 255..268
src/client/components/forms/type-editor/identifier-type.tsx on lines 269..282
src/client/components/forms/type-editor/relationship-type.tsx on lines 266..279
src/client/components/forms/type-editor/relationship-type.tsx on lines 280..293
src/client/components/forms/type-editor/relationship-type.tsx on lines 308..321

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

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Description</Form.Label>
                                <Form.Control
Severity: Major
Found in src/client/components/forms/type-editor/identifier-type.tsx and 8 other locations - About 4 hrs to fix
src/client/components/forms/type-editor/identifier-type.tsx on lines 213..226
src/client/components/forms/type-editor/identifier-type.tsx on lines 241..254
src/client/components/forms/type-editor/identifier-type.tsx on lines 255..268
src/client/components/forms/type-editor/identifier-type.tsx on lines 269..282
src/client/components/forms/type-editor/relationship-type.tsx on lines 266..279
src/client/components/forms/type-editor/relationship-type.tsx on lines 280..293
src/client/components/forms/type-editor/relationship-type.tsx on lines 294..307
src/client/components/forms/type-editor/relationship-type.tsx on lines 308..321

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

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Reverse Link Phrase</Form.Label>
                                <Form.Control
src/client/components/forms/type-editor/identifier-type.tsx on lines 213..226
src/client/components/forms/type-editor/identifier-type.tsx on lines 227..240
src/client/components/forms/type-editor/identifier-type.tsx on lines 241..254
src/client/components/forms/type-editor/identifier-type.tsx on lines 255..268
src/client/components/forms/type-editor/identifier-type.tsx on lines 269..282
src/client/components/forms/type-editor/relationship-type.tsx on lines 266..279
src/client/components/forms/type-editor/relationship-type.tsx on lines 280..293
src/client/components/forms/type-editor/relationship-type.tsx on lines 294..307

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

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

                    <Row>
                        <Col lg={lgCol}>
                            <Form.Group>
                                <Form.Label>Validation RegEx</Form.Label>
                                <Form.Control
Severity: Major
Found in src/client/components/forms/type-editor/identifier-type.tsx and 8 other locations - About 4 hrs to fix
src/client/components/forms/type-editor/identifier-type.tsx on lines 213..226
src/client/components/forms/type-editor/identifier-type.tsx on lines 227..240
src/client/components/forms/type-editor/identifier-type.tsx on lines 241..254
src/client/components/forms/type-editor/identifier-type.tsx on lines 269..282
src/client/components/forms/type-editor/relationship-type.tsx on lines 266..279
src/client/components/forms/type-editor/relationship-type.tsx on lines 280..293
src/client/components/forms/type-editor/relationship-type.tsx on lines 294..307
src/client/components/forms/type-editor/relationship-type.tsx on lines 308..321

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

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 validateForm(
    formData: any, identifierTypes?: Array<_IdentifierType> | null | undefined
): boolean {
    const conditions = [
        validateAliases(get(formData, 'aliasEditor', {})),
Severity: Major
Found in src/client/entity-editor/validators/series.ts and 3 other locations - About 4 hrs to fix
src/client/entity-editor/validators/author.ts on lines 97..111
src/client/entity-editor/validators/publisher.ts on lines 79..93
src/client/entity-editor/validators/work.ts on lines 48..62

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

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 validateForm(
    formData: any, identifierTypes?: Array<_IdentifierType> | null | undefined
): boolean {
    const conditions = [
        validateAliases(get(formData, 'aliasEditor', {})),
Severity: Major
Found in src/client/entity-editor/validators/work.ts and 3 other locations - About 4 hrs to fix
src/client/entity-editor/validators/author.ts on lines 97..111
src/client/entity-editor/validators/publisher.ts on lines 79..93
src/client/entity-editor/validators/series.ts on lines 50..64

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

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