department-of-veterans-affairs/vets-website

View on GitHub
src/applications/simple-forms/21-4138/config/constants.js

Summary

Maintainability
D
3 days
Test Coverage

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

import React from 'react';
import { useSelector } from 'react-redux';
import { VA_FORM_IDS } from 'platform/forms/constants';

export const PrimaryActionLink = ({ href = '/', children, onClick = null }) => (
Severity: Major
Found in src/applications/simple-forms/21-4138/config/constants.js - About 1 day to fix

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

    export const ADDITIONAL_INFO_OTHER_HOUSING_RISKS = Object.freeze(
      <va-additional-info
        trigger="What to know before sharing details about other housing risks"
        data-testid="otherHousingRisksAdditionalInfo"
      >
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/constants.js and 1 other location - About 4 hrs to fix
    src/applications/simple-forms/20-10207/config/constants.js on lines 190..211

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

    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

    export const PrimaryActionLink = ({ href = '/', children, onClick = null }) => (
      <div className="action-bar-arrow">
        <div className="vads-u-background-color--primary vads-u-padding--1">
          <a className="vads-c-action-link--white" href={href} onClick={onClick}>
            {children}
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/constants.js and 1 other location - About 3 hrs to fix
    src/applications/simple-forms/form-upload/config/constants.js on lines 5..13

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

    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 OTHER_REASONS = Object.freeze({
      FINANCIAL_HARDSHIP:
        'I’m experiencing extreme financial hardship (such as loss of your job or sudden decrease in income).',
      ALS:
        'I have ALS (amyotrophic lateral sclerosis), also known as Lou Gehrig’s disease.',
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/constants.js and 3 other locations - About 1 hr to fix
    src/applications/letters/utils/constants.js on lines 26..35
    src/platform/forms/save-in-progress/actions.js on lines 43..52
    src/applications/disability-benefits/all-claims/constants.js on lines 395..405

    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 LIVING_SITUATIONS = Object.freeze({
      OVERNIGHT:
        'I live or sleep overnight in a place that isn’t meant for regular sleeping. This includes a car, park, abandoned building, bus station, train station, airport, or camping ground.',
      SHELTER:
        'I live in a shelter (including a hotel or motel) that’s meant for temporary stays.',
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/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/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 8 locations. Consider refactoring.
    Open

            <p>
              <strong>Compensation claims</strong>
              <br />
              Department of Veterans Affairs Compensation Intake Center
              <br />
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/constants.js and 7 other locations - About 40 mins to fix
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 33..41
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 42..50
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 51..59
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 60..68
    src/applications/simple-forms/21-4138/config/constants.js on lines 448..456
    src/applications/simple-forms/21-4138/config/constants.js on lines 457..465
    src/applications/simple-forms/21-4138/config/constants.js on lines 466..474

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

            <p>
              <strong>Fiduciary</strong>
              <br />
              Department of Veterans Affairs Fiduciary Intake Center
              <br />
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/constants.js and 7 other locations - About 40 mins to fix
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 33..41
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 42..50
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 51..59
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 60..68
    src/applications/simple-forms/21-4138/config/constants.js on lines 439..447
    src/applications/simple-forms/21-4138/config/constants.js on lines 448..456
    src/applications/simple-forms/21-4138/config/constants.js on lines 457..465

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

            <p>
              <strong>Pension and survivors benefit claims</strong>
              <br />
              Department of Veterans Affairs Pension Intake Center
              <br />
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/constants.js and 7 other locations - About 40 mins to fix
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 33..41
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 42..50
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 51..59
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 60..68
    src/applications/simple-forms/21-4138/config/constants.js on lines 439..447
    src/applications/simple-forms/21-4138/config/constants.js on lines 457..465
    src/applications/simple-forms/21-4138/config/constants.js on lines 466..474

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

            <p>
              <strong>Board of Veterans' Appeals</strong>
              <br />
              Department of Veterans Affairs Board of Veterans' Appeals
              <br />
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/constants.js and 7 other locations - About 40 mins to fix
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 33..41
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 42..50
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 51..59
    src/applications/simple-forms/20-10207/containers/ConfirmationPage.jsx on lines 60..68
    src/applications/simple-forms/21-4138/config/constants.js on lines 439..447
    src/applications/simple-forms/21-4138/config/constants.js on lines 448..456
    src/applications/simple-forms/21-4138/config/constants.js on lines 466..474

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

    export const STATEMENT_TYPES = Object.freeze({
      BUDDY_STATEMENT: 'buddy-statement',
      DECISION_REVIEW: 'decision-review',
      PRIORITY_PROCESSING: 'priority-processing',
      PERSONAL_RECORDS: 'personal-records',
    Severity: Major
    Found in src/applications/simple-forms/21-4138/config/constants.js and 2 other locations - About 40 mins to fix
    src/applications/accredited-representative-portal/accreditation/21a/constants/options.js on lines 14..21
    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