department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

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

const IntroductionPage = props => {
  useEffect(() => {
    focusElement('h1');
    scrollTo('topContentElement');
  }, []);
Severity: Major
Found in src/applications/appeals/10182/containers/IntroductionPage.jsx - About 4 hrs to fix

    Function BurialAllowance has 104 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function BurialAllowance(props) {
      const { values } = useFormikContext();
    
      const getBurialAllowanceRequestedOptions = () => {
        const allowanceTypes = [
    Severity: Major
    Found in src/applications/burial-poc-v6/pages/BurialAllowance.jsx - About 4 hrs to fix

      Function YourTreatmentPlan has 104 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const YourTreatmentPlan = props => {
        const { avs } = props;
        const { medChangesSummary, orders } = avs;
      
        const medChanges =
      Severity: Major
      Found in src/applications/avs/components/YourTreatmentPlan.jsx - About 4 hrs to fix

        Function useDirectDeposit has 104 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const useDirectDeposit = () => {
          const dispatch = useDispatch();
        
          const [formData, setFormData] = useState({});
        
        
        Severity: Major
        Found in src/applications/personalization/profile/hooks/useDirectDeposit.js - About 4 hrs to fix

          Function ManageDependents has 104 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ManageDependents = props => {
            const {
              relationship,
              updateFormData,
              cleanupFormData,

            File RefillPrescriptions.jsx has 340 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, { useState, useEffect, useMemo } from 'react';
            import PropTypes from 'prop-types';
            import { Link, useLocation } from 'react-router-dom';
            import { useSelector, useDispatch } from 'react-redux';
            import {
            Severity: Minor
            Found in src/applications/mhv-medications/containers/RefillPrescriptions.jsx - About 4 hrs to fix

              File profile.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React from 'react';
              import PropTypes from 'prop-types';
              
              import {
                isValidEmail,
              Severity: Minor
              Found in src/platform/forms-system/src/js/utilities/data/profile.js - About 4 hrs to fix

                File ResultsPage.jsx has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useEffect } from 'react';
                import { connect } from 'react-redux';
                import PropTypes from 'prop-types';
                import { waitForRenderThenFocus } from '@department-of-veterans-affairs/platform-utilities/ui';
                import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
                Severity: Minor
                Found in src/applications/income-limits/containers/ResultsPage.jsx - About 4 hrs to fix

                  File profile.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React from 'react';
                  import PropTypes from 'prop-types';
                  
                  import {
                    isValidEmail,

                    File profile.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React from 'react';
                    import PropTypes from 'prop-types';
                    
                    import {
                      isValidEmail,

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

                        render() {
                          const { route, showWizard } = this.props;
                          const { formConfig, pageList } = route;
                          const sipProps = { formConfig, pageList };
                      
                      

                        Function PreSubmitNotice has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const PreSubmitNotice = props => {
                          const { preSubmitInfo, showError, onSectionComplete, submission } = props;
                          const { field, required } = preSubmitInfo;
                        
                          const [accepted, setAccepted] = useState(false);
                        Severity: Major
                        Found in src/applications/hca/components/PreSubmitNotice/index.jsx - About 4 hrs to fix

                          Function AppointmentListInfoBlock has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const AppointmentListInfoBlock = () => {
                            const { t } = useTranslation();
                            const [privacyActModalOpen, setPrivacyActModalOpen] = useState(false);
                          
                            const getModalUrl = modalState => {
                          Severity: Major
                          Found in src/applications/check-in/components/AppointmentListInfoBlock.jsx - About 4 hrs to fix

                            Function updateSchema has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                  const updateSchema = () => {
                                    if (addressFormData) {
                                      // if livesOnMilitaryBase is checked
                                      if (addressFormData?.['view:livesOnMilitaryBase']) {
                                        const filteredRequiredArray = addressFormRequiredData.filter(

                              Function selfEnteredReducer has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const selfEnteredReducer = (state = initialState, action) => {
                                switch (action.type) {
                                  case Actions.SelfEntered.GET_VITALS: {
                                    return {
                                      ...state,
                              Severity: Major
                              Found in src/applications/mhv-medical-records/reducers/selfEnteredData.js - About 4 hrs to fix

                                Function getMissingInfo has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
                                  const missingInfo = [];
                                  // If both home & mobile selected, make only one phone required
                                  const phones = [keys.homePhone, '|', keys.mobilePhone];
                                  const eitherPhone =
                                Severity: Minor
                                Found in src/platform/forms-system/src/js/utilities/data/profile.js - About 4 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 EvidenceSummary has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const EvidenceSummary = ({
                                  data,
                                  goBack,
                                  goForward,
                                  setFormData,
                                Severity: Minor
                                Found in src/applications/appeals/testing/sc/components/EvidenceSummary.jsx - About 4 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 getMissingInfo has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
                                  const missingInfo = [];
                                  // If both home & mobile selected, make only one phone required
                                  const phones = [keys.homePhone, '|', keys.mobilePhone];
                                  const eitherPhone =

                                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 getMissingInfo has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
                                  const missingInfo = [];
                                  // If both home & mobile selected, make only one phone required
                                  const phones = [keys.homePhone, '|', keys.mobilePhone];
                                  const eitherPhone =

                                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 getMissingInfo has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
                                  const missingInfo = [];
                                  // If both home & mobile selected, make only one phone required
                                  const phones = [keys.homePhone, '|', keys.mobilePhone];
                                  const eitherPhone =

                                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