Showing 12,816 of 12,816 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
export default {
uiSchema: {
...titleUI(
'Your mailing address',
'We’ll send any important information about this request to this address.',
- 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 88.
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
eventA.fieldDatetimeRangeTimezone.push({
value: now
.clone()
.add(1, 'week')
.unix(),
- 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 88.
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
militaryServiceExperienceBranchDateRangePage: pageBuilder.itemPage({
title: 'Military service experience branch and date range',
path: 'military-service-experiences/:index/branch-date-range',
onNavForward: props => {
return !props.formData.currentlyServing
- 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 88.
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
File SearchControls.jsx
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import {
VaModal,
File DownloadRecordsPage.jsx
has 277 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useCallback, useEffect, useState } from 'react';
import { useDispatch, useSelector } from 'react-redux';
import { focusElement } from '@department-of-veterans-affairs/platform-utilities/ui';
import { formatDateLong } from '@department-of-veterans-affairs/platform-utilities/exports';
import PropTypes from 'prop-types';
Function render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { formConfig, buttonOnly, devOnly } = this.props;
const devOnlyForceShowFormControls =
environment.isLocalhost() &&
!window.Cypress &&
Function ITFBanner
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ITFBanner = props => {
const [messageDismissed, setMessageDismissed] = useState(false);
const [reviewInitialFocus, setReviewInitialFocus] = useState(false);
const goHome = () => {
Function ITFBanner
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ITFBanner = props => {
const [messageDismissed, setMessageDismissed] = useState(false);
const [reviewInitialFocus, setReviewInitialFocus] = useState(false);
const goHome = () => {
Function createDirectDepositPage
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createDirectDepositPage() {
const bankAccountProperties = {
type: 'object',
properties: {
accountType: {
Function createMockAddressValidationSuccessResponse
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createMockAddressValidationSuccessResponse = _data => {
return {
data: {
messages: [
{
Function CommunityCareProviderSelectionPage
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function CommunityCareProviderSelectionPage() {
const pageTitle = useSelector(state => getPageTitle(state, pageKey));
const dispatch = useDispatch();
const { data, pageChangeInProgress, schema } = useSelector(
Function useUnavailableItems
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const useUnavailableItems = () => {
const { groups, items, channels } = getEntities(communicationPreferences);
const excludedGroupIds = [
// Always exclude QUICK_SUBMIT and GENERAL
Function mapStateToProps
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapStateToProps = state => {
const { isReady: hasLoadedScheduledDowntime } = state.scheduledDowntime;
const isLOA3 = isLOA3Selector(state);
const isLOA1 = isLOA1Selector(state);
const isVAPatient = isVAPatientSelector(state);
Function directDeposit
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
function directDeposit(state = initialState, action) {
switch (action.type) {
case DIRECT_DEPOSIT_FETCH_SUCCEEDED:
case DIRECT_DEPOSIT_SAVE_SUCCEEDED: {
return {
Function content
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
const content = () => {
if (accessAlert) {
return (
<AccessTroubleAlertBox
alertType={accessAlertTypes.VITALS}
Function render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { enrollment, id } = this.props;
const amendments = enrollment.amendments || [];
const yellowRibbonStatus = enrollment.yellowRibbonAmount > 0 && (
<div className="yellow-ribbon-school">
Function render
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const contentClasses = classNames(
'form-expanding-group-open',
'wizard-content',
{
Function FormSaveErrorMessage
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
function FormSaveErrorMessage(props) {
const { route, formConfig, user, form, location, showLoginModal } = props;
const savedStatus = form?.savedStatus;
const appType = formConfig?.customText?.appType || APP_TYPE_DEFAULT;
Function SubmitButtons
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function SubmitButtons(props) {
const { onBack, onSubmit, submission, formConfig, formErrors = {} } = props;
const appType = formConfig?.customText?.appType || APP_TYPE_DEFAULT;
const buttonText =
File form.js
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { VA_FORM_IDS } from 'platform/forms/constants';
import preSubmitInfo from 'platform/forms/preSubmitInfo';
import FormFooter from 'platform/forms/components/FormFooter';
import { externalServices as services } from 'platform/monitoring/DowntimeNotification';