department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,717 of 12,717 total issues

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

export const isValidDate = dateString => {
  let isValid = true;
  const errors = {
    addError: () => {
      isValid = false;
Severity: Major
Found in src/applications/appeals/testing/hlr/validations/date.js and 5 other locations - About 1 hr to fix
src/applications/appeals/10182/validations/date.js on lines 31..40
src/applications/appeals/995/validations/date.js on lines 46..55
src/applications/appeals/996/validations/date.js on lines 30..39
src/applications/appeals/testing/sc/validations/date.js on lines 46..55
src/applications/appeals/testing/sc/validations/date.js on lines 87..96

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

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

  'GET /vaos/v2/epsApi/specialties/:specialtyId': (req, res) => {
    return res.json({
      data: specialties.specialties.find(
        specialty => specialty?.id === req.params.specialtyId,
      ),
Severity: Major
Found in src/applications/vaos/services/mocks/index.js and 5 other locations - About 1 hr to fix
src/applications/vaos/services/mocks/index.js on lines 589..595
src/applications/vaos/services/mocks/index.js on lines 609..615
src/applications/vaos/services/mocks/index.js on lines 622..628
src/applications/vaos/services/mocks/index.js on lines 629..638
src/applications/vaos/services/mocks/index.js on lines 655..661

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

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

  'GET /vaos/v2/epsApi/provider-services/:providerServiceId/slots': (
    req,
    res,
  ) => {
    return res.json({
Severity: Major
Found in src/applications/vaos/services/mocks/index.js and 5 other locations - About 1 hr to fix
src/applications/vaos/services/mocks/index.js on lines 589..595
src/applications/vaos/services/mocks/index.js on lines 599..605
src/applications/vaos/services/mocks/index.js on lines 609..615
src/applications/vaos/services/mocks/index.js on lines 622..628
src/applications/vaos/services/mocks/index.js on lines 655..661

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

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

export const isValidDate = dateString => {
  let isValid = true;
  const errors = {
    addError: () => {
      isValid = false;
Severity: Major
Found in src/applications/appeals/testing/sc/validations/date.js and 5 other locations - About 1 hr to fix
src/applications/appeals/10182/validations/date.js on lines 31..40
src/applications/appeals/995/validations/date.js on lines 46..55
src/applications/appeals/996/validations/date.js on lines 30..39
src/applications/appeals/testing/hlr/validations/date.js on lines 30..39
src/applications/appeals/testing/sc/validations/date.js on lines 87..96

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

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

export const ACTIONS = {
  DELETE_FILE: 'DELETE_FILE',
  DOC_DESC: 'DOC_DESC',
  DOC_TYPE: 'DOC_TYPE',
  FILE_DESCRIPTION_REQUIRED: 'FILE_DESCRIPTION_REQUIRED',
Severity: Major
Found in src/applications/lgy/coe/shared/constants.js and 5 other locations - About 1 hr to fix
src/applications/ask-va/config/schema-helpers/formFlowHelper.js on lines 49..68
src/applications/mhv-medical-records/util/constants.js on lines 233..244
src/applications/mhv-medications/util/constants.js on lines 156..167
src/platform/utilities/oauth/constants.js on lines 40..51
src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskRed/shared/constants.js on lines 1..12

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

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

export const isValidDate = dateString => {
  let isValid = true;
  const errors = {
    addError: () => {
      isValid = false;
Severity: Major
Found in src/applications/appeals/996/validations/date.js and 5 other locations - About 1 hr to fix
src/applications/appeals/10182/validations/date.js on lines 31..40
src/applications/appeals/995/validations/date.js on lines 46..55
src/applications/appeals/testing/hlr/validations/date.js on lines 30..39
src/applications/appeals/testing/sc/validations/date.js on lines 46..55
src/applications/appeals/testing/sc/validations/date.js on lines 87..96

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

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

export const dispStatusObj = {
  unknown: 'Unknown',
  active: 'Active',
  refillinprocess: 'Active: Refill in Process',
  submitted: 'Active: Submitted',
Severity: Major
Found in src/applications/mhv-medications/util/constants.js and 5 other locations - About 1 hr to fix
src/applications/ask-va/config/schema-helpers/formFlowHelper.js on lines 49..68
src/applications/mhv-medical-records/util/constants.js on lines 233..244
src/platform/utilities/oauth/constants.js on lines 40..51
src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskRed/shared/constants.js on lines 1..12
src/applications/lgy/coe/shared/constants.js on lines 1..12

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

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

  'GET /vaos/v2/epsApi/specialty-groups/:specialtyGroupId': (req, res) => {
    return res.json({
      data: specialtyGroups.specialtyGroups.find(
        specialtyGroup => specialtyGroup?.id === req.params.specialtyGroupId,
      ),
Severity: Major
Found in src/applications/vaos/services/mocks/index.js and 5 other locations - About 1 hr to fix
src/applications/vaos/services/mocks/index.js on lines 589..595
src/applications/vaos/services/mocks/index.js on lines 599..605
src/applications/vaos/services/mocks/index.js on lines 622..628
src/applications/vaos/services/mocks/index.js on lines 629..638
src/applications/vaos/services/mocks/index.js on lines 655..661

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

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

export const isValidVaDate = dateString => {
  let isValid = true;
  const errors = {
    addError: () => {
      isValid = false;
Severity: Major
Found in src/applications/appeals/testing/sc/validations/date.js and 5 other locations - About 1 hr to fix
src/applications/appeals/10182/validations/date.js on lines 31..40
src/applications/appeals/995/validations/date.js on lines 46..55
src/applications/appeals/996/validations/date.js on lines 30..39
src/applications/appeals/testing/hlr/validations/date.js on lines 30..39
src/applications/appeals/testing/sc/validations/date.js on lines 46..55

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

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

export const flowPaths = {
  aboutMyselfRelationshipVeteran: 'about-myself-relationship-veteran',
  aboutMyselfRelationshipFamilyMember:
    'about-myself-relationship-family-member',
  aboutSomeoneElseRelationshipVeteran:
src/applications/mhv-medical-records/util/constants.js on lines 233..244
src/applications/mhv-medications/util/constants.js on lines 156..167
src/platform/utilities/oauth/constants.js on lines 40..51
src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskRed/shared/constants.js on lines 1..12
src/applications/lgy/coe/shared/constants.js on lines 1..12

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

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

  cancelAddTitle: props => {
    const itemName = props.getItemName(props.itemData);
    return itemName
      ? `Cancel adding ${itemName}`
      : `Cancel adding this ${props.nounSingular}`;
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 4..9
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 10..15
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 48..53
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 82..87

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

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

  deleteTitle: props => {
    const itemName = props.getItemName(props.itemData);
    return itemName
      ? `Delete ${itemName}’s information?`
      : `Delete this ${props.nounSingular}?`;
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 4..9
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 10..15
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 33..38
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 48..53

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

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

  alertItemUpdated: props => {
    const itemName = props.getItemName(props.itemData);
    return itemName
      ? `${itemName}’s information has been updated`
      : `${props.nounSingular} information has been updated`;
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 10..15
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 33..38
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 48..53
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 82..87

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

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

Results2.propTypes = {
  formResponses: PropTypes.object.isRequired,
  router: PropTypes.shape({
    push: PropTypes.func,
  }).isRequired,
Severity: Major
Found in src/applications/pact-act/containers/results/Results2.jsx and 4 other locations - About 1 hr to fix
src/applications/pact-act/containers/results/Results1-1.jsx on lines 70..76
src/applications/pact-act/containers/results/Results1-2.jsx on lines 161..167
src/applications/pact-act/containers/results/Results3.jsx on lines 63..69
src/applications/pact-act/containers/results/Results4.jsx on lines 40..46

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

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

Results3.propTypes = {
  formResponses: PropTypes.object.isRequired,
  router: PropTypes.shape({
    push: PropTypes.func,
  }).isRequired,
Severity: Major
Found in src/applications/pact-act/containers/results/Results3.jsx and 4 other locations - About 1 hr to fix
src/applications/pact-act/containers/results/Results1-1.jsx on lines 70..76
src/applications/pact-act/containers/results/Results1-2.jsx on lines 161..167
src/applications/pact-act/containers/results/Results2.jsx on lines 73..79
src/applications/pact-act/containers/results/Results4.jsx on lines 40..46

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

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

Results4.propTypes = {
  formResponses: PropTypes.object.isRequired,
  router: PropTypes.shape({
    push: PropTypes.func,
  }).isRequired,
Severity: Major
Found in src/applications/pact-act/containers/results/Results4.jsx and 4 other locations - About 1 hr to fix
src/applications/pact-act/containers/results/Results1-1.jsx on lines 70..76
src/applications/pact-act/containers/results/Results1-2.jsx on lines 161..167
src/applications/pact-act/containers/results/Results2.jsx on lines 73..79
src/applications/pact-act/containers/results/Results3.jsx on lines 63..69

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

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

Results1Page2.propTypes = {
  formResponses: PropTypes.object.isRequired,
  router: PropTypes.shape({
    push: PropTypes.func,
  }).isRequired,
src/applications/pact-act/containers/results/Results1-1.jsx on lines 70..76
src/applications/pact-act/containers/results/Results2.jsx on lines 73..79
src/applications/pact-act/containers/results/Results3.jsx on lines 63..69
src/applications/pact-act/containers/results/Results4.jsx on lines 40..46

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

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

Results1Page1.propTypes = {
  formResponses: PropTypes.object.isRequired,
  router: PropTypes.shape({
    push: PropTypes.func,
  }).isRequired,
src/applications/pact-act/containers/results/Results1-2.jsx on lines 161..167
src/applications/pact-act/containers/results/Results2.jsx on lines 73..79
src/applications/pact-act/containers/results/Results3.jsx on lines 63..69
src/applications/pact-act/containers/results/Results4.jsx on lines 40..46

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

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

  cancelEditTitle: props => {
    const itemName = props.getItemName(props.itemData);
    return itemName
      ? `Cancel editing ${itemName}`
      : `Cancel editing this ${props.nounSingular}`;
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 4..9
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 10..15
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 33..38
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 82..87

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

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

  alertItemDeleted: props => {
    const itemName = props.getItemName(props.itemData);
    return itemName
      ? `${itemName}’s information has been deleted`
      : `${props.nounSingular} information has been deleted`;
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 4..9
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 33..38
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 48..53
src/platform/forms-system/src/js/patterns/array-builder/arrayBuilderText.js on lines 82..87

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

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