department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

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

export function getCemeteries() {
  return fetch(`${environment.API_URL}/v0/preneeds/cemeteries`, {
    credentials: 'include',
    headers: {
      'X-Key-Inflection': 'camel',
Severity: Major
Found in src/applications/pre-need-integration/utils/helpers.js and 1 other location - About 1 day to fix
src/applications/pre-need/utils/helpers.js on lines 752..783

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

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

File form.js has 555 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// we're not using JSON schema for this form
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import footerContent from 'platform/forms/components/FormFooter';
import getHelp from '../../shared/components/GetFormHelp';

Severity: Major
Found in src/applications/simple-forms/20-10207/config/form.js - About 1 day to fix

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

      cancelUpdate = event => {
        // Don't act like the continue button
        if (event) {
          // Apparently the unit tests don't send this event to the onClick handler
          event.preventDefault();
    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 466..491

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

    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

      cancelUpdate = event => {
        // Don't act like the continue button
        if (event) {
          // Apparently the unit tests don't send this event to the onClick handler
          event.preventDefault();
    src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 474..499

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

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

    FileField.propTypes = {
      schema: PropTypes.object.isRequired,
      onChange: PropTypes.func.isRequired,
      disabled: PropTypes.bool,
      enableShortWorkflow: PropTypes.bool,
    Severity: Major
    Found in src/applications/pre-need/components/FileField.jsx and 2 other locations - About 1 day to fix
    src/applications/simple-forms/40-0247/components/FileField.jsx on lines 703..727
    src/platform/forms-system/src/js/fields/FileField.jsx on lines 723..747

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

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

    FileField.propTypes = {
      schema: PropTypes.object.isRequired,
      onChange: PropTypes.func.isRequired,
      disabled: PropTypes.bool,
      enableShortWorkflow: PropTypes.bool,
    Severity: Major
    Found in src/platform/forms-system/src/js/fields/FileField.jsx and 2 other locations - About 1 day to fix
    src/applications/pre-need/components/FileField.jsx on lines 703..727
    src/applications/simple-forms/40-0247/components/FileField.jsx on lines 703..727

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

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

    FileField.propTypes = {
      schema: PropTypes.object.isRequired,
      onChange: PropTypes.func.isRequired,
      disabled: PropTypes.bool,
      enableShortWorkflow: PropTypes.bool,
    src/applications/pre-need/components/FileField.jsx on lines 703..727
    src/platform/forms-system/src/js/fields/FileField.jsx on lines 723..747

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

    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

      studentEarningsFromSchoolYear: {
        'ui:title': 'Student’s income for the year attending school',
        'ui:description': (
          <p>
            Enter the amounts before any deductions, like taxes and insurance.{' '}
    src/applications/disability-benefits/686c-674/config/chapters/674/student-income-information/studentIncomeInformation.js on lines 66..110

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

    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

      studentExpectedEarningsNextYear: {
        'ui:title': 'Student’s expected income for next year',
        'ui:description': (
          <p>
            Enter the amounts before any deductions, like taxes and insurance.{' '}
    src/applications/disability-benefits/686c-674/config/chapters/674/student-income-information/studentIncomeInformation.js on lines 15..59

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

    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

    File ReviewCardField.jsx has 552 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      getDefaultFormState,
      getDefaultRegistry,
    } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
    import * as Sentry from '@sentry/browser';

      File FileField.jsx has 552 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import PropTypes from 'prop-types';
      import React, { useEffect, useState, useRef } from 'react';
      import classNames from 'classnames';
      import { VaModal } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
      
      
      Severity: Major
      Found in src/applications/appeals/shared/components/FileField.jsx - About 1 day to fix

        Function arrayBuilderPages has 231 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function arrayBuilderPages(options, pageBuilderCallback) {
          let introPath;
          let summaryPath;
          let hasItemsKey;
          const itemPages = [];

          File address-schema.js has 551 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /**
           * The intent for this module is to provide a flexible, reusable address schema and widget that can be used in any form throughout VA.gov.
           * The address uiSchema should be flexible enough to handle these cases:
           * 1. Top level address property (schema.properties.address)
           * 2. Nested address property (schema.properties.someProperty.properties.address)
          Severity: Major
          Found in src/applications/disability-benefits/2346/schemas/address-schema.js - About 1 day to fix

            Function ResponseInboxPage has 230 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const ResponseInboxPage = () => {
              const [error, hasError] = useState(false);
              const [sendReply, setSendReply] = useState({ reply: '', attachments: [] });
              const [loading, isLoading] = useState(true);
              const [inquiryData, setInquiryData] = useState([]);
            Severity: Major
            Found in src/applications/ask-va/containers/ResponseInboxPage.jsx - About 1 day to fix

              File CompareLayout.jsx has 550 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from 'react';
              import { connect } from 'react-redux';
              import classNames from 'classnames';
              import _ from 'lodash';
              import environment from 'platform/utilities/environment';
              Severity: Major
              Found in src/applications/gi/containers/CompareLayout.jsx - About 1 day to fix

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

                describe('Prescriptions Page <AuthContent>', () => {
                  it('renders what we expect', () => {
                    const wrapper = shallow(<AuthContent />);
                
                    const text = wrapper.text();
                src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/UnauthContent/index.unit.spec.js on lines 8..32
                src/applications/static-pages/health-care-manage-benefits/schedule-view-va-appointments-page/components/UnauthContent/index.unit.spec.js on lines 8..36
                src/applications/static-pages/health-care-manage-benefits/secure-messaging-page/components/AuthContent/index.unit.spec.js on lines 8..32

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

                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

                describe('Prescriptions Page <UnauthContent>', () => {
                  it('renders what we expect', () => {
                    const wrapper = shallow(<UnauthContent />);
                
                    const text = wrapper.text();
                src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/AuthContent/index.unit.spec.js on lines 8..32
                src/applications/static-pages/health-care-manage-benefits/schedule-view-va-appointments-page/components/UnauthContent/index.unit.spec.js on lines 8..36
                src/applications/static-pages/health-care-manage-benefits/secure-messaging-page/components/AuthContent/index.unit.spec.js on lines 8..32

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

                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

                describe('Secure Messaging Page <AuthContent>', () => {
                  it('renders what we expect', () => {
                    const wrapper = shallow(<AuthContent />);
                
                    const text = wrapper.text();
                src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/AuthContent/index.unit.spec.js on lines 8..32
                src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/UnauthContent/index.unit.spec.js on lines 8..32
                src/applications/static-pages/health-care-manage-benefits/schedule-view-va-appointments-page/components/UnauthContent/index.unit.spec.js on lines 8..36

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

                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

                describe('Scheduling Page <UnauthContent>', () => {
                  it('renders what we expect', () => {
                    const wrapper = shallow(<UnauthContent />);
                
                    const text = wrapper.text();
                src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/AuthContent/index.unit.spec.js on lines 8..32
                src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/UnauthContent/index.unit.spec.js on lines 8..32
                src/applications/static-pages/health-care-manage-benefits/secure-messaging-page/components/AuthContent/index.unit.spec.js on lines 8..32

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

                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

                const royaltyRecipientPage = {
                  uiSchema: {
                    ...arrayBuilderItemFirstPageTitleUI({
                      title:
                        'Income and net worth associated with royalties and other properties',
                src/applications/income-and-asset-statement/config/chapters/03-unassociated-incomes/unassociatedIncomePages.js on lines 114..160
                src/applications/income-and-asset-statement/config/chapters/04-associated-incomes/associatedIncomePages.js on lines 115..161
                src/applications/income-and-asset-statement/config/chapters/05-owned-assets/ownedAssetPages.js on lines 118..164

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

                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