department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,835 of 12,835 total issues

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

  toxicExposure: {
    specifyOtherExposures: {
      startDate: currentOrPastDateUI({
        title: exposureStartDateApproximate,
      }),
src/applications/disability-benefits/all-claims/pages/toxicExposure/herbicideOtherLocations.js on lines 34..53

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

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 id="vre-orientation-return">
        If you’re not sure this is the right form, you can{' '}
        <Link
          aria-describedby="vre-orientation-return"
          to="/start"
Severity: Major
Found in src/applications/vre/28-1900/containers/IntroductionPage.jsx and 1 other location - About 2 hrs to fix
src/applications/vre/28-1900/containers/IntroductionPage.jsx on lines 103..117

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

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 (sortField === 'SENDER_NAME') {
      if (sortOrder === 'DESC') {
        return b.attributes.senderName.localeCompare(a.attributes.senderName);
      }
      if (sortOrder === 'ASC') {
Severity: Major
Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js and 1 other location - About 2 hrs to fix
src/platform/mhv/api/mocks/secure-messaging/threads/index.js on lines 54..65

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

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

      it('renders custom header', () => {
        const { getByText } = render(
          <CheckInProvider>
            <ValidateDisplay header="foo" setDobError={setDobError} />
          </CheckInProvider>,
src/applications/check-in/components/pages/validate/ValidateDisplay.unit.spec.jsx on lines 42..50

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

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 (sortField === 'RECIPIENT_NAME') {
      if (sortOrder === 'DESC') {
        return b.attributes.recipientName.localeCompare(
          a.attributes.recipientName,
        );
Severity: Major
Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js and 1 other location - About 2 hrs to fix
src/platform/mhv/api/mocks/secure-messaging/threads/index.js on lines 47..65

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

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

            {debtCardContent.showRequestHelp && (
              <p>
                <a
                  aria-label="Request help with your debt"
                  className="vads-c-action-link--blue"
src/applications/combined-debt-portal/debt-letters/components/DebtDetailsCard.jsx on lines 69..83

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

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 schema = {
  type: 'object',
  properties: {
    childMarriage: {
      type: 'array',
src/applications/disability-benefits/686c-674-v2/config/chapters/report-child-stopped-attending-school/child-information/childInformation.js on lines 14..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 80.

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

  toxicExposure: {
    otherHerbicideLocations: {
      startDate: currentOrPastDateUI({
        title: startDateApproximate,
      }),
src/applications/disability-benefits/all-claims/pages/toxicExposure/specifyOtherExposures.js on lines 37..56

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

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

        <legend className="schemaform-block-title">
          <h3 className="vads-u-margin--0">
            {`${
              installmentContracts.length === index ? 'Add' : 'Update'
            } an installment contract or other debt`}
src/applications/financial-status-report/components/householdExpenses/CreditCardBill.jsx on lines 203..212

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

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

        recordEvent({
          event: 'view_search_results',
          'search-page-path': document.location.pathname,
          'search-query': name,
          'search-results-total-count': count,
Severity: Major
Found in src/applications/gi/containers/search/NameSearchResults.jsx and 1 other location - About 2 hrs to fix
src/platform/site-wide/user-nav/components/SearchMenu.jsx on lines 83..97

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

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

export function updateRequiredFields(schema, uiSchema, formData, index = null) {
  if (!uiSchema) {
    return schema;
  }

Severity: Major
Found in src/platform/forms-system/src/js/state/helpers.js - About 2 hrs to fix

    File results-set-1-page-2-dynamic-content.jsx has 260 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { Fragment } from 'react';
    import { BATCHES } from './question-batches';
    
    export const accordions = {
      [BATCHES.BURN_PITS]: [

      Function App has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const App = props => {
        const {
          children,
          features,
          fetchEnrollmentStatus,
      Severity: Major
      Found in src/applications/ezr/containers/App.jsx - About 2 hrs to fix

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

        const IntroductionPage = props => {
          const { route } = props;
          const { formConfig, pageList } = route;
        
          useEffect(

          Function applicantInsuranceTypeSchema has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function applicantInsuranceTypeSchema(isPrimary) {
            const keyname = isPrimary
              ? 'applicantPrimaryInsuranceType'
              : 'applicantSecondaryInsuranceType';
            return {

            File ChangeOfAddressForm.jsx has 260 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, { useEffect, useState } from 'react';
            import PropTypes from 'prop-types';
            import ADDRESS_DATA from 'platform/forms/address/data';
            import { validateAsciiCharacters } from 'platform/user/profile/vap-svc/util';
            import SchemaForm from '@department-of-veterans-affairs/platform-forms-system/SchemaForm';

              Function IdentityVerificationAlert has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const IdentityVerificationAlert = () => {
                const onVerifyEvent = recordEvent({ event: AUTH_EVENTS.VERIFY });
                return (
                  <div className="vads-u-margin-top--6 vads-u-margin-bottom--8 vads-l-grid-container large-screen:vads-u-padding-x--0">
                    <va-alert

                Function WarningExplanation has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const WarningExplanation = () => {
                  const { statusCode } = useSelector(selectEnrollmentStatus);
                
                  // Declare content blocks for use
                  const {

                  Function getListOfThreads has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  ) => async (dispatch, getState) => {
                    if (!update) {
                      dispatch({ type: Actions.Thread.IS_LOADING, payload: true });
                    }
                    try {
                  Severity: Major
                  Found in src/applications/mhv-secure-messaging/actions/threads.js - About 2 hrs to fix

                    Function fetchConfirmedFutureAppointments has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function fetchConfirmedFutureAppointments() {
                      return async dispatch => {
                        dispatch({
                          type: FETCH_CONFIRMED_FUTURE_APPOINTMENTS,
                        });
                    Severity: Major
                    Found in src/applications/personalization/appointments/actions/index.js - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language