department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,673 of 12,673 total issues

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

      <div
        className="vads-u-border-color--gray-lighter
            vads-u-color-gray-dark
            vads-u-display--flex
            vads-u-flex-direction--column
src/applications/personalization/profile/components/direct-deposit/vye/containers/ChangeOfAddressWrapper.jsx on lines 224..316

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

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

      <div
        className="vads-u-border-color--gray-lighter
            vads-u-color-gray-dark
            vads-u-display--flex
            vads-u-flex-direction--column
src/applications/verify-your-enrollment/containers/ChangeOfAddressWrapper.jsx on lines 241..333

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

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

import React from 'react';
import { merge } from 'lodash';
import PropTypes from 'prop-types';
import get from 'platform/utilities/data/get';
import omit from 'platform/utilities/data/omit';
Severity: Major
Found in src/applications/pre-need-integration/utils/helpers.js - About 3 days to fix

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

    class IntroductionPage extends React.Component {
      componentDidMount() {
        focusElement('.va-nav-breadcrumbs-list');
      }
    
    
    src/applications/edu-benefits/10215/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/10216/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/10282/containers/IntroductionPage.jsx on lines 7..87
    src/applications/edu-benefits/1919/containers/IntroductionPage.jsx on lines 7..91

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

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

    class IntroductionPage extends React.Component {
      componentDidMount() {
        focusElement('.va-nav-breadcrumbs-list');
      }
    
    
    src/applications/edu-benefits/10216/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/10282/containers/IntroductionPage.jsx on lines 7..87
    src/applications/edu-benefits/1919/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/8794/containers/IntroductionPage.jsx on lines 7..91

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

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

    class IntroductionPage extends React.Component {
      componentDidMount() {
        focusElement('.va-nav-breadcrumbs-list');
      }
    
    
    src/applications/edu-benefits/10215/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/10216/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/1919/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/8794/containers/IntroductionPage.jsx on lines 7..91

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

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

    class IntroductionPage extends React.Component {
      componentDidMount() {
        focusElement('.va-nav-breadcrumbs-list');
      }
    
    
    src/applications/edu-benefits/10215/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/10282/containers/IntroductionPage.jsx on lines 7..87
    src/applications/edu-benefits/1919/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/8794/containers/IntroductionPage.jsx on lines 7..91

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

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

    class IntroductionPage extends React.Component {
      componentDidMount() {
        focusElement('.va-nav-breadcrumbs-list');
      }
    
    
    src/applications/edu-benefits/10215/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/10216/containers/IntroductionPage.jsx on lines 7..91
    src/applications/edu-benefits/10282/containers/IntroductionPage.jsx on lines 7..87
    src/applications/edu-benefits/8794/containers/IntroductionPage.jsx on lines 7..91

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

    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 getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
      const missingInfo = [];
      // If both home & mobile selected, make only one phone required
      const phones = [keys.homePhone, '|', keys.mobilePhone];
      const eitherPhone =
    src/platform/forms-system/src/js/utilities/data/profile.js on lines 362..402

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

    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 getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
      const missingInfo = [];
      // If both home & mobile selected, make only one phone required
      const phones = [keys.homePhone, '|', keys.mobilePhone];
      const eitherPhone =
    Severity: Major
    Found in src/platform/forms-system/src/js/utilities/data/profile.js and 1 other location - About 3 days to fix
    src/applications/_mock-form-ae-design-patterns/utils/data/task-purple/profile.js on lines 362..402

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

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

    export function getStatusContents(appeal, name = {}) {
      const { status, aoj, programArea } = appeal.attributes;
      const appealType = appeal.type;
      const statusType = status.type || status;
      const details = status.details || {};
    Severity: Major
    Found in src/applications/claims-status/utils/appeals-v2-helpers.jsx - About 3 days to fix

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

      const Notice5103 = ({
        data = {},
        goBack,
        goForward,
        setFormData,
      Severity: Major
      Found in src/applications/appeals/995/components/Notice5103.jsx and 1 other location - About 2 days to fix
      src/applications/appeals/testing/sc/components/Notice5103.jsx on lines 15..87

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

      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 Notice5103 = ({
        data = {},
        goBack,
        goForward,
        setFormData,
      Severity: Major
      Found in src/applications/appeals/testing/sc/components/Notice5103.jsx and 1 other location - About 2 days to fix
      src/applications/appeals/995/components/Notice5103.jsx on lines 15..87

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

      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 BenefitType = ({ data = {}, error, setPageData }) => {
        useEffect(() => {
          setTimeout(() => {
            focusElement('#main h2');
          });
      Severity: Major
      Found in src/applications/appeals/995/subtask/pages/start.jsx and 1 other location - About 2 days to fix
      src/applications/appeals/testing/sc/subtask/pages/start.jsx on lines 48..123

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

      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 BenefitType = ({ data = {}, error, setPageData }) => {
        useEffect(() => {
          setTimeout(() => {
            focusElement('#main h2');
          });
      Severity: Major
      Found in src/applications/appeals/testing/sc/subtask/pages/start.jsx and 1 other location - About 2 days to fix
      src/applications/appeals/995/subtask/pages/start.jsx on lines 48..123

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

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

      import PropTypes from 'prop-types';
      import React, { useState } from 'react';
      import _ from 'lodash';
      import classNames from 'classnames';
      
      
      Severity: Major
      Found in src/applications/gi/components/profile/CalculateYourBenefitsForm.jsx - About 2 days to fix

        File moment-tz.js has 1126 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* istanbul ignore file */
        //! moment-timezone.js
        //! version : 0.5.25
        //! Copyright (c) JS Foundation and other contributors
        //! license : MIT
        Severity: Major
        Found in src/applications/personalization/dashboard/lib/moment-tz.js - About 2 days to fix

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

          const mapStateToProps = state => {
            const { featureToggles } = state;
            const selectedAddress = state.form?.data['view:currentAddress'];
            const shippingAddress = state.form?.data[selectedAddress];
            const { fullName, vetEmail, order, supplies } = state.form?.data;
          src/applications/disability-benefits/2346/containers/ConfirmationPage.jsx on lines 315..374

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

          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 mapStateToProps = state => {
            const { featureToggles } = state;
            const selectedAddress = state.form?.data['view:currentAddress'];
            const shippingAddress = state.form?.data[selectedAddress];
            const { fullName, vetEmail, order, supplies } = state.form?.data;
          src/applications/health-care-supply-reordering/containers/ConfirmationPage.jsx on lines 315..374

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

          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

              {
                id: 'c3e3e32701e23fdf389c06eae00fcb24',
                type: 'va_appointments',
                attributes: {
                  startDate: formatISO(addDays(Date.now(), 35)),
          src/applications/personalization/dashboard/utils/mocks/appointments/MOCK_VA_APPOINTMENTS_OVER_30_DAYS.js on lines 5..120

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

          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