Showing 4,177 of 14,709 total issues
Function fetchRefreshStatus
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const fetchRefreshStatus = () => async dispatch => {
try {
const response = await getRefreshStatus();
const statusList = response?.facilityExtractStatusList || [];
const mostRecentLastRequested =
- 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 getListWithRetry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getListWithRetry = async (
dispatch,
getList,
retryInterval = defaultRetryInterval,
endTimeParam = 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 areDatesEqualToMinute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const areDatesEqualToMinute = (var1, var2) => {
const parseDate = input => {
let date;
if (/^\d+$/.test(input)) {
// Input is a numeric string, parse it as a number (timestamp)
- 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 HealthCareContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const HealthCareContent = ({
appointments,
authenticatedWithSSOe,
shouldFetchUnreadMessages,
fetchConfirmedFutureAppointments,
- 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 DownloadDateRange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const DownloadDateRange = () => {
const history = useHistory();
const [selectedDate, setSelectedDate] = useState('');
const [selectionError, setSelectionError] = useState(null);
const [customFromDate, setCustomFromDate] = useState('');
- 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 findMatchingCvixReport
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const findMatchingCvixReport = (phrResponse, cvixResponseList) => {
if (phrResponse && Array.isArray(cvixResponseList)) {
for (const cvixResponse of cvixResponseList) {
if (radiologyReportsMatch(phrResponse, cvixResponse)) {
return 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 formatAppointmentsContentToText
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const formatAppointmentsContentToText = content => {
const sections = content.results.items;
// Preface text
const { preface } = content.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 VaccineDetails
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const VaccineDetails = props => {
const { runningUnitTest } = props;
const record = useSelector(state => state.mr.vaccines.vaccineDetails);
const vaccines = useSelector(state => state.mr.vaccines.vaccinesList);
const user = useSelector(state => state.user.profile);
- 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 ImageGallery
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ImageGallery = ({ imageList, imagesPerPage, studyId }) => {
const apiImagingPath = `${
environment.API_URL
}/my_health/v1/medical_records/imaging`;
- 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 getDateSigned
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getDateSigned = record => {
if (isArrayAndHasItems(record.authenticator?.extension)) {
const ext = record.authenticator.extension.find(e => e.valueDateTime);
if (ext) {
const formattedDate = formatDateLong(ext.valueDateTime);
- 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 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 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 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"
Further reading
Function RxBreadcrumbs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const RxBreadcrumbs = () => {
const location = useLocation();
const prescription = useSelector(
state => state.rx.prescriptions?.prescriptionDetails,
);
- 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"