department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,730 of 12,800 total issues

Function FacilityReview has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FacilityReview = props => {
  const { data, goToPath } = props;
  const plannedClinic = data['view:plannedClinic'];
  const veteranSelectedFacility = plannedClinic.veteranSelected;
  const selectedCaregiverSupportFacility = plannedClinic.caregiverSupport;

    Function useDetectFieldChanges has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const useDetectFieldChanges = formData => {
      const prevDataRef = useRef();
      const [shouldShowReviewButton, setShouldShowReviewButton] = useState(true);
    
      useEffect(

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

        const updateFormData = e => {
          e.preventDefault();
      
          if (!employmentRecord.type || employmentRecord.type === '') {
            setTypeError('Please select your type of work.');

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

          const updateFormData = e => {
            e.preventDefault();
        
            if (!employmentRecord.type || employmentRecord.type === '') {
              setTypeError('Please select your type of work.');

          Function ReadOnlyUserDescription has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ReadOnlyUserDescription = props => {
            const [isLoggedIn, setIsLoggedIn] = useState();
            useEffect(
              () => {
                setIsLoggedIn(props.isLoggedIn);
          Severity: Minor
          Found in src/applications/vre/25-8832/components/ReadOnlyUserDescription.js - About 1 hr to fix

            Function handleSearch has 40 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const handleSearch = () => {
                setFiltersCleared(false);
                if (filterBoxRef.current.checkFormValidity()) return;
            
                let relativeToDate;

              Function PreferredDatesSection has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function PreferredDatesSection(props) {
                const history = useHistory();
                const { home, ccRequestDateTime, requestDateTime } = useSelector(
                  getNewAppointmentFlow,
                );

                Function PreferredDatePage has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function PreferredDatePage() {
                  const pageTitle = useSelector(state => getPageTitle(state, pageKey));
                
                  const dispatch = useDispatch();
                  const { schema, data, pageChangeInProgress } = useSelector(

                  Function uiSchema has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function uiSchema(
                    addressTitle = applicantContactInfoAddressTitle,
                    contactInfoSubheader = applicantContactInfoSubheader,
                    contactInfoDescription = applicantContactInfoDescription,
                  ) {

                    Function debtsReducer has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const debtsReducer = (state = initialState, action) => {
                      switch (action.type) {
                        case DEBTS_FETCH_INITIATED || COPAYS_FETCH_INITIATED:
                          return {
                            ...state,
                    Severity: Minor
                    Found in src/applications/personalization/dashboard/reducers/debts.js - About 1 hr to fix

                      Function locationUiSchema has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const locationUiSchema = uiRequiredCallback => {
                        return {
                          isOutsideUs: {
                            'ui:title': 'This happened outside of the U.S.',
                          },

                        Function ChemHemResults has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const ChemHemResults = props => {
                          const { results } = props;
                        
                          return (
                            <ul className="result-cards">

                          Function refreshReducer has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const refreshReducer = (state = initialState, action) => {
                            switch (action.type) {
                              case Actions.Refresh.SET_INITIAL_FHIR_LOAD: {
                                return {
                                  ...state,
                          Severity: Minor
                          Found in src/applications/mhv-medical-records/reducers/refresh.js - About 1 hr to fix

                            Function PhrRefresh has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const PhrRefresh = () => {
                              const dispatch = useDispatch();
                              const refresh = useSelector(state => state.mr.refresh);
                              const [endPollingDate, setEndPollingDate] = useState(null);
                            
                            

                              Function prefillContactInformation has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const prefillContactInformation = data => {
                                  const newData = _.omit(['contactInformation', 'avaProfile'], data);
                                  const { contactInformation, avaProfile } = data;
                              
                                  if (contactInformation) {
                              Severity: Minor
                              Found in src/applications/representative-appoint/prefill-transformer.js - About 1 hr to fix

                                Function PrintOnlyPage has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const PrintOnlyPage = props => {
                                  const { children, title, preface, subtitle, hasError } = props;
                                  return (
                                    <div className="print-only landing-page">
                                      <div
                                Severity: Minor
                                Found in src/applications/mhv-medications/containers/PrintOnlyPage.jsx - About 1 hr to fix

                                  Function SipsDevModal has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const SipsDevModal = props => {
                                    const { pageList, form, locationPathname } = props || {};
                                    const { formId, version, data, submission } = form || {};
                                  
                                    const [isModalVisible, toggleModal] = useState(false);
                                  Severity: Minor
                                  Found in src/platform/forms/save-in-progress/SaveInProgressDevModal.jsx - About 1 hr 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 generateResultsContent has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const generateResultsContent = async (doc, parent, data) => {
                                    for (const resultItem of data.results) {
                                      const results = doc.struct('Sect', {
                                        title: resultItem.header || 'Results',
                                      });
                                  Severity: Minor
                                  Found in src/platform/pdf/templates/medications.js - About 1 hr 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 formatAddress has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export function formatAddress(address) {
                                    /* eslint-disable prefer-template */
                                  
                                    const {
                                      addressLine1,
                                  Severity: Minor
                                  Found in src/platform/forms/address/helpers.js - About 1 hr 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 TernaryRadios has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  const TernaryRadios = ({
                                    formError,
                                    formResponses,
                                    formValue,
                                    h1,
                                  Severity: Minor
                                  Found in src/applications/pact-act/containers/questions/TernaryRadios.jsx - About 1 hr 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