department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,805 of 12,805 total issues

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

    <VaCheckboxGroup
      label="Which sponsor's benefits would you like to use?"
      hint="Select all sponsors whose benefits you would like to apply for."
      onVaChange={onValueChange}
      required
Severity: Major
Found in src/applications/toe/components/SponsorsCheckboxGroup.jsx and 1 other location - About 4 hrs to fix
src/applications/toe/containers/SponsorsSelectionPage.jsx on lines 66..85

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

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 amountInput = (
      <div id={kickerFieldId}>
        <label htmlFor={kickerAmountId}>How much is your kicker?</label>
        <input
          inputMode="decimal"
src/applications/gi/components/profile/CalculateYourBenefitsForm.jsx on lines 940..957

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

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

          <li>
            <button
              data-dd-action-name={`${
                dataDogActionNames.shared.DOWNLOAD_A_PDF_OF_THIS
              }${list ? 'List' : 'Page'} Option - ${
src/applications/mhv-medications/components/shared/PrintDownload.jsx on lines 136..149

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

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 ADDITIONAL_INFO_OTHER_HOUSING_RISKS_3RD_PTY_VET = Object.freeze(
  <va-additional-info
    trigger="What to know before sharing details about other housing risks"
    data-testid="otherHousingRisksAdditionalInfo3rdPtyVet"
  >
Severity: Major
Found in src/applications/simple-forms/20-10207/config/constants.js and 1 other location - About 4 hrs to fix
src/applications/simple-forms/20-10207/config/constants.js on lines 237..259

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

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="row small-collapse vads-u-display--flex vads-u-align-items--center">
                    <div className="vads-u-flex--fill">
                      <ViewField
                        formData={item}
                        onEdit={() => this.handleEdit(index)}
src/platform/forms-system/src/js/fields/ArrayField.jsx on lines 535..550

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

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

  const renderResultItems = (searchQuery, apiResults) => {
    return apiResults?.map((result, index) => {
      let item;
      const showHealthConnectNumber = isHealthAndHealthConnect(result, query);

Severity: Major
Found in src/applications/facility-locator/components/ResultsList.jsx - About 4 hrs to fix

    Function guardianInformation has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function guardianInformation(schema, options) {
      // Use the defaults as necessary, but override with the options given
      const { fields, required } = {
        ...defaults(),
        ...options,
    Severity: Major
    Found in src/applications/edu-benefits/1995/pages/guardianInformation.jsx - About 4 hrs to fix

      Function FacilityPatientSatisfactionScoresWidget has 112 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function FacilityPatientSatisfactionScoresWidget(props) {
        if (props.loading || !Object.keys(props.facility).length) {
          return (
            <va-loading-indicator message="Loading facility patient satisfaction scores..." />
          );

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

        export function prefillTransformerV1(pages, formData, metadata, state) {
          const bankInformation = state.data?.bankInformation || {};
          const claimant = state.data?.formData?.data?.attributes?.claimant || {};
          const contactInfo = claimant?.contactInfo || {};
          const sponsors = state.data?.formData?.attributes?.sponsors;
        Severity: Major
        Found in src/applications/toe/helpers.jsx - About 4 hrs to fix

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

            render() {
              const { idSchema, formContext, formData, uiSchema, schema } = this.props;
              const id = idSchema.$id;
          
              // wrap matching text in a <span> element

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

              render() {
                const {
                  deriveResultsEndNumber,
                  deriveResultsStartNumber,
                  onPageSelect,
            Severity: Major
            Found in src/applications/yellow-ribbon/containers/SearchResults/index.jsx - About 4 hrs to fix

              File address.js has 353 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';
              
              

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

                function handleClick(history, home, ccClosestCity) {
                  return e => {
                    // Stop default behavior for anchor tag since we are using React routing.
                    e.preventDefault();
                
                
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/PreferredLanguageSection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ContactDetailSection.jsx on lines 37..49
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ReasonForAppointmentSection.jsx on lines 9..22
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/VAAppointmentSection/TypeOfVisitSection.jsx on lines 10..22
                src/applications/vaos/new-appointment/components/ReviewPage/SelectedProviderSection.jsx on lines 11..23

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

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

                export function handleClick(history, home, visitType) {
                  return e => {
                    // Stop default behavior for anchor tag since we are using React routing.
                    e.preventDefault();
                
                
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/PreferredLanguageSection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/SchedulingFacilitySection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ContactDetailSection.jsx on lines 37..49
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ReasonForAppointmentSection.jsx on lines 9..22
                src/applications/vaos/new-appointment/components/ReviewPage/SelectedProviderSection.jsx on lines 11..23

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

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

                function handleClick(history, home, ccLanguage) {
                  return e => {
                    // Stop default behavior for anchor tag since we are using React routing.
                    e.preventDefault();
                
                
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/SchedulingFacilitySection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ContactDetailSection.jsx on lines 37..49
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ReasonForAppointmentSection.jsx on lines 9..22
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/VAAppointmentSection/TypeOfVisitSection.jsx on lines 10..22
                src/applications/vaos/new-appointment/components/ReviewPage/SelectedProviderSection.jsx on lines 11..23

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

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

                function handleClick(history, home, ccPreferences) {
                  return e => {
                    // Stop default behavior for anchor tag since we are using React routing.
                    e.preventDefault();
                
                
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/PreferredLanguageSection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/SchedulingFacilitySection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ContactDetailSection.jsx on lines 37..49
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ReasonForAppointmentSection.jsx on lines 9..22
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/VAAppointmentSection/TypeOfVisitSection.jsx on lines 10..22

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

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

                function handleClick(history, home, reasonForAppointment) {
                  return e => {
                    // Stop default behavior for anchor tag since we are using React routing.
                    e.preventDefault();
                
                
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/PreferredLanguageSection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/SchedulingFacilitySection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ContactDetailSection.jsx on lines 37..49
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/VAAppointmentSection/TypeOfVisitSection.jsx on lines 10..22
                src/applications/vaos/new-appointment/components/ReviewPage/SelectedProviderSection.jsx on lines 11..23

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

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

                function handleClick(history, home, contactInfo) {
                  return e => {
                    // Stop default behavior for anchor tag since we are using React routing.
                    e.preventDefault();
                
                
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/PreferredLanguageSection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/CommunityCareSection/SchedulingFacilitySection.jsx on lines 8..20
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/ReasonForAppointmentSection.jsx on lines 9..22
                src/applications/vaos/new-appointment/components/ReviewPage/ReviewRequestInfo/VAAppointmentSection/TypeOfVisitSection.jsx on lines 10..22
                src/applications/vaos/new-appointment/components/ReviewPage/SelectedProviderSection.jsx on lines 11..23

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

                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

                ConfirmationPage.propTypes = {
                  form: PropTypes.shape({
                    data: PropTypes.shape({
                      veteranInformation: PropTypes.shape({
                        fullName: PropTypes.shape({
                src/applications/disability-benefits/686c-674-v2/containers/ConfirmationPage.jsx on lines 183..200

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

                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

                ConfirmationPage.propTypes = {
                  form: PropTypes.shape({
                    data: PropTypes.shape({
                      veteranInformation: PropTypes.shape({
                        fullName: PropTypes.shape({
                src/applications/disability-benefits/686c-674/containers/ConfirmationPage.jsx on lines 199..216

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

                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