department-of-veterans-affairs/vets-website

View on GitHub
src/applications/disability-benefits/all-claims/constants.js

Summary

Maintainability
D
1 day
Test Coverage

File constants.js has 324 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import constants from 'vets-json-schema/dist/constants.json';
import fullSchema from 'vets-json-schema/dist/21-526EZ-ALLCLAIMS-schema.json';

const { pciuStates: PCIU_STATES } = constants;

Severity: Minor
Found in src/applications/disability-benefits/all-claims/constants.js - About 3 hrs to fix

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

    export const ANALYTICS_EVENTS = {
      openedPrivateRecordsAcknowledgment: {
        event: 'disability-526EZ-form-help-text-clicked',
        [HELP_TEXT_CLICKED_EVENT]:
          'Disability - Form 4142 - Private Medical Records: Read the full text',
    Severity: Major
    Found in src/applications/disability-benefits/all-claims/constants.js and 1 other location - About 5 hrs to fix
    src/applications/financial-status-report/constants/reviewErrors.js on lines 42..79

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 151.

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

    export const HERBICIDE_LOCATIONS = Object.freeze({
      cambodia: 'Cambodia at Mimot or Krek, Kampong Cham Province',
      guam: 'Guam, American Samoa, or their territorial waters',
      koreandemilitarizedzone: 'In or near the Korean demilitarized zone',
      johnston: 'Johnston Atoll or on a ship that called at Johnston Atoll',
    src/applications/personalization/profile/constants.js on lines 41..52
    src/applications/personalization/profile/constants.js on lines 54..65

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

    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 const ADDITIONAL_EXPOSURES = Object.freeze({
      asbestos: 'Asbestos',
      chemical:
        'Chemical and biological warfare testing through Project 112 or Project Shipboard Hazard and Defense (SHAD)',
      water: 'Contaminated water at Camp Lejeune or MCAS New River, North Carolina',
    src/applications/letters/utils/constants.js on lines 26..35
    src/applications/simple-forms/21-4138/config/constants.js on lines 107..119
    src/platform/forms/save-in-progress/actions.js on lines 43..52

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

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

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

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

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

    Refactorings

    Further Reading

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

    export const GULF_WAR_2001_LOCATIONS = Object.freeze({
      djibouti: 'Djibouti',
      lebanon: 'Lebanon',
      uzbekistan: 'Uzbekistan',
      yemen: 'Yemen',
    Severity: Major
    Found in src/applications/disability-benefits/all-claims/constants.js and 7 other locations - About 55 mins to fix
    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

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 54.

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

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

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

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

    Refactorings

    Further Reading

    There are no issues that match your filters.

    Category
    Status