Showing 12,835 of 12,835 total issues
Function vitalReducer
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const vitalReducer = (state = initialState, action) => {
switch (action.type) {
case Actions.Vitals.GET: {
return {
...state,
Function render
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { enrollmentData } = this.props;
let introText;
let printButton;
if (enrollmentData.veteranIsEligible) {
File helpers.jsx
has 260 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { Link } from 'react-router';
import moment from 'moment';
import {
File EnhancedSpouseEmploymentRecord.jsx
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { setData } from 'platform/forms-system/src/js/actions';
import {
Function initUserMock
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function initUserMock(token, level) {
mock(token, {
path: '/v0/user',
verb: 'get',
value: {
Function ReviewFieldTemplate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ReviewFieldTemplate(props) {
const { children, uiSchema, schema, formContext } = props;
const label = uiSchema['ui:title'] || props.label;
const description = uiSchema['ui:description'];
const textDescription = typeof description === 'string' ? description : null;
Function checkValidSchema
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function checkValidSchema(schema, errors = [], path = ['root']) {
if (typeof schema.type !== 'string') {
errors.push(`Missing type in ${path.join('.')} schema.`);
}
Function fetchPersonalInformation
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fetchPersonalInformation(
forceCacheClear = false,
recordAnalyticsEvent = recordEvent,
) {
return async dispatch => {
Function createAdditionalConsiderations
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createAdditionalConsiderations(submissionForm) {
if (submissionForm?.mebExclusionPeriodEnabled) {
const exclusionPeriods = submissionForm.exclusionPeriods || [];
const mapping = {
academyRotcScholarship: {
Function fetchLocations
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const fetchLocations = async (
address = null,
bounds,
locationType,
serviceType,
Function BenefitRelinquishmentDate
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
const BenefitRelinquishmentDate = props => {
const { formData, setFormData } = props;
const aYearAgo = moment(new Date()).subtract(1, 'y');
const populateDate = () => {
Function render
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.state.loading) {
return <va-loading-indicator message="Loading facilities..." />;
}
Function TravelEligibilityAddtionalInfo
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
const TravelEligibilityAddtionalInfo = () => {
const boldComponent = [
<span key="bold" className="vads-u-font-weight--bold" />,
];
return (
Function Waivers
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Waivers = () => {
useEffect(() => {
recordEvent({
event: 'howToWizard-alert-displayed',
'reason-for-alert':
Function getPastAppointmentDateRangeOptions
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getPastAppointmentDateRangeOptions(today = moment()) {
const startOfToday = today.clone().startOf('day');
// Past 3 months
const options = [
Function AccountUpdateView
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const AccountUpdateView = props => {
// all props used come from the result of the useDirectDeposit hook
const {
formData,
formSubmit,
Function SearchReducer
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
function SearchReducer(state = initialState, action) {
switch (action.type) {
case FETCH_SEARCH_RESULTS: {
return {
...state,
Identical blocks of code found in 2 locations. Consider refactoring. Open
currentName: merge({}, fullNameUI, {
first: {
'ui:title': 'Sponsor’s first name',
},
last: {
- 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 79.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
export const titleCase = str => {
return str
.toLowerCase()
.split(' ')
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
- 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 79.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
const options = INSTITUTION_TYPES.map(type => {
return {
name: type.toUpperCase(),
checked: excludedSchoolTypes.includes(type.toUpperCase()),
optionLabel: INSTITUTION_TYPES_DICTIONARY[type],
- 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 79.
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