department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function useLocalStorage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const useLocalStorage = (key, defaultValue) => {
  const [value, setValue] = useState(() => {
    let currentValue;

    try {

    Function certificateOfEligibility has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const certificateOfEligibility = (state = initialState, action) => {
      switch (action.type) {
        case UPDATE_LOGGEDIN_STATUS:
          return { ...state, profileIsUpdating: false };
        case SKIP_AUTOMATIC_COE_CHECK:

      Function libraryCurrent has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function libraryCurrent() {
        let increment = 1;
        let numVal;
        Array.prototype.slice.call(cards).forEach(element => {
          if (

        Function handleEditPageDisplayTweaks has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const handleEditPageDisplayTweaks = location => {
          const navHeader = document.querySelector('#nav-form-header');
          const chapterProgress = document.querySelector(
            '.schemaform-chapter-progress',
          );
        Severity: Minor
        Found in src/applications/_mock-form-ae-design-patterns/App.jsx - About 1 hr to fix

          Function certificateOfEligibility has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const certificateOfEligibility = (state = initialState, action) => {
            switch (action.type) {
              case UPDATE_LOGGEDIN_STATUS:
                return { ...state, profileIsUpdating: false };
              case SKIP_AUTOMATIC_COE_CHECK:
          Severity: Minor
          Found in src/applications/lgy/coe/shared/reducers/index.js - About 1 hr to fix

            Function createDuplicateEvents has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const createDuplicateEvents = () => {
              const eventA = createEvent(
                now
                  .clone()
                  .add(5, 'days')
            Severity: Minor
            Found in src/applications/static-pages/events/helpers/event-generator.js - About 1 hr to fix

              Function fetchNearbyVetCenters has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const fetchNearbyVetCenters = async () => {
                  const mainAddress = props.mainVetCenterAddress;
                  if (!mainAddress) {
                    return;
                  }

                Function buildHourItem has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const buildHourItem = item => {
                    // {day: 4, starthours: 700, endhours: 1730, comment: ""}
                    if (
                      item.starthours < 0 ||
                      item.endhours < 0 ||
                Severity: Minor
                Found in src/applications/static-pages/facilities/vetCentersHours.jsx - About 1 hr to fix

                  Function formatReadableDate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const formatReadableDate = rawDate => {
                    const months = [
                      'January',
                      'February',
                      'March',
                  Severity: Minor
                  Found in src/applications/toe/helpers.jsx - About 1 hr to fix

                    Function MixedLanguageDisclaimer has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const MixedLanguageDisclaimer = () => {
                      const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
                      const {
                        isTranslationDisclaimerSpanishEnabled,
                        isTranslationDisclaimerTagalogEnabled,
                    Severity: Minor
                    Found in src/applications/check-in/components/MixedLanguageDisclaimer.jsx - About 1 hr to fix

                      Function setDayOfData has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          payload => {
                            batch(() => {
                              const {
                                appointments,
                                demographics,
                      Severity: Minor
                      Found in src/applications/check-in/hooks/useGetCheckInData.jsx - About 1 hr to fix

                        Function formatReadableDate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const formatReadableDate = rawDate => {
                          const months = [
                            'January',
                            'February',
                            'March',

                          Function showSeparationLocation has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const showSeparationLocation = formData => {
                            const { serviceInformation = {} } = formData || {};
                            const { servicePeriods, reservesNationalGuardService } = serviceInformation;
                          
                            // moment(undefined) => today
                          Severity: Minor
                          Found in src/applications/disability-benefits/all-claims/utils/index.jsx - About 1 hr to fix

                            Function submit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function submit(form, formConfig) {
                              const headers = { 'Content-Type': 'application/json' };
                            
                              const body = transform(formConfig, form);
                              const apiRequestOptions = {
                            Severity: Minor
                            Found in src/applications/burials-ez/config/submit.js - About 1 hr to fix

                              Function transformSecondaryDisabilities has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const transformSecondaryDisabilities = formData => {
                                  if (!formData.newSecondaryDisabilities) {
                                    return formData;
                                  }
                              
                              

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

                                  render() {
                                    const pageDescription = (
                                      <>
                                        <h3 className="vads-u-font-size--h4">Shipping address</h3>
                                        <div className="vads-u-margin-top--2">

                                  Function DisagreeFileClaimPage has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const DisagreeFileClaimPage = () => {
                                    const linkText = 'Learn about the decision review process';
                                  
                                    recordEvent({
                                      event: 'howToWizard-alert-displayed',

                                    Function uiSchema has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export const uiSchema = index => {
                                      const addressUI = addressUISchema(
                                        `secondaryIncident${index}.sources[:index]address`,
                                        null,
                                        false,

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

                                      export const ConfirmationPage = props => {
                                        const form = useSelector(state => state.form || {});
                                        const { submission } = form;
                                        const { formConfig } = props?.route;
                                        const submitDate = submission.timestamp;

                                        Function SurveyInformation has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const SurveyInformation = () => {
                                          const isProduction = environment.isProduction();
                                        
                                          // showForm/loadForm use specific survey numbers for each environment
                                          const surveyNumber = isProduction
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language