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

        {values?.relationship?.type === 'Other' && (
          <div className="vads-u-margin-y--3">
            <RadioGroup
              name="benefitsUnclaimedRemains"
              label="Are you seeking burial benefits for the unclaimed remains of a Veteran?"
Severity: Major
Found in src/applications/burial-poc-v6/pages/BurialAllowance.jsx and 1 other location - About 3 hrs to fix
src/applications/burial-poc-v6/pages/BurialAllowance.jsx on lines 89..101

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

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 additional info if provided', () => {
        const additionalInfo = <div data-testid="additional-info">FOO</div>;
        const { getByTestId } = render(
          <CheckInProvider>
            <ConfirmablePage additionalInfo={additionalInfo} />
src/applications/check-in/components/pages/ConfirmablePage/ConfirmablePage.unit.spec.jsx on lines 93..101

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

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

AddIncome.propTypes = {
  data: PropTypes.shape({
    additionalIncome: PropTypes.shape({
      addlIncRecords: PropTypes.arrayOf(
        PropTypes.shape({
src/applications/financial-status-report/components/otherAssets/AddAsset.jsx on lines 171..184

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

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 getFileSize = num => {
  if (num > 999999) {
    return `${(num / 1000000).toFixed(1)} MB`;
  }
  if (num > 999) {
Severity: Major
Found in src/applications/simple-forms/form-upload/helpers/index.js and 1 other location - About 3 hrs to fix
src/applications/mhv-secure-messaging/util/helpers.js on lines 251..259

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

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

            <button
              type="submit"
              data-e2e-id="sitewide-search-submit-button"
              className="vads-u-margin-right--0p5"
            >
Severity: Major
Found in src/platform/site-wide/user-nav/components/SearchMenu.jsx and 1 other location - About 3 hrs to fix
src/applications/search/containers/SearchApp.jsx on lines 387..405

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

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 SearchResult = ({
  representativeName,
  addressLine1,
  addressLine2,
  addressLine3,
src/applications/discharge-wizard/components/v2/questions/shared/Dropdown.jsx on lines 29..166

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

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

ResolutionExplainerWidget.propTypes = {
  contentAfterButtons: PropTypes.object,
  contentBeforeButtons: PropTypes.object,
  data: PropTypes.shape({
    reviewNavigation: PropTypes.bool,
src/applications/financial-status-report/components/householdExpenses/HouseholdExpensesExplainerWidget.jsx on lines 104..115

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

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

AddAsset.propTypes = {
  data: PropTypes.shape({
    assets: PropTypes.shape({
      otherAssets: PropTypes.arrayOf(
        PropTypes.shape({
src/applications/financial-status-report/components/householdIncome/AddIncome.jsx on lines 157..170

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

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 results-set-1-page-1-dynamic-content.jsx has 297 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { Fragment } from 'react';
import { RESPONSES, SHORT_NAME_MAP } from './question-data-map';
import { locationList as BurnPit211Locations } from '../containers/questions/burn-pit/BurnPit-2-1-1';
import { locationList as BurnPit212Locations } from '../containers/questions/burn-pit/BurnPit-2-1-2';
import { locationList as BurnPit213Locations } from '../containers/questions/burn-pit/BurnPit-2-1-3';

    File IntroductionPage.jsx has 297 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useEffect } from 'react';
    import PropTypes from 'prop-types';
    
    import { focusElement } from 'platform/utilities/ui';
    import FormTitle from 'platform/forms-system/src/js/components/FormTitle';
    Severity: Minor
    Found in src/applications/pensions/components/IntroductionPage.jsx - About 3 hrs to fix

      File reducer.js has 297 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import moment from 'moment';
      import set from 'platform/utilities/data/set';
      
      import {
        FETCH_FUTURE_APPOINTMENTS,
      Severity: Minor
      Found in src/applications/vaos/appointment-list/redux/reducer.js - About 3 hrs to fix

        Function Column has 78 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const Column = props => {
          const {
            mobileMediaQuery,
            data,
            keyName,
        Severity: Major
        Found in src/platform/site-wide/mega-menu/components/Column.jsx - About 3 hrs to fix

          Function ErrorLinks has 78 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ErrorLinks = props => {
            const { appType, testId, errors } = props;
            const errorRef = useRef(null);
            const [hadErrors, setHadErrors] = useState(false);
          
          
          Severity: Major
          Found in src/platform/forms-system/src/js/review/submit-states/ErrorLinks.jsx - About 3 hrs to fix

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

            export default function ConfirmationPage(props) {
              const { values } = useFormikContext();
            
              const benefits = {
                burialAllowance: values?.benefitsSelection?.burialAllowance,
            Severity: Major
            Found in src/applications/burial-poc-v6/pages/ConfirmationPage.jsx - About 3 hrs to fix

              Function updateProgramDetailsSchema has 78 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function updateProgramDetailsSchema() {
                const usaStates = states.USA.map(state => state.value);
                const usaLabels = states.USA.map(state => state.label);
                const canProvinces = states.CAN.map(state => state.value);
                const canLabels = states.CAN.map(state => state.label);
              Severity: Major
              Found in src/applications/edu-benefits/10203/helpers.jsx - About 3 hrs to fix

                Function transformForSubmit has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function transformForSubmit(formConfig, form) {
                  const transformedData = JSON.parse(
                    formsSystemTransformForSubmit(formConfig, form),
                  );
                
                
                Severity: Major
                Found in src/applications/ivc-champva/10-10D/config/submitTransformer.js - About 3 hrs to fix

                  Function getFormSchema has 78 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const getFormSchema = (formData = {}) => {
                    const defaultCountry =
                      countries.find(
                        country => country.countryCodeISO3 === formData?.countryCodeIso3,
                      )?.countryCodeISO3 || 'USA';

                    File ConfirmationPage.jsx has 296 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import React, { useEffect } from 'react';
                    import PropTypes from 'prop-types';
                    
                    import { utcToZonedTime, format } from 'date-fns-tz';
                    import { connect } from 'react-redux';
                    Severity: Minor
                    Found in src/applications/pensions/containers/ConfirmationPage.jsx - About 3 hrs to fix

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

                        {
                          id: 5621493,
                          reasonForStudy: null,
                          radiologist: 'DOE,JOHN',
                          clinicalHistory:
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 2..25
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 26..49
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 50..72
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 97..120
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 121..143
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 144..166
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 167..190
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 191..214
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 215..237
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 238..260
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 261..284
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 285..307
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 308..331
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 332..354
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 355..376
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 377..398
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 399..422
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 423..446
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 447..469
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 470..493

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

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

                        {
                          id: 5621491,
                          reasonForStudy: null,
                          radiologist: 'DOE,JOHN',
                          clinicalHistory:
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 2..25
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 50..72
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 73..96
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 97..120
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 121..143
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 144..166
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 167..190
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 191..214
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 215..237
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 238..260
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 261..284
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 285..307
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 308..331
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 332..354
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 355..376
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 377..398
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 399..422
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 423..446
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 447..469
                      src/platform/mhv/api/mocks/medical-records/mhv-radiology/index.js on lines 470..493

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

                      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