department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

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

    case FETCH_MULTI_FACILITY_STARTED: {
      const tempMultiData = retrieveMultiData(state);
      const tempMultiLoading = retrieveMultiLoading(state);
      const tempMultiError = retrieveMultiError(state);
      tempMultiLoading[action.facilityID] = true;
Severity: Major
Found in src/applications/static-pages/facilities/reducers/index.js and 1 other location - About 3 hrs to fix
src/applications/static-pages/facilities/reducers/index.js on lines 73..86

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

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 PrimaryActionLink = ({ href = '/', children, onClick = null }) => (
  <div className="action-bar-arrow">
    <div className="vads-u-background-color--primary vads-u-padding--1">
      <a className="vads-c-action-link--white" href={href} onClick={onClick}>
        {children}
Severity: Major
Found in src/applications/simple-forms/21-4138/config/constants.js and 1 other location - About 3 hrs to fix
src/applications/simple-forms/form-upload/config/constants.js on lines 5..13

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

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

    case FETCH_MULTI_FACILITY_FAILED: {
      const tempMultiData = retrieveMultiData(state);
      const tempMultiLoading = retrieveMultiLoading(state);
      const tempMultiError = retrieveMultiError(state);
      tempMultiLoading[action.facilityID] = false;
Severity: Major
Found in src/applications/static-pages/facilities/reducers/index.js and 1 other location - About 3 hrs to fix
src/applications/static-pages/facilities/reducers/index.js on lines 45..58

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

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 PrimaryActionLink = ({ href = '/', children, onClick = null }) => (
  <div className="action-bar-arrow">
    <div className="vads-u-background-color--primary vads-u-padding--1">
      <a className="vads-c-action-link--white" href={href} onClick={onClick}>
        {children}
src/applications/simple-forms/21-4138/config/constants.js on lines 5..13

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

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

    case STATUS_TYPES.hlrReceived:
      contents.title =
        'A higher-level reviewer is taking a new look at your case';
      contents.description = (
        <div>
Severity: Major
Found in src/applications/claims-status/utils/appeals-v2-helpers.jsx and 1 other location - About 3 hrs to fix
src/applications/personalization/dashboard/utils/getStatusContents.jsx on lines 505..531

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

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

const OverviewPage = () => {
  const { debtLetters, mcp } = useSelector(
    ({ combinedPortal }) => combinedPortal,
  );
  const {

    Function genBBoxFromAddress has 91 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const genBBoxFromAddress = (query, expandedRadius = false) => {
      // Prevent empty search request to Mapbox, which would result in error, and
      // clear results list to respond with message of no facilities found.
      if (!query.searchString) {
        return {

      Function createLocationEvents has 91 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const createLocationEvents = () => {
        const facilityEventData = {
          fieldEventCost: 'Free',
          fieldFacilityLocation: {
            entity: {
      Severity: Major
      Found in src/applications/static-pages/events/helpers/event-generator.js - About 3 hrs to fix

        Function editEmailAddressSuccess has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const editEmailAddressSuccess = () => {
          // store the email address that's passed in via the POST or PUT call so we can
          // return it with the GET user/ response
          let newEmailAddress;
          return [
        Severity: Major
        Found in src/applications/personalization/profile/msw-mocks.js - About 3 hrs to fix

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

            render() {
              const { form } = this.props;
              const { name } = form.data.application.claimant;
              const submittedAt = moment(form.submission.submittedAt);
          
          
          Severity: Major
          Found in src/applications/pre-need-integration/containers/ConfirmationPage.jsx - About 3 hrs to fix

            Function RecordList has 91 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const RecordList = props => {
              const { records, type, perPage = 10, hidePagination } = props;
              const totalEntries = records?.length;
            
              const history = useHistory();

              Function MrBreadcrumbs has 91 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const MrBreadcrumbs = () => {
                const dispatch = useDispatch();
                const location = useLocation();
                const history = useHistory();
                const crumbsList = useSelector(state => state.mr.breadcrumbs.crumbsList);
              Severity: Major
              Found in src/applications/mhv-medical-records/components/MrBreadcrumbs.jsx - About 3 hrs to fix

                File BenefitsForm.jsx has 318 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { useState } from 'react';
                import PropTypes from 'prop-types';
                import EbenefitsLink from 'platform/site-wide/ebenefits/containers/EbenefitsLink';
                import {
                  ariaLabels,
                Severity: Minor
                Found in src/applications/gi/components/profile/BenefitsForm.jsx - About 3 hrs to fix

                  File actions.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import * as Sentry from '@sentry/browser';
                  import recordEvent from 'platform/monitoring/record-event';
                  import localStorage from 'platform/utilities/storage/localStorage';
                  import { displayFileSize } from 'platform/utilities/ui/index';
                  import { FILE_UPLOAD_NETWORK_ERROR_MESSAGE } from 'platform/forms-system/src/js/constants';
                  Severity: Minor
                  Found in src/platform/forms-system/src/js/actions.js - About 3 hrs to fix

                    File personalInformationHelper.js has 317 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    import VaTextInputField from 'platform/forms-system/src/js/web-component-fields/VaTextInputField';
                    import {
                      dateOfBirthSchema,
                      dateOfBirthUI,
                      selectSchema,

                      Function SubTask has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const SubTask = props => {
                        const { pages = [], formData, setFormData, router } = props;
                        const [currentPage, setCurrentPage] = useState(pages[0] || {});
                        const [subTaskData, setSubTaskData] = useState(getStoredSubTask());
                        const [hasError, setHasError] = useState(false);
                      Severity: Major
                      Found in src/platform/forms/sub-task/index.js - About 3 hrs to fix

                        Function getProfileInfoFieldAttributes has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const getProfileInfoFieldAttributes = fieldName => {
                          let apiRoute;
                          let convertCleanDataToPayload;
                          let title;
                          let uiSchema;

                          Function transform has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function transform(formConfig, form) {
                            const expandedPages = expandArrayPages(
                              createFormPageList(formConfig),
                              form.data,
                            );
                          Severity: Major
                          Found in src/applications/hca/utils/helpers/index.js - About 3 hrs to fix

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

                              render() {
                                const { disabilities } = this.state;
                                const { calculatedRating } = this.state;
                                const ratings = getRatings(disabilities);
                            
                            

                              Function ContactInformation has 90 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const ContactInformation = () => {
                                const lastLocation = useLastLocation();
                              
                                const hasUnsavedEdits = useSelector(
                                  state => state.vapService.hasUnsavedEdits,
                                Severity
                                Category
                                Status
                                Source
                                Language