department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function content has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const content = () => {
    if (accessAlert) {
      return (
        <AccessTroubleAlertBox
          alertType={accessAlertTypes.HEALTH_CONDITIONS}
Severity: Major
Found in src/applications/mhv-medical-records/containers/ConditionDetails.jsx - About 3 hrs to fix

    Function NonVaPrescription has 96 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const NonVaPrescription = prescription => {
      const content = () => {
        const status = prescription?.dispStatus?.toString();
        return (
          <div className="medication-details-div vads-u-border-top--1px vads-u-border-color--gray-lighter vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--3">

      File IntroductionPage.jsx has 326 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 3 hrs to fix

        File assetTransferPages.js has 325 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import merge from 'lodash/merge';
        import {
          arrayBuilderItemFirstPageTitleUI,
          arrayBuilderItemSubsequentPageTitleUI,

          Function ReviewPage has 95 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ReviewPage = props => {
            const [privacyCheckbox, setPrivacyCheckbox] = useState(false);
            const [submitted, setSubmitted] = useState(false);
          
            const { chapterTitles, getChapterPagesFromChapterIndex } = setupPages();
          Severity: Major
          Found in src/applications/appeals/testing/nod-new/components/ReviewPage2.jsx - About 3 hrs to fix

            Function BurialIntroduction has 95 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function BurialIntroduction(props) {
              return (
                <>
                  <Page {...props}>
                    <div className="schemaform-intro">
            Severity: Major
            Found in src/applications/burial-poc-v6/pages/BurialIntroduction.jsx - About 3 hrs to fix

              Function HomeAcreageValueInput has 95 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const HomeAcreageValueInput = props => {
                const {
                  goBack,
                  goForward,
                  onReviewPage = false,
              Severity: Major
              Found in src/applications/pensions/components/HomeAcreageValueInput.jsx - About 3 hrs to fix

                File SearchBenefits.jsx has 325 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useState } from 'react';
                import { useFeatureToggle } from 'platform/utilities/feature-toggles';
                import EbenefitsLink from 'platform/site-wide/ebenefits/containers/EbenefitsLink';
                import recordEvent from 'platform/monitoring/record-event';
                import PropTypes from 'prop-types';
                Severity: Minor
                Found in src/applications/gi/components/SearchBenefits.jsx - About 3 hrs to fix

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

                  export default function(state = INITIAL_STATE, action) {
                    switch (action.type) {
                      case ADD_COMPARE_INSTITUTION:
                        if (state.selected.length < 3) {
                          return {
                  Severity: Major
                  Found in src/applications/gi/reducers/compare.js - About 3 hrs to fix

                    Function CopyAddressModal has 95 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const CopyAddressModal = props => {
                      const {
                        mailingAddress = null,
                        homeAddress,
                        transaction,

                      File trustPages.js has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from 'react';
                      import merge from 'lodash/merge';
                      import {
                        arrayBuilderItemFirstPageTitleUI,
                        arrayBuilderItemSubsequentPageTitleUI,

                        File constants.js has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import constants from 'vets-json-schema/dist/constants.json';
                        import fullSchema from 'vets-json-schema/dist/21-526EZ-ALLCLAIMS-schema.json';
                        
                        const { pciuStates: PCIU_STATES } = constants;
                        
                        
                        Severity: Minor
                        Found in src/applications/disability-benefits/all-claims/constants.js - About 3 hrs to fix

                          Function ViewDependentsListItem has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function ViewDependentsListItem(props) {
                            const [open, setOpen] = useState(false);
                          
                            const {
                              manageDependentsToggle,

                            Function CareSummariesAndNotesListItem has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const CareSummariesAndNotesListItem = props => {
                              const { record } = props;
                              const isDischargeSummary = record.type === loincCodes.DISCHARGE_SUMMARY;
                            
                              const admDate = dischargeSummarySortFields.ADMISSION_DATE;

                              File index.js has 323 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import moment from 'moment-timezone';
                              import { isArray, sortBy, filter, isEmpty } from 'lodash';
                              
                              export const filterByOptions = [
                                {
                              Severity: Minor
                              Found in src/applications/static-pages/events/helpers/index.js - About 3 hrs to fix

                                File LocationSearchForm.jsx has 323 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                /* eslint-disable react-hooks/exhaustive-deps */
                                /* eslint-disable react/jsx-no-bind */
                                /* eslint-disable react/jsx-wrap-multilines */
                                /* eslint-disable react/prop-types */
                                import React, { useEffect, useState, createRef } from 'react';
                                Severity: Minor
                                Found in src/applications/gi/containers/search/LocationSearchForm.jsx - About 3 hrs to fix

                                  Function generate has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const generate = async data => {
                                    validate(data);
                                    const tocPageData = {};
                                    const doc = createAccessibleDoc(data, config);
                                  
                                  
                                  Severity: Minor
                                  Found in src/platform/pdf/templates/blue_button_report.js - About 3 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 ContactInfo has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const ContactInfo = ({
                                    data,
                                    goBack,
                                    goForward,
                                    onReviewPage,
                                  Severity: Minor
                                  Found in src/platform/forms-system/src/js/components/ContactInfo.jsx - About 3 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 Autocomplete has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const Autocomplete = ({
                                    availableResults,
                                    debounceDelay,
                                    formData,
                                    id,

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

                                  const ContestableIssues = props => {
                                    const {
                                      id,
                                      options,
                                      formContext = {},
                                  Severity: Minor
                                  Found in src/applications/appeals/shared/components/ContestableIssues.jsx - About 3 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