department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

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

  render() {
    const { onCheckboxChange, onReactStateChange, onSubmitHandler } = this;
    const { showMobileForm } = this.props;
    const {
      city,
Severity: Major
Found in src/applications/yellow-ribbon/containers/SearchForm/index.jsx - About 4 hrs to fix

    Function makeSchemas has 108 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function makeSchemas(prefix) {
      const properties = makeFormProperties(prefix);
      const schema = {
        type: 'object',
        properties: {

      File newContactMethod.js has 346 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from 'react';
      import { createSelector } from 'reselect';
      import { Link } from 'react-router';
      
      import TextNotificationsDisclaimer from '../../../../components/TextNotificationsDisclaimer';

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

          render() {
            const { loadedStatus, formConfig } = this.props;
            let content;
            const appType = formConfig?.customText?.appType || APP_TYPE_DEFAULT;
            const continueAppButtonText =
        Severity: Major
        Found in src/platform/forms/save-in-progress/SaveInProgressErrorPage.jsx - About 4 hrs to fix

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

            render() {
              return (
                <div className="schemaform-intro">
                  <FormTitle title="GI Bill® School Feedback Tool" />
                  <p>

            Function InsuranceSummary has 107 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const InsuranceSummary = props => {
              const {
                data,
                goBack,
                goForward,
            Severity: Major
            Found in src/applications/ezr/components/FormPages/InsuranceSummary.jsx - About 4 hrs to fix

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

              const IntroductionPage = props => {
                useEffect(() => {
                  focusElement('h1');
                  scrollToTop();
                }, []);

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

                const IntroductionPage = props => {
                  useEffect(() => {
                    focusElement('h1');
                    scrollToTop();
                  }, []);

                  Function InsuranceSummary has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const InsuranceSummary = props => {
                    const {
                      data,
                      goBack,
                      goForward,

                    Function UpcomingAppointmentsList has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const UpcomingAppointmentsList = props => {
                      const { router, app, upcomingAppointments } = props;
                      const { jumpToPage, getCurrentPageFromRouter } = useFormRouting(router);
                      const { t } = useTranslation();
                      const page = getCurrentPageFromRouter();
                    Severity: Major
                    Found in src/applications/check-in/components/UpcomingAppointmentsList.jsx - About 4 hrs to fix

                      File RequestedAppointmentsList.unit.spec.js has 345 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from 'react';
                      import MockDate from 'mockdate';
                      import { expect } from 'chai';
                      import moment from 'moment';
                      import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';

                        Function convertDemographics has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const convertDemographics = info => {
                          if (!info) return null;
                        
                          return {
                            id: info.id,
                        Severity: Major
                        Found in src/applications/mhv-medical-records/reducers/blueButton.js - About 4 hrs to fix

                          Function sanitizeKramesHtmlStr has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const sanitizeKramesHtmlStr = htmlString => {
                            const tempDiv = document.createElement('div');
                            tempDiv.innerHTML = htmlString;
                          
                            // This section is to address removing <body> and <page> tags
                          Severity: Major
                          Found in src/applications/mhv-medications/util/helpers.js - About 4 hrs to fix

                            File SearchForm.jsx has 344 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React, { useEffect, useMemo, useRef, useState } from 'react';
                            import FEATURE_FLAG_NAMES from '@department-of-veterans-affairs/platform-utilities/featureFlagNames';
                            import PropTypes from 'prop-types';
                            import { useLocation } from 'react-router-dom';
                            import { useDispatch, useSelector } from 'react-redux';

                              File InstitutionProfile.jsx has 344 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              /* eslint-disable jsx-a11y/anchor-has-content */
                              import React from 'react';
                              import PropTypes from 'prop-types';
                              import { getScrollOptions } from 'platform/utilities/ui';
                              import scrollTo from 'platform/utilities/ui/scrollTo';
                              Severity: Minor
                              Found in src/applications/gi/components/profile/InstitutionProfile.jsx - About 4 hrs to fix

                                File communicationPreferences.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import recordEvent from '~/platform/monitoring/record-event';
                                import { apiRequest } from '~/platform/utilities/api';
                                
                                import { LOADING_STATES } from '../../common/constants';
                                import { RX_TRACKING_SUPPORTING_FACILITIES } from '../constants';

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

                                  const generate = async data => {
                                    validate(data);
                                    const doc = createAccessibleDoc(data, config);
                                  
                                    await registerVaGovFonts(doc);
                                  Severity: Minor
                                  Found in src/platform/pdf/templates/self_entered_info.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 FieldTemplate has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export default function FieldTemplate(props) {
                                    const {
                                      id,
                                      schema,
                                      help,
                                  Severity: Minor
                                  Found in src/platform/forms-system/src/js/components/FieldTemplate.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 ArrayBuilderSummaryPage has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export default function ArrayBuilderSummaryPage(arrayBuilderOptions) {
                                    const {
                                      arrayPath,
                                      getFirstItemPagePath,
                                      getText,

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

                                  export function uiSchema(
                                    label = 'Address',
                                    useStreet3 = false,
                                    isRequired = null,
                                    ignoreRequired = false,
                                  Severity: Minor
                                  Found in src/applications/pre-need/definitions/address.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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language