bookbrainz/bookbrainz-site

View on GitHub

Showing 1,033 of 1,033 total issues

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 513..522
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

    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 295..304
src/server/routes/entity/edition.ts on lines 513..522
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

    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 295..304
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

    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 295..304
src/server/routes/entity/edition.ts on lines 513..522
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

Function RevisionsTable has 109 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function RevisionsTable(props) {
    const {results, showEntities, showRevisionNote, showRevisionEditor, tableHeading} = props;
    return (
        <div>
            <div>
Severity: Major
Found in src/client/components/pages/parts/revisions-table.js - About 4 hrs to fix

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

    Function render has 105 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        render() {
            const loadingElement =
                this.state.waiting ? <LoadingSpinner/> : null;
            const genderOptions = this.state.genders.map((gender) => ({
                id: gender.id,
    Severity: Major
    Found in src/client/components/forms/profile.js - About 4 hrs to fix

      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

      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>Detection 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 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 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/author.ts and 3 other locations - About 4 hrs to fix
      src/client/entity-editor/validators/publisher.ts on lines 79..93
      src/client/entity-editor/validators/series.ts on lines 50..64
      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 9 locations. Consider refactoring.
      Open

                          <Row>
                              <Col lg={lgCol}>
                                  <Form.Group>
                                      <Form.Label>Display Template</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 255..268
      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 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 9 locations. Consider refactoring.
      Open

                          <Row>
                              <Col lg={lgCol}>
                                  <Form.Group>
                                      <Form.Label>Description</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 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>Label</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 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/publisher.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/series.ts on lines 50..64
      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 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>Label</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 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
      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

      Severity
      Category
      Status
      Source
      Language