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

  return apiRequest(LH_MIGRATION__options.summaryEndpoint.path)
    .then(response => {
      // eslint-disable-next-line -- LH_MIGRATION
      const LH_MIGRATION__entryPointKeys = LH_MIGRATION__options.dataEntryPoint;
      // eslint-disable-next-line -- LH_MIGRATION
Severity: Major
Found in src/applications/letters/actions/letters.js and 1 other location - About 2 hrs to fix
src/applications/letters/actions/letters.js on lines 35..72

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

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

          <p>
            If you don’t receive your decision letter within a week after you
            apply, please don’t apply again. Call us at{' '}
            <va-telephone contact={CONTACTS['222_VETS']} /> (
            <va-telephone contact={CONTACTS['711']} tty />
src/applications/static-pages/ezr-submission-options/components/Descriptions/index.jsx on lines 6..15

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

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

  return apiRequest(LH_MIGRATION__options.listEndpoint.path)
    .then(response => {
      // eslint-disable-next-line -- LH_MIGRATION
      const LH_MIGRATION__entryPointKeys = LH_MIGRATION__options.dataEntryPoint;
      // eslint-disable-next-line -- LH_MIGRATION
Severity: Major
Found in src/applications/letters/actions/letters.js and 1 other location - About 2 hrs to fix
src/applications/letters/actions/letters.js on lines 78..93

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

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 isTest(path) {
  return (
    path.node.type === 'CallExpression' &&
    (path.node.callee.name === 'it' ||
      (path.node.callee.object?.name === 'it' &&
Severity: Major
Found in src/applications/vaos/scripts/gherkin.js and 1 other location - About 2 hrs to fix
src/applications/vaos/scripts/gherkin.js on lines 19..26

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

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

  medicationsListPage: {
    FILL_OR_REFILL_BUTTON: `Fill or Refill Button - ${pageType.LIST}`,
    MEDICATION_NAME_LINK_IN_CARD: `Medication Name Link In Card - ${
      pageType.LIST
    }`,
Severity: Major
Found in src/applications/mhv-medications/util/dataDogConstants.js and 1 other location - About 2 hrs to fix
src/applications/check-in/utils/storage/index.js on lines 9..15

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

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 default {
  uiSchema: {
    ...titleUI(
      'Veteran’s mailing address',
      'We’ll send any important information about this request to this address.',
src/applications/simple-forms/20-10207/pages/nonVeteranMailingAddressThirdPartyNonVeteran.js on lines 8..32

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

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 getCategories = () => async dispatch => {
  try {
    const response = await getMessageCategoryList();
    dispatch({
      type: Actions.Category.GET_LIST,
Severity: Major
Found in src/applications/mhv-secure-messaging/actions/categories.js and 1 other location - About 2 hrs to fix
src/applications/mhv-secure-messaging/actions/triageTeams.js on lines 4..16

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

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

    veteranPersonalInfoChapter: {
      title: ({ formData }) =>
        formData?.authorizerType === AUTHORIZER_TYPES.VETERAN
          ? 'Your personal information'
          : 'Veteran’s personal information',
Severity: Major
Found in src/applications/simple-forms/21-0845/config/form.js and 1 other location - About 2 hrs to fix
src/applications/simple-forms/21-0845/config/form.js on lines 174..189

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

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 sessionStorageKeys = {
    CURRENT_UUID: `${namespaces[app]}.current.uuid`,
    COMPLETE: `${namespaces[app]}.complete`,
    COMPLETE_TIMESTAMP: `${namespaces[app]}.complete.timestamp`,
    PROGRESS_STATE: `${namespaces[app]}.progress`,
Severity: Major
Found in src/applications/check-in/utils/storage/index.js and 1 other location - About 2 hrs to fix
src/applications/mhv-medications/util/dataDogConstants.js on lines 10..22

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 92.

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

FormTitle.propTypes = {
  id: PropTypes.string.isRequired,
  title: PropTypes.string.isRequired,
  currentPosition: PropTypes.number,
  formName: PropTypes.string,
Severity: Major
Found in src/applications/find-forms/components/FormTitle.jsx and 1 other location - About 2 hrs to fix
src/applications/vaos/components/TextareaWidget.jsx on lines 39..48

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

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

    veteranIdentificationInfoChapter: {
      title: ({ formData }) =>
        formData?.authorizerType === AUTHORIZER_TYPES.VETERAN
          ? 'Your identification information'
          : 'Veteran’s identification information',
Severity: Major
Found in src/applications/simple-forms/21-0845/config/form.js and 1 other location - About 2 hrs to fix
src/applications/simple-forms/21-0845/config/form.js on lines 158..173

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

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 getTriageTeams = () => async dispatch => {
  try {
    const response = await getTriageTeamList();
    dispatch({
      type: Actions.TriageTeam.GET_LIST,
Severity: Major
Found in src/applications/mhv-secure-messaging/actions/triageTeams.js and 1 other location - About 2 hrs to fix
src/applications/mhv-secure-messaging/actions/categories.js on lines 4..16

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

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

export const renderWhyMightIHaveThisDebt = deductionCode => {
  switch (deductionCode) {
    case '30':
      return (
        <section>

    File EvidenceVaRecords.jsx has 285 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useState, useEffect } from 'react';
    import { VaTextInput } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
    
    import { EVIDENCE_VA_PATH } from '../constants';
    import { content } from '../content/evidenceVaRecords';
    Severity: Minor
    Found in src/applications/appeals/995/components/EvidenceVaRecords.jsx - About 2 hrs to fix

      Function renderLocationInputField has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const renderLocationInputField = () => {
          const {
            locationChanged,
            searchString,
            geolocationInProgress,
      Severity: Major
      Found in src/applications/facility-locator/components/SearchControls.jsx - About 2 hrs to fix

        Function BuildPage has 71 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const BuildPage = props => {
          const { title, field, id, goToPath, subTitle } = props;
        
          const headerRef = useRef(null);
        
        

          Function selectConfirmedAppointmentData has 71 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function selectConfirmedAppointmentData(state, appointment) {
            const comment = selectComment(appointment);
            const isCommunityCare = appointment?.vaos?.isCommunityCare;
            const appointmentTypePrefix = isCommunityCare ? 'cc' : 'va';
          
          
          Severity: Major
          Found in src/applications/vaos/appointment-list/redux/selectors.js - About 2 hrs to fix

            File CalendarWidget.jsx has 285 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * Shared calendar widget component used by the VAOS application.
             * @module components/calendar
             */
            import React, { useState } from 'react';
            Severity: Minor
            Found in src/applications/vaos/components/calendar/CalendarWidget.jsx - About 2 hrs to fix

              Function CCRequest has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function CCRequest() {
                const pageTitle = useSelector(state => getPageTitle(state, pageKey));
              
                const { data, pageChangeInProgress } = useSelector(
                  state => getFormPageInfo(state, pageKey),

                Function claimDetailReducer has 71 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function claimDetailReducer(state = initialState, action) {
                  switch (action.type) {
                    case RESET_UPLOADS: {
                      return initialState;
                    }
                Severity: Major
                Found in src/applications/claims-status/reducers/uploads.js - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language