department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

File ArrayField.jsx has 341 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import PropTypes from 'prop-types';
import React from 'react';
import Scroll from 'react-scroll';
import {
  getDefaultFormState,
Severity: Minor
Found in src/platform/forms-system/src/js/review/ArrayField.jsx - About 4 hrs to fix

    File EvidenceSummaryLists.jsx has 341 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from 'react';
    import { Link } from 'react-router';
    import PropTypes from 'prop-types';
    
    import readableList from 'platform/forms-system/src/js/utilities/data/readableList';

      File EvidenceSummaryLists.jsx has 341 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from 'react';
      import { Link } from 'react-router';
      import PropTypes from 'prop-types';
      
      import readableList from 'platform/forms-system/src/js/utilities/data/readableList';
      Severity: Minor
      Found in src/applications/appeals/995/components/EvidenceSummaryLists.jsx - About 4 hrs to fix

        File submit.js has 341 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import _ from 'platform/utilities/data';
        import {
          PTSD_INCIDENT_ITERATION,
          PTSD_CHANGE_LABELS,
          ATTACHMENT_KEYS,
        Severity: Minor
        Found in src/applications/disability-benefits/all-claims/utils/submit.js - About 4 hrs to fix

          File ArrayField.jsx has 341 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import get from '@department-of-veterans-affairs/platform-forms-system/get';
          import set from '@department-of-veterans-affairs/platform-forms-system/set';
          import {
            getDefaultFormState,
            toIdSchema,
          Severity: Minor
          Found in src/applications/ask-va/components/ArrayField.jsx - About 4 hrs to fix

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

              render() {
                const {
                  currentDropdown,
                  currentSection,
                  data,
            Severity: Major
            Found in src/platform/site-wide/mega-menu/components/MegaMenu.jsx - About 4 hrs to fix

              Function FormNav has 104 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function FormNav(props) {
                const {
                  formConfig = {},
                  currentPath,
                  formData,
              Severity: Major
              Found in src/platform/forms-system/src/js/components/FormNav.jsx - About 4 hrs to fix

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

                const IntroductionPage = props => {
                  useEffect(() => {
                    focusElement('h1');
                    scrollTo('topContentElement');
                  }, []);
                Severity: Major
                Found in src/applications/appeals/10182/containers/IntroductionPage.jsx - About 4 hrs to fix

                  Function BurialAllowance has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function BurialAllowance(props) {
                    const { values } = useFormikContext();
                  
                    const getBurialAllowanceRequestedOptions = () => {
                      const allowanceTypes = [
                  Severity: Major
                  Found in src/applications/burial-poc-v6/pages/BurialAllowance.jsx - About 4 hrs to fix

                    Function YourTreatmentPlan has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const YourTreatmentPlan = props => {
                      const { avs } = props;
                      const { medChangesSummary, orders } = avs;
                    
                      const medChanges =
                    Severity: Major
                    Found in src/applications/avs/components/YourTreatmentPlan.jsx - About 4 hrs to fix

                      Function useDirectDeposit has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const useDirectDeposit = () => {
                        const dispatch = useDispatch();
                      
                        const [formData, setFormData] = useState({});
                      
                      
                      Severity: Major
                      Found in src/applications/personalization/profile/hooks/useDirectDeposit.js - About 4 hrs to fix

                        Function ManageDependents has 104 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const ManageDependents = props => {
                          const {
                            relationship,
                            updateFormData,
                            cleanupFormData,

                          File profile.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import React from 'react';
                          import PropTypes from 'prop-types';
                          
                          import {
                            isValidEmail,
                          Severity: Minor
                          Found in src/platform/forms-system/src/js/utilities/data/profile.js - About 4 hrs to fix

                            File profile.js has 339 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            import React from 'react';
                            import PropTypes from 'prop-types';
                            
                            import {
                              isValidEmail,

                              Function useGetSearchResults has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function useGetSearchResults(articles, query, page) {
                                const [results, setResults] = useState([]);
                              
                                // Refresh the results list when the query is submitted or the page is changed.
                                useEffect(
                              Severity: Major
                              Found in src/applications/resources-and-support/hooks/useGetSearchResults.js - About 4 hrs to fix

                                Function PreSubmitNotice has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const PreSubmitNotice = props => {
                                  const { preSubmitInfo, showError, onSectionComplete, submission } = props;
                                  const { field, required } = preSubmitInfo;
                                
                                  const [accepted, setAccepted] = useState(false);
                                Severity: Major
                                Found in src/applications/hca/components/PreSubmitNotice/index.jsx - About 4 hrs to fix

                                  Function AppointmentListInfoBlock has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const AppointmentListInfoBlock = () => {
                                    const { t } = useTranslation();
                                    const [privacyActModalOpen, setPrivacyActModalOpen] = useState(false);
                                  
                                    const getModalUrl = modalState => {
                                  Severity: Major
                                  Found in src/applications/check-in/components/AppointmentListInfoBlock.jsx - About 4 hrs to fix

                                    Function updateSchema has 103 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 getMissingInfo has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
                                        const missingInfo = [];
                                        // If both home & mobile selected, make only one phone required
                                        const phones = [keys.homePhone, '|', keys.mobilePhone];
                                        const eitherPhone =
                                      Severity: Minor
                                      Found in src/platform/forms-system/src/js/utilities/data/profile.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 EvidenceSummary has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                                      Open

                                      const EvidenceSummary = ({
                                        data,
                                        goBack,
                                        goForward,
                                        setFormData,
                                      Severity: Minor
                                      Found in src/applications/appeals/995/components/EvidenceSummary.jsx - 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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language