Showing 12,811 of 12,811 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
const saveDischargeDate = (date, isBDD) => {
if (date) {
window.sessionStorage.setItem(SAVED_SEPARATION_DATE, date);
// this flag helps maintain the correct form title within a session
window.sessionStorage.setItem(FORM_STATUS_BDD, isBDD ? 'true' : 'false');
- 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 99.
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
<VaRadio
class="vads-u-margin-y--2"
label="Has your spouse had any jobs in the last 2 years? "
onVaValueChange={onSelection}
required
- 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 99.
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
events: [
{
title: 'Your appeal will be sent it to the Board',
description: (
<p>
- 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 99.
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
return {
facility,
kind,
checkInSteps,
clinicPhoneNumber,
- 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 99.
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
export function powConfinementDateRangeValidation(errors, fields) {
const { powConfinementStartDate, powConfinementEndDate } = fields;
const startDate = moment(powConfinementStartDate);
const endDate = moment(powConfinementEndDate);
- 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 99.
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
export {
API_VERSION,
API_SESSION_URL,
AUTH_EVENTS,
SERVICE_PROVIDERS,
- 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 99.
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 ObjectField.jsx
has 299 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 {
DEFAULT_ARRAY_BUILDER_TEXT
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export const DEFAULT_ARRAY_BUILDER_TEXT = {
alertItemUpdated: props => {
const itemName = props.getItemName(props.itemData);
return itemName
? `${itemName}’s information has been updated`
Function fetchInProgressForm
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fetchInProgressForm(
formId,
migrations,
prefill = false,
prefillTransformer = null,
Function DuplicateContactInfoModal
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DuplicateContactInfoModal(props) {
useEffect(
() => {
const allPotentialDuplicates = props?.duplicateEmail?.concat(
props?.duplicatePhone,
Function App
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function App(props) {
const { location, children } = props;
const { chapterTitles, findPageFromPath } = setupPages(formConfig);
const currentPath = location.pathname;
const { chapterIndex } = findPageFromPath(currentPath);
Function DuplicateContactInfoModal
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DuplicateContactInfoModal(props) {
useEffect(
() => {
const allPotentialDuplicates = props?.duplicateEmail?.concat(
props?.duplicatePhone,
Function DuplicateContactInfoModal
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
function DuplicateContactInfoModal(props) {
useEffect(
() => {
const allPotentialDuplicates = props?.duplicateEmail?.concat(
props?.duplicatePhone,
Function MessageActionButtons
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MessageActionButtons = props => {
const {
threadId,
hideReplyButton,
handleReplyButton,
Function moveToFolderModal
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
const moveToFolderModal = () => {
return (
<div
className="message-actions-buttons-modal"
data-testid="message-actions-buttons-modal"
Function getAppointmentSlots
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getAppointmentSlots(startDate, endDate, forceFetch = false) {
return async (dispatch, getState) => {
const state = getState();
const siteId = getSiteIdFromFacilityId(getFormData(state).vaFacility);
const newAppointment = getNewAppointment(state);
Function content
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
const content = () => {
if (activeAlert && activeAlert.type === ALERT_TYPE_ERROR) {
return (
<>
<h1 className="vads-u-margin-bottom--0p5">Allergy:</h1>
File contactMethod.js
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { createSelector } from 'reselect';
import TextNotificationsDisclaimer from '../../../../components/TextNotificationsDisclaimer';
import { formFields } from '../../../../constants';
File index.js
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Functions related to patient specific information
* @module services/Patient
*/
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
Identical blocks of code found in 2 locations. Consider refactoring. Open
onError: (_id, fileName, _reason, { response, status }) => {
if (status === 401) {
dispatch({
type: SET_UNAUTHORIZED,
});
- 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 98.
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