department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

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

export const validateAddress = (formData, fullName) => async (
  dispatch,
  getState,
) => {
  dispatch({ type: ADDRESS_VALIDATION_START });

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

      render() {
        let view;
    
        if (this.props.success) {
          view = (
    Severity: Major
    Found in src/applications/veteran-id-card/containers/EmailCapture.jsx - About 2 hrs to fix

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

        render() {
          let message;
      
          if (this.props.errors) {
            message = this.renderErrors();
      Severity: Major
      Found in src/applications/veteran-id-card/containers/Main.jsx - About 2 hrs to fix

        Function allergyReducer has 62 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          File day-of.reducers.unit.spec.js has 269 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { expect } from 'chai';
          
          import {
            receivedDemographicsDataHandler,
            receivedAppointmentDetailsHandler,

            Function applicantInformation has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function applicantInformation(schema, options) {
              // Use the defaults as necessary, but override with the options given
              const prefix = options && options.isVeteran ? 'veteran' : 'relative';
              const mergedOptions = Object.assign({}, defaults(prefix), options);
              const { fields, required, labels } = mergedOptions;
            Severity: Major
            Found in src/platform/forms/pages/applicantInformation.jsx - About 2 hrs to fix

              Function getNonArraySchema has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function getNonArraySchema(schema, uiSchema = {}) {
                if (
                  schema.type === 'array' &&
                  !get('ui:options.keepInPageOnReview', uiSchema)
                ) {
              Severity: Major
              Found in src/platform/forms-system/src/js/helpers.js - About 2 hrs to fix

                Function ProfileInformationView has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const ProfileInformationView = props => {
                  const { data, fieldName, title, id } = props;
                
                  const titleLower = title.toLowerCase();
                
                

                  Function getPreviouslyVerified has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const getPreviouslyVerified = () => {
                      let enrollments = [];
                  
                      Object.values(pastAndCurrentAwards).forEach(month => {
                        if (month.length > 1) {

                    Function submitRepresentativeReport has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const submitRepresentativeReport = newReport => {
                      return async dispatch => {
                        dispatch({
                          type: REPORT_SUBMITTED,
                          payload: {

                      Function medsIntro has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const medsIntro = (avs, fullState) => {
                        return (
                          <>
                            <p>
                              The medications listed below were reviewed with you by your provider and
                      Severity: Major
                      Found in src/applications/avs/components/YourHealthInformation.jsx - About 2 hrs to fix

                        Function MhvAlert has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const MhvAlert = () => {
                            return (
                              <CustomAlert headline={headline} icon="lock" status="warning">
                                <div>
                                  <p>

                          Function NextOfKin has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

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

                            Function LanguagePicker has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function LanguagePicker() {
                              const { i18n } = useTranslation();
                              const { language } = i18n;
                            
                              function getUrl(lang) {
                            Severity: Major
                            Found in src/applications/check-in/components/LanguagePicker.jsx - About 2 hrs to fix

                              Function EmergencyContact has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

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

                                Function useSendTravelPayClaim has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const useSendTravelPayClaim = appointment => {
                                  const [isLoading, setIsLoading] = useState(false);
                                  const [travelPayClaimError, setTravelPayClaimError] = useState(false);
                                  const [travelPayClaimRequested, setTravelPayClaimRequested] = useState();
                                
                                
                                Severity: Major
                                Found in src/applications/check-in/hooks/useSendTravelPayClaim.jsx - About 2 hrs to fix

                                  Function IntroductionPage has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const IntroductionPage = props => {
                                    const { route } = props;
                                    const userLoggedIn = useSelector(state => isLoggedIn(state));
                                    const userIdVerified = useSelector(state => isLOA3(state));
                                  
                                  
                                  Severity: Major
                                  Found in src/applications/simple-forms/21-4138/containers/IntroductionPage.jsx - About 2 hrs to fix

                                    Function askVA has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      askVA: (state = initialState, action) => {
                                        switch (action.type) {
                                          case SET_CATEGORY_ID:
                                            return {
                                              ...state,
                                    Severity: Major
                                    Found in src/applications/ask-va/reducers/index.js - About 2 hrs to fix

                                      Function DeductionSampleTable has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const DeductionSampleTable = () => {
                                        return (
                                          <>
                                            <p className="sr-only">
                                              A sample two-column table from a pay stub showing common deductions and

                                        Function updateFormData has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                          const updateFormData = e => {
                                            e.preventDefault();
                                            if (isEditing) {
                                              // find the one we are editing in the employeeRecords array
                                              const updatedRecords = spEmploymentRecords.map((item, arrayIndex) => {
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language