department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

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

export default function ConfirmationPage(props) {
  const { values } = useFormikContext();

  const benefits = {
    burialAllowance: values?.benefitsSelection?.burialAllowance,
Severity: Major
Found in src/applications/burial-poc-v6/pages/ConfirmationPage.jsx - About 3 hrs to fix

    Function updateProgramDetailsSchema has 78 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function updateProgramDetailsSchema() {
      const usaStates = states.USA.map(state => state.value);
      const usaLabels = states.USA.map(state => state.label);
      const canProvinces = states.CAN.map(state => state.value);
      const canLabels = states.CAN.map(state => state.label);
    Severity: Major
    Found in src/applications/edu-benefits/10203/helpers.jsx - About 3 hrs to fix

      Function transformForSubmit has 78 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function transformForSubmit(formConfig, form) {
        const transformedData = JSON.parse(
          formsSystemTransformForSubmit(formConfig, form),
        );
      
      
      Severity: Major
      Found in src/applications/ivc-champva/10-10D/config/submitTransformer.js - About 3 hrs to fix

        Function SubtopicSelect has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const SubtopicSelect = props => {
          const { id, onChange, value, loggedIn, topicID } = props;
        
          const [apiData, setApiData] = useState([]);
          const [loading, isLoading] = useState(false);
        Severity: Major
        Found in src/applications/ask-va/components/FormFields/SubtopicSelect.jsx - About 3 hrs to fix

          Function getFormSchema has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const getFormSchema = (formData = {}) => {
            const defaultCountry =
              countries.find(
                country => country.countryCodeISO3 === formData?.countryCodeIso3,
              )?.countryCodeISO3 || 'USA';

            File ConfirmationPage.jsx has 296 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, { useEffect } from 'react';
            import PropTypes from 'prop-types';
            
            import { utcToZonedTime, format } from 'date-fns-tz';
            import { connect } from 'react-redux';
            Severity: Minor
            Found in src/applications/pensions/containers/ConfirmationPage.jsx - About 3 hrs to fix

              Function ArrayBuilderCancelButton has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

              const ArrayBuilderCancelButton = ({
                arrayPath,
                setFormData,
                formData,
                goToPath,

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

              export const RequiredLoginView = props => {
                const { user, verify, useSiS, showProfileErrorMessage = false } = props;
              
                const shouldSignIn = useCallback(() => !user.login.currentlyLoggedIn, [
                  user.login.currentlyLoggedIn,
              Severity: Minor
              Found in src/platform/user/authorization/components/RequiredLoginView.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 SearchBar has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

              function SearchBar({ onInputChange, previousValue, setSearchData, userInput }) {
                const [isGlobalSearch, setGlobalSearch] = useState(false);
                const [expanded, setExpanded] = useState(false);
                const [inputError, setInputError] = useState(false);
                const GLOBAL = 'All VA.gov';
              Severity: Minor
              Found in src/applications/resources-and-support/components/SearchBar.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 ReportModal has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

              const ReportModal = ({
                representativeName,
                representativeId,
                address,
                phone,

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

              export default function transformForSubmit(formConfig, form) {
                const hasReceivedMedicalTreatment =
                  form?.data?.['view:hasReceivedMedicalTreatment'];
              
                const transformedData = JSON.parse(
              Severity: Minor
              Found in src/applications/simple-forms/20-10207/config/submit-transformer.js - 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 PrimaryAddressWithAutofill has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

              const PrimaryAddressWithAutofill = props => {
                const {
                  errorSchema,
                  formContext,
                  formData,

              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 GET /vaos/v2/appointments has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

                'GET /vaos/v2/appointments': (req, res) => {
                  // merge arrays together
                  const appointments = confirmedV2.data.concat(requestsV2.data, mockAppts);
                  const filteredAppointments = appointments.filter(appointment => {
                    return req.query.statuses.some(status => {
              Severity: Minor
              Found in src/applications/vaos/services/mocks/index.js - 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 RecentActivity has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function RecentActivity({ claim }) {
                const { TOGGLE_NAMES, useToggleValue } = useFeatureToggle();
                const cst5103UpdateEnabled = useToggleValue(
                  TOGGLE_NAMES.cst5103UpdateEnabled,
                );

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

              export default function EstimatedBenefits({
                outputs,
                calculator,
                isOJT,
                dispatchShowModal,
              Severity: Minor
              Found in src/applications/gi/components/profile/EstimatedBenefits.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

              File ResultsList.jsx has 295 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { useEffect, useRef, useState } from 'react';
              import PropTypes from 'prop-types';
              import { bindActionCreators } from 'redux';
              import { connect } from 'react-redux';
              import { toggleValues } from 'platform/site-wide/feature-toggles/selectors';
              Severity: Minor
              Found in src/applications/facility-locator/components/ResultsList.jsx - About 3 hrs to fix

                Function ReviewPage has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const ReviewPage = props => {
                  const [privacyCheckbox, setPrivacyCheckbox] = useState(false);
                  const [submitted, setSubmitted] = useState(false);
                
                  const { chapterTitles, getChapterPagesFromChapterIndex } = setupPages();
                Severity: Major
                Found in src/applications/appeals/testing/nod-new/components/ReviewPage.jsx - About 3 hrs to fix

                  Function FindVaForms has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const FindVaForms = () => {
                    return (
                      <>
                        <SearchForm />
                        <SearchResults />
                  Severity: Major
                  Found in src/applications/find-forms/components/FindVaForms.jsx - About 3 hrs to fix

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

                    import React from 'react';
                    import footerContent from '@department-of-veterans-affairs/platform-forms/FormFooter';
                    import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                    
                    import {
                    Severity: Minor
                    Found in src/applications/simple-forms/21-0972/config/form.js - About 3 hrs to fix

                      Function SignatureInput has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const SignatureInput = props => {
                        const {
                          fullName,
                          required,
                          label,
                        Severity
                        Category
                        Status
                        Source
                        Language