department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

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

const RadioGroup = ({
  formError,
  formResponses,
  formValue,
  hint,
src/applications/toe/containers/ToeApp.jsx on lines 19..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 103.

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 (
    <VaModal
      id="eligibilityModal"
      status="warning"
      visible
src/applications/vaos/new-appointment/components/VAFacilityPage/EligibilityModal.jsx on lines 20..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 103.

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 (
    <VaModal
      id="eligibilityModal"
      status="warning"
      visible
src/applications/vaos/covid-19-vaccine/components/VAFacilityPage/EligibilityModal.jsx on lines 41..58

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

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 {
  uiSchema: {
    'ui:title': VetPersInfoUiTitle,
    veteranFullName: fullNameDeprecatedUI,
    veteranDateOfBirth: {
Severity: Major
Found in src/applications/simple-forms/21-10210/pages/vetPersInfo.js and 1 other location - About 3 hrs to fix
src/applications/simple-forms/21-10210/pages/claimantPersInfo.js on lines 8..30

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

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

        <SaveInProgressIntro
          headingLevel={2}
          formConfig={this.props.route.formConfig}
          prefillEnabled={this.props.route.formConfig.prefillEnabled}
          messages={this.props.route.formConfig.savedFormMessages}
src/applications/pre-need/components/IntroductionPage.jsx on lines 32..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 103.

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 (successMessage) {
    successSpanId = `${channelId}-success-message`;
    successSpan = (
      <NotificationStatusMessage
        id={successSpanId}
src/applications/personalization/profile/components/notification-settings/NotificationCheckbox.jsx on lines 37..48

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

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

File address.js has 308 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import get from 'platform/utilities/data/get';
import set from 'platform/utilities/data/set';
import unset from 'platform/utilities/data/unset';
import { createSelector } from 'reselect';

Severity: Minor
Found in src/applications/pre-need/definitions/address.js - About 3 hrs to fix

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

    import { VA_FORM_IDS } from 'platform/forms/constants';
    import environment from 'platform/utilities/environment';
    import FormFooter from 'platform/forms/components/FormFooter';
    import { externalServices } from 'platform/monitoring/DowntimeNotification';
    import {
    Severity: Minor
    Found in src/applications/caregivers/config/form.js - About 3 hrs to fix

      File ChangeOfAddressWrapper.jsx has 308 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React, { useState, useEffect, useCallback } from 'react';
      import PropTypes from 'prop-types';
      import { useDispatch, useSelector } from 'react-redux';
      import { useLocation } from 'react-router-dom';
      import LoadingButton from '~/platform/site-wide/loading-button/LoadingButton';

        File AutosugggestField.jsx has 308 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import PropTypes from 'prop-types';
        import Downshift from 'downshift';
        import classNames from 'classnames';
        
        

          Function createSchoolSelectionPage has 84 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function createSchoolSelectionPage(schema, options) {
            const { fields, required, title } = options;
          
            const possibleUISchemaFields = {
              educationProgram: educationProgram.uiSchema,
          Severity: Major
          Found in src/applications/edu-benefits/pages/schoolSelection.js - About 3 hrs to fix

            Function filterEvents has 84 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const filterEvents = (
              events,
              filterBy,
              options = {},
              now = moment(),
            Severity: Major
            Found in src/applications/static-pages/events/helpers/index.js - About 3 hrs to fix

              Function GettingStartedWithVetTec has 84 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const GettingStartedWithVetTec = () => {
                return (
                  <div className="vads-u-padding-top--1 vads-u-padding-bottom--3 small-screen-font">
                    <div className="vads-u-padding-bottom--1px">
                      <h3 className="small-screen-font">
              Severity: Major
              Found in src/applications/gi/components/vet-tec/GettingStartedWithVetTec.jsx - About 3 hrs to fix

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

                  route: PropTypes.shape({
                    pageConfig: PropTypes.shape({
                      pageKey: PropTypes.string.isRequired,
                      schema: PropTypes.object.isRequired,
                      uiSchema: PropTypes.object.isRequired,
                src/applications/edu-benefits/0993/containers/FormPage.jsx on lines 160..171
                src/platform/forms/save-in-progress/RoutedSavablePage.jsx on lines 116..127

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

                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 3 locations. Consider refactoring.
                Open

                  route: PropTypes.shape({
                    pageConfig: PropTypes.shape({
                      pageKey: PropTypes.string.isRequired,
                      schema: PropTypes.object.isRequired,
                      uiSchema: PropTypes.object.isRequired,
                Severity: Major
                Found in src/platform/forms/save-in-progress/RoutedSavablePage.jsx and 2 other locations - About 3 hrs to fix
                src/applications/edu-benefits/0993/containers/FormPage.jsx on lines 160..171
                src/applications/edu-benefits/0993/containers/RoutedSavableFormPage.jsx on lines 94..105

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

                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 3 locations. Consider refactoring.
                Open

                  route: PropTypes.shape({
                    pageConfig: PropTypes.shape({
                      pageKey: PropTypes.string.isRequired,
                      schema: PropTypes.object.isRequired,
                      uiSchema: PropTypes.object.isRequired,
                Severity: Major
                Found in src/applications/edu-benefits/0993/containers/FormPage.jsx and 2 other locations - About 3 hrs to fix
                src/applications/edu-benefits/0993/containers/RoutedSavableFormPage.jsx on lines 94..105
                src/platform/forms/save-in-progress/RoutedSavablePage.jsx on lines 116..127

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

                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 const StudentNameHeader = ({ formData }) => {
                  const { first, last } = formData.studentNameAndSSN.fullName;
                  return (
                    <div>
                      <p className="vads-u-font-weight--bold vads-u-font-size--h3 vads-u-border-bottom--2px vads-u-border-color--primary vads-u-font-family--serif">
                src/applications/disability-benefits/686c-674/config/chapters/674/helpers.jsx on lines 3..12

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

                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 const formatAddress = address => {
                  const city = address?.city ?? '';
                  const stateCode = address?.stateCode ?? '';
                  const zipCode = address?.zipCode ?? '';
                
                
                Severity: Major
                Found in src/applications/verify-your-enrollment/helpers.jsx and 1 other location - About 3 hrs to fix
                src/applications/personalization/profile/components/direct-deposit/vye/helper.js on lines 39..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 102.

                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 4 locations. Consider refactoring.
                Open

                        {loggedIn && (
                          <p className="vads-u-margin-top--0p5">
                            <Link
                              id="edit-mobile-phone"
                              to="1/task-purple/veteran-information/edit-mobile-phone"
                src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/ContactInfo.jsx on lines 237..252
                src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/ContactInfo.jsx on lines 289..304
                src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/ContactInfo.jsx on lines 313..328

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

                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 4 locations. Consider refactoring.
                Open

                const summaryPage = {
                  uiSchema: {
                    'view:isAddingUnassociatedIncomes': arrayBuilderYesNoUI(
                      options,
                      {
                src/applications/income-and-asset-statement/config/chapters/04-associated-incomes/associatedIncomePages.js on lines 84..112
                src/applications/income-and-asset-statement/config/chapters/05-owned-assets/ownedAssetPages.js on lines 87..115
                src/applications/income-and-asset-statement/config/chapters/06-royalties-and-other-properties/royaltiesAndOtherPropertyPages.js on lines 91..120

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

                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

                Severity
                Category
                Status
                Source
                Language