department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,805 of 12,805 total issues

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

          <li>
            <svg
              aria-hidden="true"
              className="vcl-crisis-panel-icon"
              focusable="false"
src/platform/site-wide/va-footer/components/CrisisPanel.jsx on lines 115..136

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

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

    <va-accordion-item header="What we consider an asset">
      <p>
        Assets include the fair market value of all the real and personal
        property that you own, minus the amount of any mortgages you have. "Real
        property" is the land and buildings you own. And "personal property" is
Severity: Major
Found in src/applications/pensions/components/FormAlerts/index.jsx and 1 other location - About 4 hrs to fix
src/applications/appeals/996/content/Authorization.jsx on lines 4..43

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

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 generateTextFile = (content, fileName) => {
  const blob = new Blob([content], { type: 'text/plain' });
  const url = window.URL.createObjectURL(blob);
  const a = document.createElement('a');
  a.href = url;
Severity: Major
Found in src/applications/mhv-medical-records/util/helpers.js and 1 other location - About 4 hrs to fix
src/applications/mhv-medications/util/helpers.js on lines 78..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 132.

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 evidenceTypeHelp = (
  <va-additional-info trigger="Which evidence type should I choose?">
    <h4>Types of evidence</h4>
    <h5 className="vads-u-padding-top--1p5">
      Required Separation Health Assessment - Part A Self-Assessment
src/applications/disability-benefits/all-claims/content/evidenceTypes.jsx on lines 3..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 132.

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 errorAddressAlert = deliveryPointValidation => {
  if (deliveryPointValidation === BAD_UNIT_NUMBER) {
    return (
      <Alert
        status="warning"
Severity: Major
Found in src/applications/verify-your-enrollment/constants/index.js and 1 other location - About 4 hrs to fix
src/applications/personalization/profile/components/direct-deposit/vye/constants/index.js on lines 48..80

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

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

      contents.description = (
        <div>
          <p>
            The {aojDescription} sent you a Statement of the Case on{' '}
            {formattedSocDate}. The Statement of the Case explains the reasons
src/applications/claims-status/utils/appeals-v2-helpers.jsx on lines 309..332

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

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

            <li>
              <svg
                aria-hidden="true"
                className="va-crisis-panel-icon"
                focusable="false"
Severity: Major
Found in src/platform/site-wide/va-footer/components/CrisisPanel.jsx and 1 other location - About 4 hrs to fix
src/applications/proxy-rewrite/partials/crisis-line-modal.jsx on lines 99..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 132.

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

      contents.description = (
        <div>
          <p>
            The {aojDescription} sent you a Statement of the Case on{' '}
            {formattedSocDate}. The Statement of the Case explains the reasons
Severity: Major
Found in src/applications/claims-status/utils/appeals-v2-helpers.jsx and 1 other location - About 4 hrs to fix
src/applications/personalization/dashboard/utils/getStatusContents.jsx on lines 61..84

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

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 generateTextFile = (content, fileName) => {
  const blob = new Blob([content], { type: 'text/plain' });
  const url = window.URL.createObjectURL(blob);
  const a = document.createElement('a');
  a.href = url;
Severity: Major
Found in src/applications/mhv-medications/util/helpers.js and 1 other location - About 4 hrs to fix
src/applications/mhv-medical-records/util/helpers.js on lines 232..241

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

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 errorAddressAlert = deliveryPointValidation => {
  if (deliveryPointValidation === BAD_UNIT_NUMBER) {
    return (
      <Alert
        status="warning"
src/applications/verify-your-enrollment/constants/index.js on lines 125..157

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

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

const FormStartControls = props => {
  const {
    formId,
    migrations,
    startPage,
Severity: Major
Found in src/platform/forms/save-in-progress/FormStartControls.jsx - About 4 hrs to fix

    Function WhatToDoNext has 121 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const WhatToDoNext = props => {
      const { router, appointments, action, goToDetails } = props;
      const selectApp = useMemo(makeSelectApp, []);
      const { app } = useSelector(selectApp);
      const { t } = useTranslation();
    Severity: Major
    Found in src/applications/check-in/components/WhatToDoNext.jsx - About 4 hrs to fix

      File form.js has 367 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import FormFooter from 'platform/forms/components/FormFooter';
      
      // import CustomPageWrapper from '../components/CustomPageWrapper';
      import IntroductionPage from '../containers/IntroductionPage';
      import taskList from '../pages/taskList';
      Severity: Minor
      Found in src/applications/appeals/testing/nod-new/config/form.js - About 4 hrs to fix

        File calculator.js has 367 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import { isFinite } from 'lodash';
        import camelCaseKeysRecursive from 'camelcase-keys-recursive';
        
        import {
          CALCULATOR_INPUTS_CHANGED,
        Severity: Minor
        Found in src/applications/gi/reducers/calculator.js - About 4 hrs to fix

          File labsAndTests.js has 367 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { parseISO } from 'date-fns';
          import { Actions } from '../util/actionTypes';
          import {
            concatObservationInterpretations,
            dateFormatWithoutTimezone,
          Severity: Minor
          Found in src/applications/mhv-medical-records/reducers/labsAndTests.js - About 4 hrs to fix

            Function generate has 120 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const generate = async data => {
              validate(data.details);
            
              const doc = createAccessibleDoc(data, config);
            
            
            Severity: Major
            Found in src/platform/pdf/templates/veteran_status.js - About 4 hrs to fix

              Function ResourcesAndSupportSearchApp has 120 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const ResourcesAndSupportSearchApp = () => {
                const [articles, errorMessage] = useArticleData();
                const [userInput, setUserInput] = useState('');
                const [query, setQuery] = useState('');
                const [page, setPage] = useState(1);

                Function applicantInformationUpdate has 120 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export default function applicantInformationUpdate(schema, options) {
                  // Use the defaults as necessary, but override with the options given
                  const prefix = options && options.isVeteran ? 'veteran' : 'relative';
                  const { fields, required, labels } = {
                    ...defaults(prefix),

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

                      [formFields.viewMailingAddress]: {
                        [formFields.address]: {
                          street: address?.addressLine1,
                          street2: address?.addressLine2 || undefined,
                          city: address?.city,
                  Severity: Major
                  Found in src/applications/my-education-benefits/helpers.js and 2 other locations - About 4 hrs to fix
                  src/applications/my-education-benefits/helpers.js on lines 466..482
                  src/applications/my-education-benefits/helpers.js on lines 747..763

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

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

                      [formFields.viewMailingAddress]: {
                        [formFields.address]: {
                          street: address?.addressLine1,
                          street2: address?.addressLine2 || undefined,
                          city: address?.city,
                  Severity: Major
                  Found in src/applications/my-education-benefits/helpers.js and 2 other locations - About 4 hrs to fix
                  src/applications/my-education-benefits/helpers.js on lines 602..618
                  src/applications/my-education-benefits/helpers.js on lines 747..763

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

                  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