department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

File ProfileInformationEditView.jsx has 383 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 { focusElement } from 'platform/utilities/ui';

    File ResultCard.jsx has 382 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useState } from 'react';
    import { connect } from 'react-redux';
    import classNames from 'classnames';
    import appendQuery from 'append-query';
    import { Link } from 'react-router-dom';
    Severity: Minor
    Found in src/applications/gi/containers/search/ResultCard.jsx - About 5 hrs to fix

      Function FieldTemplate has 129 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function FieldTemplate(props) {
        const {
          id,
          schema,
          help,
      Severity: Major
      Found in src/platform/forms-system/src/js/components/FieldTemplate.jsx - About 5 hrs to fix

        Function alertMessage has 129 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const alertMessage = (alertType, appType) => {
          switch (alertType) {
            case ALERT_TYPES.ALL_ZERO:
              return {
                alertStatus: 'info',

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

            render() {
              const downloadStatus = this.props.letterDownloadStatus;
              const letterItems = (this.props.letters || []).map((letter, index) => {
                let content;
                let letterTitle;
          Severity: Major
          Found in src/applications/letters/containers/LetterList.jsx - About 5 hrs to fix

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

            export function fetchDuplicateContactInfo(email, phoneNumber) {
              return async dispatch => {
                dispatch({ type: FETCH_DUPLICATE_CONTACT });
                return apiRequest(DUPLICATE_CONTACT_INFO_ENDPOINT, {
                  method: 'POST',
            Severity: Major
            Found in src/applications/my-education-benefits/actions/index.js and 2 other locations - About 5 hrs to fix
            src/applications/survivor-dependent-education-benefit/22-5490/actions.js on lines 55..79
            src/applications/toe/actions.js on lines 188..212

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

            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

            export const schema = {
              type: 'object',
              properties: {
                application: {
                  type: 'object',
            src/applications/pre-need-integration/config/pages/militaryDetailsPreparer.jsx on lines 25..55
            src/applications/pre-need-integration/config/pages/militaryDetailsSelf.jsx on lines 25..55

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

            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

            export const schema = {
              type: 'object',
              properties: {
                application: {
                  type: 'object',
            src/applications/pre-need-integration/config/pages/militaryDetailsSelf.jsx on lines 25..55
            src/applications/pre-need-integration/config/pages/sponsorMilitaryDetailsPreparer.jsx on lines 69..99

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

            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

                  <Row classNames="form-progress-buttons vads-u-margin-y--2">
                    <Column classNames="small-6 medium-5">
                      <Back onButtonClick={onBack} />
                    </Column>
                    <Column classNames="small-6 medium-5">
            src/platform/forms-system/src/js/review/submit-states/ClientError.jsx on lines 45..60
            src/platform/forms-system/src/js/review/submit-states/ValidationError.jsx on lines 44..59

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

            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

            export function fetchDuplicateContactInfo(email, phoneNumber) {
              return async dispatch => {
                dispatch({ type: FETCH_DUPLICATE_CONTACT });
                return apiRequest(DUPLICATE_CONTACT_INFO_ENDPOINT, {
                  method: 'POST',
            Severity: Major
            Found in src/applications/toe/actions.js and 2 other locations - About 5 hrs to fix
            src/applications/my-education-benefits/actions/index.js on lines 224..248
            src/applications/survivor-dependent-education-benefit/22-5490/actions.js on lines 55..79

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

            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

                  <Row classNames="form-progress-buttons vads-u-margin-y--2">
                    <Column classNames="small-6 medium-5">
                      <Back onButtonClick={onBack} />
                    </Column>
                    <Column classNames="small-6 medium-5">
            src/platform/forms-system/src/js/review/submit-states/ThrottledError.jsx on lines 38..53
            src/platform/forms-system/src/js/review/submit-states/ValidationError.jsx on lines 44..59

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

            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

            export const schema = {
              type: 'object',
              properties: {
                application: {
                  type: 'object',
            src/applications/pre-need-integration/config/pages/militaryDetailsPreparer.jsx on lines 25..55
            src/applications/pre-need-integration/config/pages/sponsorMilitaryDetailsPreparer.jsx on lines 69..99

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

            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

            export function fetchDuplicateContactInfo(email, phoneNumber) {
              return async dispatch => {
                dispatch({ type: FETCH_DUPLICATE_CONTACT });
                return apiRequest(DUPLICATE_CONTACT_INFO_ENDPOINT, {
                  method: 'POST',
            src/applications/my-education-benefits/actions/index.js on lines 224..248
            src/applications/toe/actions.js on lines 188..212

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

            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

                  <Row classNames="form-progress-buttons vads-u-margin-y--2">
                    <Column classNames="small-6 medium-5">
                      <Back onButtonClick={onBack} />
                    </Column>
                    <Column classNames="small-6 medium-5">
            src/platform/forms-system/src/js/review/submit-states/ClientError.jsx on lines 45..60
            src/platform/forms-system/src/js/review/submit-states/ThrottledError.jsx on lines 38..53

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

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

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

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

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

            Refactorings

            Further Reading

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

            export const generateCoe = (skip = false) => async dispatch => {
              if (!skip) {
                dispatch({ type: GENERATE_AUTOMATIC_COE_STARTED });
                return getCoeStatus()
                  .then(response => {
            Severity: Major
            Found in src/applications/lgy/coe/shared/actions/index.js and 1 other location - About 5 hrs to fix
            src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskRed/shared/actions/index.js on lines 20..36

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

            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

              startEditing = addressType => {
                const newState = { editing: true };
                if (addressType === 'permanentAddress') {
                  newState.permAddressShouldBeFocused = true;
                } else if (addressType === 'temporaryAddress') {
            src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 448..464

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

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

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

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

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

            Refactorings

            Further Reading

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

            export const generateCoe = (skip = false) => async dispatch => {
              if (!skip) {
                dispatch({ type: GENERATE_AUTOMATIC_COE_STARTED });
                return getCoeStatus()
                  .then(response => {
            src/applications/lgy/coe/shared/actions/index.js on lines 20..36

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

            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

              startEditing = addressType => {
                const newState = { editing: true };
                if (addressType === 'permanentAddress') {
                  newState.permAddressShouldBeFocused = true;
                } else if (addressType === 'temporaryAddress') {
            src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 456..472

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

            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 locationList = (
              <ul>
                <li>Bahrain</li>
                <li>Iraq</li>
                <li>Kuwait</li>
            src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-3.jsx on lines 14..26

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

            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 possibleProperties = {
                ...schema.properties,
                minorQuestions: {
                  type: 'object',
                  properties: {
            src/applications/edu-benefits/5490/components/GuardianInformation.jsx on lines 42..75

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

            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