department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

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

const secondaryTwoPersonalInformation = {
  uiSchema: {
    ...titleUI(content['secondary-two-info-title--personal']),
    secondaryTwoFullName: fullNameUI({
      label: inputLabel,
src/applications/caregivers/config/chapters/primary/personalInformation.js on lines 16..34
src/applications/caregivers/config/chapters/secondaryOne/personalInformation.js on lines 16..37

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 121.

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

export {
  selectUser,
  isLoggedIn,
  selectProfile,
  isVAPatient,
Severity: Major
Found in src/platform/user/exportsFile.js and 1 other location - About 4 hrs to fix
src/platform/user/exportsFile.js on lines 230..255

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 121.

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

  return {
    appointment,
    bookingNotes,
    cancelInfo,
    canceled,
Severity: Major
Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 4 hrs to fix
src/applications/ivc-champva/shared/components/fileUploads/MissingFileOverview.jsx on lines 183..208

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 121.

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

  componentDidMount() {
    const { searchDropdownComponentEnabled } = this.props;
    if (!searchDropdownComponentEnabled) {
      document.addEventListener('keyup', event => {
        if (
Severity: Major
Found in src/platform/site-wide/user-nav/components/SearchMenu.jsx and 1 other location - About 4 hrs to fix
src/platform/site-wide/user-nav/components/SearchMenu.jsx on lines 59..72

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 121.

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

export {
  VAP_SERVICE_CLEAR_LAST_SAVED,
  VAP_SERVICE_TRANSACTIONS_FETCH_SUCCESS,
  VAP_SERVICE_TRANSACTION_REQUESTED,
  VAP_SERVICE_TRANSACTION_REQUEST_FAILED,
Severity: Major
Found in src/platform/user/exportsFile.js and 1 other location - About 4 hrs to fix
src/platform/user/exportsFile.js on lines 1..26

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 121.

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

  componentWillUnmount() {
    const { searchDropdownComponentEnabled } = this.props;
    if (!searchDropdownComponentEnabled) {
      document.removeEventListener('keyup', event => {
        if (
Severity: Major
Found in src/platform/site-wide/user-nav/components/SearchMenu.jsx and 1 other location - About 4 hrs to fix
src/platform/site-wide/user-nav/components/SearchMenu.jsx on lines 26..39

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 121.

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

    return (
      <div
        className="region-list usa-width-one-whole vads-u-display--flex vads-u-flex-direction--column
        small-screen:vads-u-flex-direction--row facility
      vads-u-margin-bottom--4 medium-screen:vads-u-margin-bottom--5"
src/applications/static-pages/facilities/vet-center/components/VAFAcility.jsx on lines 8..28

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 121.

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

export default function MissingFileOverview({
  contentAfterButtons,
  data,
  goBack,
  goForward,
src/applications/vaos/appointment-list/redux/selectors.js on lines 770..795

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 121.

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

  return (
    <div
      className="region-list usa-width-one-whole vads-u-display--flex vads-u-flex-direction--column
        small-screen:vads-u-flex-direction--row facility
      vads-u-margin-bottom--4 medium-screen:vads-u-margin-bottom--5"
src/applications/static-pages/facilities/vet-center/NearByVetCenters.jsx on lines 145..168

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 121.

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 render has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const { loadedStatus, formConfig } = this.props;
    let content;
    const appType = formConfig?.customText?.appType || APP_TYPE_DEFAULT;
    const continueAppButtonText =
Severity: Major
Found in src/platform/forms/save-in-progress/SaveInProgressErrorPage.jsx - About 4 hrs to fix

    File benefits.js has 345 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const categories = {
      EDUCATION: 'Education',
      EMPLOYMENT: 'Careers & Employment',
      MORE_SUPPORT: 'More Support',
      HEALTHCARE: 'Healthcare',

      Function InsuranceSummary has 107 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const InsuranceSummary = props => {
        const {
          data,
          goBack,
          goForward,
      Severity: Major
      Found in src/applications/ezr/components/FormPages/InsuranceSummary.jsx - About 4 hrs to fix

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

          render() {
            return (
              <div className="schemaform-intro">
                <FormTitle title="GI Bill® School Feedback Tool" />
                <p>

          Function InsuranceSummary has 107 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const InsuranceSummary = props => {
            const {
              data,
              goBack,
              goForward,

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

            const IntroductionPage = props => {
              useEffect(() => {
                focusElement('h1');
                scrollToTop();
              }, []);

              Function UpcomingAppointmentsList has 107 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const UpcomingAppointmentsList = props => {
                const { router, app, upcomingAppointments } = props;
                const { jumpToPage, getCurrentPageFromRouter } = useFormRouting(router);
                const { t } = useTranslation();
                const page = getCurrentPageFromRouter();
              Severity: Major
              Found in src/applications/check-in/components/UpcomingAppointmentsList.jsx - About 4 hrs to fix

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

                import React from 'react';
                import PropTypes from 'prop-types';
                import { connect, useSelector } from 'react-redux';
                
                import { ConfirmationPageView } from '../../shared/components/ConfirmationPageView';
                Severity: Minor
                Found in src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx - About 4 hrs to fix

                  Function ProgressNoteDetails has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const ProgressNoteDetails = props => {
                    const { record, runningUnitTest } = props;
                    const user = useSelector(state => state.user.profile);
                    const allowTxtDownloads = useSelector(
                      state =>

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

                      const content = () => {
                        if (labAndTestDetails) {
                          return (
                            <>
                              <PrintHeader />

                      Function sanitizeKramesHtmlStr has 107 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const sanitizeKramesHtmlStr = htmlString => {
                        const tempDiv = document.createElement('div');
                        tempDiv.innerHTML = htmlString;
                      
                        // This section is to address removing <body> and <page> tags
                      Severity: Major
                      Found in src/applications/mhv-medications/util/helpers.js - About 4 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language