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

            <Modal
              cssClass="va-modal-large"
              id="start-over-modal"
              onClose={this.toggleModal}
              title={`Starting over will delete your in-progress ${appType}.`}
Severity: Major
Found in src/platform/forms/save-in-progress/ApplicationStatus.jsx and 1 other location - About 4 hrs to fix
src/platform/forms/save-in-progress/ApplicationStatus.jsx on lines 222..236

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

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

function setFirstFields(id) {
  if (id === 'root') {
    const containers = [document].concat(
      Array.from(document.querySelectorAll('.schemaform-block')),
    );
src/platform/forms-system/src/js/fields/ObjectField.jsx on lines 27..41

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

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

/*
OVERVIEW:
The MissingFileOverview component is responsible for tracking file uploads
within the form and displaying a message to the user indicating which files
they have yet to upload before the application is considered complete. 

    File AddressValidationView.jsx has 355 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React from 'react';
    import PropTypes from 'prop-types';
    import { connect } from 'react-redux';
    import { VaAlert } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
    import {

      File medicareInformation.js has 355 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import React from 'react';
      import {
        titleUI,
        titleSchema,
        textUI,
      Severity: Minor
      Found in src/applications/ivc-champva/10-7959C/chapters/medicareInformation.js - About 4 hrs to fix

        File form-submit-transform.js has 355 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        // this constant maps the values on address.js in vets.json schema from VA.gov values to LTS values
        // the lts values were found on the LTS database and LTS validates them, so we need to send correct value from here
        const countries = [
          { schemaValue: 'USA', ltsValue: 'US', label: 'United States' },
          { schemaValue: 'AFG', ltsValue: 'AF', label: 'Afghanistan' },

          Function MessageThreadHeader has 113 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const MessageThreadHeader = props => {
            const {
              message,
              cannotReply,
              isCreateNewModalVisible,

            Function Hub has 113 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const Hub = () => {
              const { label, link } = useSignInServiceProvider();
              const hasBadAddress = useSelector(hasBadAddressSelector);
            
              useEffect(() => {
            Severity: Major
            Found in src/applications/personalization/profile/components/hub/Hub.jsx - About 4 hrs to fix

              Function RadiologyImagesList has 113 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const RadiologyImagesList = () => {
                const dispatch = useDispatch();
                const allowTxtDownloads = useSelector(
                  state =>
                    state.featureToggles[

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

                function validatePostalCodes(errors, address) {
                  let isValidPostalCode = true;
                
                  // Checks if postal code is valid
                  if (address.country === 'USA') {
                Severity: Major
                Found in src/platform/forms-system/src/js/definitions/address.js and 2 other locations - About 4 hrs to fix
                src/applications/simple-forms/shared/definitions/pdfAddress.js on lines 15..32
                src/platform/forms/definitions/address.js on lines 14..31

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

                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

                function validatePostalCodes(errors, address) {
                  let isValidPostalCode = true;
                
                  // Checks if postal code is valid
                  if (address.country === 'USA') {
                src/platform/forms-system/src/js/definitions/address.js on lines 12..29
                src/platform/forms/definitions/address.js on lines 14..31

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

                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

                function validatePostalCodes(errors, address) {
                  let isValidPostalCode = true;
                
                  // Checks if postal code is valid
                  if (address.country === 'USA') {
                Severity: Major
                Found in src/platform/forms/definitions/address.js and 2 other locations - About 4 hrs to fix
                src/applications/simple-forms/shared/definitions/pdfAddress.js on lines 15..32
                src/platform/forms-system/src/js/definitions/address.js on lines 12..29

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

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

                      it('renders the correct error on cant-file-claim-type', () => {
                        const component = render(
                          <CheckInProvider store={{ error: 'cant-file-claim-type' }}>
                            <Error />
                          </CheckInProvider>,
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 27..36
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 37..46
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 87..96
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 97..106
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 107..116

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

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

                      it('renders the correct error on btsss-service-down', () => {
                        const component = render(
                          <CheckInProvider store={{ error: 'btsss-service-down' }}>
                            <Error />
                          </CheckInProvider>,
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 27..36
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 37..46
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 59..68
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 87..96
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 107..116

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

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

                      it('renders the correct error on max-validation', () => {
                        const component = render(
                          <CheckInProvider store={{ error: 'max-validation' }}>
                            <Error />
                          </CheckInProvider>,
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 37..46
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 59..68
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 87..96
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 97..106
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 107..116

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

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

                      it('renders the correct error on uuid-not-found', () => {
                        const component = render(
                          <CheckInProvider store={{ error: 'uuid-not-found' }}>
                            <Error />
                          </CheckInProvider>,
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 27..36
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 59..68
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 87..96
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 97..106
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 107..116

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

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

                      it('renders the correct error on no-token', () => {
                        const component = render(
                          <CheckInProvider store={{ error: 'no-token' }}>
                            <Error />
                          </CheckInProvider>,
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 27..36
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 37..46
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 59..68
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 97..106
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 107..116

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

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

                      it('renders the correct error on some-error', () => {
                        const component = render(
                          <CheckInProvider store={{ error: 'some-error' }}>
                            <Error />
                          </CheckInProvider>,
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 27..36
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 37..46
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 59..68
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 87..96
                src/applications/check-in/travel-claim/pages/error/Error.unit.spec.jsx on lines 97..106

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

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

                        <VaMemorableDate
                          id="to-date"
                          name="to"
                          label={content.dateEnd}
                          required
                src/applications/appeals/995/components/EvidenceRecords.jsx on lines 116..130
                src/applications/appeals/995/components/EvidenceRecords.jsx on lines 131..145
                src/applications/appeals/testing/sc/components/EvidenceRecords.jsx on lines 136..150

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

                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 function transform(formConfig, form) {
                  const transformedForm = form;
                  checkBoxElements.forEach(elementName => {
                    Object.keys(form.data[elementName])
                      .filter(key => form.data[elementName][key] === undefined)
                src/applications/coronavirus-research/sign-up/config/formHelper.js on lines 73..83

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

                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