department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function FacilityPatientSatisfactionScoresWidget has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function FacilityPatientSatisfactionScoresWidget(props) {
  if (props.loading || !Object.keys(props.facility).length) {
    return (
      <va-loading-indicator message="Loading facility patient satisfaction scores..." />
    );

    Function prefillTransformerV1 has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function prefillTransformerV1(pages, formData, metadata, state) {
      const bankInformation = state.data?.bankInformation || {};
      const claimant = state.data?.formData?.data?.attributes?.claimant || {};
      const contactInfo = claimant?.contactInfo || {};
      const sponsors = state.data?.formData?.attributes?.sponsors;
    Severity: Major
    Found in src/applications/toe/helpers.jsx - About 4 hrs to fix

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

        render() {
          const {
            deriveResultsEndNumber,
            deriveResultsStartNumber,
            onPageSelect,
      Severity: Major
      Found in src/applications/yellow-ribbon/containers/SearchResults/index.jsx - About 4 hrs to fix

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

          render() {
            const { idSchema, formContext, formData, uiSchema, schema } = this.props;
            const id = idSchema.$id;
        
            // wrap matching text in a <span> element

          File address.js has 353 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import get from 'platform/utilities/data/get';
          import set from 'platform/utilities/data/set';
          import unset from 'platform/utilities/data/unset';
          import { createSelector } from 'reselect';
          
          

            File AddressValidationModal.jsx has 352 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

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

              Function generateFeatureToggles has 111 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const generateFeatureToggles = (toggles = {}) => {
                const {
                  mhvLandingPagePersonalization = true,
                  mhvMedicationsToVaGovRelease = true,
                  mhvMedicationsDisplayRefillContent = true,
              Severity: Major
              Found in src/platform/mhv/api/mocks/feature-toggles/index.js - About 4 hrs to fix

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

                  render() {
                    const { showWizard } = this.props;
                
                    if (showWizard === undefined) return null;
                    return (
                Severity: Major
                Found in src/applications/edu-benefits/1990/containers/IntroductionPage.jsx - About 4 hrs to fix

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

                  export default function ReviewPage() {
                    const pageTitle = useSelector(state => getPageTitle(state, pageKey));
                  
                    const dispatch = useDispatch();
                    const {
                  Severity: Major
                  Found in src/applications/vaos/new-appointment/components/ReviewPage/index.jsx - About 4 hrs to fix

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

                    import sinon from 'sinon';
                    import { expect } from 'chai';
                    import { rest } from 'msw';
                    import { setupServer } from 'msw/node';
                    
                    

                      Function paginatedThreads has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const paginatedThreads = (req, res) => {
                        const { index } = req.params;
                        const { pageSize, pageNumber, sortField, sortOrder } = req.query;
                      
                        const sortFunc = (a, b) => {
                      Severity: Minor
                      Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.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 validateAddress has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export const validateAddress = (
                        route,
                        method,
                        fieldName,
                        inputAddress,
                      Severity: Minor
                      Found in src/platform/user/profile/vap-svc/actions/transactions.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 MissingFileOverview has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export default function MissingFileOverview({
                        contentAfterButtons,
                        data,
                        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

                      Function prefillTransformer has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export default function prefillTransformer(pages, formData, metadata) {
                        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 FileInput has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const FileInput = props => {
                        const {
                          attachments,
                          setAttachments,
                          setAttachFileSuccess,

                      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 render has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        render() {
                          const { uiSchema, errorSchema, idSchema, schema, formContext } = this.props;
                          const { SchemaField } = this.props.registry.fields || {};
                      
                          const properties = Object.keys(schema.properties);
                      Severity: Major
                      Found in src/platform/forms-system/src/js/review/ObjectField.jsx - About 4 hrs to fix

                        File utilities.js has 350 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        import appendQuery from 'append-query';
                        import * as Sentry from '@sentry/browser';
                        import 'url-search-params-polyfill';
                        import environment from 'platform/utilities/environment';
                        import { createOAuthRequest } from 'platform/utilities/oauth/utilities';
                        Severity: Minor
                        Found in src/platform/user/authentication/utilities.js - About 4 hrs to fix

                          Function TravelPayAlert has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const TravelPayAlert = props => {
                            const {
                              travelPayEligible,
                              travelPayClaimRequested,
                              travelPayClaimError,

                            Function TypeOfCarePage has 110 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function TypeOfCarePage() {
                              const pageTitle = useSelector(state => getPageTitle(state, pageKey));
                            
                              const dispatch = useDispatch();
                              const {

                              Function RequiredLoginView has 109 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export const RequiredLoginView = props => {
                                const { user, verify, useSiS, showProfileErrorMessage = false } = props;
                              
                                const shouldSignIn = useCallback(() => !user.login.currentlyLoggedIn, [
                                  user.login.currentlyLoggedIn,
                              Severity: Major
                              Found in src/platform/user/authorization/components/RequiredLoginView.jsx - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language