department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function determineBoardObj has 57 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const determineBoardObj = (formResponses, noDRB) => {
  if (!formResponses) {
    return null;
  }

Severity: Major
Found in src/applications/discharge-wizard/helpers/index.jsx - About 2 hrs to fix

    Function ProgramApprovalInformation has 57 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const ProgramApprovalInformation = () => {
      return (
        <MainContentSubDiv
          id="program-approval-information"
          header="Program approval information"

      Function generateStatusResponse has 57 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const generateStatusResponse = (req, res) => {
        const { id } = req.params;
      
        // increase to use multiple retries
        const requiredRetries = 0;

        Function NeedsVAPatient has 57 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const NeedsVAPatient = () => {
          const content = {
            heading: 'We couldn’t match your information to our VA patient records',
            alertText: (
              <>

          Function listItems has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const listItems = dependents.map((item, index) => {
              const { fullName, dependentRelation } = item;
              const dependentName = normalizeFullName(fullName);
          
              return (
          Severity: Major
          Found in src/applications/hca/components/FormFields/DependentList.jsx - About 2 hrs to fix

            Function NeedsSSNResolution has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const NeedsSSNResolution = () => {
              const content = {
                heading: 'The information you provided doesn’t match our records',
                alertText: (
                  <div>

              Function YourHealthInformation has 57 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const YourHealthInformation = props => {
                const { avs } = props;
                const fullState = useSelector(state => state);
              
                const appointmentDate = getFormattedAppointmentDate(avs);
              Severity: Major
              Found in src/applications/avs/components/YourHealthInformation.jsx - About 2 hrs to fix

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

                  render() {
                    if (this.state.messageDismissed) {
                      return this.props.children;
                    }
                
                

                  Function SpouseEmploymentHistoryWidget has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const SpouseEmploymentHistoryWidget = props => {
                    const {
                      goToPath,
                      goForward,
                      contentBeforeButtons,

                    Function EmploymentHistoryWidget has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const EmploymentHistoryWidget = props => {
                      const {
                        goToPath,
                        goForward,
                        contentBeforeButtons,

                      Function calculateHousing has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function calculateHousing(constant, eligibility, institution, derived) {
                        if (derived.chapter === 31 && derived.isFlightOrCorrespondence) {
                          return {
                            qualifier: 'per month',
                            ratedQualifier: ' / month',
                      Severity: Major
                      Found in src/applications/gi/selectors/estimator.js - About 2 hrs to fix

                        Function generateStatusResponse has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const generateStatusResponse = (req, res) => {
                          const { id } = req.params;
                        
                          // increase to use multiple retries
                          const requiredRetries = 0;

                          Function fetchCopays has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const fetchCopays = () => async dispatch => {
                            dispatch({ type: COPAYS_FETCH_INITIATED });
                            const getCopays = () => {
                              const options = {
                                method: 'GET',
                          Severity: Major
                          Found in src/applications/personalization/dashboard/actions/debts.js - About 2 hrs to fix

                            Function fetchDebts has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export const fetchDebts = () => async dispatch => {
                              dispatch({ type: DEBTS_FETCH_INITIATED });
                              const getDebts = () => {
                                const options = {
                                  method: 'GET',
                            Severity: Major
                            Found in src/applications/personalization/dashboard/actions/debts.js - About 2 hrs to fix

                              Function generateStatusResponse has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const generateStatusResponse = (req, res) => {
                                const { id } = req.params;
                              
                                // increase to use multiple retries
                                const requiredRetries = 0;

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

                                import React from 'react';
                                
                                import PropTypes from 'prop-types';
                                import { connect } from 'react-redux';
                                
                                
                                Severity: Minor
                                Found in src/applications/edu-benefits/10203/containers/IntroductionPage.jsx - About 2 hrs to fix

                                  Function render has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    render() {
                                      const {
                                        formIds,
                                        profile,
                                        login,
                                  Severity: Minor
                                  Found in src/platform/forms/save-in-progress/ApplicationStatus.jsx - About 2 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 SubTask has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export const SubTask = props => {
                                    const { pages = [], formData, setFormData, router } = props;
                                    const [currentPage, setCurrentPage] = useState(pages[0] || {});
                                    const [subTaskData, setSubTaskData] = useState(getStoredSubTask());
                                    const [hasError, setHasError] = useState(false);
                                  Severity: Minor
                                  Found in src/platform/forms/sub-task/index.js - About 2 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 navigateForward has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export const navigateForward = (SHORT_NAME, formResponses, router) => {
                                    const roadmap = makeRoadmap(getServicePeriodResponse(formResponses));
                                  
                                    if (roadmap?.length) {
                                      const CURRENT_INDEX = roadmap?.indexOf(SHORT_NAME);
                                  Severity: Minor
                                  Found in src/applications/pact-act/utilities/page-navigation.js - About 2 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 AreaOfDisagreement has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const AreaOfDisagreement = ({
                                    data = {},
                                    pagePerItemIndex,
                                    goBack,
                                    goForward,

                                  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