Showing 4,231 of 14,884 total issues
Consider simplifying this complex logical expression. Open
if (
errorCodes.some(
code =>
code === 10001 ||
code === 10006 ||
Consider simplifying this complex logical expression. Open
if (
monthIndex < 0 ||
monthIndex > 11 ||
day < 1 ||
day > 31 ||
Consider simplifying this complex logical expression. Open
if (records?.length) {
const vitalDisplayName = vitalTypeDisplayNames[records[0].type];
const ddDisplayName = vitalDisplayName.includes('Blood oxygen level')
? 'Blood Oxygen'
: vitalDisplayName;
Consider simplifying this complex logical expression. Open
if (
((prescriptionsFullList?.length &&
pdfTxtGenerateStatus.format !== PRINT_FORMAT.PRINT) ||
(pdfTxtGenerateStatus.format === PRINT_FORMAT.PRINT &&
(showFilterContent
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 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 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 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 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 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"
Further reading
Function removeDeeplyEmptyObjects
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function removeDeeplyEmptyObjects(root, checkEmpty = isEmpty) {
// Check for null because typeof null === 'object', of course. Thanks JavaScript.
if (typeof root !== 'object' || root === null) {
return root;
}
- 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 uiSchema
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function uiSchema(
label = 'Address',
useStreet3 = false,
isRequired = null,
ignoreRequired = 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 formatDowntime
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const formatDowntime = dateTime => {
let date;
const timeZone = 'America/New_York';
if (dateTime instanceof 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 FormSaveErrorMessage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function FormSaveErrorMessage(props) {
const { route, formConfig, user, form, location, showLoginModal } = props;
const savedStatus = form?.savedStatus;
const appType = formConfig?.customText?.appType || APP_TYPE_DEFAULT;
- 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 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 VaFileInputField
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const VaFileInputField = props => {
const mappedProps = vaFileInputFieldMapping(props);
const dispatch = useDispatch();
const { formNumber } = props?.uiOptions;
const { fileUploadUrl } = mappedProps;
- 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 vaTextInputFieldMapping
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export default function vaTextInputFieldMapping(props) {
const {
description,
textDescription,
DescriptionField,
- 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() {
let beforeText = '';
if (this.props.beforeText && this.props.beforeText === '«') {
beforeText = (
- 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 useEditOrAddForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function useEditOrAddForm({
isEdit,
schema,
uiSchema,
data,
- 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 {
uiSchema,
errorSchema,
idSchema,
- 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"