department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

File DeselectableObjectField.jsx has 334 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import PropTypes from 'prop-types';
import React from 'react';
import classNames from 'classnames';
import groupBy from 'lodash/groupBy';
import {

    Function arrayBuilderYesNoUI has 100 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const arrayBuilderYesNoUI = (
      arrayBuilderOptions,
      yesNoOptions,
      yesNoOptionsMore,
    ) => {

      Function DependentSummary has 100 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const DependentSummary = props => {
        const {
          data,
          goBack,
          goForward,
      Severity: Major
      Found in src/applications/hca/components/FormPages/DependentSummary.jsx - About 4 hrs to fix

        Function EnrollmentStatusFAQ has 100 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const EnrollmentStatusFAQ = () => {
          const { statusCode } = useSelector(selectEnrollmentStatus);
        
          // Declare content blocks for use
          const {

          Function FileUpload has 100 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const FileUpload = props => {
            const {
              acceptFileTypes = '.pdf,.jpeg,.png',
              buttonText = 'Upload file',
              error,
          Severity: Major
          Found in src/applications/ask-va/components/FileUpload.jsx - About 4 hrs to fix

            Function letters has 100 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function letters(state = initialState, action) {
              switch (action.type) {
                case GET_LETTERS_SUCCESS: {
                  const letterDownloadStatus = {};
                  action.data.letters.forEach(letter => {
            Severity: Major
            Found in src/applications/letters/reducers/index.js - About 4 hrs to fix

              Function ThirdFAQSection has 100 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const ThirdFAQSection = () => {
                return (
                  <>
                    <h3 className="dhp-faq-section-header">Troubleshooting</h3>
                    <va-accordion
              Severity: Major
              Found in src/applications/dhp-connected-devices/components/FAQSections.jsx - About 4 hrs to fix

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

                ITFBanner.propTypes = {
                  status: PropTypes.oneOf(['error', 'itf-found', 'itf-created']).isRequired,
                  children: PropTypes.any,
                  currentExpDate: PropTypes.string,
                  previousExpDate: PropTypes.string,
                Severity: Major
                Found in src/applications/appeals/995/components/ITFBanner.jsx and 1 other location - About 4 hrs to fix
                src/applications/appeals/testing/sc/components/ITFBanner.jsx on lines 98..110

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

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

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

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

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

                Refactorings

                Further Reading

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

                export function uiSchema(label, getOptions, options = {}) {
                  const validations = [];
                  if (!options['ui:options']?.freeInput) {
                    validations.push(validateAutosuggestOption);
                  }
                Severity: Major
                Found in src/platform/forms-system/src/js/definitions/autosuggest.js and 1 other location - About 4 hrs to fix
                src/applications/pre-need-integration/definitions/autosuggest.js on lines 27..50

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

                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

                    if (page.showPagePerItem) {
                      pageSchema =
                        pageState.schema.properties[page.arrayPath].items[page.index];
                      pageUiSchema = pageState.uiSchema[page.arrayPath].items;
                    } else {
                src/applications/ask-va/components/ReviewCollapsibleChapter.jsx on lines 285..296

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

                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

                function validatePostalCodes(errors, address) {
                  let isValidPostalCode = true;
                
                  // Checks if postal code is valid
                  if (address.country === 'USA') {
                Severity: Major
                Found in src/applications/pre-need/definitions/address.js and 1 other location - About 4 hrs to fix
                src/applications/pre-need-integration/definitions/address.js on lines 16..32

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

                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

                ITFBanner.propTypes = {
                  status: PropTypes.oneOf(['error', 'itf-found', 'itf-created']).isRequired,
                  children: PropTypes.any,
                  currentExpDate: PropTypes.string,
                  previousExpDate: PropTypes.string,
                Severity: Major
                Found in src/applications/appeals/testing/sc/components/ITFBanner.jsx and 1 other location - About 4 hrs to fix
                src/applications/appeals/995/components/ITFBanner.jsx on lines 98..110

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

                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

                function validatePostalCodes(errors, address) {
                  let isValidPostalCode = true;
                
                  // Checks if postal code is valid
                  if (address.country === 'USA') {
                Severity: Major
                Found in src/applications/pre-need-integration/definitions/address.js and 1 other location - About 4 hrs to fix
                src/applications/pre-need/definitions/address.js on lines 16..32

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

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

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

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

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

                Refactorings

                Further Reading

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

                export function uiSchema(label, getOptions, options = {}) {
                  const validations = [];
                  if (!options['ui:options']?.freeInput) {
                    validations.push(validateAutosuggestOption);
                  }
                src/platform/forms-system/src/js/definitions/autosuggest.js on lines 27..50

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

                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

                    if (page.showPagePerItem) {
                      pageSchema =
                        pageState.schema.properties[page.arrayPath].items[page.index];
                      pageUiSchema = pageState.uiSchema[page.arrayPath].items;
                    } else {
                src/platform/forms-system/src/js/review/ReviewCollapsibleChapter.jsx on lines 363..374

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

                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 function addPerson() {
                  return dispatch => {
                    dispatch({ type: MVI_ADD_INITIATED });
                
                    return apiRequest('/mvi_users/21-0966', { method: 'POST' })
                src/applications/disability-benefits/all-claims/actions/index.js on lines 26..37

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

                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 claimWorkSchema = {
                  uiSchema: {
                    ...titleUI('Claim relation to work'),
                    claimIsWorkRelated: yesNoUI({
                      title: 'Is this a claim for a work-related injury or condition?',
                src/applications/ivc-champva/10-7959a/chapters/claimInformation.js on lines 88..116

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 115.

                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

                        <div id="not-eligbile-details" aria-live="polite">
                          <span className="sr-only">Info: </span>
                          <p className="vads-u-margin-top--0">
                            Based on your separation date, you’re not eligible to file for
                            disability benefits right now.
                src/applications/disability-benefits/wizard/pages/unable-to-file-bdd.jsx on lines 33..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 115.

                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 LOAD_STATUSES.failure:
                        content = (
                          <div>
                            <div className="usa-alert usa-alert-error background-color-only">
                              We’re sorry. We’re having some server issues and are working to
                src/platform/forms/save-in-progress/SaveInProgressErrorPage.jsx on lines 124..139

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

                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

                          {complaintRows.every(
                            complaintType => complaintType.allCampuses === null,
                          ) && (
                            <div className="row">
                              <div className="small-11 columns">
                src/applications/gi/components/profile/CautionaryInformation.jsx on lines 221..232

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

                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