Showing 12,810 of 12,810 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
{statementsByUniqueFacility.map(copay => (
<va-checkbox
checked={selectedDebtsAndCopays?.some(
currCopay => currCopay.selectedDebtId === copay.id,
)}
- Read upRead up
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 112.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
<div className="vads-grid-col padding-bottom-2">
<VaButton
onClick={openModalV3}
text="Click here to open V3 modal"
uswds
- Read upRead up
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 112.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function UnderReview
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function UnderReview(response, name) {
return (
<>
<div>
<va-alert
Function createAppointments
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createAppointments = (
token = defaultUUID,
demographicsNeedsUpdate = false,
demographicsConfirmedAt = null,
nextOfKinNeedsUpdate = false,
Function StepComponent
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const StepComponent = props => {
const { step, clickHandler } = props;
const data = orientationSteps[step];
let content;
Function adaptPayload
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const adaptPayload = formData => {
const payload = {};
const {
fullName: { firstName: first, lastName: last },
date,
Function PathologyDetails
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PathologyDetails = props => {
const { record, fullState, runningUnitTest } = props;
const user = useSelector(state => state.user.profile);
const allowTxtDownloads = useSelector(
state =>
Function NonVaPrescription
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NonVaPrescription = prescription => {
const content = () => {
const status = prescription?.dispStatus?.toString();
return (
<div className="medication-details-div vads-u-border-top--1px vads-u-border-color--gray-lighter vads-u-margin-top--3 medium-screen:vads-u-margin-top--4 vads-u-margin-bottom--3">
Function ReviewPage
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ReviewPage = props => {
const [privacyCheckbox, setPrivacyCheckbox] = useState(false);
const [submitted, setSubmitted] = useState(false);
const { chapterTitles, getChapterPagesFromChapterIndex } = setupPages();
Function BurialIntroduction
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function BurialIntroduction(props) {
return (
<>
<Page {...props}>
<div className="schemaform-intro">
Function render
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { submission, data } = this.props.form;
const { response } = submission;
const name = data.claimantFullName;
Function prefillTransformer
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function prefillTransformer(pages, formData, metadata, state) {
const bankInformation = state.data?.bankInformation || {};
const claimant = state.data?.formData?.data?.attributes?.claimant || {};
const contactInfo = claimant?.contactInfo || {};
const stateUser = state.user;
File TravelPayStatusApp.jsx
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState, useEffect, useCallback, useRef } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import {
isProfileLoading,
isLoggedIn,
Function HomeAcreageValueInput
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
const HomeAcreageValueInput = props => {
const {
goBack,
goForward,
onReviewPage = false,
File IntroductionPage.jsx
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
File SearchBenefits.jsx
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import { useFeatureToggle } from 'platform/utilities/feature-toggles';
import EbenefitsLink from 'platform/site-wide/ebenefits/containers/EbenefitsLink';
import recordEvent from 'platform/monitoring/record-event';
import PropTypes from 'prop-types';
Function default
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(state = INITIAL_STATE, action) {
switch (action.type) {
case ADD_COMPARE_INSTITUTION:
if (state.selected.length < 3) {
return {
Function CopyAddressModal
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CopyAddressModal = props => {
const {
mailingAddress = null,
homeAddress,
transaction,
File form.js
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
import commonDefinitions from 'vets-json-schema/dist/definitions.json';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import profileContactInfo from 'platform/forms-system/src/js/definitions/profileContactInfo';
import configService from '../utilities/configService';
import manifest from '../manifest.json';
Identical blocks of code found in 5 locations. Consider refactoring. Open
onPropertyChange(name) {
return value => {
const formData = Object.keys(this.props.formData || {}).length
? this.props.formData
: getDefaultFormState(
- Read upRead up
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 111.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76