Showing 4,177 of 14,709 total issues
Function prescriptionsReducer
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const prescriptionsReducer = (state = initialState, action) => {
switch (action.type) {
case Actions.Prescriptions.SET_DETAILS:
case Actions.Prescriptions.GET_DETAILS: {
return {
Function data
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
data: (state = initialState, action) => {
switch (action.type) {
case FETCH_EXCLUSION_PERIODS:
return {
...state,
Function createMockSuccessResponse
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createMockSuccessResponse = (
token,
demographicsNeedsUpdate = false,
demographicsConfirmedAt = null,
nextOfKinNeedsUpdate = false,
Function render
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { submission, data } = this.props.form;
const { response } = submission;
const veteranFirstName = data?.veteranInformation?.fullName?.first || '';
const veteranLastName = data?.veteranInformation?.fullName?.last || '';
Function render
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const downloadStatus = this.props.letterDownloadStatus;
const letterItems = (this.props.letters || []).map((letter, index) => {
let content;
let letterTitle;
Function GrossMonthlyIncomeInput
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
const GrossMonthlyIncomeInput = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
Function render
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
uiSchema,
errorSchema,
idSchema,
Function renderView
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderView = () => {
// This block renders the desktop and mobile view. It ensures that the desktop map
// gets re-loaded when resizing from mobile to desktop.
const {
currentQuery,
Function render
has 145 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { showWizard } = this.props;
if (showWizard === undefined) return null;
File ContactInfo.jsx
has 408 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState, useRef } from 'react';
import { useSelector, connect } from 'react-redux';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
File index.js
has 407 lines of code (exceeds 250 allowed). Consider refactoring. Open
import path from 'path';
import get from 'platform/utilities/data/get';
import disableFTUXModals from 'platform/user/tests/disableFTUXModals';
Function render
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { supplies, order, eligibility } = this.props;
const currentDate = moment();
const apneaSupplies = supplies.filter(
supply => supply.productGroup === APNEA,
Function IntroductionPage
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IntroductionPage = props => {
useEffect(() => {
focusElement('.schemaform-title > h1');
scrollToTop();
document.title =
Function mapRecordItems
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapRecordItems = (type, record) => {
const commonItems = {
[seiVitalTypes.BLOOD_PRESSURE]: [
{ title: 'Time', value: record.time, inline: true },
{ title: 'Systolic', value: record.systolic, inline: true },
Function ChangeOfAddressWrapper
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const ChangeOfAddressWrapper = ({ mailingAddress, loading, applicantName }) => {
const { loading: isLoading, error, data: response } = useSelector(
state => state.updateAddress,
);
const {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function FacilitySearch
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const FacilitySearch = props => {
const { data: formData, goBack, goForward, goToPath } = props;
const [query, setQuery] = useState('');
const [submittedQuery, setSubmittedQuery] = useState('');
const [loading, setLoading] = useState(false);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function EmploymentWorkDates
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const EmploymentWorkDates = props => {
const { goToPath, setFormData, data } = props;
const RETURN_PATH = '/enhanced-employment-records';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function SpouseEmploymentWorkDates
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
const SpouseEmploymentWorkDates = props => {
const { goToPath, setFormData, data } = props;
const RETURN_PATH = '/enhanced-spouse-employment-records';
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File touData.jsx
has 405 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
export default [
{
Function default
has 143 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function() {
if (
// need this environment check for unit tests to work
environment.isProduction() &&
// this will filter production users using the feature flag