department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,827 of 12,827 total issues

Function submitRepresentativeReport has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const submitRepresentativeReport = newReport => {
  return async dispatch => {
    dispatch({
      type: REPORT_SUBMITTED,
      payload: {

    Function medsIntro has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const medsIntro = (avs, fullState) => {
      return (
        <>
          <p>
            The medications listed below were reviewed with you by your provider and
    Severity: Major
    Found in src/applications/avs/components/YourHealthInformation.jsx - About 2 hrs to fix

      Function VetCenterHours has 61 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const VetCenterHours = props => {
        const hoursH4Style = props.isSatelliteLocation
          ? 'force-small-header vads-u-margin-top--0 vads-u-line-height--1 vads-u-margin-bottom--1'
          : 'vads-u-font-size--lg vads-u-margin-top--0 vads-u-line-height--1 vads-u-margin-bottom--1';
        if (props.hours.length === 0)
      Severity: Major
      Found in src/applications/static-pages/facilities/vetCentersHours.jsx - About 2 hrs to fix

        Function MhvAlert has 61 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const MhvAlert = () => {
            return (
              <CustomAlert headline={headline} icon="lock" status="warning">
                <div>
                  <p>

          Function LanguagePicker has 61 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function LanguagePicker() {
            const { i18n } = useTranslation();
            const { language } = i18n;
          
            function getUrl(lang) {
          Severity: Major
          Found in src/applications/check-in/components/LanguagePicker.jsx - About 2 hrs to fix

            Function EmergencyContact has 61 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const EmergencyContact = props => {
              const { router } = props;
              const { t } = useTranslation();
              const selectVeteranData = useMemo(makeSelectVeteranData, []);
              const { demographics } = useSelector(selectVeteranData);
            Severity: Major
            Found in src/applications/check-in/day-of/pages/EmergencyContact.jsx - About 2 hrs to fix

              Function useSendTravelPayClaim has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const useSendTravelPayClaim = appointment => {
                const [isLoading, setIsLoading] = useState(false);
                const [travelPayClaimError, setTravelPayClaimError] = useState(false);
                const [travelPayClaimRequested, setTravelPayClaimRequested] = useState();
              
              
              Severity: Major
              Found in src/applications/check-in/hooks/useSendTravelPayClaim.jsx - About 2 hrs to fix

                Function NextOfKin has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const NextOfKin = props => {
                  const { router } = props;
                  const { t } = useTranslation();
                  const selectVeteranData = useMemo(makeSelectVeteranData, []);
                  const { demographics } = useSelector(selectVeteranData);
                Severity: Major
                Found in src/applications/check-in/day-of/pages/NextOfKin.jsx - About 2 hrs to fix

                  Function IntroductionPage has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const IntroductionPage = props => {
                    const { route } = props;
                    const userLoggedIn = useSelector(state => isLoggedIn(state));
                    const userIdVerified = useSelector(state => isLOA3(state));
                  
                  
                  Severity: Major
                  Found in src/applications/simple-forms/21-4138/containers/IntroductionPage.jsx - About 2 hrs to fix

                    Function askVA has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      askVA: (state = initialState, action) => {
                        switch (action.type) {
                          case SET_CATEGORY_ID:
                            return {
                              ...state,
                    Severity: Major
                    Found in src/applications/ask-va/reducers/index.js - About 2 hrs to fix

                      Function DeductionSampleTable has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const DeductionSampleTable = () => {
                        return (
                          <>
                            <p className="sr-only">
                              A sample two-column table from a pay stub showing common deductions and

                        Function updateFormData has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          const updateFormData = e => {
                            e.preventDefault();
                            if (isEditing) {
                              // find the one we are editing in the employeeRecords array
                              const updatedRecords = spEmploymentRecords.map((item, arrayIndex) => {

                          Function MessageThreadMeta has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const MessageThreadMeta = props => {
                            const {
                              message,
                              fromMe,
                              replyMessage,

                            Function fetchPastAppointments has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function fetchPastAppointments(startDate, endDate, selectedIndex) {
                              return async (dispatch, getState) => {
                                const featureVAOSServiceVAAppointments = selectFeatureVAOSServiceVAAppointments(
                                  getState(),
                                );
                            Severity: Major
                            Found in src/applications/vaos/appointment-list/redux/actions.js - About 2 hrs to fix

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

                                const content = () => {
                                  if (refreshedOnThisPage) {
                                    if (refreshPhase === refreshPhases.FAILED) {
                                      return failedMsg();
                                    }

                                File CautionaryInformation.jsx has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                                Open

                                import PropTypes from 'prop-types';
                                import React from 'react';
                                import CautionFlagDetails from './CautionFlagDetails';
                                import SchoolClosingDetails from './SchoolClosingDetails';
                                import LearnMoreLabel from '../LearnMoreLabel';
                                Severity: Minor
                                Found in src/applications/gi/components/profile/CautionaryInformation.jsx - About 2 hrs to fix

                                  File MOCK_VA_APPOINTMENTS_OVER_30_DAYS.js has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import { addDays, formatISO } from 'date-fns';
                                  
                                  export default {
                                    data: [
                                      {

                                    Function vapService has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export default function vapService(state = initialState, action) {
                                      switch (action.type) {
                                        case VAP_SERVICE_TRANSACTIONS_FETCH_SUCCESS: {
                                          const transactions = action.data.map(transactionData =>
                                            // Wrap in a "data" property to imitate the API response for a single transaction
                                    Severity: Minor
                                    Found in src/platform/user/profile/vap-svc/reducers/index.js - About 2 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 getProfileInfoFieldAttributes has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    export const getProfileInfoFieldAttributes = fieldName => {
                                      let apiRoute;
                                      let convertCleanDataToPayload;
                                      let title;
                                      let uiSchema;

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

                                    export const getInitialFormValues = options => {
                                      const { fieldName, data, modalData } = options;
                                    
                                      if (fieldName === FIELD_NAMES.EMAIL) {
                                        return data ? { ...data } : { emailAddress: '' };

                                    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