Showing 3,724 of 12,675 total issues
Function reduceErrors
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export const reduceErrors = (errors, pageList, reviewErrors = {}) =>
errors.reduce((processedErrors, error) => {
let errorIndex = null; // save key (index) of array items with __error
const findErrors = (name, err) => {
if (err && typeof err === 'object') {
- 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 updateRequiredFields
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export function updateRequiredFields(schema, uiSchema, formData, index = null) {
if (!uiSchema) {
return schema;
}
- 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 render
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { location } = this.props;
if (!location) {
return null;
- 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 Dropdown
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const Dropdown = ({
shortName,
router,
formResponses,
formValue,
- 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 RadioGroup
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
const RadioGroup = ({
formError,
formResponses,
formValue,
hint,
- 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 nextQuestion
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
function nextQuestion(currentQuestion, answer, state) {
let next;
const noGeneralCourtMartial = ['2', '3'].includes(state['7_courtMartial']);
const dischargeYear = state['2_dischargeYear'];
const dischargeMonth = state['3_dischargeMonth'] || 1;
- 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 getDerivedAttributes
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export function getDerivedAttributes(constant, eligibility, institution) {
const your = eligibility;
const its = institution;
const chapter = Number(your.giBillChapter);
let monthlyRate;
- 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 SearchQueryReducer
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const SearchQueryReducer = (state = INITIAL_STATE, action) => {
switch (action.type) {
case SEARCH_STARTED:
return {
...state,
Function render
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { showWizard } = this.props;
if (showWizard === undefined) return null;
return (
Function render
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { showWizard } = this.props;
if (showWizard === undefined) return null;
return (
Function UpcomingAppointmentsList
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function UpcomingAppointmentsList() {
const history = useHistory();
const dispatch = useDispatch();
const {
showScheduleButton,
File MissingFileOverview.jsx
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
OVERVIEW:
The MissingFileOverview component is responsible for tracking file uploads
within the form and displaying a message to the user indicating which files
they have yet to upload before the application is considered complete.
File AddressValidationView.jsx
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { VaAlert } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
import {
File medicareInformation.js
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import {
titleUI,
titleSchema,
textUI,
File form-submit-transform.js
has 355 lines of code (exceeds 250 allowed). Consider refactoring. Open
// this constant maps the values on address.js in vets.json schema from VA.gov values to LTS values
// the lts values were found on the LTS database and LTS validates them, so we need to send correct value from here
const countries = [
{ schemaValue: 'USA', ltsValue: 'US', label: 'United States' },
{ schemaValue: 'AFG', ltsValue: 'AF', label: 'Afghanistan' },
Function MessageThreadHeader
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MessageThreadHeader = props => {
const {
message,
cannotReply,
isCreateNewModalVisible,
Function RadiologyImagesList
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
const RadiologyImagesList = () => {
const dispatch = useDispatch();
const allowTxtDownloads = useSelector(
state =>
state.featureToggles[
Function Hub
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Hub = () => {
const { label, link } = useSignInServiceProvider();
const hasBadAddress = useSelector(hasBadAddressSelector);
useEffect(() => {
Function renderResultItems
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderResultItems = (searchQuery, apiResults) => {
return apiResults?.map((result, index) => {
let item;
const showHealthConnectNumber = isHealthAndHealthConnect(result, query);
Function guardianInformation
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function guardianInformation(schema, options) {
// Use the defaults as necessary, but override with the options given
const { fields, required } = {
...defaults(),
...options,