department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

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

  const getHighlightedText = text => {
    if (!keyword) return text;
    const parts = text.split(new RegExp(`(${keyword})`, 'gi'));
    return (
      <span>
src/applications/mhv-secure-messaging/components/ThreadList/ThreadListItem.jsx on lines 48..70

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

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

responses has 48 functions (exceeds 20 allowed). Consider refactoring.
Open

const responses = {
  'GET /vaos/v0/appointments': (req, res) => {
    if (req.query.type === 'cc') {
      return res.json(confirmedCC);
    }
Severity: Minor
Found in src/applications/vaos/services/mocks/index.js - About 6 hrs to fix

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

    import merge from 'lodash/merge';
    import get from 'platform/utilities/data/get';
    import unset from 'platform/utilities/data/unset';
    
    import fullSchema1990 from 'vets-json-schema/dist/22-1990-schema.json';
    Severity: Minor
    Found in src/applications/edu-benefits/1990/config/form.js - About 6 hrs to fix

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

          <va-additional-info trigger="What are some examples of additional evidence?">
            <p className="vads-u-margin-bottom--4">
              If you <strong>don’t live in the U.S.</strong> or a territory of the
              U.S., you’ll need to provide a copy of each child’s birth certificate
            </p>
      src/applications/disability-benefits/686c-674-v2/config/chapters/add-a-child/child-place-of-birth/childStatusDescription.jsx on lines 13..37

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

      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

          <va-additional-info
            trigger="What are some examples of additional evidence?"
            uswds="false"
          >
            <p className="vads-u-margin-bottom--4">
      src/applications/disability-benefits/686c-674/config/chapters/add-a-child/child-place-of-birth/childStatusDescription.jsx on lines 13..34

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      VeteranIdentificationInformationPage.propTypes = {
        name: PropTypes.string.isRequired,
        schema: PropTypes.object.isRequired,
        uiSchema: PropTypes.object.isRequired,
        appStateData: PropTypes.object,
      src/applications/simple-forms/form-upload/pages/nameAndZipCode.jsx on lines 63..80
      src/applications/simple-forms/mock-simple-forms-patterns/pages/mockCustomPage.js on lines 88..105

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      MockCustomPage.propTypes = {
        name: PropTypes.string.isRequired,
        schema: PropTypes.object.isRequired,
        uiSchema: PropTypes.object.isRequired,
        appStateData: PropTypes.object,
      src/applications/simple-forms/form-upload/pages/nameAndZipCode.jsx on lines 63..80
      src/applications/simple-forms/form-upload/pages/veteranIdentificationInformation.jsx on lines 39..56

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      NameAndZipCodePage.propTypes = {
        name: PropTypes.string.isRequired,
        schema: PropTypes.object.isRequired,
        uiSchema: PropTypes.object.isRequired,
        appStateData: PropTypes.object,
      src/applications/simple-forms/form-upload/pages/veteranIdentificationInformation.jsx on lines 39..56
      src/applications/simple-forms/mock-simple-forms-patterns/pages/mockCustomPage.js on lines 88..105

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

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

      export function uiSchema(
        label = 'Address',
        useStreet3 = false,
        isRequired = null,
        ignoreRequired = false,
      Severity: Major
      Found in src/platform/forms-system/src/js/definitions/address.js - About 6 hrs to fix

        Function ReplyForm has 166 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const ReplyForm = props => {
          const {
            cannotReply,
            drafts,
            replyMessage,

          File get.js has 443 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /* istanbul ignore file */
          const dateFns = require('date-fns');
          const { utcToZonedTime, zonedTimeToUtc, format } = require('date-fns-tz');
          const {
            singleAppointment,
          Severity: Minor
          Found in src/applications/check-in/api/local-mock-api/mocks/v2/shared/get.js - About 6 hrs to fix

            Function render has 165 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                const { showWizard } = this.props;
            
                if (showWizard === undefined) return null;
            
            
            Severity: Major
            Found in src/applications/edu-benefits/0994/containers/IntroductionPage.jsx - About 6 hrs to fix

              Function RequestedAppointmentDetailsPage has 165 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function RequestedAppointmentDetailsPage() {
                const { id } = useParams();
                const dispatch = useDispatch();
              
                useEffect(

                Function content has 165 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  const content = () => {
                    if (!isLoading) {
                      return (
                        <div className="landing-page no-print">
                          <h1 data-testid="list-page-title" className="vads-u-margin-bottom--2">
                Severity: Major
                Found in src/applications/mhv-medications/containers/Prescriptions.jsx - About 6 hrs to fix

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

                  export const content = {
                    title: (addOrEdit, index) =>
                      `${addOrEdit === 'add' ? 'Add' : 'Edit'} the ${numberToWords(
                        index || 1,
                      )} provider where you received treatment`,
                  src/applications/appeals/testing/sc/content/evidencePrivateRecords.jsx on lines 3..32

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

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                  export const content = {
                    title: (addOrEdit, index) =>
                      `${addOrEdit === 'add' ? 'Add' : 'Edit'} the ${numberToWords(
                        index || 1,
                      )} provider where you received treatment`,
                  src/applications/appeals/995/content/evidencePrivateRecords.jsx on lines 3..32

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

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                        <div itemScope itemType="http://schema.org/Question">
                          <h2 itemProp="name" id="will-my-personal-health-inform">
                            Will my personal health information be protected?
                          </h2>
                          <div
                  src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/AuthContent/index.js on lines 311..343
                  src/applications/static-pages/health-care-manage-benefits/secure-messaging-page/components/AuthContent/index.js on lines 235..267

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

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                        <div itemScope itemType="http://schema.org/Question">
                          <h2 itemProp="name" id="will-my-personal-health-inform">
                            Will my personal health information be protected?
                          </h2>
                          <div
                  src/applications/static-pages/health-care-manage-benefits/secure-messaging-page/components/AuthContent/index.js on lines 235..267
                  src/applications/static-pages/health-care-manage-benefits/view-test-and-lab-results-page/components/AuthContent/index.js on lines 231..263

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

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

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

                        <div itemScope itemType="http://schema.org/Question">
                          <h2 itemProp="name" id="will-my-personal-health-inform">
                            Will my personal health information be protected?
                          </h2>
                          <div
                  src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/AuthContent/index.js on lines 311..343
                  src/applications/static-pages/health-care-manage-benefits/view-test-and-lab-results-page/components/AuthContent/index.js on lines 231..263

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

                  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

                      describe('setError', () => {
                        describe('setErrorHandler', () => {
                          it('should return form structure', () => {
                            const action = setError('');
                            const state = setErrorHandler({ error: '' }, action);
                  src/applications/check-in/reducers/universal/universal.reducers.unit.spec.js on lines 11..27

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

                  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