Showing 3,724 of 12,675 total issues
Function LabsAndTestsListItem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LabsAndTestsListItem = props => {
const { record } = props;
return (
<va-card
Function ConditionListItem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ConditionListItem = props => {
const { record } = props;
return (
<va-card
Function allergiesReducer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const allergiesReducer = (state = initialState, action) => {
switch (action.type) {
case Actions.Allergies.GET_LIST: {
return {
...state,
Function dropdownContent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const dropdownContent = () => {
return (
<>
<p className="vads-u-padding-bottom--1">
A VA provider added this medication record in your VA medical
Consider simplifying this complex logical expression. Open
} else if (prefillEnabled && !verifyRequiredPrefill) {
const H = `h${this.props.headingLevel}`;
const {
buttonOnly,
retentionPeriod,
Consider simplifying this complex logical expression. Open
if (
nextProps.reviewMode &&
!nextProps.editModeOnReviewPage &&
nextProps.reviewMode === this.props.reviewMode &&
deepEquals(this.state, nextState) &&
Consider simplifying this complex logical expression. Open
} else if (
allowITF &&
!isCreating &&
!hasActiveITF &&
!createITFCalled &&
Consider simplifying this complex logical expression. Open
} else if (
allowITF &&
!isCreating &&
!hasActiveITF &&
!createITFCalled &&
Consider simplifying this complex logical expression. Open
if (
nextProps.reviewMode &&
!nextProps.editModeOnReviewPage &&
nextProps.reviewMode === this.props.reviewMode &&
deepEquals(this.state, nextState) &&
Consider simplifying this complex logical expression. Open
if (
[SENT_DATE_DESCENDING.value, DRAFT_DATE_DESCENDING.value].includes(
sortOrder,
) ||
(sortOrder === SENDER_ALPHA_ASCENDING.value &&
Consider simplifying this complex logical expression. Open
if (
errorCodes.some(
code =>
code === 10001 ||
code === 10006 ||
Consider simplifying this complex logical expression. Open
if (!isLoading) {
return (
<div className="landing-page no-print">
<h1 data-testid="list-page-title" className="vads-u-margin-bottom--2">
Medications
Consider simplifying this complex logical expression. Open
if (
((prescriptionsFullList?.length &&
pdfTxtGenerateStatus.format !== PRINT_FORMAT.PRINT) ||
(pdfTxtGenerateStatus.format === PRINT_FORMAT.PRINT &&
paginatedPrescriptionsList?.length)) &&
Function FormStartControls
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const FormStartControls = props => {
const {
formId,
migrations,
startPage,
- 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 generateResultsContent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const generateResultsContent = async (doc, parent, data) => {
const results = doc.struct('Sect', {
title: 'Results',
});
parent.add(results);
- 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 testForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const testForm = testConfig => {
const {
appName,
arrayPages = [],
dataPrefix,
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { formConfig, buttonOnly, devOnly } = this.props;
const devOnlyForceShowFormControls =
environment.isLocalhost() &&
!window.Cypress &&
- 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 generateResultsContent
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const generateResultsContent = async (doc, parent, data, config) => {
const results = doc.struct('Sect', {
title: 'Results',
});
parent.add(results);
- 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 exports
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
module.exports = async (on, config) => {
if (process.env.CODE_COVERAGE === 'true') {
require('@cypress/code-coverage/task')(on, config);
on('file:preprocessor', require('@cypress/code-coverage/use-babelrc'));
}
- 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 titleUI
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const titleUI = (titleOption, descriptionOption) => {
const {
title,
description,
headerLevel,
- 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"