department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

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

const OMBInfo = () => {
  const expDate = '07/31/2027';
  const ombNum = '2900-0091';
  const resBurden = '27';
  return (
Severity: Major
Found in src/applications/ezr/components/IntroductionPage/OMBInfo.jsx and 1 other location - About 6 hrs to fix
src/applications/_mock-form-ae-design-patterns/shared/components/OMBInfo.jsx on lines 3..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 172.

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 OMBInfo = () => {
  const expDate = '07/31/2027';
  const ombNum = '2900-0091';
  const resBurden = '27';
  return (
src/applications/ezr/components/IntroductionPage/OMBInfo.jsx on lines 3..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 172.

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 parseDateToDateObj = (date, template) => {
  let newDate = date;
  if (typeof date === 'string') {
    if (date.includes('T')) {
      newDate = parseISO((date || '').split('T')[0]);
src/applications/appeals/shared/utils/dates.js on lines 10..24

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

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 parseDateToDateObj = (date, template) => {
  let newDate = date;
  if (typeof date === 'string') {
    if (date.includes('T')) {
      newDate = parseISO((date || '').split('T')[0]);
Severity: Major
Found in src/applications/appeals/shared/utils/dates.js and 1 other location - About 6 hrs to fix
src/applications/_mock-form-ae-design-patterns/utils/dates.js on lines 13..27

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

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 applicantMedicarePartDCardsUploadUiSchema = {
  applicants: {
    'ui:options': { viewField: ApplicantField },
    items: {
      ...titleUI(
src/applications/ivc-champva/10-10D/components/Applicant/applicantFileUpload.js on lines 268..299

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

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 applicantMedicarePartAPartBCardsUploadUiSchema = {
  applicants: {
    'ui:options': { viewField: ApplicantField },
    items: {
      ...titleUI(
src/applications/ivc-champva/10-10D/components/Applicant/applicantFileUpload.js on lines 306..337

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

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

  render() {
    const {
      activeEditView,
      fieldName,
      isEmpty,

    Function DebtDetails has 171 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const DebtDetails = () => {
      const { selectedDebt, debts } = useSelector(
        ({ combinedPortal }) => combinedPortal.debtLetters,
      );
      const approvedLetterCodes = ['100', '101', '102', '109', '117', '123', '130'];

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

        render() {
          const {
            activeEditView,
            fieldName,
            isEmpty,

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

          render() {
            const { supplies, order, eligibility } = this.props;
            const currentDate = moment();
            const batterySupplies = supplies.filter(
              batterySupply => batterySupply.productGroup === BATTERY,
        Severity: Major
        Found in src/applications/disability-benefits/2346/components/Batteries.jsx - About 6 hrs to fix

          Function Navigation has 171 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const Navigation = () => {
            const [isMobile, setIsMobile] = useState(true);
            const [isNavigationOpen, setIsNavigationOpen] = useState(false);
            const location = useLocation();
            const activeFolder = useSelector(folder);
          Severity: Major
          Found in src/applications/mhv-secure-messaging/components/Navigation.jsx - About 6 hrs to fix

            Function submitFiles has 171 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function submitFiles(claimId, trackedItem, files) {
              let filesComplete = 0;
              let bytesComplete = 0;
              let hasError = false;
              const totalSize = files.reduce((sum, file) => sum + file.file.size, 0);
            Severity: Major
            Found in src/applications/claims-status/actions/index.js - About 6 hrs to fix

              File Dashboard.jsx has 451 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { useEffect, useState } from 'react';
              import PropTypes from 'prop-types';
              import { connect, useDispatch, useSelector } from 'react-redux';
              import isEmpty from 'lodash/isEmpty';
              
              
              Severity: Minor
              Found in src/applications/personalization/dashboard/components/Dashboard.jsx - About 6 hrs to fix

                Function uiSchema has 170 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function uiSchema(
                  label = 'Address',
                  useStreet3 = false,
                  isRequired = null,
                  ignoreRequired = false,
                Severity: Major
                Found in src/platform/forms/definitions/address.js - About 6 hrs to fix

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

                  import React from 'react';
                  import get from '@department-of-veterans-affairs/platform-forms-system/get';
                  import fullSchemaBurials from 'vets-json-schema/dist/21P-530V2-schema.json';
                  import { externalServices } from '@department-of-veterans-affairs/platform-monitoring/DowntimeNotification';
                  import FormFooter from '@department-of-veterans-affairs/platform-forms/FormFooter';
                  Severity: Minor
                  Found in src/applications/burials-ez/config/form.js - About 6 hrs to fix

                    File pdfConfigs.js has 450 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import {
                      createNoDescriptionText,
                      createOriginalFillRecord,
                      dateFormat,
                      processList,
                    Severity: Minor
                    Found in src/applications/mhv-medications/util/pdfConfigs.js - About 6 hrs to fix

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

                                      {!hasVisibleError &&
                                        !showPasswordInput &&
                                        get('properties.attachmentId', itemSchema) && (
                                          <Tag className="schemaform-file-attachment review">
                                            <SchemaField
                      Severity: Major
                      Found in src/platform/forms-system/src/js/fields/FileField.jsx and 3 other locations - About 6 hrs to fix
                      src/applications/appeals/shared/components/FileField.jsx on lines 540..559
                      src/applications/pre-need/components/FileField.jsx on lines 563..582
                      src/applications/simple-forms/40-0247/components/FileField.jsx on lines 568..587

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                                      {!hasVisibleError &&
                                        !showPasswordInput &&
                                        get('properties.attachmentId', itemSchema) && (
                                          <Tag className="schemaform-file-attachment review">
                                            <SchemaField
                      Severity: Major
                      Found in src/applications/pre-need/components/FileField.jsx and 3 other locations - About 6 hrs to fix
                      src/applications/appeals/shared/components/FileField.jsx on lines 540..559
                      src/applications/simple-forms/40-0247/components/FileField.jsx on lines 568..587
                      src/platform/forms-system/src/js/fields/FileField.jsx on lines 577..596

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                                      {!hasVisibleError &&
                                        !showPasswordInput &&
                                        get('properties.attachmentId', itemSchema) && (
                                          <Tag className="schemaform-file-attachment review">
                                            <SchemaField
                      Severity: Major
                      Found in src/applications/appeals/shared/components/FileField.jsx and 3 other locations - About 6 hrs to fix
                      src/applications/pre-need/components/FileField.jsx on lines 563..582
                      src/applications/simple-forms/40-0247/components/FileField.jsx on lines 568..587
                      src/platform/forms-system/src/js/fields/FileField.jsx on lines 577..596

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

                      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

                        useEffect(
                          () => {
                            // how sure are we that people will always enter 5 digits for their zipcode?
                            if (props.zipcode && props.zipcode.length === 5) {
                              isLoading(true);
                      src/applications/coronavirus-research/sign-up/config/va-location/DynamicRadioWidget.jsx on lines 29..51

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

                      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