department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function mapRating has 64 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const mapRating = institution => {
    const { type } = institution; // used to identify if the training is OJT
    let ratingAverage = false;
    let ratingCount = -1;
    let institutionRatingIsNotNull = false;
Severity: Major
Found in src/applications/gi/containers/CompareLayout.jsx - About 2 hrs to fix

    Function StemAskVAQuestions has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function StemAskVAQuestions() {
      const handler = {
        recordLinkClick: () => {
          recordEvent({
            event: 'nav-ask-va-questions-link-click',
    Severity: Major
    Found in src/applications/claims-status/components/StemAskVAQuestions.jsx - About 2 hrs to fix

      Function specializedMissionAttributes has 64 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const specializedMissionAttributes = () => {
          const options = [
            {
              name: 'specialMissionHbcu',
              checked: specialMissionHbcu,
      Severity: Major
      Found in src/applications/gi/containers/FilterYourResults.jsx - About 2 hrs to fix

        Function mapStateToProps has 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const mapStateToProps = state => {
          const togglesLoaded = togglesAreLoaded(state);
          const profileToggles = selectProfileToggles(state);
          const signInServicesEligibleForDD = new Set([
            CSP_IDS.ID_ME,
        Severity: Major
        Found in src/applications/personalization/profile/components/Profile.jsx - About 2 hrs to fix

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

            const content = () => {
              if (activeAlert && activeAlert.type === ALERT_TYPE_ERROR) {
                return (
                  <>
                    <h1 className="vads-u-margin-bottom--0p5">Vaccine:</h1>
          Severity: Major
          Found in src/applications/mhv-medical-records/containers/VaccineDetails.jsx - About 2 hrs to fix

            Function generateMedicationsContent has 64 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const generateMedicationsContent = record => {
              return {
                title: record.drugName,
                details: [
                  {

              Function vaccineReducer has 64 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const vaccineReducer = (state = initialState, action) => {
                switch (action.type) {
                  case Actions.Vaccines.GET: {
                    const vaccine = action.response;
                    return {
              Severity: Major
              Found in src/applications/mhv-medical-records/reducers/vaccines.js - About 2 hrs to fix

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

                import React from 'react';
                
                import ADDRESS_DATA from 'platform/forms/address/data';
                import cloneDeep from 'platform/utilities/data/cloneDeep';
                import { validateAsciiCharacters } from 'platform/user/profile/vap-svc/util';

                  File TermsOfUse.jsx has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React, { useState, useEffect } from 'react';
                  import { useSelector } from 'react-redux';
                  import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/exports';
                  import { VaModal } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
                  import {
                  Severity: Minor
                  Found in src/applications/terms-of-use/containers/TermsOfUse.jsx - About 2 hrs to fix

                    File utils.js has 273 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React from 'react';
                    
                    export const orientationSteps = [
                      {
                        number: 0,
                    Severity: Minor
                    Found in src/applications/vre/28-1900/orientation/utils.js - About 2 hrs to fix

                      File labels.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import constants from 'vets-json-schema/dist/constants.json';
                      
                      export const militaryBranches = [
                        'Air Force',
                        'Army',
                      Severity: Minor
                      Found in src/platform/forms/address/data/labels.js - About 2 hrs to fix

                        File SmApi.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                        import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/exports';
                        import { DefaultFolders, threadSortingOptions } from '../util/constants';
                        
                        const apiBasePath = `${environment.API_URL}/my_health/v1`;
                        Severity: Minor
                        Found in src/applications/mhv-secure-messaging/api/SmApi.js - About 2 hrs to fix

                          Function generateTitleSection has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const generateTitleSection = (doc, parent, data) => {
                            const titleSection = doc.struct('Sect', {
                              title: 'Introduction',
                            });
                            parent.add(titleSection);
                          Severity: Major
                          Found in src/platform/pdf/templates/self_entered_info.js - About 2 hrs to fix

                            Function reduceErrors has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              errors.reduce((processedErrors, error) => {
                                let errorIndex = null; // save key (index) of array items with __error
                                const findErrors = (name, err) => {
                                  if (err && typeof err === 'object') {
                                    // process the last type of error message which provides an `__errors`
                            Severity: Major
                            Found in src/platform/forms-system/src/js/utilities/data/reduceErrors.js - About 2 hrs to fix

                              Function ConfirmationPage has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const ConfirmationPage = () => {
                                const alertRef = useRef(null);
                                const form = useSelector(state => state.form || {});
                                const { submission, formId, data = {} } = form;
                                const { fullName } = data;

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

                                export function transform(formConfig, form) {
                                  const newSchoolTransform = formData => {
                                    let clonedData = _.cloneDeep(formData);
                                    delete clonedData.newSchoolName;
                                    delete clonedData.newSchoolAddress;
                                Severity: Major
                                Found in src/applications/edu-benefits/1995/config/submit-transformer.js - About 2 hrs to fix

                                  Function listItems has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    const listItems = dependents.map((item, index) => {
                                      const { fullName, dependentRelation } = item;
                                      const dependentName = normalizeFullName(fullName);
                                      const modalDescription = replaceStrValues(
                                        content['household-dependent-modal-remove-description'],
                                  Severity: Major
                                  Found in src/applications/ezr/components/FormFields/DependentList.jsx - About 2 hrs to fix

                                    Function validateAddress has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const validateAddress = (formData, fullName) => async (
                                      dispatch,
                                      getState,
                                    ) => {
                                      dispatch({ type: ADDRESS_VALIDATION_START });
                                    Severity: Major
                                    Found in src/applications/verify-your-enrollment/actions/index.js - About 2 hrs to fix

                                      Function listItems has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        const listItems = dependents.map((item, index) => {
                                          const { fullName, dependentRelation } = item;
                                          const dependentName = normalizeFullName(fullName);
                                          const modalDescription = replaceStrValues(
                                            content['household-dependent-modal-remove-description'],

                                        Function Demographics has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const Demographics = props => {
                                          const dispatch = useDispatch();
                                          const selectVeteranData = useMemo(makeSelectVeteranData, []);
                                          const { t } = useTranslation();
                                          const { demographics } = useSelector(selectVeteranData);
                                        Severity: Major
                                        Found in src/applications/check-in/day-of/pages/Demographics.jsx - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language