Showing 4,177 of 14,709 total issues
Avoid too many return
statements within this function. Open
return Promise.reject(
new Error(
'post-911-gib-status getEnrollmentData() received unexpected error (no status code available)',
),
);
Avoid too many return
statements within this function. Open
return {
...state,
selectedSortOption: action.payload,
};
Avoid too many return
statements within this function. Open
return (
<>
<p data-testid="status">Expired</p>
<va-additional-info
uswds
Avoid too many return
statements within this function. Open
return {
...state,
refillableList,
renewableList,
apiError: false,
Avoid too many return
statements within this function. Open
return {
...state,
refillNotification: initialState.refillNotification,
};
Avoid too many return
statements within this function. Open
return {
...state,
prescriptionsList: state.prescriptionsList?.map(
rx =>
rx.prescriptionId === action.err.id
Avoid too many return
statements within this function. Open
return {
...state,
prescriptionsList: state.prescriptionsList?.map(
rx =>
rx.prescriptionId === action.prescriptionId
Avoid too many return
statements within this function. Open
return (
<>
<p data-testid="status">Transferred</p>
<va-additional-info
uswds
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return (
<>
<p data-testid="status">Active: Refill in process</p>
<va-additional-info uswds trigger="What does this status mean?">
{dropdownContent()}
Avoid too many return
statements within this function. Open
return (
<>
<p data-testid="status">Active: Submitted</p>
<va-additional-info
uswds
Avoid too many return
statements within this function. Open
return {
...state,
refillNotification: {
successfulMeds,
failedMeds,
Avoid too many return
statements within this function. Open
return Promise.reject(
new Error(
`post-911-gib-status getEnrollmentData() received unexpected error: ${
error.status
}: ${error.title}: ${error.detail}`,
Avoid too many return
statements within this function. Open
return {
...state,
prescriptionsList: state.prescriptionsList?.map(
rx =>
rx.prescriptionId === action.response.id
Function Search
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Search = () => {
const onInputSubmit = componentState => {
const inputValue = componentState?.inputValue;
const savedSuggestions = componentState?.savedSuggestions || [];
const suggestions = componentState?.suggestions || [];
- 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 defaultPostHook
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const defaultPostHook = pathname => {
// On review pages, check the privacy agreement box if it exists and submit.
if (pathname.endsWith('/review-and-submit')) {
return () => {
cy.get(APP_SELECTOR, NO_LOG_OPTION).then($form => {
- 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 setStaticHeaderDisplay
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function setStaticHeaderDisplay(
show,
isMinimalHeaderApplicable,
headerState,
isDesktop,
- 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 determineHeaderState
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function determineHeaderState(show, showMinimalHeader, path, isDesktop) {
if (!show) {
return 'none';
}
if (
- 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 FormSaved
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const FormSaved = props => {
const {
router,
route,
lastSavedDate,
- 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 startApp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function startApp({
routes,
createRoutesWithStore,
component,
reducer,
- 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"