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

  if (
    requestReason === ELIGIBILITY_REASONS.notSupported &&
    directReason === ELIGIBILITY_REASONS.noRecentVisit
  ) {
    const monthRequirement = settings?.direct?.patientHistoryDuration
src/applications/vaos/new-appointment/components/VAFacilityPage/getEligibilityMessage.js on lines 67..113

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

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

function makeSchema(itemId) {
  return {
    type: 'object',
    properties: {
      toxicExposure: {
src/applications/disability-benefits/all-claims/pages/toxicExposure/herbicideDetails.js on lines 66..96

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

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

          {complaintRows.every(
            complaintType => complaintType.thisCampus === null,
          ) && (
            <div className="row">
              <div className="small-11 columns">
src/applications/gi/components/profile/CautionaryInformation.jsx on lines 242..253

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

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 claimAutoSchema = {
  uiSchema: {
    ...titleUI('Claim relation to an auto-related accident'),
    claimIsAutoRelated: yesNoUI({
      title:
src/applications/ivc-champva/10-7959a/chapters/claimInformation.js on lines 59..86

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

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

      case LOAD_STATUSES.clientFailure:
        content = (
          <div>
            <div className="usa-alert usa-alert-error background-color-only">
              We’re sorry, but we’re unable to connect to VA.gov. Please check
src/platform/forms/save-in-progress/SaveInProgressErrorPage.jsx on lines 98..113

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

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 createITF() {
  return dispatch => {
    dispatch({ type: ITF_CREATION_INITIATED });

    return apiRequest('/intent_to_file/compensation', { method: 'POST' })
src/applications/disability-benefits/all-claims/actions/index.js on lines 46..57

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

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

  } else if (requestReason === ELIGIBILITY_REASONS.noRecentVisit) {
    const monthRequirement = settings?.request?.patientHistoryDuration
      ? (settings.request.patientHistoryDuration / 365) * 12
      : '24';
    title = 'We can’t find a recent appointment for you';
src/applications/vaos/new-appointment/components/VAFacilityPage/getEligibilityMessage.js on lines 20..113

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

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

function makeSchema(locationId) {
  return {
    type: 'object',
    properties: {
      toxicExposure: {
src/applications/disability-benefits/all-claims/pages/toxicExposure/additionalExposuresDetails.js on lines 68..98

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

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 id="not-eligbile-details" aria-live="polite">
        <span className="sr-only">Info: </span>
        <p className="vads-u-margin-top--0">
          Based on your separation date, you’re not eligible to file for
          disability benefits right now.
src/applications/disability-benefits/all-claims/subtask/pages/unable-to-file-bdd.jsx on lines 38..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 115.

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

import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';

import {
Severity: Minor
Found in src/applications/appeals/995/components/EvidenceRecords.jsx - About 4 hrs to fix

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

    import environment from 'platform/utilities/environment';
    import commonDefinitions from 'vets-json-schema/dist/definitions.json';
    import { arrayBuilderPages } from 'platform/forms-system/src/js/patterns/array-builder';
    import manifest from '../manifest.json';
    import IntroductionPage from '../containers/IntroductionPage';

      File StatusDropdown.jsx has 332 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from 'react';
      import PropTypes from 'prop-types';
      import { dispStatusObj } from '../../util/constants';
      
      const StatusDropdown = props => {
      Severity: Minor
      Found in src/applications/mhv-medications/components/shared/StatusDropdown.jsx - About 4 hrs to fix

        Function render has 99 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
        Severity: Major
        Found in src/platform/forms-system/src/js/fields/AutosuggestField.jsx - About 3 hrs to fix

          Function GuardianInformation has 99 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/1990/pages/GuardianInformation.jsx - About 3 hrs to fix

            Function DependentSummary has 99 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

              const IntroductionPage = props => {
                const { route, isLoggedIn } = props;
                const { formConfig, pageList } = route;
              
                useEffect(
              Severity: Major
              Found in src/applications/ivc-champva/10-10D/containers/IntroductionPage.jsx - About 3 hrs to fix

                Function DependentSummary has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

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

                  Function confirmationFAQ has 99 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const confirmationFAQ = () => {
                    return (
                      <>
                        <section className="hca-confirmation-faq">
                          <h2>What to do if you have questions now</h2>
                  Severity: Major
                  Found in src/applications/hca/components/ConfirmationPage/ConfirmationFAQ.jsx - About 3 hrs to fix

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

                      render() {
                        const { searchTerm, ariaLive1, ariaLive2, filteredOptions } = this.state;
                        const autocompleteHelperText = `
                          When autocomplete results are available use up and down arrows to
                          review and enter to select. Touch device users, explore by touch or

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

                        render() {
                          const {
                            appealsLoading,
                            claimsLoading,
                            list,
                      Severity: Major
                      Found in src/applications/claims-status/containers/YourClaimsPageV2.jsx - About 3 hrs to fix
                        Severity
                        Category
                        Status
                        Source
                        Language