department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function ContestableIssuesWidget has 210 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const ContestableIssuesWidget = props => {
  const {
    value = [],
    id,
    options,

    Function useNotificationSettingsUtils has 210 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const useNotificationSettingsUtils = () => {
      const communicationPreferences = useSelector(
        state => state?.communicationPreferences,
      );
    
    

      Function NewAppointment has 209 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function NewAppointment() {
        const isCernerOnlyPatient = useSelector(selectIsCernerOnlyPatient);
        const isNewAppointmentStarted = useSelector(selectIsNewAppointmentStarted);
        const featureBreadcrumbUrlUpdate = useSelector(state =>
          selectFeatureBreadcrumbUrlUpdate(state),
      Severity: Major
      Found in src/applications/vaos/new-appointment/index.jsx - About 1 day to fix

        File ProfileInformationFieldController.jsx has 514 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import PropTypes from 'prop-types';
        import { connect } from 'react-redux';
        
        // platform level imports

          Function Confirmation has 208 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const Confirmation = () => {
            useEffect(() => {
              focusElement('#main h2');
              scrollTo('topScrollElement');
            });
          Severity: Major
          Found in src/applications/appeals/testing/download/containers/Confirmation.jsx - About 1 day to fix

            File ApiInitializer.js has 512 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import session from '../mocks/v2/sessions';
            import preCheckInData from '../mocks/v2/pre-check-in-data';
            import checkInData from '../mocks/v2/check-in-data';
            import btsss from '../mocks/v2/btsss';
            import sharedData from '../mocks/v2/shared';
            Severity: Major
            Found in src/applications/check-in/api/local-mock-api/e2e/ApiInitializer.js - About 1 day to fix

              Function ConfirmationPageV2 has 207 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const ConfirmationPageV2 = () => {
                const alertRef = useRef(null);
              
                const form = useSelector(state => state.form || {});
                const profile = useSelector(state => selectProfile(state));
              Severity: Major
              Found in src/applications/appeals/10182/components/ConfirmationPageV2.jsx - About 1 day to fix

                Function generateData has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring.
                Open

                const generateData = (type, formData) => {
                  switch (type) {
                    case 'claimant-information':
                      return {
                        'Claimant’s first name': formData?.claimantFullName?.first
                Severity: Minor
                Found in src/applications/burials-ez/components/NoFormPage.jsx - About 1 day 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

                File DeceasedPersons.jsx has 510 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import PropTypes from 'prop-types';
                import React from 'react';
                import classNames from 'classnames';
                import Scroll from 'react-scroll';
                import {
                Severity: Major
                Found in src/applications/pre-need-integration/components/DeceasedPersons.jsx - About 1 day to fix

                  File ProfileInformationFieldController.jsx has 508 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import React from 'react';
                  import PropTypes from 'prop-types';
                  import { connect } from 'react-redux';
                  
                  // platform level imports

                    File debtDetailsCardContent.js has 508 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React from 'react';
                    import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
                    import { endDate } from '../../utils/helpers';
                    
                    const ContactDMC = () => (

                      Function MyVAHealth has 204 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function MyVAHealth() {
                        const [{ loadingMessage, isLoading }, setLoadingMessage] = useState(
                          defaultMessage,
                        );
                        const [showDeclineModal, setShowDeclineModal] = useState(false);
                      Severity: Major
                      Found in src/applications/terms-of-use/components/MyVAHealth.jsx - About 1 day to fix

                        Function renderResults has 203 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          renderResults() {
                            const { searchGovMaintenance } = this.props;
                            const {
                              loading,
                              errors,
                        Severity: Major
                        Found in src/applications/search/containers/SearchApp.jsx - About 1 day to fix

                          Function uiSchema has 202 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function uiSchema(
                            label = 'Address',
                            useStreet2 = true,
                            useStreet3 = false,
                            isRequired = null,

                            Function transform has 202 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function transform(formConfig, form) {
                              // Grab isBDD before things are changed/deleted
                              const isBDDForm = isBDD(form.data);
                              // Grab ratedDisabilities before they're deleted in case the page is inactive
                              // We need to send all of these to vets-api even if the veteran doesn't apply
                            Severity: Major
                            Found in src/applications/disability-benefits/all-claims/submit-transformer.js - About 1 day to fix

                              File ArrayField.jsx has 500 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import PropTypes from 'prop-types';
                              import React from 'react';
                              import classNames from 'classnames';
                              import Scroll from 'react-scroll';
                              
                              
                              Severity: Minor
                              Found in src/platform/forms-system/src/js/fields/ArrayField.jsx - About 1 day to fix

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

                                const all = [
                                  {
                                    id: 5621490,
                                    reasonForStudy: null,
                                    radiologist: 'DOE,JOHN',
                                Severity: Minor
                                Found in src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js - About 1 day to fix

                                  Function uiSchema has 199 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export function uiSchema(
                                    label = 'Address',
                                    useStreet3 = false,
                                    isRequired = null,
                                    ignoreRequired = false,
                                  Severity: Major
                                  Found in src/applications/pre-need/definitions/address.js - About 7 hrs to fix

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

                                      render() {
                                        const {
                                          uiSchema,
                                          errorSchema,
                                          idSchema,

                                      Function NoFormPage has 198 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const NoFormPage = () => {
                                        const [data, setData] = useState({});
                                        const [loading, setLoading] = useState(false);
                                        const loggedIn = useSelector(isLoggedIn);
                                      
                                      
                                      Severity: Major
                                      Found in src/applications/pensions/components/NoFormPage.jsx - About 7 hrs to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language