department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

Function ViewAppeal has 163 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ViewAppeal = () => {
  useEffect(() => {
    focusElement('h2');
    scrollTo('topScrollElement');
  });
Severity: Major
Found in src/applications/appeals/testing/download/containers/ViewAppeal.jsx - About 6 hrs to fix

    Function getGroupedPreviousEnrollments has 163 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const getGroupedPreviousEnrollments = month => {
      const { transactDate, actBegin, actEnd, id, paymentDate } = month[0];
      const myUUID = uuidv4();
    
      return (
    Severity: Major
    Found in src/applications/verify-your-enrollment/helpers.jsx - About 6 hrs to fix

      Function AddressValidationRadio has 163 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const AddressValidationRadio = props => {
        const { formData, setFormData } = props;
        const [apiData, setApiData] = useState([]);
        const [loading, isLoading] = useState(false);
      
      

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

              <div className="vads-u-margin-bottom--6">
                <va-alert
                  background-only
                  close-btn-aria-label="Close notification"
                  status="info"
        src/applications/toe/components/confirmation/ApprovedConfirmation.jsx on lines 70..95

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

        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

              <div className="vads-u-margin-bottom--6">
                <va-alert
                  background-only
                  close-btn-aria-label="Close notification"
                  status="info"
        src/applications/toe/components/confirmation/DeniedConfirmation.jsx on lines 77..102

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

        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

          confirmedSuggestions: PropTypes.arrayOf(
            PropTypes.shape({
              addressLine1: PropTypes.string.isRequired,
              addressType: PropTypes.string.isRequired,
              city: PropTypes.string.isRequired,
        src/platform/user/profile/vap-svc/containers/AddressValidationView.jsx on lines 365..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 165.

        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

          confirmedSuggestions: PropTypes.arrayOf(
            PropTypes.shape({
              addressLine1: PropTypes.string.isRequired,
              addressType: PropTypes.string.isRequired,
              city: PropTypes.string.isRequired,
        src/platform/user/profile/vap-svc/containers/AddressValidationModal.jsx on lines 360..374

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

        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

        VAFacilityPage.propTypes = {
          address: PropTypes.object,
          canScheduleAtChosenFacility: PropTypes.bool,
          changeCrumb: PropTypes.func,
          clinicsStatus: PropTypes.string,
        src/applications/gi/components/search/KeywordSearch.jsx on lines 221..239
        src/applications/mhv-secure-messaging/components/Draft/DeleteDraft.jsx on lines 181..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 165.

        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

        DeleteDraft.propTypes = {
          cannotReply: PropType.bool,
          draftBody: PropType.string,
          draftId: PropType.number,
          draftSequence: PropType.number,
        src/applications/gi/components/search/KeywordSearch.jsx on lines 221..239
        src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.jsx on lines 340..358

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

        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

        KeywordSearch.propTypes = {
          className: PropTypes.string,
          dispatchError: PropTypes.func,
          errorReducer: PropTypes.object,
          error: PropTypes.string,
        Severity: Major
        Found in src/applications/gi/components/search/KeywordSearch.jsx and 2 other locations - About 6 hrs to fix
        src/applications/mhv-secure-messaging/components/Draft/DeleteDraft.jsx on lines 181..199
        src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/index.jsx on lines 340..358

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

        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

              {
                fileNumber: '796121200',
                payeeNumber: '00',
                personEntitled: 'STUB_M',
                deductionCode: '44',
        Severity: Major
        Found in src/applications/financial-status-report/mocks/responses.js and 1 other location - About 6 hrs to fix
        src/applications/personalization/dashboard/mocks/debts/index.js on lines 195..243

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

        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

        const FormFooter = ({ formConfig, currentLocation }) => {
          const GetHelp = formConfig.getHelp;
          const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
          const isConfirmationPage = trimmedPathname.endsWith('confirmation');
        
        
        Severity: Major
        Found in src/applications/ezr/components/FormFooter/index.jsx and 1 other location - About 6 hrs to fix
        src/applications/_mock-form-ae-design-patterns/shared/components/FormFooter.jsx on lines 5..20

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

        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

        const FormFooter = ({ formConfig, currentLocation }) => {
          const GetHelp = formConfig.getHelp;
          const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
          const isConfirmationPage = trimmedPathname.endsWith('confirmation');
        
        
        src/applications/ezr/components/FormFooter/index.jsx on lines 5..20

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

        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

              {
                fileNumber: '796121211',
                payeeNumber: '00',
                personEntitled: 'STUB_M',
                deductionCode: '30',
        src/applications/financial-status-report/mocks/responses.js on lines 1291..1339

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

        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 NoFormPage.jsx has 437 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React, { useEffect, useState } from 'react';
        import { useSelector } from 'react-redux';
        import { apiRequest } from 'platform/utilities/api';
        import { formatSSN } from 'platform/utilities/ui';
        import { isLoggedIn } from '@department-of-veterans-affairs/platform-user/selectors';
        Severity: Minor
        Found in src/applications/burials-ez/components/NoFormPage.jsx - About 6 hrs to fix

          Function submitAppointmentOrRequest has 162 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function submitAppointmentOrRequest(history) {
            return async (dispatch, getState) => {
              const state = getState();
              const featureVAOSServiceVAAppointments = selectFeatureVAOSServiceVAAppointments(
                state,
          Severity: Major
          Found in src/applications/vaos/new-appointment/redux/actions.js - About 6 hrs to fix

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

            function isValidSSN(value) {
              if (
                value === '123456789' ||
                value === '123-45-6789' ||
                /^0{3}-?\d{2}-?\d{4}$/.test(value) ||
            Severity: Major
            Found in src/platform/forms/validations.js and 1 other location - About 6 hrs to fix
            src/platform/forms-system/src/js/utilities/validations/index.js on lines 16..37

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

            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

            export function isValidSSN(value) {
              if (
                value === '123456789' ||
                value === '123-45-6789' ||
                /^0{3}-?\d{2}-?\d{4}$/.test(value) ||
            src/platform/forms/validations.js on lines 163..184

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

            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

                    page22: {
                      path: 'applicant-other-insurance-10-7959c-file/:index',
                      arrayPath: 'applicants',
                      showPagePerItem: true,
                      title: item => `${applicantWording(item)} 10-7959c upload`,
            Severity: Major
            Found in src/applications/ivc-champva/10-10D/config/form.js and 2 other locations - About 6 hrs to fix
            src/applications/ivc-champva/10-10D/config/form.js on lines 805..834
            src/applications/ivc-champva/10-10D/config/form.js on lines 835..865

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

            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

                    page18e: {
                      path: 'applicant-child-marriage-file/:index',
                      arrayPath: 'applicants',
                      showPagePerItem: true,
                      title: item =>
            Severity: Major
            Found in src/applications/ivc-champva/10-10D/config/form.js and 2 other locations - About 6 hrs to fix
            src/applications/ivc-champva/10-10D/config/form.js on lines 805..834
            src/applications/ivc-champva/10-10D/config/form.js on lines 1193..1220

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

            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