department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

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

        additionalInfoUpload: {
          title: 'Upload additional information',
          taskListHide: true,
          path: 'additional-info-upload',
          depends: formData => formData['view:additionalInfo'],
Severity: Major
Found in src/applications/appeals/testing/nod-new/config/form.js and 1 other location - About 1 hr to fix
src/applications/appeals/testing/nod-new/config/form.js on lines 283..292

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

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

const getMedicationsNotTaking = avs => {
  const medications = getCombinedMedications(avs);
  return medications.filter(
    medication =>
      medication.patientTaking === false &&
Severity: Major
Found in src/applications/avs/utils/medications/index.js and 1 other location - About 1 hr to fix
src/applications/avs/utils/medications/index.js on lines 30..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 66.

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

      {showMebLettersMaintenanceAlert && (
        <va-alert
          close-btn-aria-label="Close notification"
          status="error"
          visible
src/applications/education-letters/components/LetterResults.jsx on lines 22..35

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

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

    if (
      headerFixed &&
      !hasScrollTo &&
      scrollHeaderRef.current.scrollLeft !== scrollPageRef.current.scrollLeft
    ) {
Severity: Major
Found in src/applications/gi/containers/ComparePage.jsx and 1 other location - About 1 hr to fix
src/applications/gi/containers/ComparePage.jsx on lines 162..170

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

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

const faqBlock6 = (
  <section className="hca-enrollment-faq" data-testid="hca-enrollment-faq-6">
    <h3>How do I submit this information to VA?</h3>
    <p>
      Please {callOurTeam} for directions on how to submit your information.{' '}
src/applications/hca/components/IntroductionPage/EnrollmentStatus/ContentBlocks/GeneralFAQs.jsx on lines 74..83

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

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 const selectVaRadio = (container, value, selector = 'va-radio') => {
  const changeEvent = new CustomEvent('selected', {
    detail: { value },
  });
  $(selector, container).__events.vaValueChange(changeEvent);
Severity: Major
Found in src/applications/mhv-secure-messaging/util/testUtils.js and 1 other location - About 1 hr to fix
src/applications/mhv-secure-messaging/util/testUtils.js on lines 31..36

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

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

    attributes: PropTypes.shape({
      createdAt: PropTypes.string.isRequired,
      dismissed: PropTypes.bool.isRequired,
      templateId: PropTypes.string.isRequired,
      vaProfileId: PropTypes.string.isRequired,
src/applications/vaos/appointment-list/components/ConfirmedAppointmentDetailsPage/AtlasLocation.jsx on lines 42..47

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

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

const faqBlock4 = (
  <section className="hca-enrollment-faq" data-testid="hca-enrollment-faq-4">
    <h3>Do any VA medical centers treat CHAMPVA recipients?</h3>
    <p>
      Yes. To learn more about VA medical centers that offer services to CHAMPVA
src/applications/hca/components/IntroductionPage/EnrollmentStatus/ContentBlocks/GeneralFAQs.jsx on lines 94..102

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

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

      <SaveStatus
        isLoggedIn={user.login.currentlyLoggedIn}
        showLoginModal={this.props.showLoginModal}
        toggleLoginModal={this.props.toggleLoginModal}
        form={form}
Severity: Major
Found in src/platform/forms/save-in-progress/RoutedSavablePage.jsx and 1 other location - About 1 hr to fix
src/platform/forms/save-in-progress/RoutedSavableReviewPage.jsx on lines 84..90

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

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

  useEffect(
    () => {
      if (record) {
        focusElement(document.querySelector('h1'));
        updatePageTitle(`${record.name} - ${pageTitles.VACCINES_PAGE_TITLE}`);
src/applications/mhv-medical-records/containers/AllergyDetails.jsx on lines 66..74

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

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 const selectVaSelect = (container, value, selector = 'va-select') => {
  const changeEvent = new CustomEvent('vaSelect', {
    detail: { value },
  });
  $(selector, container).__events.vaSelect(changeEvent);
Severity: Major
Found in src/applications/mhv-secure-messaging/util/testUtils.js and 1 other location - About 1 hr to fix
src/applications/mhv-secure-messaging/util/testUtils.js on lines 48..53

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

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

        address: PropTypes.shape({
          line: PropTypes.array.isRequired,
          city: PropTypes.string.isRequired,
          state: PropTypes.string.isRequired,
          postalCode: PropTypes.string.isRequired,
src/applications/personalization/dashboard/components/notifications/TestNotification.jsx on lines 54..59

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

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

  render() {
    const { user, form, formConfig, route } = this.props;
    const finishAppLaterMessage =
      formConfig?.customText?.finishAppLaterMessage ||
      FINISH_APP_LATER_DEFAULT_MESSAGE;
Severity: Minor
Found in src/platform/forms/save-in-progress/RoutedSavablePage.jsx - About 1 hr to fix

    Function addFocusBehaviorToCrisisLineModal has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function addFocusBehaviorToCrisisLineModal() {
      const overlay = document.getElementById('modal-crisisline');
      const modal = document.querySelector('.va-crisis-panel.va-modal-inner');
      const tabbableElements = getTabbableElements(modal);
      let openControl;
    Severity: Minor
    Found in src/platform/site-wide/accessible-VCL-modal.js - About 1 hr to fix

      Function HealthcareModalContent has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function HealthcareModalContent() {
        return (
          <>
            <p>
              <strong>Respondent Burden:</strong> This information is collected in

        Function titleUI has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const titleUI = (titleOption, descriptionOption) => {
          const {
            title,
            description,
            headerLevel,

          Function itemPage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            pageBuilder.itemPage = pageConfig => {
              const requiredOpts = ['title', 'path', 'uiSchema', 'schema'];
              verifyRequiredPropsPageConfig('itemPage', requiredOpts, pageConfig);
              const { onNavBack, onNavForward } = getNavItem(pageConfig.path);
          
          

            Function schema has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const schema = optionalFields => {
              const s = {
                type: 'object',
                properties: {
                  bankAccount: {
            Severity: Minor
            Found in src/platform/forms-system/src/js/definitions/directDeposit.jsx - About 1 hr to fix

              Function determineResultsPage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const determineResultsPage = (formResponses, router) => {
                const responseToServicePeriod = getServicePeriodResponse(formResponses);
                const { RESULTS_4 } = SHORT_NAME_MAP;
              
                const resultsPages = DISPLAY_CONDITIONS?.RESULTS;
              Severity: Minor
              Found in src/applications/pact-act/utilities/display-logic-results.js - About 1 hr to fix

                Function updateData has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function updateData(oldForm, newForm) {
                  const updatedForm = newForm;
                  checkBoxElements.forEach(elementName => {
                    // For each checkBoxGroup in the form, get the number of selected elements before and after the current event
                    const oldSelectedCount = Object.keys(oldForm[elementName]).filter(
                Severity: Minor
                Found in src/applications/coronavirus-research/sign-up/config/formHelper.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language