department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

File VaPrescription.jsx has 324 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import PropTypes from 'prop-types';
import { useSelector } from 'react-redux';
import { Link } from 'react-router-dom';
import FEATURE_FLAG_NAMES from '@department-of-veterans-affairs/platform-utilities/featureFlagNames';

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

      render() {
        const { form } = this.props;
        const { name } = form.data.application.claimant;
        const submittedAt = moment(form.submission.submittedAt);
    
    
    Severity: Major
    Found in src/applications/pre-need/containers/ConfirmationPage.jsx - About 3 hrs to fix

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

      const ThreadsList = props => {
        const {
          folder,
          threadList,
          keyword,

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

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

          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

            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 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

            Function updateSchema has 93 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  const updateSchema = () => {
                    if (addressFormData) {
                      // if livesOnMilitaryBase is checked
                      if (addressFormData?.['view:livesOnMilitaryBase']) {
                        const filteredRequiredArray = addressFormRequiredData.filter(

              Function TravelIntro has 93 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const TravelIntro = props => {
                const { router } = props;
                const { t } = useTranslation();
              
                const { goToNextPage } = useFormRouting(router);
              Severity: Major
              Found in src/applications/check-in/travel-claim/pages/travel-intro/index.jsx - About 3 hrs to fix

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

                  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">
                        <h2 className="vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--2 no-print">

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

                  const all = {
                    resourceType: 'Bundle',
                    id: '12121',
                    meta: {
                      lastUpdated: '2023-09-29T11:04:31.316-04:00',
                  Severity: Minor
                  Found in src/platform/mhv/api/mocks/medical-records/allergies/index.js - About 3 hrs to fix

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

                    import commonDefinitions from 'vets-json-schema/dist/definitions.json';
                    import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                    import profileContactInfo from 'platform/forms-system/src/js/definitions/profileContactInfo';
                    import configService from '../utilities/configService';
                    import manifest from '../manifest.json';
                    Severity: Minor
                    Found in src/applications/representative-appoint/config/form.js - About 3 hrs to fix

                      Function MobileLinks has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function MobileLinks(props) {
                        const { links, visible, langConfig, minimalFooter } = props;
                      
                        return (
                          <div
                      Severity: Major
                      Found in src/platform/site-wide/va-footer/components/MobileLinks.jsx - About 3 hrs to fix

                        Function FormSaved has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const FormSaved = props => {
                          const {
                            router,
                            route,
                            lastSavedDate,
                        Severity: Major
                        Found in src/platform/forms/save-in-progress/FormSaved.jsx - About 3 hrs to fix

                          Function exports has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          module.exports = async (on, config) => {
                            if (process.env.CODE_COVERAGE === 'true') {
                              require('@cypress/code-coverage/task')(on, config);
                              on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'));
                            }
                          Severity: Major
                          Found in src/platform/testing/e2e/cypress/plugins/index.js - About 3 hrs to fix

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

                            export function transform(formConfig, form) {
                              const usFormTransform = () =>
                                JSON.parse(transformForSubmit(formConfig, form));
                            
                              const prefillTransforms = formData => {
                            Severity: Major
                            Found in src/applications/edu-benefits/0994/submit-transformer.js - About 3 hrs to fix

                              Function Avs has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const Avs = props => {
                                useDatadogRum();
                              
                                const user = useSelector(selectUser);
                                const { avsEnabled, featureTogglesLoading } = useSelector(
                              Severity: Major
                              Found in src/applications/avs/containers/Avs.jsx - About 3 hrs to fix

                                Function Landing has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const Landing = props => {
                                  const { location, router } = props;
                                  const { jumpToPage } = useFormRouting(router);
                                  const { t } = useTranslation();
                                
                                
                                Severity: Major
                                Found in src/applications/check-in/day-of/pages/Landing.jsx - About 3 hrs to fix

                                  File TravelPayStatusApp.jsx has 320 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import React, { useState, useEffect, useCallback, useRef } from 'react';
                                  import { useDispatch, useSelector } from 'react-redux';
                                  import {
                                    isProfileLoading,
                                    isLoggedIn,
                                  Severity: Minor
                                  Found in src/applications/travel-pay/containers/TravelPayStatusApp.jsx - About 3 hrs to fix

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

                                      render() {
                                        const {
                                          loadingDecisionRequest,
                                          decisionRequestError,
                                          params,
                                    Severity: Major
                                    Found in src/applications/claims-status/containers/AskVAPage.jsx - About 3 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language