department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

Function transform has 92 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function transform(formConfig, form) {
  const usFormTransform = () =>
    JSON.parse(transformForSubmit(formConfig, form));

  const prefillTransforms = formData => {
Severity: Major
Found in src/applications/edu-benefits/0994/submit-transformer.js - About 3 hrs to fix

    Function Avs has 92 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const Avs = props => {
      useDatadogRum();
    
      const user = useSelector(selectUser);
      const { avsEnabled, featureTogglesLoading } = useSelector(
    Severity: Major
    Found in src/applications/avs/containers/Avs.jsx - About 3 hrs to fix

      Function Landing has 92 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Landing = props => {
        const { location, router } = props;
        const { jumpToPage } = useFormRouting(router);
        const { t } = useTranslation();
      
      
      Severity: Major
      Found in src/applications/check-in/day-of/pages/Landing.jsx - About 3 hrs to fix

        Function TravelClaimDetails has 92 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function TravelClaimDetails() {
          const { id } = useParams();
          const location = useLocation();
          const { claimDetailsProps = null } = location.state ?? {};
          const [claimDetails, setClaimDetails] = useState(claimDetailsProps);
        Severity: Major
        Found in src/applications/travel-pay/components/TravelClaimDetails.jsx - About 3 hrs to fix

          Function render has 92 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              const {
                loadingDecisionRequest,
                decisionRequestError,
                params,
          Severity: Major
          Found in src/applications/claims-status/containers/AskVAPage.jsx - About 3 hrs to fix

            File SchoolLocations.jsx has 320 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, { useEffect, useState } from 'react';
            import { BrowserRouter as Router, Link } from 'react-router-dom';
            import recordEvent from 'platform/monitoring/record-event';
            import { waitForRenderThenFocus } from 'platform/utilities/ui';
            import { getCalculatedBenefits } from '../../selectors/calculator';
            Severity: Minor
            Found in src/applications/gi/components/profile/SchoolLocations.jsx - About 3 hrs to fix

              Function sharingCardContent has 92 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const sharingCardContent = () => {
                  if (statusError) {
                    if (['optin', 'optout'].includes(statusError.type)) {
                      const optInError = statusError.type === 'optin';
                      return (
              Severity: Major
              Found in src/applications/mhv-medical-records/containers/SettingsPage.jsx - About 3 hrs to fix

                Function buildPrescriptionsPDFList has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const buildPrescriptionsPDFList = prescriptions => {
                  return prescriptions?.map(rx => {
                    if (rx?.prescriptionSource === 'NV') {
                      return {
                        ...buildNonVAPrescriptionPDFList(rx)[0],
                Severity: Major
                Found in src/applications/mhv-medications/util/pdfConfigs.js - About 3 hrs to fix

                  Consider simplifying this complex logical expression.
                  Open

                      if (prescription) {
                        const dispStatus = 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">

                    File labels.jsx has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React from 'react';
                    
                    import { states } from 'platform/forms/address';
                    import { createUSAStateLabels } from 'platform/forms-system/src/js/helpers';
                    
                    
                    Severity: Minor
                    Found in src/applications/edu-benefits/utils/labels.jsx - About 3 hrs to fix

                      File claimInformation.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from 'react';
                      import {
                        titleUI,
                        titleSchema,
                        radioUI,
                      Severity: Minor
                      Found in src/applications/ivc-champva/10-7959a/chapters/claimInformation.js - About 3 hrs to fix

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

                        import React from 'react';
                        import PropTypes from 'prop-types';
                        import manifest from '../manifest.json';
                        import Alert from '../components/Alert';
                        
                        
                        Severity: Minor
                        Found in src/applications/verify-your-enrollment/constants/index.js - About 3 hrs to fix

                          File event-generator.js has 319 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import moment from 'moment-timezone';
                          import { fleshOutRecurringEvents, removeDuplicateEvents } from '.';
                          
                          moment.tz.setDefault('America/New_York');
                          const now = moment().clone();
                          Severity: Minor
                          Found in src/applications/static-pages/events/helpers/event-generator.js - About 3 hrs to fix

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

                            // Node modules.
                            import React from 'react';
                            import PropTypes from 'prop-types';
                            // Relative imports.
                            import { getCernerURL } from 'platform/utilities/cerner';

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

                                const generatePathologyPdf = async () => {
                                  setDownloadStarted(true);
                                  const { title, subject, preface } = generateLabsIntro(record);
                                  const scaffold = generatePdfScaffold(user, title, subject, preface);
                                  const pdfData = { ...scaffold, ...generatePathologyContent(record) };
                              src/applications/mhv-medical-records/components/CareSummaries/AdmissionAndDischargeDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/CareSummaries/ProgressNoteDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/LabsAndTests/ChemHemDetails.jsx on lines 65..72
                              src/applications/mhv-medical-records/components/LabsAndTests/EkgDetails.jsx on lines 58..65
                              src/applications/mhv-medical-records/components/LabsAndTests/MicroDetails.jsx on lines 63..70

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

                                const generateEkgDetailsPdf = async () => {
                                  setDownloadStarted(true);
                                  const { title, subject, preface } = generateLabsIntro(record);
                                  const scaffold = generatePdfScaffold(user, title, subject, preface);
                                  const pdfData = { ...scaffold, ...generateEkgContent(record) };
                              src/applications/mhv-medical-records/components/CareSummaries/AdmissionAndDischargeDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/CareSummaries/ProgressNoteDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/LabsAndTests/ChemHemDetails.jsx on lines 65..72
                              src/applications/mhv-medical-records/components/LabsAndTests/MicroDetails.jsx on lines 63..70
                              src/applications/mhv-medical-records/components/LabsAndTests/PathologyDetails.jsx on lines 61..68

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

                                const generateCareNotesPDF = async () => {
                                  setDownloadStarted(true);
                                  const { title, subject, preface } = generateNotesIntro(record);
                                  const scaffold = generatePdfScaffold(user, title, subject, preface);
                                  const pdfData = { ...scaffold, ...generateProgressNoteContent(record) };
                              src/applications/mhv-medical-records/components/CareSummaries/AdmissionAndDischargeDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/LabsAndTests/ChemHemDetails.jsx on lines 65..72
                              src/applications/mhv-medical-records/components/LabsAndTests/EkgDetails.jsx on lines 58..65
                              src/applications/mhv-medical-records/components/LabsAndTests/MicroDetails.jsx on lines 63..70
                              src/applications/mhv-medical-records/components/LabsAndTests/PathologyDetails.jsx on lines 61..68

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

                                const generateCareNotesPDF = async () => {
                                  setDownloadStarted(true);
                                  const { title, subject, preface } = generateNotesIntro(record);
                                  const scaffold = generatePdfScaffold(user, title, subject, preface);
                                  const pdfData = { ...scaffold, ...generateDischargeSummaryContent(record) };
                              src/applications/mhv-medical-records/components/CareSummaries/ProgressNoteDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/LabsAndTests/ChemHemDetails.jsx on lines 65..72
                              src/applications/mhv-medical-records/components/LabsAndTests/EkgDetails.jsx on lines 58..65
                              src/applications/mhv-medical-records/components/LabsAndTests/MicroDetails.jsx on lines 63..70
                              src/applications/mhv-medical-records/components/LabsAndTests/PathologyDetails.jsx on lines 61..68

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

                                const generateMicrobiologyPdf = async () => {
                                  setDownloadStarted(true);
                                  const { title, subject, preface } = generateLabsIntro(record);
                                  const scaffold = generatePdfScaffold(user, title, subject, preface);
                                  const pdfData = { ...scaffold, ...generateMicrobioContent(record) };
                              src/applications/mhv-medical-records/components/CareSummaries/AdmissionAndDischargeDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/CareSummaries/ProgressNoteDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/LabsAndTests/ChemHemDetails.jsx on lines 65..72
                              src/applications/mhv-medical-records/components/LabsAndTests/EkgDetails.jsx on lines 58..65
                              src/applications/mhv-medical-records/components/LabsAndTests/PathologyDetails.jsx on lines 61..68

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

                                const generateChemHemPdf = async () => {
                                  setDownloadStarted(true);
                                  const { title, subject, preface } = generateLabsIntro(record);
                                  const scaffold = generatePdfScaffold(user, title, subject, preface);
                                  const pdfData = { ...scaffold, ...generateChemHemContent(record) };
                              src/applications/mhv-medical-records/components/CareSummaries/AdmissionAndDischargeDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/CareSummaries/ProgressNoteDetails.jsx on lines 60..67
                              src/applications/mhv-medical-records/components/LabsAndTests/EkgDetails.jsx on lines 58..65
                              src/applications/mhv-medical-records/components/LabsAndTests/MicroDetails.jsx on lines 63..70
                              src/applications/mhv-medical-records/components/LabsAndTests/PathologyDetails.jsx on lines 61..68

                              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

                              Severity
                              Category
                              Status
                              Source
                              Language