department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

Function FolderHeader has 102 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const FolderHeader = props => {
  const { folder, searchProps, threadCount } = props;
  const location = useLocation();
  const userFacilities = useSelector(state => state?.user?.profile?.facilities);
  const showInnerNav =

    Function renderYellowRibbon has 102 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const renderYellowRibbon = () => {
        if (!displayedInputs.yellowRibbon) return null;
    
        let {
          yellowRibbonDegreeLevelOptions,
    Severity: Major
    Found in src/applications/gi/components/profile/CalculateYourBenefitsForm.jsx - About 4 hrs to fix

      File component-library-analytics-setup.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable camelcase */
      /**
       * Attaches CustomEvent 'component-library-analytics' listener to document.body
       * to translate component library actions into analytics dataLayer events.
       */
      Severity: Minor
      Found in src/platform/site-wide/component-library-analytics-setup.js - About 4 hrs to fix

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        export function getLTSCountryCode(schemaCountryValue) {
          // Start by assuming the input is a three-character code.
          let country = countries.find(
            countryInfo => countryInfo.schemaValue === schemaCountryValue,
          );
        Severity: Major
        Found in src/applications/toe/utils/form-submit-transform.js and 1 other location - About 4 hrs to fix
        src/applications/my-education-benefits/utils/form-submit-transform.js on lines 258..271

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        export function getLTSCountryCode(schemaCountryValue) {
          // Start by assuming the input is a three-character code.
          let country = countries.find(
            countryInfo => countryInfo.schemaValue === schemaCountryValue,
          );
        src/applications/toe/utils/form-submit-transform.js on lines 276..289

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                    <h3 className="vads-u-font-size--h4 vads-u-display--flex vads-u-align-items--center">
                      <span className="vads-u-display--inline-block ">
                        {awards.actBegin !== null
                          ? translateDateIntoMonthYearFormat(awards.actBegin)
                          : translateDateIntoMonthYearFormat(awards.actEnd)}
        Severity: Major
        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 4 hrs to fix
        src/applications/verify-your-enrollment/helpers.jsx on lines 493..505

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

                    <h3 className="vads-u-font-size--h4 vads-u-display--flex vads-u-align-items--center">
                      <span className="vads-u-display--inline-block ">
                        {awards.actBegin !== null
                          ? translateDateIntoMonthYearFormat(awards.actBegin)
                          : translateDateIntoMonthYearFormat(awards.actEnd)}
        Severity: Major
        Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 4 hrs to fix
        src/applications/verify-your-enrollment/helpers.jsx on lines 442..454

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        function App({ location, children, showForm, isLoading }) {
          if (isLoading) {
            return (
              <va-loading-indicator
                message="Please wait while we load the application for you."
        Severity: Major
        Found in src/applications/simple-forms/21-4138/containers/App.jsx and 1 other location - About 4 hrs to fix
        src/applications/simple-forms/20-10207/containers/App.jsx on lines 13..32

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        function App({ location, children, showForm, isLoading }) {
          if (isLoading) {
            return (
              <va-loading-indicator
                message="Please wait while we load the application for you."
        Severity: Major
        Found in src/applications/simple-forms/20-10207/containers/App.jsx and 1 other location - About 4 hrs to fix
        src/applications/simple-forms/21-4138/containers/App.jsx on lines 13..32

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        ConfirmationApproved.propTypes = {
          claimantName: PropTypes.string.isRequired,
          confirmationDate: PropTypes.string.isRequired,
          confirmationError: PropTypes.bool.isRequired,
          confirmationLoading: PropTypes.bool.isRequired,
        src/applications/find-forms/widgets/createFindVaFormsPDFDownloadHelper/DownloadHandler.js on lines 92..101
        src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmRemoveModal.jsx on lines 80..89

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        ConfirmRemoveModal.propTypes = {
          cancelAction: PropTypes.func.isRequired,
          deleteAction: PropTypes.func.isRequired,
          fieldName: PropTypes.string.isRequired,
          isEnrolledInVAHealthCare: PropTypes.bool.isRequired,
        src/applications/find-forms/widgets/createFindVaFormsPDFDownloadHelper/DownloadHandler.js on lines 92..101
        src/applications/my-education-benefits/components/confirmation/ConfirmationApproved.jsx on lines 141..150

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 3 locations. Consider refactoring.
        Open

        DownloadHandler.propTypes = {
          clickedId: PropTypes.string.isRequired,
          downloadUrl: PropTypes.string.isRequired,
          form: PropTypes.object.isRequired,
          formNumber: PropTypes.string.isRequired,
        src/applications/my-education-benefits/components/confirmation/ConfirmationApproved.jsx on lines 141..150
        src/platform/user/profile/vap-svc/components/ContactInformationFieldInfo/ConfirmRemoveModal.jsx on lines 80..89

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    <div className="vads-l-col--12 small-screen:vads-l-col--6 vads-u-margin--1">
                      <VaAdditionalInfo trigger="Expand Additional Information" uswds>
                        <div>Here are some items</div>
                        <ul>
                          <li>Item 1</li>
        Severity: Major
        Found in src/applications/ds-playground/pages/V1V3Page.jsx and 1 other location - About 4 hrs to fix
        src/applications/ds-v3-playground/pages/V3BasePage.jsx on lines 462..472

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            function findChange(low, high) {
                var mid, diff;
        
                while ((diff = ((high.at - low.at) / 12e4 | 0) * 6e4)) {
                    mid = new OffsetAt(new Date(low.at + diff));
        Severity: Major
        Found in src/applications/vaos/lib/moment-tz.js and 1 other location - About 4 hrs to fix
        src/applications/personalization/dashboard/lib/moment-tz.js on lines 263..276

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          function findChange(low, high) {
            var mid, diff;
        
            while ((diff = (((high.at - low.at) / 12e4) | 0) * 6e4)) {
              mid = new OffsetAt(new Date(low.at + diff));
        Severity: Major
        Found in src/applications/personalization/dashboard/lib/moment-tz.js and 1 other location - About 4 hrs to fix
        src/applications/vaos/lib/moment-tz.js on lines 251..264

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                  <div className="vads-grid-col">
                    <VaAdditionalInfo trigger="Expand Additional Information" uswds>
                      <div>Here are some items</div>
                      <ul>
                        <li>Item 1</li>
        Severity: Major
        Found in src/applications/ds-v3-playground/pages/V3BasePage.jsx and 1 other location - About 4 hrs to fix
        src/applications/ds-playground/pages/V1V3Page.jsx on lines 762..772

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 116.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

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

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

          Function threadDetailsReducer has 101 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const threadDetailsReducer = (state = initialState, action) => {
            switch (action.type) {
              case Actions.Thread.GET_THREAD:
                return {
                  ...initialState,
          Severity: Major
          Found in src/applications/mhv-secure-messaging/reducers/threadDetails.js - About 4 hrs to fix

            Function GettingStartedWithBenefits has 101 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const GettingStartedWithBenefits = () => {
              return (
                <div>
                  <div className="vads-u-margin-top--neg1p5 vads-u-padding-left--2p5 small-screen-font">
                    <div className="vads-u-margin-y--2p5">
            Severity: Major
            Found in src/applications/gi/components/profile/GettingStartedWithBenefits.jsx - About 4 hrs to fix

              File Modals.jsx has 334 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { useState } from 'react';
              import {
                VaModal,
                VaButton,
              } from '@department-of-veterans-affairs/web-components/react-bindings';
                Severity
                Category
                Status
                Source
                Language