Showing 3,724 of 12,675 total issues
Function locationInfo
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const locationInfo = (city, state, country) => {
let address = '';
if (isCountryUSA(country)) {
if (city && state) {
address = `${city}, ${state}`;
- 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 ConnectedDevicesSection
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const ConnectedDevicesSection = ({
connectedDevices,
successAlert,
failureAlert,
disconnectSuccessAlert,
- 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 CopyAddressModal
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const CopyAddressModal = props => {
const {
mailingAddress = null,
homeAddress,
transaction,
- 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 mockGetRefreshStatus
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const mockGetRefreshStatus = () => {
switch (scenario) {
case 1: {
return mockStatusResponse(0, 80, 70, 70); // STALE
}
- 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 getLatestCopay
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getLatestCopay = statements => {
if (!statements) return null;
return statements.reduce((acc, currentCopay) => {
if (currentCopay.pSStatementDateOutput) {
if (!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 dateFormatWithoutTimezone
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const dateFormatWithoutTimezone = datetime => {
let withoutTimezone = datetime;
if (typeof datetime === 'string' && datetime.includes('-')) {
// Check if datetime has a timezone and strip it off if present
if (datetime.includes('T')) {
- 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 {
activeIndex,
isOpen,
inputValue,
- 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 RadiologySingleImage
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const RadiologySingleImage = () => {
const dispatch = useDispatch();
const { labId, imageId } = useParams();
// const labAndTestDetails = useSelector(
// state => state.mr.labsAndTests.labsAndTestsDetails,
- 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 VeteranDetails
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function VeteranDetails({ profile }) {
const { veteranSocialSecurityNumber, vaFileNumber, dob, gender } = profile;
const { first, middle, last, suffix } = profile.userFullName;
const mask = srSubstitute('●●●–●●–', 'ending with');
- 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 PrescriptionDetailsDocumentation
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const PrescriptionDetailsDocumentation = () => {
const { prescriptionId } = useParams();
const { search } = useLocation();
const queryParams = new URLSearchParams(search);
const ndcNumber = queryParams.get('ndc');
- 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 buildMedicationInformationPDF
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const buildMedicationInformationPDF = list => {
const listOfHeaders = ['h2', 'h3'];
const sections = [
...list
.filter(listItem => listOfHeaders.includes(listItem.type))
- 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 uiSchemaValidate
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
errors,
uiSchema,
schema,
formData,
path = '',
Function uploadFile
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
file,
uiOptions,
onProgress,
onChange,
onError,
Function validateMilitaryCity
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
errors,
city,
formData,
schema,
messages,
Function validateMilitaryState
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
errors,
state,
formData,
schema,
messages,
Function uiSchema
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
subHeader = veteranApplicantDetailsSubHeader,
description = '',
nameUI = nonPreparerFullMaidenNameUI,
ssnUI = ssnDashesUI,
dateOfBirthUI = nonPreparerDateOfBirthUI,
Function uiSchema
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
subHeader = veteranApplicantDetailsSubHeader,
description = '',
nameUI = nonPreparerFullMaidenNameUI,
ssnUI = ssnDashesUI,
dateOfBirthUI = nonPreparerDateOfBirthUI,
Avoid deeply nested control flow statements. Open
if (sortOrder === 'ASC') {
return a.attributes.recipientName.localeCompare(
b.attributes.recipientName,
);
}
Function generateHeaderBanner
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const generateHeaderBanner = async (doc, header, data, config) => {
doc.moveDown(1);
const currentHeight = doc.y;
// Calculate text width
- 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
Avoid deeply nested control flow statements. Open
if (sortOrder === 'DESC') {
return b.attributes.recipientName.localeCompare(
a.attributes.recipientName,
);
}