department-of-veterans-affairs/vets-website

View on GitHub

Showing 14,709 of 14,709 total issues

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

const VeteranProfileInformation = ({
  goBack,
  goForward,
  profile,
  veteran,
src/applications/_mock-form-ae-design-patterns/patterns/pattern1/ezr/VeteranProfileInformation.jsx on lines 12..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 701.

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

const { sub, formatISO } = require('date-fns');
const {
  senderInfo,
  categoryInfo,
  triageGroupNames,
Severity: Major
Found in src/platform/mhv/api/mocks/secure-messaging/threads/inboxThreads.js - About 4 days to fix

    File index.js has 1486 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const set = require('lodash/set');
    const cloneDeep = require('lodash/cloneDeep');
    /**
     * Loops through the claims array and adds the claims to the user object
     *
    Severity: Major
    Found in src/applications/representative-appoint/mocks/endpoints/user/index.js - About 3 days to fix

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

        getEditView = () => {
          const {
            disabled,
            errorSchema,
            formData,
      src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 179..281

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

      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

        getEditView = () => {
          const {
            disabled,
            errorSchema,
            formData,
      src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 179..281

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

      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

          {
            id: 16227426,
            relationship: 'S',
            firstName: 'self',
            lastName: 'lastself',
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 137..268
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 400..531
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 677..808
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 809..940

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

      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

          {
            id: 18677258,
            relationship: 'GFMS',
            firstName: 'MHV-8646 mhv-np-user-api Regression Test in SysTest',
            lastName: 'MHV-8646 mhv-np-user-api Regression Test in SysTest',
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 5..136
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 400..531
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 677..808
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 809..940

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

      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

          {
            id: 18918208,
            relationship: 'NPHW',
            firstName: 'MHV9231 Regression ',
            lastName: 'MHV9231 Regression ',
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 5..136
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 137..268
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 400..531
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 677..808

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

      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

          {
            id: 17698738,
            relationship: 'M',
            firstName: '2020.1.5.0 Release Regression ',
            lastName: '2020.1.5.0 Release Regression ',
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 5..136
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 137..268
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 400..531
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 809..940

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

      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

          {
            id: 16453514,
            relationship: 'GFMS',
            firstName: 'me',
            lastName: 'me',
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 5..136
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 137..268
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 677..808
      src/platform/mhv/api/mocks/medical-records/self-entered/seiFamilyHealthHistory.js on lines 809..940

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

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

      const commonResponses = require('../../../platform/testing/local-dev-mock-api/common');
      
      module.exports = {
        ...commonResponses,
        'GET /v0/feature_toggles': {
      Severity: Major
      Found in src/applications/financial-status-report/mocks/responses.js - About 3 days to fix

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

        export default function RadioWidget(props) {
          const { options, formContext = {}, value, disabled, onChange, id } = props;
          const { enumOptions, labels = {} } = options;
        
          const onReviewPage = formContext?.onReviewPage || false;
        Severity: Major
        Found in src/applications/pre-need/components/PreparerRadioWidget.jsx and 1 other location - About 3 days to fix
        src/applications/pre-need-integration/components/PreparerRadioWidget.jsx on lines 10..79

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

        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 default function RadioWidget(props) {
          const { options, formContext = {}, value, disabled, onChange, id } = props;
          const { enumOptions, labels = {} } = options;
        
          const onReviewPage = formContext?.onReviewPage || false;
        src/applications/pre-need/components/PreparerRadioWidget.jsx on lines 10..79

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

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

          (constant, eligibility, institution, inputs) => {
            if (
              [constant, eligibility, institution, inputs].some(e => !e || isEmpty(e))
            ) {
              return {};
        Severity: Major
        Found in src/applications/gi/selectors/calculator.js - About 3 days to fix

          Function Prescriptions has 755 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const Prescriptions = () => {
            const { search } = useLocation();
            const history = useHistory();
            const dispatch = useDispatch();
            const paginatedPrescriptionsList = useSelector(
          Severity: Major
          Found in src/applications/mhv-medications/containers/Prescriptions.jsx - About 3 days to fix

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

            export default {
              default: {
                allowedSignInProviders: { ...defaultSignInProviders },
                legacySignInProviders,
                isMobile: false,
            Severity: Major
            Found in src/platform/user/authentication/config/prod.config.js and 1 other location - About 3 days to fix
            src/platform/user/authentication/config/staging.config.js on lines 15..135

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

            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 default {
              default: {
                allowedSignInProviders: { ...defaultSignInProviders },
                legacySignInProviders,
                isMobile: false,
            Severity: Major
            Found in src/platform/user/authentication/config/staging.config.js and 1 other location - About 3 days to fix
            src/platform/user/authentication/config/prod.config.js on lines 15..135

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

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

            import React from 'react';
            import { Link } from 'react-router';
            
            import currentOrPastDateUI from 'platform/forms-system/src/js/definitions/currentOrPastDate';
            
            

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

                return (
                  <form onSubmit={updateFormData}>
                    <fieldset className="vads-u-margin-y--2">
                      <legend className="schemaform-block-title">
                        <h3 className="vads-u-margin--0">Add a job</h3>
              src/applications/financial-status-report/components/employment/EnhancedEmploymentRecord.jsx on lines 166..261

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

              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

                return (
                  <form onSubmit={updateFormData}>
                    <fieldset className="vads-u-margin-y--2">
                      <legend className="schemaform-block-title">
                        <h3 className="vads-u-margin--0">Add a job</h3>
              src/applications/financial-status-report/components/employment/EnhancedSpouseEmploymentRecord.jsx on lines 166..261

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

              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