Showing 12,841 of 12,841 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (address.length !== 0) {
address = address.join(', ');
} else {
// If we don't have an address fallback on coords
const { lat, long } = location.attributes;
- 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 78.
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
{
type: 'still_need_from_you_list',
trackedItemId: 51,
description: 'What we still need from you item two.',
displayName: 'Request 2',
- 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 78.
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 VerifiedAlert = (
<div>
<div className="usa-alert usa-alert-info schemaform-sip-alert">
<div className="usa-alert-body">
<strong>Note:</strong> Since you’re signed in to your account and your
- 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 78.
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 index.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { stateList } from './stateList';
const APP_NAMES = Object.freeze({
CHECK_IN: 'dayOf',
PRE_CHECK_IN: 'preCheckIn',
File contactInformation.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
// import _ from 'platform/utilities/data';
import merge from 'lodash/merge';
import omit from 'platform/utilities/data/omit';
import fullSchema from 'vets-json-schema/dist/21-526EZ-ALLCLAIMS-schema.json';
File search.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
import camelCaseKeysRecursive from 'camelcase-keys-recursive';
import {
SEARCH_STARTED,
SEARCH_FAILED,
File index.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
const maximalSetOfPreferences = {
data: {
id: '',
type: 'hashes',
attributes: {
File index.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
const createDebtsSuccess = () => {
return {
hasDependentDebts: false,
debts: [
{
File config.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import environment from 'platform/utilities/environment';
import compact from 'lodash/compact';
import {
LocationType,
FacilityType,
Function submitTransformer
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function submitTransformer(formConfig, form) {
const { data: formData, loadedData } = form;
const expandedPages = expandArrayPages(
createFormPageList(formConfig),
formData,
Function updateSchema
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateSchema: (formData, addressSchema, addressUiSchema, index, path) => {
let currentSchema = addressSchema;
const modifiedData = { ...formData };
Function submitTransformer
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function submitTransformer(formConfig, form) {
const { data: formData, loadedData } = form;
const expandedPages = expandArrayPages(
createFormPageList(formConfig),
formData,
Function IdentityVerificationAlert
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IdentityVerificationAlert = () => {
const onVerify = () => recordEvent({ event: AUTH_EVENTS.VERIFY });
return (
<va-alert status="continue" data-testid="hca-identity-alert" uswds>
<h2 slot="headline">
Function data
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
data: (state = initialState, action) => {
switch (action.type) {
case FETCH_PERSONAL_INFORMATION:
return {
...state,
Function getPtsdClassification
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getPtsdClassification = (formData, formType) => {
const isCombat = _.get(
'view:selectablePtsdTypes.view:combatPtsdType',
formData,
false,
Function itemsList
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
items.map((item, index) => {
const itemIsSelected = !!get(
selectedPropName || this.defaultSelectedPropName,
item,
);
File DashboardCards.jsx
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
VaPagination,
VaSelect,
} from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/api';
Function DashboardUnreadMessages
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DashboardUnreadMessages = props => {
const { inbox } = props;
const { noAssociations, allTriageGroupsBlocked } = useSelector(
state => state.sm.recipients,
Function perTermSections
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const perTermSections = () => {
const { perTerm } = outputs;
const sections = Object.keys(perTerm).map(section => {
const {
Function ReplaceAccreditedRepresentative
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ReplaceAccreditedRepresentative = props => {
const { formData } = props;
const currentRepresentative =
formData?.['view:representativeStatus']?.attributes || {};