department-of-veterans-affairs/vets-website

View on GitHub
src/applications/discover-your-benefits/constants/benefits.js

Summary

Maintainability
F
1 wk
Test Coverage

File benefits.js has 768 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const categories = {
  BURIALS: 'Burials and memorials',
  EDUCATION: 'Education',
  EMPLOYMENT: 'Careers and Employment',
  MORE_SUPPORT: 'More Support',
Severity: Major
Found in src/applications/discover-your-benefits/constants/benefits.js - About 1 day to fix

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

      {
        name: 'Veteran Readiness and Employment (Chapter 31)',
        category: categories.EDUCATION,
        id: 'VRE',
        description:
    src/applications/discover-your-benefits/constants/benefits.js on lines 515..545

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

    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

      {
        name: 'Foreign Medical Program',
        category: categories.HEALTH_CARE,
        id: 'FMP',
        description:
    src/applications/discover-your-benefits/constants/benefits.js on lines 351..382

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

    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

      {
        name: 'Transfer your GI Bill benefits',
        category: categories.EDUCATION,
        id: 'TGI',
        description:
    src/applications/discover-your-benefits/constants/benefits.js on lines 330..350

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

    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

      {
        name: 'Transition Assistance Program (TAP)',
        category: categories.MORE_SUPPORT,
        id: 'TAP',
        description:
    src/applications/discover-your-benefits/constants/benefits.js on lines 737..760

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

    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

        mappings: {
          [mappingTypes.GOALS]: [goalTypes.CAREER, goalTypes.UNDERSTAND],
          [mappingTypes.LENGTH_OF_SERVICE]: [anyType.ANY],
          [mappingTypes.CURRENTLY_SERVING]: [anyType.ANY],
          [mappingTypes.EXPECTED_SEPARATION]: [anyType.ANY],
    src/applications/discover-your-benefits/constants/benefits.js on lines 185..199

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

    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

        mappings: {
          [mappingTypes.GOALS]: [goalTypes.CAREER, goalTypes.UNDERSTAND],
          [mappingTypes.LENGTH_OF_SERVICE]: [anyType.ANY],
          [mappingTypes.CURRENTLY_SERVING]: [yesNoType.YES],
          [mappingTypes.EXPECTED_SEPARATION]: [anyType.ANY],
    src/applications/discover-your-benefits/constants/benefits.js on lines 258..272

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

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

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

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

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

    Refactorings

    Further Reading

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

        extraConditions: {
          dependsOn: [
            {
              field: mappingTypes.CURRENTLY_SERVING,
              value: yesNoType.YES,
    src/applications/discover-your-benefits/constants/benefits.js on lines 273..288

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 88.

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

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

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

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

    Refactorings

    Further Reading

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

        extraConditions: {
          dependsOn: [
            {
              field: mappingTypes.CURRENTLY_SERVING,
              value: yesNoType.YES,
    src/applications/discover-your-benefits/constants/benefits.js on lines 310..325

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 88.

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

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

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

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

    Refactorings

    Further Reading

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

    export const mappingTypes = {
      GOALS: 'goals',
      LENGTH_OF_SERVICE: 'militaryServiceTotalTimeServed',
      CURRENTLY_SERVING: 'militaryServiceCurrentlyServing',
      PREVIOUS_SERVICE: 'militaryServiceCompleted',
    src/applications/disability-benefits/686c-674-v2/config/constants.js on lines 7..18
    src/applications/mhv-medical-records/util/constants.js on lines 159..169
    src/applications/simple-forms/21-4142/definitions/constants.js on lines 1..11
    src/applications/simple-forms/26-4555/definitions/constants.js on lines 1..11
    src/applications/appeals/996/constants.js on lines 45..61
    src/applications/appeals/testing/hlr/constants.js on lines 45..61

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 56.

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

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

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

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

    Refactorings

    Further Reading

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

    export const characterOfDischargeTypeLabels = Object.freeze({
      HONORABLE: 'Honorable',
      UNDER_HONORABLE_CONDITIONS_GENERAL: 'Under Honorable Conditions (General)',
      UNDER_OTHER_THAN_HONORABLE_CONDITIONS:
        'Under Other Than Honorable Conditions',
    Severity: Major
    Found in src/applications/discover-your-benefits/constants/benefits.js and 10 other locations - About 55 mins to fix
    src/applications/discover-your-benefits/constants/benefits.js on lines 119..128
    src/applications/simple-forms/20-10207/config/constants.js on lines 40..53
    src/applications/simple-forms/20-10207/config/constants.js on lines 54..67
    src/applications/simple-forms/20-10207/config/constants.js on lines 68..81
    src/applications/simple-forms/20-10207/config/constants.js on lines 276..286
    src/applications/simple-forms/20-10207/config/constants.js on lines 288..299
    src/applications/simple-forms/20-10207/config/constants.js on lines 301..313
    src/applications/simple-forms/21-4138/config/constants.js on lines 92..105
    src/platform/user/profile/vap-svc/constants/addressValidationMessages.js on lines 5..13
    src/applications/disability-benefits/all-claims/constants.js on lines 371..379

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 54.

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

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

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

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

    Refactorings

    Further Reading

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

    export const characterOfDischargeTypes = Object.freeze({
      HONORABLE: 'HONORABLE',
      UNDER_HONORABLE_CONDITIONS_GENERAL: 'UNDER_HONORABLE_CONDITIONS_GENERAL',
      UNDER_OTHER_THAN_HONORABLE_CONDITIONS:
        'UNDER_OTHER_THAN_HONORABLE_CONDITIONS',
    Severity: Major
    Found in src/applications/discover-your-benefits/constants/benefits.js and 10 other locations - About 55 mins to fix
    src/applications/discover-your-benefits/constants/benefits.js on lines 130..139
    src/applications/simple-forms/20-10207/config/constants.js on lines 40..53
    src/applications/simple-forms/20-10207/config/constants.js on lines 54..67
    src/applications/simple-forms/20-10207/config/constants.js on lines 68..81
    src/applications/simple-forms/20-10207/config/constants.js on lines 276..286
    src/applications/simple-forms/20-10207/config/constants.js on lines 288..299
    src/applications/simple-forms/20-10207/config/constants.js on lines 301..313
    src/applications/simple-forms/21-4138/config/constants.js on lines 92..105
    src/platform/user/profile/vap-svc/constants/addressValidationMessages.js on lines 5..13
    src/applications/disability-benefits/all-claims/constants.js on lines 371..379

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 54.

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

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

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

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

    Refactorings

    Further Reading

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

    export const goalTypeLabels = Object.freeze({
      FINANCIAL: 'Get financial support for a service-connected condition',
      SCHOOL: 'Go back to school',
      RETIREMENT: 'Plan for my transition or retirement',
      CAREER: 'Start a new career',
    Severity: Major
    Found in src/applications/discover-your-benefits/constants/benefits.js and 8 other locations - About 40 mins to fix
    src/applications/accredited-representative-portal/accreditation/21a/constants/options.js on lines 14..21
    src/applications/discover-your-benefits/constants/benefits.js on lines 26..33
    src/applications/discover-your-benefits/constants/benefits.js on lines 44..51
    src/applications/discover-your-benefits/constants/benefits.js on lines 53..60
    src/applications/discover-your-benefits/constants/benefits.js on lines 77..84
    src/applications/discover-your-benefits/constants/benefits.js on lines 86..93
    src/applications/simple-forms/21-4138/config/constants.js on lines 49..56
    src/platform/forms/save-in-progress/actions.js on lines 18..25

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

    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

    export const separationTypeLabels = Object.freeze({
      UP_TO_3_MONTHS: '0 to 3 months',
      UP_TO_6_MONTHS: '4 to 6 months',
      UP_TO_1_YEAR: '7 months to 1 year',
      UP_TO_2_YEARS: '1 to 2 years',
    Severity: Major
    Found in src/applications/discover-your-benefits/constants/benefits.js and 8 other locations - About 40 mins to fix
    src/applications/accredited-representative-portal/accreditation/21a/constants/options.js on lines 14..21
    src/applications/discover-your-benefits/constants/benefits.js on lines 26..33
    src/applications/discover-your-benefits/constants/benefits.js on lines 35..42
    src/applications/discover-your-benefits/constants/benefits.js on lines 44..51
    src/applications/discover-your-benefits/constants/benefits.js on lines 53..60
    src/applications/discover-your-benefits/constants/benefits.js on lines 77..84
    src/applications/simple-forms/21-4138/config/constants.js on lines 49..56
    src/platform/forms/save-in-progress/actions.js on lines 18..25

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

    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

    export const goalTypes = Object.freeze({
      FINANCIAL: 'FINANCIAL',
      SCHOOL: 'SCHOOL',
      RETIREMENT: 'RETIREMENT',
      CAREER: 'CAREER',
    Severity: Major
    Found in src/applications/discover-your-benefits/constants/benefits.js and 8 other locations - About 40 mins to fix
    src/applications/accredited-representative-portal/accreditation/21a/constants/options.js on lines 14..21
    src/applications/discover-your-benefits/constants/benefits.js on lines 35..42
    src/applications/discover-your-benefits/constants/benefits.js on lines 44..51
    src/applications/discover-your-benefits/constants/benefits.js on lines 53..60
    src/applications/discover-your-benefits/constants/benefits.js on lines 77..84
    src/applications/discover-your-benefits/constants/benefits.js on lines 86..93
    src/applications/simple-forms/21-4138/config/constants.js on lines 49..56
    src/platform/forms/save-in-progress/actions.js on lines 18..25

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

    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

    export const separationTypes = Object.freeze({
      UP_TO_3_MONTHS: 'UP_TO_3_MONTHS',
      UP_TO_6_MONTHS: 'UP_TO_6_MONTHS',
      UP_TO_1_YEAR: 'UP_TO_1_YEAR',
      UP_TO_2_YEARS: 'UP_TO_2_YEARS',
    Severity: Major
    Found in src/applications/discover-your-benefits/constants/benefits.js and 8 other locations - About 40 mins to fix
    src/applications/accredited-representative-portal/accreditation/21a/constants/options.js on lines 14..21
    src/applications/discover-your-benefits/constants/benefits.js on lines 26..33
    src/applications/discover-your-benefits/constants/benefits.js on lines 35..42
    src/applications/discover-your-benefits/constants/benefits.js on lines 44..51
    src/applications/discover-your-benefits/constants/benefits.js on lines 53..60
    src/applications/discover-your-benefits/constants/benefits.js on lines 86..93
    src/applications/simple-forms/21-4138/config/constants.js on lines 49..56
    src/platform/forms/save-in-progress/actions.js on lines 18..25

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

    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

    export const militaryServiceTimeServedTypes = Object.freeze({
      UP_TO_3_MONTHS: 'UP_TO_3_MONTHS',
      UP_TO_6_MONTHS: 'UP_TO_6_MONTHS',
      UP_TO_1_YEAR: 'UP_TO_1_YEAR',
      UP_TO_2_YEARS: 'UP_TO_2_YEARS',
    Severity: Major
    Found in src/applications/discover-your-benefits/constants/benefits.js and 8 other locations - About 40 mins to fix
    src/applications/accredited-representative-portal/accreditation/21a/constants/options.js on lines 14..21
    src/applications/discover-your-benefits/constants/benefits.js on lines 26..33
    src/applications/discover-your-benefits/constants/benefits.js on lines 35..42
    src/applications/discover-your-benefits/constants/benefits.js on lines 44..51
    src/applications/discover-your-benefits/constants/benefits.js on lines 77..84
    src/applications/discover-your-benefits/constants/benefits.js on lines 86..93
    src/applications/simple-forms/21-4138/config/constants.js on lines 49..56
    src/platform/forms/save-in-progress/actions.js on lines 18..25

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

    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

    export const militaryServiceTimeServedLabels = Object.freeze({
      UP_TO_3_MONTHS: '0 to 3 months',
      UP_TO_6_MONTHS: '4 to 6 months',
      UP_TO_1_YEAR: '7 months to 1 year',
      UP_TO_2_YEARS: '1 to 2 years',
    Severity: Major
    Found in src/applications/discover-your-benefits/constants/benefits.js and 8 other locations - About 40 mins to fix
    src/applications/accredited-representative-portal/accreditation/21a/constants/options.js on lines 14..21
    src/applications/discover-your-benefits/constants/benefits.js on lines 26..33
    src/applications/discover-your-benefits/constants/benefits.js on lines 35..42
    src/applications/discover-your-benefits/constants/benefits.js on lines 53..60
    src/applications/discover-your-benefits/constants/benefits.js on lines 77..84
    src/applications/discover-your-benefits/constants/benefits.js on lines 86..93
    src/applications/simple-forms/21-4138/config/constants.js on lines 49..56
    src/platform/forms/save-in-progress/actions.js on lines 18..25

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

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status