department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

Function TravelIntro has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const TravelIntro = props => {
  const { router } = props;
  const { t } = useTranslation();

  const { goToNextPage } = useFormRouting(router);
Severity: Major
Found in src/applications/check-in/travel-claim/pages/travel-intro/index.jsx - About 3 hrs to fix

    Function parseLabsAndTests has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const parseLabsAndTests = records => {
      return `
    ${txtLine}
    1) Lab and test results
    
    
    Severity: Major
    Found in src/applications/mhv-medical-records/util/txtHelpers/labsAndTests.js - About 3 hrs to fix

      Function content has 93 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const content = () => {
          const status = prescription?.dispStatus?.toString();
          return (
            <div className="medication-details-div vads-u-border-top--1px vads-u-border-color--gray-lighter vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--3">
              <h2 className="vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--2 no-print">

        File index.js has 321 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        const all = {
          resourceType: 'Bundle',
          id: '12121',
          meta: {
            lastUpdated: '2023-09-29T11:04:31.316-04:00',
        Severity: Minor
        Found in src/platform/mhv/api/mocks/medical-records/allergies/index.js - About 3 hrs to fix

          File LocationSearchForm.jsx has 321 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* eslint-disable react-hooks/exhaustive-deps */
          /* eslint-disable react/jsx-no-bind */
          /* eslint-disable react/jsx-wrap-multilines */
          /* eslint-disable react/prop-types */
          import React, { useEffect, useState, createRef } from 'react';
          Severity: Minor
          Found in src/applications/gi/containers/search/LocationSearchForm.jsx - About 3 hrs to fix

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

              addressValidationSuccessSingleConfirmedSuggestion() {
                return asyncReturn(
                  {
                    addresses: [
                      {
            Severity: Major
            Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 3 other locations - About 3 hrs to fix
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 375..403
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 404..433
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 434..463

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

            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

              addressValidationSuccessSingleMissingUnitNumber() {
                return asyncReturn(
                  {
                    addresses: [
                      {
            Severity: Major
            Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 3 other locations - About 3 hrs to fix
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 234..262
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 375..403
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 434..463

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

            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="usa-radio vads-u-margin-top--2p5">
                        <span className="vads-u-font-weight--bold">
                          Suggested Addresses:
                        </span>
                        <input
            src/applications/personalization/profile/components/direct-deposit/vye/components/SuggestedAddress.jsx on lines 150..169

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

            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

              addressValidationSuccessSingleLowConfidenceSuggestion() {
                return asyncReturn(
                  {
                    addresses: [
                      {
            Severity: Major
            Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 3 other locations - About 3 hrs to fix
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 234..262
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 404..433
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 434..463

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

            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="usa-radio vads-u-margin-top--2p5">
                        <span className="vads-u-font-weight--bold">
                          Suggested Addresses:
                        </span>
                        <input
            src/applications/verify-your-enrollment/components/SuggestedAddress.jsx on lines 146..165

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

            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

              addressValidationSuccessSingleBadUnitNumber() {
                return asyncReturn(
                  {
                    addresses: [
                      {
            Severity: Major
            Found in src/platform/user/profile/vap-svc/util/local-vapsvc.js and 3 other locations - About 3 hrs to fix
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 234..262
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 375..403
            src/platform/user/profile/vap-svc/util/local-vapsvc.js on lines 404..433

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

            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

            VARadioButton.propTypes = {
              initialValue: PropTypes.string.isRequired,
              radioLabel: PropTypes.string.isRequired,
              onVaValueChange: PropTypes.func.isRequired,
              ariaDescribedby: PropTypes.string,
            Severity: Major
            Found in src/applications/gi/components/VARadioButton.jsx and 2 other locations - About 3 hrs to fix
            src/applications/edu-benefits/utils/VaRadioButton.jsx on lines 49..61
            src/applications/gi/components/VACheckboxButton.jsx on lines 49..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 109.

            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

            VARadioButton.propTypes = {
              initialValue: PropTypes.string.isRequired,
              radioLabel: PropTypes.string.isRequired,
              onVaValueChange: PropTypes.func.isRequired,
              ariaDescribedby: PropTypes.string,
            Severity: Major
            Found in src/applications/edu-benefits/utils/VaRadioButton.jsx and 2 other locations - About 3 hrs to fix
            src/applications/gi/components/VACheckboxButton.jsx on lines 49..61
            src/applications/gi/components/VARadioButton.jsx on lines 55..67

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

            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

            VACheckboxButton.propTypes = {
              initialValue: PropTypes.string.isRequired,
              radioLabel: PropTypes.string.isRequired,
              onVaValueChange: PropTypes.func.isRequired,
              ariaDescribedby: PropTypes.string,
            Severity: Major
            Found in src/applications/gi/components/VACheckboxButton.jsx and 2 other locations - About 3 hrs to fix
            src/applications/edu-benefits/utils/VaRadioButton.jsx on lines 49..61
            src/applications/gi/components/VARadioButton.jsx on lines 55..67

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

            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

                claimantPersonalInfoChapter: {
                  // for Flows 3 & 4: non-vet claimant
                  title: ({ formData } = {}) =>
                    formData.claimOwnership === CLAIM_OWNERSHIPS.SELF
                      ? 'Your personal information'
            Severity: Major
            Found in src/applications/simple-forms/21-10210/config/form.js and 2 other locations - About 3 hrs to fix
            src/applications/simple-forms/21-10210/config/form.js on lines 254..272
            src/applications/simple-forms/21-10210/config/form.js on lines 292..310

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

            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

                claimantContactInfoChapter: {
                  // for Flows 3 & 4: non-vet claimant
                  title: ({ formData } = {}) =>
                    formData.claimOwnership === CLAIM_OWNERSHIPS.SELF
                      ? 'Your contact information'
            Severity: Major
            Found in src/applications/simple-forms/21-10210/config/form.js and 2 other locations - About 3 hrs to fix
            src/applications/simple-forms/21-10210/config/form.js on lines 235..253
            src/applications/simple-forms/21-10210/config/form.js on lines 254..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 109.

            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

                claimantIdInfoChapter: {
                  // for Flows 3 & 4: non-vet claimant
                  title: ({ formData } = {}) =>
                    formData.claimOwnership === CLAIM_OWNERSHIPS.SELF
                      ? 'Your identification information'
            Severity: Major
            Found in src/applications/simple-forms/21-10210/config/form.js and 2 other locations - About 3 hrs to fix
            src/applications/simple-forms/21-10210/config/form.js on lines 235..253
            src/applications/simple-forms/21-10210/config/form.js on lines 292..310

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

            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

              if (allowedIssues.length) {
                allowedBlock = (
                  <div>
                    <h5 className="allowed-items">Granted</h5>
                    <p>
            src/applications/claims-status/components/appeals-v2/Decision.jsx on lines 42..55

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

            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 generateVaccinesPdf = async () => {
                setDownloadStarted(true);
                const { title, subject, preface } = generateVaccinesIntro(
                  vaccines,
                  lastUpdatedText,
            Severity: Major
            Found in src/applications/mhv-medical-records/containers/Vaccines.jsx and 1 other location - About 3 hrs to fix
            src/applications/mhv-medical-records/containers/VitalDetails.jsx on lines 202..213

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

            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

            (function (root, factory) {
                "use strict";
            
                /*global define*/
                if (typeof module === 'object' && module.exports) {
            Severity: Major
            Found in src/applications/vaos/lib/moment-tz.js and 1 other location - About 3 hrs to fix
            src/applications/personalization/dashboard/lib/moment-tz.js on lines 9..1278

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

            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