department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,675 of 12,675 total issues

File V3BasePage.jsx has 467 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * This page is for testing the compatibility of running v3 components without Formation styling.
 */

import React, { useState } from 'react';
Severity: Minor
Found in src/applications/ds-v3-playground/pages/V3BasePage.jsx - About 7 hrs to fix

    Function renderYourMilitaryDetails has 180 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const renderYourMilitaryDetails = () => {
        const chapter33Check = giBillChapter === '33a' || giBillChapter === '33b';
        /*
          ***toggleCumulativeDropDown***
          Hide Cumulative Post 9/11 active-duty service drop down if applicant selects 'Fry Scholarship'
    Severity: Major
    Found in src/applications/gi/components/profile/BenefitsForm.jsx - About 7 hrs to fix

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

        handleRemove(indexToRemove, confirmRemove) {
          if (confirmRemove) {
            this.setState(set(['removing', indexToRemove], true, this.state));
          } else {
            const newItems = this.props.formData.filter(
      src/platform/forms-system/src/js/fields/ArrayField.jsx on lines 170..190

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

      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

        handleRemove(indexToRemove, confirmRemove) {
          if (confirmRemove) {
            this.setState(set(['removing', indexToRemove], true, this.state));
          } else {
            const newItems = this.props.formData.filter(
      Severity: Major
      Found in src/platform/forms-system/src/js/fields/ArrayField.jsx and 1 other location - About 7 hrs to fix
      src/applications/pre-need-integration/components/DeceasedPersons.jsx on lines 179..199

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

      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 getZone(name, caller) {
          name = normalizeName(name);
      
          var zone = zones[name];
          var link;
      Severity: Major
      Found in src/applications/personalization/dashboard/lib/moment-tz.js and 1 other location - About 7 hrs to fix
      src/applications/vaos/lib/moment-tz.js on lines 401..427

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

      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 Actions.Conditions.GET_LIST: {
            const oldList = state.conditionsList;
            const newList =
              action.response.entry
                ?.map(record => {
      Severity: Major
      Found in src/applications/mhv-medical-records/reducers/conditions.js and 1 other location - About 7 hrs to fix
      src/applications/mhv-medical-records/reducers/vaccines.js on lines 134..151

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

      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 getZone (name, caller) {
              
              name = normalizeName(name);
      
              var zone = zones[name];
      Severity: Major
      Found in src/applications/vaos/lib/moment-tz.js and 1 other location - About 7 hrs to fix
      src/applications/personalization/dashboard/lib/moment-tz.js on lines 422..451

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

      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 DEPENDENT_SUBPAGES = [
        {
          id: 'basic',
          title: content['household-dependent-info-basic-title'],
        },
      src/applications/ezr/utils/constants.js on lines 17..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 179.

      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 Actions.Vaccines.GET_LIST: {
            const oldList = state.vaccinesList;
            const newList =
              action.response.entry
                ?.map(record => {
      Severity: Major
      Found in src/applications/mhv-medical-records/reducers/vaccines.js and 1 other location - About 7 hrs to fix
      src/applications/mhv-medical-records/reducers/conditions.js on lines 110..126

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

      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

      Cypress.Commands.add('typeInDate', (fieldName, dateString) => {
        // Remove leading zeros
        const date = dateString.split('-').map(v => parseInt(v, 10).toString());
        const name = removeLeadingHash(fieldName);
        cy.tabToElement(`#${name}Month`);
      src/applications/disability-benefits/all-claims/pages/trainingPayWaiver.js on lines 6..21

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

      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 DEPENDENT_SUBPAGES = [
        {
          id: 'basic',
          title: content['household-dependent-info-basic-title'],
        },
      Severity: Major
      Found in src/applications/ezr/utils/constants.js and 1 other location - About 7 hrs to fix
      src/applications/_mock-form-ae-design-patterns/utils/constants.js on lines 49..90

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

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

        render() {
          return (
            <div
              className="schemaform-intro"
              itemScope
      Severity: Major
      Found in src/applications/edu-benefits/10203/containers/IntroductionPage.jsx - About 7 hrs to fix

        Function VaMedicalCenter has 179 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const VaMedicalCenter = props => {
          const {
            errorSchema,
            formContext,
            formData,
        Severity: Major
        Found in src/applications/hca/components/FormFields/VaMedicalCenter.jsx - About 7 hrs to fix

          File FilterYourResults.jsx has 465 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { useState } from 'react';
          import { useHistory } from 'react-router-dom';
          import { connect } from 'react-redux';
          import _ from 'lodash';
          import recordEvent from 'platform/monitoring/record-event';
          Severity: Minor
          Found in src/applications/gi/containers/FilterYourResults.jsx - About 7 hrs to fix

            File App.jsx has 464 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import React, { useEffect, useState } from 'react';
            import { connect } from 'react-redux';
            import moment from 'moment';
            import PropTypes from 'prop-types';
            import { VaBreadcrumbs } from '@department-of-veterans-affairs/web-components/react-bindings';
            Severity: Minor
            Found in src/applications/my-education-benefits/containers/App.jsx - About 7 hrs to fix

              File ArrayField.jsx has 464 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import PropTypes from 'prop-types';
              import React from 'react';
              import set from 'platform/utilities/data/set';
              import classNames from 'classnames';
              import Scroll from 'react-scroll';

                Function transformVAOSAppointment has 178 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function transformVAOSAppointment(appt) {
                  const appointmentType = getAppointmentType(appt);
                  const isCC = appt.kind === 'cc';
                  const isVideo = appt.kind === 'telehealth';
                  const isAtlas = !!appt.telehealth?.atlas;
                Severity: Major
                Found in src/applications/vaos/services/appointment/transformers.js - About 7 hrs to fix

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

                      case STATUS_TYPES.scReceived:
                        contents.title = 'A reviewer is examining your new evidence';
                        contents.description = (
                          <div>
                            <p>
                  Severity: Major
                  Found in src/applications/claims-status/utils/appeals-v2-helpers.jsx and 1 other location - About 7 hrs to fix
                  src/applications/personalization/dashboard/utils/getStatusContents.jsx on lines 463..504

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

                  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

                  const RealEstateReview = ({ data, title }) => {
                    const { assets } = data;
                    const { realEstateValue } = assets;
                  
                    return (
                  src/applications/financial-status-report/components/otherAssets/RecreationalVehcilesReview.jsx on lines 5..24

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

                  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.scReceived:
                        contents.title = 'A reviewer is examining your new evidence';
                        contents.description = (
                          <div>
                            <p>
                  src/applications/claims-status/utils/appeals-v2-helpers.jsx on lines 736..777

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

                  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