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

    {
      id: '20abc6741c00ac67b6cbf6b972d084c1',
      type: 'va_appointments',
      attributes: {
        startDate: formatISO(addDays(Date.now(), 2)),
src/applications/personalization/dashboard/utils/mocks/appointments/MOCK_VA_APPOINTMENTS_OVER_30_DAYS.js on lines 232..258

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

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

    {
      id: '00abc6741c00ac67b6cbf6b972d084z0',
      type: 'va_appointments',
      attributes: {
        startDate: formatISO(addDays(Date.now(), 36)),
src/applications/personalization/dashboard/utils/mocks/appointments/MOCK_VA_APPOINTMENTS.js on lines 205..231

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

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 applicantHasMedicareDSchema = {
  uiSchema: {
    ...titleUI(
      ({ formData }) =>
        `${nameWording(
src/applications/ivc-champva/10-7959C/chapters/medicareInformation.js on lines 30..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 140.

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

                  <ul className="vads-u-margin-top--0 vads-u-margin-bottom--0 vads-u-padding-bottom--0">
                    <li>
                      <a
                        href="https://www.va.gov/asistencia-y-recursos-en-espanol"
                        lang="es"
src/applications/proxy-rewrite/partials/desktop/footer/index.jsx on lines 54..82

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

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 function selectAppointmentDetails(appointment) {
  if (!appointment) return '';

  if (appointment.version === 2) {
    return appointment.comment ? appointment.comment : 'none';
Severity: Major
Found in src/applications/vaos/appointment-list/redux/selectors.js and 1 other location - About 5 hrs to fix
src/applications/vaos/appointment-list/redux/selectors.js on lines 228..242

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

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

    {
      id: '00abc6741c00ac67b6cbf6b972d084z0',
      type: 'va_appointments',
      attributes: {
        startDate: formatISO(addDays(Date.now(), 3)),
src/applications/personalization/dashboard/utils/mocks/appointments/MOCK_VA_APPOINTMENTS_OVER_30_DAYS.js on lines 205..231

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

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 renderScholarshipsAndOtherVAFunding = () => {
    if (hideScholarshipsAndOtherVAFunding()) return null;
    const name = 'Scholarships and other VA funding';

    return (
src/applications/gi/components/profile/CalculateYourBenefitsForm.jsx on lines 1124..1145

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

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 exportsFile.js has 385 lines of code (exceeds 250 allowed). Consider refactoring.
Open

export {
  selectUser,
  isLoggedIn,
  selectProfile,
  isVAPatient,
Severity: Minor
Found in src/platform/user/exportsFile.js - About 5 hrs to fix

    File ProfilePageHeader.jsx has 385 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import PropTypes from 'prop-types';
    import React, { useState } from 'react';
    import { connect } from 'react-redux';
    import _ from 'lodash';
    import classNames from 'classnames';
    Severity: Minor
    Found in src/applications/gi/containers/ProfilePageHeader.jsx - About 5 hrs to fix

      File constants.js has 384 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /* eslint-disable camelcase */
      /* eslint-disable no-restricted-syntax */
      
      export const PAGE_TITLE = 'GI Bill® CT Redesign Sandbox';
      
      
      Severity: Minor
      Found in src/applications/gi/constants.js - About 5 hrs to fix

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

          render() {
            const { location } = this.props;
        
            if (!location) {
              return null;
        Severity: Major
        Found in src/applications/facility-locator/components/AppointmentInfo.jsx - About 5 hrs to fix

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

            render() {
              const {
                benefitSummaryOptions,
                requestOptions,
                isVeteran,
          Severity: Major
          Found in src/applications/letters/containers/VeteranBenefitSummaryLetter.jsx - About 5 hrs to fix

            Function ConfirmedAppointmentDetailsPage has 130 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function ConfirmedAppointmentDetailsPage() {
              const dispatch = useDispatch();
              const { id } = useParams();
              const {
                appointment,

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

              export const contactInfoValidation = (errors = {}, _fieldData, formData) => {
                const { veteran = {}, homeless } = formData || {};
                if (!veteran.email) {
                  errors.addError?.('You must add an email address to your profile');
                }
              Severity: Major
              Found in src/applications/appeals/testing/hlr/validations/index.js and 1 other location - About 5 hrs to fix
              src/applications/appeals/996/validations/index.js on lines 49..60

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

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

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

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

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

              Refactorings

              Further Reading

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

              function FormFooter({ formConfig }) {
                const GetFormHelp = formConfig.getHelp;
              
                if (!GetFormHelp) {
                  return null;
              Severity: Major
              Found in src/applications/pre-need-integration/components/Footer.jsx and 1 other location - About 5 hrs to fix
              src/applications/pre-need/components/Footer.jsx on lines 10..29

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

              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 contactInfoValidation = (errors = {}, _fieldData, formData) => {
                const { veteran = {}, homeless } = formData || {};
                if (!veteran.email) {
                  errors.addError?.('You must add an email address to your profile');
                }
              Severity: Major
              Found in src/applications/appeals/996/validations/index.js and 1 other location - About 5 hrs to fix
              src/applications/appeals/testing/hlr/validations/index.js on lines 22..33

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

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

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

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

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

              Refactorings

              Further Reading

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

              function FormFooter({ formConfig }) {
                const GetFormHelp = formConfig.getHelp;
              
                if (!GetFormHelp) {
                  return null;
              Severity: Major
              Found in src/applications/pre-need/components/Footer.jsx and 1 other location - About 5 hrs to fix
              src/applications/pre-need-integration/components/Footer.jsx on lines 10..29

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

              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

                    <VaRadio
                      class="vads-u-margin-y--2"
                      label={label}
                      onVaValueChange={onValueChange}
                    >
              src/applications/disability-benefits/wizard/pages/start.jsx on lines 28..45

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

              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

                  <VaRadio
                    class="vads-u-margin-y--2"
                    label={label}
                    onVaValueChange={onValueChange}
                  >
              Severity: Major
              Found in src/applications/disability-benefits/wizard/pages/start.jsx and 1 other location - About 5 hrs to fix
              src/applications/disability-benefits/wizard/pages/appeals.jsx on lines 37..54

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

              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 ProfileInformationEditView.jsx has 383 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { Component } from 'react';
              import PropTypes from 'prop-types';
              import { connect } from 'react-redux';
              
              import { focusElement } from 'platform/utilities/ui';
                Severity
                Category
                Status
                Source
                Language