Showing 4,231 of 14,884 total issues
Function CareSummariesAndNotesListItem
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const CareSummariesAndNotesListItem = props => {
const { record } = props;
const isDischargeSummary = record.type === loincCodes.DISCHARGE_SUMMARY;
const admDate = dischargeSummarySortFields.ADMISSION_DATE;
- 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 getClaimUpdateDate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getClaimUpdateDate = claim => {
let updateDate;
const filedDate = claim?.attributes.claimDate;
const changeDate = claim?.attributes.claimPhaseDates?.phaseChangeDate;
if (changeDate && filedDate) {
- 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 Claim
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const Claim = ({ claim }) => {
if (!claim.attributes) {
throw new TypeError(
'`claim` prop is malformed; it should have an `attributes` property.',
);
- 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 findMatchingPhrAndCvixStudies
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const findMatchingPhrAndCvixStudies = async (
id,
phrResponse,
cvixResponse,
) => {
- 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 extractLocation
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const extractLocation = vital => {
if (isArrayAndHasItems(vital.performer)) {
if (isArrayAndHasItems(vital.performer[0].extension)) {
const refId = vital.performer[0].extension[0].valueReference?.reference;
const location = extractContainedResource(vital, refId);
- 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 DebtsCard
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const DebtsCard = ({ debts }) => {
const debtHistory = debts.reduce(
(acc, debt) => (debt.debtHistory ? acc.concat(debt.debtHistory) : acc),
[],
);
- 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 CernerFacilityAlert
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const CernerFacilityAlert = ({ linkPath, pageName }) => {
const ehrDataByVhaId = useSelector(
state => state?.drupalStaticData?.vamcEhrData?.data?.ehrDataByVhaId,
);
const userFacilities = useSelector(state => state?.user?.profile?.facilities);
- 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 convertAppointment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const convertAppointment = appt => {
if (!appt) return null;
const now = new Date();
const { attributes } = appt;
- 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 SearchResultsHeader
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const SearchResultsHeader = props => {
const { query, resultCount, inProgress } = props;
const searchWasPerformed = !!query;
- 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 buildNonVAPrescriptionTXT
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const buildNonVAPrescriptionTXT = prescription => {
return `
---------------------------------------------------------------------------------
- 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 testableApiRequestWithRetry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const testableApiRequestWithRetry = (
retryInterval,
apiRequestFunc,
) => async (path, options, endTime) => {
if (Date.now() >= endTime) {
- 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"