department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

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

const contestableIssues = {
  uiSchema: {
    'ui:title': ' ',
    'ui:options': {
      itemName: 'issues eligible for review',
Severity: Major
Found in src/applications/appeals/996/pages/contestableIssues.js and 2 other locations - About 7 hrs to fix
src/applications/appeals/10182/pages/contestableIssues.js on lines 12..53
src/applications/appeals/testing/hlr/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 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

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

const contestableIssues = {
  uiSchema: {
    'ui:title': ' ',
    'ui:options': {
      itemName: 'issues eligible for review',
Severity: Major
Found in src/applications/appeals/10182/pages/contestableIssues.js and 2 other locations - About 7 hrs to fix
src/applications/appeals/996/pages/contestableIssues.js on lines 11..52
src/applications/appeals/testing/hlr/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 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

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

const contestableIssues = {
  uiSchema: {
    'ui:title': ' ',
    'ui:options': {
      itemName: 'issues eligible for review',
src/applications/appeals/10182/pages/contestableIssues.js on lines 12..53
src/applications/appeals/996/pages/contestableIssues.js on lines 11..52

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

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

export const getForm4142 = formData => {
  const { privacyAgreementAccepted = true, limitedConsent = '' } = formData;
  const providerFacility = (formData?.providerFacility || []).reduce(
    (list, facility) => {
      if (!hasDuplicateFacility(list, facility)) {
Severity: Major
Found in src/applications/appeals/995/utils/submit.js and 1 other location - About 7 hrs to fix
src/applications/appeals/testing/sc/utils/submit.js on lines 284..314

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

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

export const MEDAL_AWARD_DESCRIPTION = Object.freeze(
  <div>
    <p>
      You’ll need to scan your document onto the device you’re using to submit
      this application, such as your computer, tablet, or mobile phone. You can
Severity: Major
Found in src/applications/simple-forms/20-10207/config/constants.js and 1 other location - About 7 hrs to fix
src/applications/simple-forms/20-10207/config/constants.js on lines 478..508

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

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

export const getForm4142 = formData => {
  const {
    evidencePrivacyAgreementAccepted = true,
    limitedConsent = '',
  } = formData;
Severity: Major
Found in src/applications/appeals/testing/sc/utils/submit.js and 1 other location - About 7 hrs to fix
src/applications/appeals/995/utils/submit.js on lines 284..311

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

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

export const POW_DESCRIPTION = Object.freeze(
  <div>
    <p>
      You’ll need to scan your document onto the device you’re using to submit
      this application, such as your computer, tablet, or mobile phone. You can
Severity: Major
Found in src/applications/simple-forms/20-10207/config/constants.js and 1 other location - About 7 hrs to fix
src/applications/simple-forms/20-10207/config/constants.js on lines 510..537

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

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

export function uiSchema() {
  const topicChangeSelector = createSelector(
    ({ formData }) => get(['topic'].concat('levelOne'), formData),
    ({ formData }) => get(['topic'].concat('levelTwo'), formData),
    ({ topicSchema }) => topicSchema,
Severity: Major
Found in src/applications/ask-a-question/form/inquiry/topic/topic.js - About 7 hrs to fix

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

    export const forceV2Migration = data => {
      const formData = { ...data };
    
      // Remove sameOffice
      delete formData.sameOffice;
    src/applications/appeals/testing/hlr/migrations/01-lighthouse-v2-updates.js on lines 5..30

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

    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 forceV2Migration = data => {
      const formData = { ...data };
    
      // Remove sameOffice
      delete formData.sameOffice;
    src/applications/appeals/996/migrations/01-lighthouse-v2-updates.js on lines 5..30

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

    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 inboxMessages.js has 470 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const { sub, formatISO } = require('date-fns');
    
    const inboxMessages = {
      data: [
        {
    Severity: Minor
    Found in src/platform/mhv/api/mocks/secure-messaging/messages/inboxMessages.js - About 7 hrs to fix

      File address-schema.js has 470 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)

        Function ConfirmationPage has 182 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const ConfirmationPage = props => {
          useLayoutEffect(() => {
            focusElement('h2', null, 'va-alert');
            scrollToTop('topScrollElement');
          }, []);
        Severity: Major
        Found in src/applications/simple-forms/21-0966/containers/ConfirmationPage.jsx - About 7 hrs to fix

          File actions.js has 470 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
            selectVAPResidentialAddress,
            selectVAPEmailAddress,
            selectVAPHomePhoneString,
            selectVAPMobilePhoneString,
          Severity: Minor
          Found in src/applications/vaos/covid-19-vaccine/redux/actions.js - About 7 hrs to fix

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

            const notRequiredPrivateEvidence = {
              type: 'object',
              required: [],
              properties: {
                providerFacilityName: {
            Severity: Major
            Found in src/applications/appeals/995/pages/evidencePrivateRecords.js and 1 other location - About 7 hrs to fix
            src/applications/appeals/testing/sc/pages/evidencePrivateRecords.js on lines 74..122

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

            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

              shouldComponentUpdate(nextProps, nextState) {
                if (
                  nextProps.reviewMode &&
                  !nextProps.editModeOnReviewPage &&
                  nextProps.reviewMode === this.props.reviewMode &&
            Severity: Major
            Found in src/platform/forms-system/src/js/components/SchemaForm.jsx and 1 other location - About 7 hrs to fix
            src/applications/_mock-form-ae-design-patterns/patterns/pattern1/TaskPurple/SchemaForm.jsx on lines 79..95

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

            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

              shouldComponentUpdate(nextProps, nextState) {
                if (
                  nextProps.reviewMode &&
                  !nextProps.editModeOnReviewPage &&
                  nextProps.reviewMode === this.props.reviewMode &&
            src/platform/forms-system/src/js/components/SchemaForm.jsx on lines 76..92

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

            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 notRequiredPrivateEvidence = {
              type: 'object',
              required: [],
              properties: {
                providerFacilityName: {
            src/applications/appeals/995/pages/evidencePrivateRecords.js on lines 74..122

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

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

              render() {
                const { route, userIdVerified, userLoggedIn } = this.props;
                const { formConfig, pageList } = route;
            
                return (
            Severity: Major
            Found in src/applications/simple-forms/21-0966/containers/IntroductionPage.jsx - About 7 hrs to fix

              Function PrimaryAddressWithAutofill has 181 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const PrimaryAddressWithAutofill = props => {
                const {
                  errorSchema,
                  formContext,
                  formData,
                Severity
                Category
                Status
                Source
                Language