department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function TypeOfCarePage has 121 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function TypeOfCarePage() {
  const pageTitle = useSelector(state => getPageTitle(state, pageKey));

  const dispatch = useDispatch();
  const {

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

    import FormFooter from 'platform/forms/components/FormFooter';
    
    // import CustomPageWrapper from '../components/CustomPageWrapper';
    import IntroductionPage from '../containers/IntroductionPage';
    import taskList from '../pages/taskList';
    Severity: Minor
    Found in src/applications/appeals/testing/nod-new/config/form.js - About 4 hrs to fix

      File calculator.js has 367 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { isFinite } from 'lodash';
      import camelCaseKeysRecursive from 'camelcase-keys-recursive';
      
      import {
        CALCULATOR_INPUTS_CHANGED,
      Severity: Minor
      Found in src/applications/gi/reducers/calculator.js - About 4 hrs to fix

        Function generate has 120 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const generate = async data => {
          validate(data.details);
        
          const doc = createAccessibleDoc(data, config);
        
        
        Severity: Major
        Found in src/platform/pdf/templates/veteran_status.js - About 4 hrs to fix

          Function ResourcesAndSupportSearchApp has 120 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ResourcesAndSupportSearchApp = () => {
            const [articles, errorMessage] = useArticleData();
            const [userInput, setUserInput] = useState('');
            const [query, setQuery] = useState('');
            const [page, setPage] = useState(1);

            Function applicantInformationUpdate has 120 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function applicantInformationUpdate(schema, options) {
              // Use the defaults as necessary, but override with the options given
              const prefix = options && options.isVeteran ? 'veteran' : 'relative';
              const { fields, required, labels } = {
                ...defaults(prefix),

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

                const content = () => {
                  if (activeAlert && activeAlert.type === ALERT_TYPE_ERROR) {
                    return (
                      <>
                        <h1 className="vads-u-margin-bottom--0p5">Allergy:</h1>
              Severity: Major
              Found in src/applications/mhv-medical-records/containers/AllergyDetails.jsx - About 4 hrs to fix

                File EvidenceRecords.jsx has 366 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React from 'react';
                import PropTypes from 'prop-types';
                import { Link } from 'react-router';
                
                import {
                Severity: Minor
                Found in src/applications/appeals/testing/sc/components/EvidenceRecords.jsx - About 4 hrs to fix

                  Function prefillTransformerV1 has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function prefillTransformerV1(pages, formData, metadata, state) {
                    const bankInformation = state.data?.bankInformation || {};
                    const claimant = state.data?.formData?.data?.attributes?.claimant || {};
                    const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
                    const contactInfo = claimant?.contactInfo || {};
                  Severity: Major
                  Found in src/applications/my-education-benefits/helpers.js - About 4 hrs to fix

                    Function EmailSignup has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const EmailSignup = () => {
                      const [inputError, setInputError] = useState(null);
                      const [email, setEmail] = useState('');
                      const [headerHasFocused, setHeaderHasFocused] = useState(false);
                    
                    
                    Severity: Major
                    Found in src/applications/static-pages/homepage-email-signup/EmailSignup.jsx - About 4 hrs to fix

                      Function prefillTransformer has 119 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export default function prefillTransformer(pages, formData, metadata, state) {
                        const prefillRatedDisabilities = data => {
                          const { disabilities } = data;
                      
                          if (!disabilities) {

                        Function fieldEntries has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                        Open

                        const fieldEntries = (key, uiSchema, data, schema, schemaFromState, index) => {
                          if (data === undefined || data === null) return null;
                          if (key.startsWith('view:') || key.startsWith('ui:')) return null;
                        
                          let schemaPropertiesKey = schema.properties?.[key];

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

                          render() {
                            const {
                              value: items,
                              id,
                              options,

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

                        export function transformVAOSAppointment(appt) {
                          const appointmentType = getAppointmentType(appt);
                          const isCC = appt.kind === 'cc';
                          const isVideo = appt.kind === 'telehealth';
                          const isAtlas = !!appt.telehealth?.atlas;
                        Severity: Minor
                        Found in src/applications/vaos/services/appointment/transformers.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

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

                        import moment from 'moment';
                        import PropTypes from 'prop-types';
                        import React from 'react';
                        import { connect } from 'react-redux';
                        import environment from 'platform/utilities/environment';

                          File EvidenceRecords.jsx has 364 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import React from 'react';
                          import PropTypes from 'prop-types';
                          import { Link } from 'react-router';
                          
                          import {
                          Severity: Minor
                          Found in src/applications/appeals/995/components/EvidenceRecords.jsx - About 4 hrs to fix

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

                            import moment from 'moment';
                            import PropTypes from 'prop-types';
                            import React from 'react';
                            import { connect } from 'react-redux';
                            import environment from 'platform/utilities/environment';

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

                              export default function ConfirmationPage() {
                                const {
                                  submission: { response },
                                  data: { fullName },
                                } = useSelector(state => state.form);
                              Severity: Major
                              Found in src/applications/vre/25-8832/containers/ConfirmationPage.jsx - About 4 hrs to fix

                                Function ConfirmedAppointmentDetailsPage has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function ConfirmedAppointmentDetailsPage() {
                                  const dispatch = useDispatch();
                                  const { id } = useParams();
                                  const {
                                    appointment,

                                  Function specializedMissionAttributes has 118 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    const specializedMissionAttributes = () => {
                                      const options = [
                                        {
                                          name: 'specialMissionHbcu',
                                          dataTestId: 'special-mission-hbcu',
                                  Severity: Major
                                  Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 4 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language