department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

File index.jsx has 590 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable react/jsx-key */
import PropTypes from 'prop-types';
import React from 'react';
import moment from 'moment';
import * as Sentry from '@sentry/browser';
Severity: Major
Found in src/applications/disability-benefits/all-claims/utils/index.jsx - About 1 day to fix

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

    export const transform = (formConfig, form) => {
      const {
        questions,
        personalIdentification,
        personalData: {
    Severity: Major
    Found in src/applications/financial-status-report/utils/transform.js - About 1 day to fix

      Function DashboardCards has 253 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const DashboardCards = () => {
        const [error, hasError] = useState(false);
        const [inquiries, setInquiries] = useState([]);
        const [lastUpdatedFilter, setLastUpdatedFilter] = useState('newestToOldest');
        const [statusFilter, setStatusFilter] = useState('All');
      Severity: Major
      Found in src/applications/ask-va/containers/DashboardCardsMock.jsx - About 1 day to fix

        Function DashboardCards has 253 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const DashboardCards = () => {
          const [error, hasError] = useState(false);
          const [inquiries, setInquiries] = useState([]);
          const [statusFilter, setStatusFilter] = useState('All');
          const [categoryFilter, setCategoryFilter] = useState('All');
        Severity: Major
        Found in src/applications/ask-va/containers/DashboardCards.jsx - About 1 day to fix

          File getStatusContents.jsx has 588 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import { format } from 'date-fns';
          import _ from 'lodash';
          import * as Sentry from '@sentry/browser';
          import { Link } from 'react-router';

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

              render() {
                const {
                  uiSchema,
                  errorSchema,
                  idSchema,
            Severity: Major
            Found in src/platform/forms-system/src/js/fields/ArrayField.jsx - About 1 day to fix

              Function SearchControls has 252 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const SearchControls = props => {
                const {
                  currentQuery,
                  onChange,
                  geolocateUser,

                Function TermsOfUse has 252 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function TermsOfUse() {
                  const isAuthenticatedWithSiS = useSelector(isAuthenticatedWithOAuth);
                  const isAuthenticatedWithIAM = useSelector(isAuthenticatedWithSSOe);
                  const [isDisabled, setIsDisabled] = useState(false);
                  const [isMiddleAuth, setIsMiddleAuth] = useState(true);
                Severity: Major
                Found in src/applications/terms-of-use/containers/TermsOfUse.jsx - About 1 day to fix

                  Function ConfirmationPage has 251 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const ConfirmationPage = props => {
                    const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
                    const showUpdatedConfirmation = useToggleValue(
                      TOGGLE_NAMES.pensionConfirmationUpdate,
                    );
                  Severity: Major
                  Found in src/applications/pensions/containers/ConfirmationPage.jsx - About 1 day to fix

                    File disabilityLabelsRevised.js has 582 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    // note: the id's are no longer used for classification, but are kept here for compatibility with the old code
                    
                    export default {
                      0: 'ACL tear (anterior cruciate ligament tear), bilateral',
                      1: 'ACL tear (anterior cruciate ligament tear), left',

                      Function FileField has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const FileField = props => {
                        const {
                          enableShortWorkflow,
                          errorSchema,
                          formContext,
                      Severity: Minor
                      Found in src/platform/forms-system/src/js/fields/FileField.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

                      Function FileField has a Cognitive Complexity of 63 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const FileField = props => {
                        const {
                          errorSchema,
                          formContext,
                          formData = [],
                      Severity: Minor
                      Found in src/applications/appeals/shared/components/FileField.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 SectionField.jsx has 577 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import React from 'react';
                      import { formatSSN } from 'platform/utilities/ui';
                      import { getJobTitleOrType } from '../helpers';
                      
                      export const convertDateFormat = date => {
                      Severity: Major
                      Found in src/applications/pensions/components/SectionField.jsx - About 1 day to fix

                        Function DownloadRecordType has 246 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const DownloadRecordType = () => {
                          const history = useHistory();
                          const dispatch = useDispatch();
                          const [checkAll, setCheckAll] = useState(false);
                          const [labTestCheck, setLabTestCheck] = useState(false);

                          Function createDebtsSuccess has 244 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const createDebtsSuccess = () => {
                            return {
                              hasDependentDebts: false,
                              debts: [
                                {
                          Severity: Major
                          Found in src/applications/personalization/dashboard/mocks/debts/index.js - About 1 day to fix

                            Function FileField has a Cognitive Complexity of 62 (exceeds 5 allowed). Consider refactoring.
                            Open

                            const FileField = props => {
                              const {
                                enableShortWorkflow,
                                errorSchema,
                                formContext,
                            Severity: Minor
                            Found in src/applications/pre-need/components/FileField.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

                            Function VAFacilityPageV2 has 243 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function PrescriptionPrintOnly has 243 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const PrescriptionPrintOnly = props => {
                                const { rx, hideLineBreak, refillHistory, isDetailsRx } = props;
                                const pharmacyPhone = pharmacyPhoneNumber(rx);
                              
                                const activeNonVaContent = pres => (

                                Function appointmentsReducer has 241 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function appointmentsReducer(state = initialState, action) {
                                  switch (action.type) {
                                    case FETCH_FUTURE_APPOINTMENTS:
                                      return {
                                        ...state,
                                Severity: Major
                                Found in src/applications/vaos/appointment-list/redux/reducer.js - About 1 day to fix

                                  Function Vitals has 241 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const Vitals = () => {
                                    const dispatch = useDispatch();
                                    const updatedRecordList = useSelector(state => state.mr.vitals.updatedList);
                                    const listState = useSelector(state => state.mr.vitals.listState);
                                    const vitals = useSelector(state => state.mr.vitals.vitalsList);
                                  Severity: Major
                                  Found in src/applications/mhv-medical-records/containers/Vitals.jsx - About 1 day to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language