department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function Authentication has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function Authentication() {
  return (
    <section data-testid="unauthenticated-verify-app" className="verify">
      <div className="container">
        <div className="row">
Severity: Minor
Found in src/applications/verify/components/UnauthenticatedVerify.jsx - About 1 hr to fix

    Function generateSEIPdf has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        async () => {
          try {
            setSelfEnteredPdfRequested(true);
            setSeiPdfGenerationError(false);
    
    

      Function parseAccountSummary has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const parseAccountSummary = (records, index = 11) => {
        // Generate the structured content
        const accountSummaryContent = generateAccountSummaryContent(records || {});
      
        // Initialize an array to hold the formatted text

        Function generateTestEntriesContent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const generateTestEntriesContent = record => {
          return {
            title: record.testName,
            details: [
              {

          Function convertChemHemObservation has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const convertChemHemObservation = record => {
            const results = isArrayAndHasItems(record.result)
              ? record.result.map(item =>
                  extractContainedResource(record, item.reference),
                )
          Severity: Minor
          Found in src/applications/mhv-medical-records/reducers/labsAndTests.js - About 1 hr to fix

            Function isDataFetched has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                () => {
                  // Map the recordFilter keys to the corresponding data domains
                  const dataMap = {
                    labTests: labsAndTests,
                    careSummaries: notes,

              Function generateVaccinesContent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const generateVaccinesContent = record => {
                return {
                  title: record.vaccine,
                  details: [
                    {

                Function generateHealthProvidersContent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const generateHealthProvidersContent = record => {
                  return {
                    title: record.providerName,
                    details: [
                      {

                  Function parseMedications has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const parseMedications = (records, index = 7) => {
                    return `
                  ${index}) Medications
                  
                  This is a list of prescriptions and other medications in your VA medical records.
                  Severity: Minor
                  Found in src/applications/mhv-medical-records/util/txtHelpers/medications.js - About 1 hr to fix

                    Function generateAllergiesContent has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const generateAllergiesContent = record => {
                      return {
                        title: record.allergyName,
                        details: [
                          {

                      Function DownloadingRecordsInfo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const DownloadingRecordsInfo = props => {
                        const { allowTxtDownloads, description } = props;
                      
                        const publicSharedContent = () => {
                          return (

                        Function imagesReducer has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const imagesReducer = (state = initialState, action) => {
                          switch (action.type) {
                            case Actions.Images.REQUEST_IMAGE_STUDY: {
                              return {
                                ...state,
                        Severity: Minor
                        Found in src/applications/mhv-medical-records/reducers/images.js - About 1 hr to fix

                          Function fetchRepStatus has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const fetchRepStatus = async () => {
                            const requestUrl = `${
                              environment.BASE_URL === 'http://localhost:3001'
                                ? `https://staging-api.va.gov`
                                : `${environment.API_URL}`
                          Severity: Minor
                          Found in src/applications/representative-appoint/api/fetchRepStatus.js - About 1 hr to fix

                            Function sendNextStepsEmail has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default async function sendNextStepsEmail(body) {
                              const apiSettings = {
                                mode: 'cors',
                                method: 'POST',
                                credentials: 'include',
                            Severity: Minor
                            Found in src/applications/representative-appoint/api/sendNextStepsEmail.js - About 1 hr to fix

                              Function buildPrescriptionsTXT has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const buildPrescriptionsTXT = prescriptions => {
                                let result = `
                              ---------------------------------------------------------------------------------
                              
                                `;
                              Severity: Minor
                              Found in src/applications/mhv-medications/util/txtConfigs.js - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                  if (keys.address && requiredKeys.includes(keys.address)) {
                                    const addressObject = data[keys.address] || {};
                                    const isUS = addressObject.addressType !== ADDRESS_TYPES.international;
                                    const hasRequiredAddressFields =
                                      addressObject.countryName &&
                                Severity: Critical
                                Found in src/platform/forms-system/src/js/utilities/data/profile.js - About 1 hr to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                        if (
                                          (!fetchedPersonalInfo &&
                                            meb160630Automation &&
                                            formData?.chosenBenefit) ||
                                          (!fetchedContactInfo &&
                                  Severity: Critical
                                  Found in src/applications/my-education-benefits/containers/App.jsx - About 1 hr to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                            if (facilityType) {
                                              return selectorFiltered.filter(
                                                hsdatum =>
                                                  (hsdatum.hsdatum[5] && facilityType === 'vet_center') ||
                                                  (hsdatum.hsdatum[6] && facilityType === 'vba') ||
                                    Severity: Critical
                                    Found in src/applications/facility-locator/hooks/useServiceType.jsx - About 1 hr to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                        if (keys.address && requiredKeys.includes(keys.address)) {
                                          const addressObject = data[keys.address] || {};
                                          const isUS = addressObject.addressType !== ADDRESS_TYPES.international;
                                          const hasRequiredAddressFields =
                                            addressObject.countryName &&

                                        Consider simplifying this complex logical expression.
                                        Open

                                          if (keys.address && requiredKeys.includes(keys.address)) {
                                            const addressObject = data[keys.address] || {};
                                            const isUS = addressObject.addressType !== ADDRESS_TYPES.international;
                                            const hasRequiredAddressFields =
                                              addressObject.countryName &&
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language