department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function CrisisPanel has 136 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function CrisisPanel() {
  return (
    <div
      id="modal-crisisline"
      className="va-overlay va-modal va-modal-large"
Severity: Major
Found in src/platform/site-wide/va-footer/components/CrisisPanel.jsx - About 5 hrs to fix

    Function prefillTransformerV3 has 136 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function prefillTransformerV3(pages, formData, metadata, state) {
      const bankInformation = state.data?.bankInformation || {};
      const claimant = state.data?.formData?.data?.attributes?.claimant || {};
      const exclusionPeriods = Array.isArray(state.data?.exclusionPeriods)
        ? state.data?.exclusionPeriods
    Severity: Major
    Found in src/applications/my-education-benefits/helpers.js - About 5 hrs to fix

      Function CancelPageLayout has 136 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function CancelPageLayout() {
        const { id } = useParams();
        const {
          appointment,
          clinicName,

        Function default has 136 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function(state = INITIAL_STATE, action) {
          const newState = {
            ...state,
            loadFromUrl: false, // set this to false anytime a user action happens
          };
        Severity: Major
        Found in src/applications/gi/reducers/search.js - About 5 hrs to fix

          Function ResultsList has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          export const ResultsList = ({
            facilityTypeName,
            inProgress,
            isMobile,
            searchString,
          Severity: Minor
          Found in src/applications/facility-locator/components/ResultsList.jsx - About 5 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function ZipCodePage has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          const ZipCodePage = ({
            editMode,
            pastMode,
            router,
            toggleEditMode,
          Severity: Minor
          Found in src/applications/income-limits/containers/ZipCodePage.jsx - About 5 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function SearchPage has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          const SearchPage = props => {
            const searchResultTitleRef = useRef(null);
            const previousLocationInputString = useRef(
              props.currentQuery.locationInputString,
            );
          Severity: Minor
          Found in src/applications/representative-search/containers/SearchPage.jsx - About 5 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function EmploymentRecord has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          const EmploymentRecord = props => {
            const { data, goToPath, setFormData } = props;
          
            const editIndex = getJobIndex();
          
          

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function EmploymentRecord has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
          Open

          const EmploymentRecord = props => {
            const { data, goToPath, setFormData } = props;
          
            const editIndex = getJobIndex();
          
          

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          File ContactInfo.jsx has 392 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { useEffect, useState, useRef } from 'react';
          import { useSelector } from 'react-redux';
          import PropTypes from 'prop-types';
          import { Link } from 'react-router';
          
          

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

              render() {
                return (
                  <div className="schemaform-intro">
                    <FormTitle title="Apply for pre-need eligibility determination" />
                    <p>
            Severity: Major
            Found in src/applications/pre-need/components/IntroductionPage.jsx - About 5 hrs to fix

              Function TravelQuestion has 135 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const TravelQuestion = props => {
                const { router } = props;
                const { t } = useTranslation();
                const { jumpToPage, goToNextPage } = useFormRouting(router);
                const selectVeteranData = useMemo(makeSelectVeteranData, []);
              Severity: Major
              Found in src/applications/check-in/day-of/pages/TravelReview.jsx - About 5 hrs to fix

                Function CancelPageLayoutRequest has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function CancelPageLayoutRequest() {
                  const { id } = useParams();
                  const {
                    appointment,
                    email,

                  Function Edit has 135 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const Edit = () => {
                    const dispatch = useDispatch();
                    const history = useHistory();
                    const query = useQuery();
                  
                  
                  Severity: Major
                  Found in src/applications/personalization/profile/components/edit/Edit.jsx - About 5 hrs to fix

                    File ContactInfo.jsx has 391 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React, { useEffect, useState, useRef } from 'react';
                    import { useSelector } from 'react-redux';
                    import PropTypes from 'prop-types';
                    import { Link } from 'react-router';
                    
                    
                    Severity: Minor
                    Found in src/platform/forms-system/src/js/components/ContactInfo.jsx - About 5 hrs to fix

                      File exportsFile.js has 390 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      export {
                        selectUser,
                        isLoggedIn,
                        selectProfile,
                        isVAPatient,
                      Severity: Minor
                      Found in src/platform/user/exportsFile.js - About 5 hrs to fix

                        Function data has 134 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          data: (state = initialState, action) => {
                            switch (action.type) {
                              case FETCH_PERSONAL_INFORMATION:
                                return {
                                  ...state,
                        Severity: Major
                        Found in src/applications/toe/reducers.js - About 5 hrs to fix

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

                            render() {
                              return (
                                <div className="schemaform-intro">
                                  <FormTitle title="Apply for pre-need eligibility determination" />
                                  <p>
                          Severity: Major
                          Found in src/applications/pre-need-integration/components/IntroductionPage.jsx - About 5 hrs to fix

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

                              render() {
                                const { apps, loading, errors } = this.props;
                                const deletedApps = apps ? apps.filter(app => app.deleted) : [];
                                const activeApps = apps ? apps.filter(app => !app.deleted) : [];
                            
                            

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

                              const IntroductionPage = props => {
                                const { route, loggedIn } = props;
                                const { formConfig, pageList } = route;
                                const store = useStore();
                              
                              
                                Severity
                                Category
                                Status
                                Source
                                Language