department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

File ProfileInformationEditView.jsx has 384 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';

import { focusElement } from 'platform/utilities/ui';

    File ContactInfo.jsx has 384 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useEffect, useState, useRef } from 'react';
    import { useSelector } from 'react-redux';
    import PropTypes from 'prop-types';
    import { Link, withRouter } from 'react-router';
    
    

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

        render() {
          const { location } = this.props;
      
          if (!location) {
            return null;
      Severity: Major
      Found in src/applications/facility-locator/components/AppointmentInfo.jsx - About 5 hrs to fix

        Function AppointmentsPage has 130 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const AppointmentsPage = props => {
          const { router } = props;
          const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
          const { isUpcomingAppointmentsEnabled } = useSelector(selectFeatureToggles);
          const selectApp = useMemo(makeSelectApp, []);
        Severity: Major
        Found in src/applications/check-in/components/pages/Appointments/index.jsx - About 5 hrs to fix

          File ProfileInformationEditView.jsx has 383 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { Component } from 'react';
          import PropTypes from 'prop-types';
          import { connect } from 'react-redux';
          
          import { focusElement } from 'platform/utilities/ui';

            File ProfileInformationEditView.jsx has 383 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, { Component } from 'react';
            import PropTypes from 'prop-types';
            import { connect } from 'react-redux';
            
            import { focusElement } from 'platform/utilities/ui';

              File ProfileInformationEditView.jsx has 383 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { Component } from 'react';
              import PropTypes from 'prop-types';
              import { connect } from 'react-redux';
              
              import { focusElement } from 'platform/utilities/ui';

                Function FieldTemplate has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function FieldTemplate(props) {
                  const {
                    id,
                    schema,
                    help,
                Severity: Major
                Found in src/platform/forms-system/src/js/components/FieldTemplate.jsx - About 5 hrs to fix

                  Function alertMessage has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const alertMessage = (alertType, appType) => {
                    switch (alertType) {
                      case ALERT_TYPES.ALL_ZERO:
                        return {
                          alertStatus: 'info',

                    Function MrBreadcrumbs has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const MrBreadcrumbs = () => {
                      const dispatch = useDispatch();
                      const location = useLocation();
                      const history = useHistory();
                      const crumbsList = useSelector(state => state.mr.breadcrumbs.crumbsList);
                    Severity: Major
                    Found in src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx - About 5 hrs to fix

                      Function createSuccessPayment has 128 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const createSuccessPayment = (hasRecentPayment = false) => {
                        return {
                          data: {
                            id: '',
                            type: 'bgs_va_payment_history_response',

                        File form-submit-transform.js has 379 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        // this constant maps the values on address.js in vets.json schema from VA.gov values to LTS values
                        // the lts values were found on the LTS database and LTS validates them, so we need to send correct value from here
                        const countries = [
                          { schemaValue: 'USA', ltsValue: 'US', label: 'United States' },
                          { schemaValue: 'AFG', ltsValue: 'AF', label: 'Afghanistan' },
                        Severity: Minor
                        Found in src/applications/toe/utils/form-submit-transform.js - About 5 hrs to fix

                          File form.js has 379 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import environment from 'platform/utilities/environment';
                          import footerContent from 'platform/forms/components/FormFooter';
                          import { externalServices } from 'platform/monitoring/DowntimeNotification';
                          import { scrollAndFocus } from 'platform/utilities/ui';
                          
                          
                          Severity: Minor
                          Found in src/applications/simple-forms/21-10210/config/form.js - About 5 hrs to fix

                            File FAQSections.jsx has 379 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React from 'react';
                            
                            export const FirstFAQSection = () => {
                              return (
                                <>
                            Severity: Minor
                            Found in src/applications/dhp-connected-devices/components/FAQSections.jsx - About 5 hrs to fix

                              Function focusReview has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export const focusReview = (name, editing, reviewEditFocusOnHeaders) => {
                                setTimeout(() => {
                                  const scrollName = `${name}${SCROLL_ELEMENT_SUFFIX}`;
                                  const scrollElement = document.querySelector(`[name="${scrollName}"]`);
                              
                              
                              Severity: Minor
                              Found in src/platform/forms-system/src/js/utilities/ui/focus-review.js - About 5 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 AuthApp has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                              Open

                              export default function AuthApp({ location }) {
                                useDatadogRum();
                              
                                const [
                                  { auth, errorCode, returnUrl, loginType, state, requestId },
                              Severity: Minor
                              Found in src/applications/auth/containers/AuthApp.jsx - About 5 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 AppointmentMessage has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                              Open

                              const AppointmentMessage = props => {
                                const { appointment, page } = props;
                                const { t } = useTranslation();
                              
                                const defaultMessage = t(

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

                              export default function prefillTransformer(pages, formData, metadata, state) {
                                const prefillRatedDisabilities = data => {
                                  const { disabilities } = data;
                              
                                  if (!disabilities) {

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

                              const CreditCardBill = props => {
                                const { data, goToPath, setFormData } = props;
                              
                                const { expenses } = data;
                                const { creditCardBills = [] } = expenses;

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

                              export default function covid19VaccineReducer(state = initialState, action) {
                                switch (action.type) {
                                  case FORM_PAGE_OPENED: {
                                    const { newBooking } = state;
                                    const { data, schema } = setupFormData(
                              Severity: Minor
                              Found in src/applications/vaos/covid-19-vaccine/redux/reducer.js - About 5 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