Showing 12,811 of 12,811 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
boardAppealPage: {
depends: formData =>
formData.statementType === STATEMENT_TYPES.DECISION_REVIEW &&
isEligibleForDecisionReview(formData.decisionDate) &&
formData.decisionReviewType === DECISION_REVIEW_TYPES.BVA_REQUEST,
- 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 93.
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
Cypress.Commands.add('selectVaButtonPairSecondary', field => {
const selector = `va-button-pair${field ? `[name="${field}"]` : ''}`;
cy.get(selector)
.shadow()
.find('va-button[secondary], va-button[back]')
- 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 93.
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
const {
address,
canScheduleAtChosenFacility,
cernerSiteIds,
childFacilitiesStatus,
- 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 93.
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
moment.tz.setDefault = function(name) {
if (major < 2 || (major === 2 && minor < 9)) {
logError(
'Moment Timezone setDefault() requires Moment.js >= 2.9.0. You are using Moment.js ' +
moment.version +
- 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 93.
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 form.js
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import footerContent from 'platform/forms/components/FormFooter';
import getHelp from '../../shared/components/GetFormHelp';
import manifest from '../manifest.json';
File householdIncomeChapter.js
has 287 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
benefits,
additionalIncomeValues,
spouseBenefits,
spouseBenefitRecords,
Function expandAllEnrollments
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const expandAllEnrollments = () => {
/*
make sure the begin date and end date are in the same month,
if not then expand the enrollment period for each month
between the begin and end dates of the enrollment
Function DeactivatedMHVIds
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DeactivatedMHVIds = () => {
const content = {
heading: 'Your My HealtheVet account is inactive',
alertText: (
<div>
Function DependencyVerificationModal
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DependencyVerificationModal = props => {
const nodeToWatch = document.getElementsByTagName('body')[0];
const [otherModal, setOtherModal] = useState(null);
const openModal = () => {
Function Wrapper
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Wrapper = props => {
const {
children,
pageTitle,
titleOverride,
Function renderLocationInputField
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderLocationInputField = () => {
return (
<div>
<div id="location-input-field">
<label
Function inquiriesGridView
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const inquiriesGridView = category => {
const filteredInquiries = filterAndSortInquiries(category);
const indexOfLastItem = currentPage * itemsPerPage;
const indexOfFirstItem = indexOfLastItem - itemsPerPage;
const currentInquiries = filteredInquiries.slice(
Function FacilityList
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const FacilityList = props => {
const { facilities, onChange, query, value, error } = props;
const reviewMode = props?.formContext?.reviewMode || false;
const submitted = props?.formContext?.submitted || false;
Function Appeals
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Appeals = () => {
useEffect(() => {
recordEvent({
event: 'howToWizard-alert-displayed',
'reason-for-alert':
Function transformFormToCCRequest
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function transformFormToCCRequest(state) {
const data = getFormData(state);
const provider = data.communityCareProvider;
let preferredProviders = [];
Function render
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const crumbs = [
{
href: `../status`,
label: 'Status details',
Function renderCalendar
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderCalendar = () => {
if (!displayedInputs.calendar) return null;
const dependentDropdowns = (
<div>
Function LabsAndTests
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LabsAndTests = () => {
const dispatch = useDispatch();
const updatedRecordList = useSelector(
state => state.mr.labsAndTests.updatedList,
);
Function buildVAPrescriptionTXT
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const buildVAPrescriptionTXT = prescription => {
const refillHistory = [...(prescription?.rxRfRecords || [])];
const originalFill = createOriginalFillRecord(prescription);
refillHistory.push(originalFill);
File VAPServiceProfileField.jsx
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { focusElement } from 'platform/utilities/ui';