department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

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

export function applicantInsuranceEobSchema(isPrimary) {
  const keyname = isPrimary ? 'applicantPrimaryEob' : 'applicantSecondaryEob';
  const provider = isPrimary
    ? 'applicantPrimaryProvider'
    : 'applicantSecondaryProvider';
src/applications/ivc-champva/10-7959C/chapters/healthInsuranceInformation.js on lines 176..219

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

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

// This Component is a close duplicate of the FileField provided by Platform.
/* eslint-disable jsx-a11y/no-noninteractive-element-to-interactive-role */
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
Severity: Minor
Found in src/applications/lgy/coe/form/config/chapters/documents/FileField.jsx - About 7 hrs to fix

    Function PrintDownload has 185 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const PrintDownload = props => {
      const { onDownload, isSuccess, list, onPrint, onText } = props;
      const [isError, setIsError] = useState(false);
    
      const [menuOpen, setMenuOpen] = useState(false);
    Severity: Major
    Found in src/applications/mhv-medications/components/shared/PrintDownload.jsx - About 7 hrs to fix

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

      export const filingDeadlineContent = (
        <>
          <p>
            You can submit this online form (VA Form 10182) to appeal a VA decision
            dated on or after February 19, 2019. The Board must receive your completed
      Severity: Major
      Found in src/applications/appeals/10182/content/FilingDeadlines.jsx and 1 other location - About 7 hrs to fix
      src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/content/FilingDeadlines.jsx on lines 4..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 183.

      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 filingDeadlineContent = (
        <>
          <p>
            You can submit this online form (VA Form 10182) to appeal a VA decision
            dated on or after February 19, 2019. The Board must receive your completed
      src/applications/appeals/10182/content/FilingDeadlines.jsx on lines 4..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 183.

      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

      const contestableIssues = {
        uiSchema: {
          'ui:title': ' ',
          'ui:options': {
            itemName: 'issues eligible for review',
      src/applications/appeals/995/pages/contestableIssues.js on lines 14..55

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

      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 getInput(input, uiSchema, schema) {
        if (input && input.widget === 'autosuggest') {
          return input.label;
        }
      
      
      src/platform/forms-system/src/js/fields/AutosuggestField.jsx on lines 13..38

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

      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

      const contestableIssues = {
        uiSchema: {
          'ui:title': ' ',
          'ui:options': {
            itemName: 'issues eligible for review',
      Severity: Major
      Found in src/applications/appeals/995/pages/contestableIssues.js and 1 other location - About 7 hrs to fix
      src/applications/appeals/testing/sc/pages/contestableIssues.js on lines 17..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 183.

      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 getInput(input, uiSchema, schema) {
        if (input && input.widget === 'autosuggest') {
          return input.label;
        }
      
      
      Severity: Major
      Found in src/platform/forms-system/src/js/fields/AutosuggestField.jsx and 1 other location - About 7 hrs to fix
      src/applications/pre-need-integration/components/AutosugggestField.jsx on lines 14..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 183.

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

      export const formatReadableDate = rawDate => {
        const months = [
          'January',
          'February',
          'March',
      src/applications/fry-dea/helpers.jsx on lines 34..67
      src/applications/toe/helpers.jsx on lines 42..75

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

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

      export const formatReadableDate = rawDate => {
        const months = [
          'January',
          'February',
          'March',
      Severity: Major
      Found in src/applications/toe/helpers.jsx and 2 other locations - About 7 hrs to fix
      src/applications/fry-dea/helpers.jsx on lines 34..67
      src/applications/survivor-dependent-education-benefit/22-5490/helpers.jsx on lines 45..78

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

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

      export const formatReadableDate = rawDate => {
        const months = [
          'January',
          'February',
          'March',
      Severity: Major
      Found in src/applications/fry-dea/helpers.jsx and 2 other locations - About 7 hrs to fix
      src/applications/survivor-dependent-education-benefit/22-5490/helpers.jsx on lines 45..78
      src/applications/toe/helpers.jsx on lines 42..75

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

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

      export const buildVAPrescriptionPDFList = prescription => {
        const refillHistory = [...(prescription?.rxRfRecords || [])];
        const originalFill = createOriginalFillRecord(prescription);
        refillHistory.push(originalFill);
      
      
      Severity: Major
      Found in src/applications/mhv-medications/util/pdfConfigs.js - About 7 hrs to fix

        File healthInsuranceInformation.js has 473 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import {
          titleUI,
          titleSchema,
          textUI,

          File index.unit.spec.js has 473 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import moment from 'moment-timezone';
          import { expect } from 'chai';
          import {
            addUniqueEventsToList,
            deriveDefaultSelectedOption,
          Severity: Minor
          Found in src/applications/static-pages/events/helpers/index.unit.spec.js - About 7 hrs to fix

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

            /**
             * The intent for this module is to provide a flexible, reusable address schema and widget that can be used in any form throughout VA.gov.
             * The address uiSchema should be flexible enough to handle these cases:
             * 1. Top level address property (schema.properties.address)
             * 2. Nested address property (schema.properties.someProperty.properties.address)

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

                const fetchDropDownSuggestions = async inputValue => {
                  // encode user input for query to suggestions url
                  const encodedInput = encodeURIComponent(inputValue);
              
                  // fetch suggestions
              Severity: Major
              Found in src/platform/site-wide/header/components/Search/index.js and 1 other location - About 7 hrs to fix
              src/platform/site-wide/user-nav/components/SearchMenu.jsx on lines 111..141

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

              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

                fetchDropDownSuggestions = async inputValue => {
                  // encode user input for query to suggestions url
                  const encodedInput = encodeURIComponent(inputValue);
              
                  // fetch suggestions
              Severity: Major
              Found in src/platform/site-wide/user-nav/components/SearchMenu.jsx and 1 other location - About 7 hrs to fix
              src/platform/site-wide/header/components/Search/index.js on lines 40..71

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

              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

                const handlers = {
                  onSubmit: event => {
                    // This prevents this nested form submit event from passing to the
                    // outer form and causing a page advance
                    event.stopPropagation();
              src/platform/forms-system/src/js/components/ContactInfo.jsx on lines 112..140

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

              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

                const handlers = {
                  onSubmit: event => {
                    // This prevents this nested form submit event from passing to the
                    // outer form and causing a page advance
                    event.stopPropagation();
              Severity: Major
              Found in src/platform/forms-system/src/js/components/ContactInfo.jsx and 1 other location - About 7 hrs to fix
              src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/ContactInfo.jsx on lines 100..128

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

              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