department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

File ApplicantRelationshipPage.jsx has 305 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React, { useState, useEffect } from 'react';
import {
  VaButton,
  VaRadio,
  VaTextInput,

    File ConfirmationPage.jsx has 305 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useEffect } from 'react';
    import { connect } from 'react-redux';
    import scrollToTop from '@department-of-veterans-affairs/platform-utilities/scrollToTop';
    import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
    import { benefitsLabels } from '../utils/labels';
    Severity: Minor
    Found in src/applications/burials-ez/containers/ConfirmationPage.jsx - About 3 hrs to fix

      Function MobileOfficialGovtWebsite has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const MobileOfficialGovtWebsite = () => {
        const [expanded, setExpanded] = useState(false);
      
        const onToggle = () => {
          if (expanded) {

        Function SpouseEmploymentQuestion has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const SpouseEmploymentQuestion = props => {
          const {
            data,
            goBack,
            goToPath,

          Function ThreadListSort has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ThreadListSort = props => {
            const { sortOrder, sortCallback } = props;
            const location = useLocation();
            const [sortOrderValue, setSortOrderValue] = useState(sortOrder);
          
          

            Function hcaEnrollmentStatus has 83 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function hcaEnrollmentStatus(state = initialState, action) {
              const { data = {}, response = {}, type } = action;
              const {
                FETCH_ENROLLMENT_STATUS_STARTED,
                FETCH_ENROLLMENT_STATUS_SUCCEEDED,

              File Profile.jsx has 305 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              import React, { Component } from 'react';
              import PropTypes from 'prop-types';
              import { connect } from 'react-redux';
              import { BrowserRouter, Route, Switch, Redirect } from 'react-router-dom';
              import { LastLocationProvider } from 'react-router-last-location';
              Severity: Minor
              Found in src/applications/personalization/profile/components/Profile.jsx - About 3 hrs to fix

                Function NotificationChannel has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const NotificationChannel = props => {
                  const {
                    apiStatus,
                    channelId,
                    channelType,

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

                    const content = () => {
                      if (accessAlert) {
                        return (
                          <AccessTroubleAlertBox
                            alertType={accessAlertTypes.HEALTH_CONDITIONS}
                  Severity: Major
                  Found in src/applications/mhv-medical-records/containers/ConditionDetails.jsx - About 3 hrs to fix

                    Function AllergiesPrintOnly has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const AllergiesPrintOnly = props => {
                      const { allergies } = props;
                    
                      const content = () => {
                        return (

                      Function MedicationsList has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const MedicationsList = props => {
                        const history = useHistory();
                        const {
                          rxList,
                          pagination,

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

                        const useCheckPath = () => {
                          const [isEligibleForDirectDeposit, setIsEligibleForDirectDeposit] = useState(
                            false,
                          );
                          const currentPath = window.location.href;
                        src/applications/edu-benefits/10203/components/ShowDirectDepositDropdown.jsx on lines 9..29
                        src/applications/edu-benefits/5490/components/ShowDirectDepositDropdown.jsx on lines 9..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 101.

                        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

                        const useCheckPath = () => {
                          const [isEligibleForDirectDeposit, setIsEligibleForDirectDeposit] = useState(
                            false,
                          );
                          const currentPath = window.location.href;
                        src/applications/edu-benefits/1990/components/ShowDirectDepositDropdown.jsx on lines 9..29
                        src/applications/edu-benefits/5490/components/ShowDirectDepositDropdown.jsx on lines 9..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 101.

                        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

                        const useCheckPath = () => {
                          const [isEligibleForDirectDeposit, setIsEligibleForDirectDeposit] = useState(
                            false,
                          );
                          const currentPath = window.location.href;
                        src/applications/edu-benefits/10203/components/ShowDirectDepositDropdown.jsx on lines 9..29
                        src/applications/edu-benefits/1990/components/ShowDirectDepositDropdown.jsx on lines 9..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 101.

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

                        FinancialHardshipViewField.propTypes = {
                          defaultEditButton: PropTypes.func.isRequired,
                          formData: PropTypes.shape({
                            financialHardshipDocuments: PropTypes.arrayOf(
                              PropTypes.shape({
                        src/applications/simple-forms/20-10207/components/AlsViewField.jsx on lines 36..48
                        src/applications/simple-forms/20-10207/components/MedalAwardViewField.jsx on lines 36..48
                        src/applications/simple-forms/20-10207/components/PowViewField.jsx on lines 36..48
                        src/applications/simple-forms/20-10207/components/TerminalIllnessViewField.jsx on lines 38..50
                        src/applications/simple-forms/20-10207/components/VsiViewField.jsx on lines 37..49
                        src/applications/simple-forms/40-0247/components/SupportingDocsViewField.jsx on lines 37..49

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

                        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

                            {
                              id: '3',
                              type: 'inquiry',
                              attributes: {
                                inquiryNumber: 'A-3',
                        Severity: Major
                        Found in src/applications/ask-va/utils/mockData.js and 5 other locations - About 3 hrs to fix
                        src/applications/ask-va/utils/mockData.js on lines 1163..1187
                        src/applications/ask-va/utils/mockData.js on lines 1213..1237
                        src/applications/ask-va/utils/mockData.js on lines 1238..1263
                        src/applications/ask-va/utils/mockData.js on lines 1264..1288
                        src/applications/ask-va/utils/mockData.js on lines 1289..1313

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

                        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

                            {
                              id: '5',
                              type: 'inquiry',
                              attributes: {
                                inquiryNumber: 'A-5',
                        Severity: Major
                        Found in src/applications/ask-va/utils/mockData.js and 5 other locations - About 3 hrs to fix
                        src/applications/ask-va/utils/mockData.js on lines 1163..1187
                        src/applications/ask-va/utils/mockData.js on lines 1188..1212
                        src/applications/ask-va/utils/mockData.js on lines 1213..1237
                        src/applications/ask-va/utils/mockData.js on lines 1264..1288
                        src/applications/ask-va/utils/mockData.js on lines 1289..1313

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

                        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

                            {
                              id: '7',
                              type: 'inquiry',
                              attributes: {
                                inquiryNumber: 'A-7',
                        Severity: Major
                        Found in src/applications/ask-va/utils/mockData.js and 5 other locations - About 3 hrs to fix
                        src/applications/ask-va/utils/mockData.js on lines 1163..1187
                        src/applications/ask-va/utils/mockData.js on lines 1188..1212
                        src/applications/ask-va/utils/mockData.js on lines 1213..1237
                        src/applications/ask-va/utils/mockData.js on lines 1238..1263
                        src/applications/ask-va/utils/mockData.js on lines 1264..1288

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

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

                        SupportingDocsViewField.propTypes = {
                          defaultEditButton: PropTypes.func.isRequired,
                          formData: PropTypes.shape({
                            veteranSupportingDocuments: PropTypes.arrayOf(
                              PropTypes.shape({
                        src/applications/simple-forms/20-10207/components/AlsViewField.jsx on lines 36..48
                        src/applications/simple-forms/20-10207/components/FinancialHardshipViewField.jsx on lines 38..50
                        src/applications/simple-forms/20-10207/components/MedalAwardViewField.jsx on lines 36..48
                        src/applications/simple-forms/20-10207/components/PowViewField.jsx on lines 36..48
                        src/applications/simple-forms/20-10207/components/TerminalIllnessViewField.jsx on lines 38..50
                        src/applications/simple-forms/20-10207/components/VsiViewField.jsx on lines 37..49

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

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

                        MedalAwardViewField.propTypes = {
                          defaultEditButton: PropTypes.func.isRequired,
                          formData: PropTypes.shape({
                            medalAwardDocuments: PropTypes.arrayOf(
                              PropTypes.shape({
                        src/applications/simple-forms/20-10207/components/AlsViewField.jsx on lines 36..48
                        src/applications/simple-forms/20-10207/components/FinancialHardshipViewField.jsx on lines 38..50
                        src/applications/simple-forms/20-10207/components/PowViewField.jsx on lines 36..48
                        src/applications/simple-forms/20-10207/components/TerminalIllnessViewField.jsx on lines 38..50
                        src/applications/simple-forms/20-10207/components/VsiViewField.jsx on lines 37..49
                        src/applications/simple-forms/40-0247/components/SupportingDocsViewField.jsx on lines 37..49

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

                        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