department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

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

  render() {
    const { supplies, order, eligibility } = this.props;
    const currentDate = moment();
    const accessorySupplies = supplies.filter(
      supply => supply.productGroup === ACCESSORY,

    Function UpcomingAppointmentsPage has 139 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const UpcomingAppointmentsPage = props => {
      const { router } = props;
      const [refresh, setRefresh] = useState(false);
      const selectApp = useMemo(makeSelectApp, []);
      const { app } = useSelector(selectApp);

      Function ThreadListItem has 139 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const ThreadListItem = props => {
        const location = useLocation();
        const { keyword, activeFolder } = props;
        const {
          senderName,

        Function DeleteDraft has 139 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const DeleteDraft = props => {
          const history = useHistory();
          const location = useLocation();
          const dispatch = useDispatch();
          const deleteDraftButtonRef = useRef();

          Function submitFilesLighthouse has 139 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function submitFilesLighthouse(claimId, trackedItem, files) {
            let filesComplete = 0;
            let bytesComplete = 0;
            let hasError = false;
            const totalSize = files.reduce((sum, file) => sum + file.file.size, 0);
          Severity: Major
          Found in src/applications/claims-status/actions/index.js - About 5 hrs to fix

            Function editPhoneNumberSuccess has 139 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const editPhoneNumberSuccess = () => {
              // store the phone number that's passed in via the POST or PUT call so we can
              // return it with the GET user/ response
              let newAreaCode;
              let newPhoneNumber;
            Severity: Major
            Found in src/applications/personalization/profile/msw-mocks.js - About 5 hrs to fix

              Function Allergies has 138 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const Allergies = props => {
                const { runningUnitTest } = props;
                const dispatch = useDispatch();
                const updatedRecordList = useSelector(
                  state => state.mr.allergies.updatedList,
              Severity: Major
              Found in src/applications/mhv-medical-records/containers/Allergies.jsx - About 5 hrs to fix

                Function DependentInformation has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const DependentInformation = props => {
                  const { data, goToPath, setFormData } = props;
                
                  const { dependents = [] } = data;
                  const search = new URLSearchParams(window.location.search);
                Severity: Major
                Found in src/applications/ezr/components/FormPages/DependentInformation.jsx - About 5 hrs to fix

                  Function DependentInformation has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const DependentInformation = props => {
                    const { data, goToPath, setFormData } = props;
                  
                    const { dependents = [] } = data;
                    const search = new URLSearchParams(window.location.search);

                    File dependentChildrenPages.js has 395 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import merge from 'lodash/merge';
                    import get from 'platform/utilities/data/get';
                    
                    import {
                      arrayBuilderItemFirstPageTitleUI,

                      File IntroductionPage.jsx has 395 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import {
                        VaAlert,
                        VaButton,
                        VaSearchInput,
                      } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
                      Severity: Minor
                      Found in src/applications/ask-va/containers/IntroductionPage.jsx - About 5 hrs to fix

                        Function EmploymentQuestion has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const EmploymentQuestion = props => {
                          const {
                            data,
                            goBack,
                            goToPath,

                          Function ChemHemDetails has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const ChemHemDetails = props => {
                            const { record, fullState, runningUnitTest } = props;
                            const user = useSelector(state => state.user.profile);
                            const allowTxtDownloads = useSelector(
                              state =>

                            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 mapStateToProps has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function mapStateToProps(state, ownProps) {
                                const { formContext } = ownProps;
                              
                                const { form, askVA } = state;
                                const formData = form.data;
                              Severity: Major
                              Found in src/applications/ask-va/containers/ReviewPage.jsx - About 5 hrs to fix

                                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 Vitals has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const Vitals = () => {
                                    const dispatch = useDispatch();
                                    const updatedRecordList = useSelector(state => state.mr.vitals.updatedList);
                                    const listState = useSelector(state => state.mr.vitals.listState);
                                    const vitals = useSelector(state => state.mr.vitals.vitalsList);
                                  Severity: Major
                                  Found in src/applications/mhv-medical-records/containers/Vitals.jsx - About 5 hrs to fix

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

                                    export const ResultsList = ({
                                      facilityTypeName,
                                      inProgress,
                                      searchString,
                                      results,
                                    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

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language