Showing 60 of 537 total issues
Consider simplifying this complex logical expression. Open
if ((start >= eStart && start < eEnd) || (end > eStart && end <= eEnd) || (eStart >= start && eStart < end) || (eEnd > start && eEnd <= end)) hasConflict = true;
Consider simplifying this complex logical expression. Open
if ((start >= eStart && start < eEnd) || (end > eStart && end <= eEnd) || (eStart >= start && eStart < end) || (eEnd > start && eEnd <= end)) {
hasConflict = true;
}
Consider simplifying this complex logical expression. Open
if ((start >= eStart && start < eEnd) || (end > eStart && end <= eEnd) || (eStart >= start && eStart < end) || (eEnd > start && eEnd <= end)) hasConflict = true;
Consider simplifying this complex logical expression. Open
if ((start >= eStart && start < eEnd) || (end > eStart && end <= eEnd) || (eStart >= start && eStart < end) || (eEnd > start && eEnd <= end)) hasConflict = true;
Function newEvent
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const newEvent = (schedulerData, slotId, slotName, start, end, type, item) => {
if (confirm(`Do you want to create a new event? {slotId: ${slotId}, slotName: ${slotName}, start: ${start}, end: ${end}, type: ${type}, item: ${item}}`)) {
let newFreshId = 0;
schedulerData.events.forEach(item => {
if (item.id >= newFreshId) newFreshId = item.id + 1;
Function toggleExpandStatus
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
toggleExpandStatus(slotId) {
let slotEntered = false;
let slotIndent = -1;
let isExpanded = false;
const expandedMap = new Map();
Function drop
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
drop: (props, monitor, component) => {
const { schedulerData, resourceEvents } = props;
const { cellUnit, localeDayjs } = schedulerData;
const type = monitor.getItemType();
const pos = getPos(component.eventContainer);
Function _createInitHeaderEvents
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_createInitHeaderEvents(header) {
const start = this.localeDayjs(new Date(header.time));
const startValue = start.format(DATETIME_FORMAT);
let endValue;
- 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 _createInitRenderData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
_createInitRenderData(isEventPerspective, eventGroups, resources, headers) {
const slots = isEventPerspective ? eventGroups : resources;
const slotTree = [];
const slotMap = new Map();
slots.forEach(slot => {
- 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 EventItemPopover
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function EventItemPopover({
schedulerData,
eventItem,
title,
startTime,
- 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 getCustomDate
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export const getCustomDate = (schedulerData, num, date = schedulerData.startDate) => {
const { viewType, localeDayjs } = schedulerData;
let startDate;
let endDate;
let cellUnit;
- 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
} else if (this.cellUnit === CellUnit.Year) {
while (header >= start && header <= end) {
const time = header.format(DATE_FORMAT);
headers.push({ time });
header = header.add(1, 'years').startOf('year');
Avoid deeply nested control flow statements. Open
if (selectDate >= start && selectDate < end) {
date = this.selectDate;
}
Avoid deeply nested control flow statements. Open
while (header >= start && header <= end) {
const time = header.format(DATE_FORMAT);
headers.push({ time });
header = header.add(1, 'months').startOf('month');
}
Function componentDidMount
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
componentDidMount(props, state) {
const { schedulerData, parentRef } = this.props;
this.resolveScrollbarSize();
- 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 AgendaResourceEvents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function AgendaResourceEvents(props) {
const { schedulerData, resourceEvents, slotClickedFunc, slotItemTemplateResolver } = props;
const { startDate, endDate, config, localeDayjs } = schedulerData;
const width = schedulerData.getResourceTableWidth() - 2;
- 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 _compare
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_compare(event1, event2) {
const start1 = this.localeDayjs(event1.start);
const start2 = this.localeDayjs(event2.start);
if (start1 !== start2) return start1 < start2 ? -1 : 1;
- 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 AgendaEventItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function AgendaEventItem(props) {
const { eventItem, isStart, isEnd, eventItemClick, schedulerData, eventItemTemplateResolver } = props;
const { config, behaviors } = schedulerData;
let roundCls = 'round-none';
- 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 Summary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function Summary({ schedulerData, summary, left, width, top }) {
const { config } = schedulerData;
const color = summary.color !== undefined ? summary.color : config.summaryColor;
let textAlign = 'center';
- 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 componentDidUpdate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
componentDidUpdate(props, state) {
this.resolveScrollbarSize();
const { schedulerData } = this.props;
const { localeDayjs, behaviors } = schedulerData;
- 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"