Showing 12,811 of 12,811 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
case FETCH_MULTI_FACILITY_STARTED: {
const tempMultiData = retrieveMultiData(state);
const tempMultiLoading = retrieveMultiLoading(state);
const tempMultiError = retrieveMultiError(state);
tempMultiLoading[action.facilityID] = true;
- 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 108.
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 const PrimaryActionLink = ({ href = '/', children, onClick = null }) => (
<div className="action-bar-arrow">
<div className="vads-u-background-color--primary vads-u-padding--1">
<a className="vads-c-action-link--white" href={href} onClick={onClick}>
{children}
- 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 108.
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
case FETCH_MULTI_FACILITY_FAILED: {
const tempMultiData = retrieveMultiData(state);
const tempMultiLoading = retrieveMultiLoading(state);
const tempMultiError = retrieveMultiError(state);
tempMultiLoading[action.facilityID] = 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 108.
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 const PrimaryActionLink = ({ href = '/', children, onClick = null }) => (
<div className="action-bar-arrow">
<div className="vads-u-background-color--primary vads-u-padding--1">
<a className="vads-c-action-link--white" href={href} onClick={onClick}>
{children}
- 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 108.
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
case STATUS_TYPES.hlrReceived:
contents.title =
'A higher-level reviewer is taking a new look at your case';
contents.description = (
<div>
- 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 108.
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 OverviewPage
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
const OverviewPage = () => {
const { debtLetters, mcp } = useSelector(
({ combinedPortal }) => combinedPortal,
);
const {
Function genBBoxFromAddress
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const genBBoxFromAddress = (query, expandedRadius = false) => {
// Prevent empty search request to Mapbox, which would result in error, and
// clear results list to respond with message of no facilities found.
if (!query.searchString) {
return {
Function createLocationEvents
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createLocationEvents = () => {
const facilityEventData = {
fieldEventCost: 'Free',
fieldFacilityLocation: {
entity: {
Function editEmailAddressSuccess
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const editEmailAddressSuccess = () => {
// store the email address that's passed in via the POST or PUT call so we can
// return it with the GET user/ response
let newEmailAddress;
return [
Function render
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { form } = this.props;
const { name } = form.data.application.claimant;
const submittedAt = moment(form.submission.submittedAt);
Function RecordList
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
const RecordList = props => {
const { records, type, perPage = 10, hidePagination } = props;
const totalEntries = records?.length;
const history = useHistory();
Function MrBreadcrumbs
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MrBreadcrumbs = () => {
const dispatch = useDispatch();
const location = useLocation();
const history = useHistory();
const crumbsList = useSelector(state => state.mr.breadcrumbs.crumbsList);
File BenefitsForm.jsx
has 318 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import EbenefitsLink from 'platform/site-wide/ebenefits/containers/EbenefitsLink';
import {
ariaLabels,
File actions.js
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as Sentry from '@sentry/browser';
import recordEvent from 'platform/monitoring/record-event';
import localStorage from 'platform/utilities/storage/localStorage';
import { displayFileSize } from 'platform/utilities/ui/index';
import { FILE_UPLOAD_NETWORK_ERROR_MESSAGE } from 'platform/forms-system/src/js/constants';
File personalInformationHelper.js
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
import VaTextInputField from 'platform/forms-system/src/js/web-component-fields/VaTextInputField';
import {
dateOfBirthSchema,
dateOfBirthUI,
selectSchema,
Function SubTask
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SubTask = props => {
const { pages = [], formData, setFormData, router } = props;
const [currentPage, setCurrentPage] = useState(pages[0] || {});
const [subTaskData, setSubTaskData] = useState(getStoredSubTask());
const [hasError, setHasError] = useState(false);
Function getProfileInfoFieldAttributes
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getProfileInfoFieldAttributes = fieldName => {
let apiRoute;
let convertCleanDataToPayload;
let title;
let uiSchema;
Function transform
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function transform(formConfig, form) {
const expandedPages = expandArrayPages(
createFormPageList(formConfig),
form.data,
);
Function render
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { disabilities } = this.state;
const { calculatedRating } = this.state;
const ratings = getRatings(disabilities);
Function ContactInformation
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ContactInformation = () => {
const lastLocation = useLastLocation();
const hasUnsavedEdits = useSelector(
state => state.vapService.hasUnsavedEdits,