Showing 57 of 504 total issues
Function setViewType
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
setViewType(viewType = ViewType.Week, showAgenda = false, isEventPerspective = false) {
this.showAgenda = showAgenda;
this.isEventPerspective = isEventPerspective;
this.cellUnit = CellUnit.Day;
Function endDrag
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
endDrag: (props, monitor) => {
if (!monitor.didDrop()) return;
const { moveEvent, newEvent, schedulerData } = props;
const { events, config, viewType, localeDayjs } = schedulerData;
Function render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { schedulerData, leftCustomHeader, rightCustomHeader } = this.props;
const { viewType, renderData, showAgenda, config } = schedulerData;
const width = schedulerData.getSchedulerWidth();
- 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 BodyView
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
function BodyView({ schedulerData }) {
const { renderData, headers, config, behaviors } = schedulerData;
const width = schedulerData.getContentCellWidth();
const tableRows = renderData
- 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 hover
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
hover: (props, monitor, component) => {
const { schedulerData, resourceEvents, movingEvent } = props;
const { cellUnit, config, viewType, localeDayjs } = schedulerData;
this.config = config;
const item = monitor.getItem();
Function AddMorePopover
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AddMorePopover(props) {
const { schedulerData, headerItem, left, top, height, closeAction } = props;
const { config, localeDayjs } = schedulerData;
const { time, start, end, events } = headerItem;
Function AgendaResourceEvents
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AgendaResourceEvents(props) {
const { schedulerData, resourceEvents, slotClickedFunc, slotItemTemplateResolver } = props;
const { startDate, endDate, config, localeDayjs } = schedulerData;
const width = schedulerData.getResourceTableWidth() - 2;
Function renderSlotItem
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderSlotItem = (item, indents) => {
let indent = <span key={`es${item.indent}`} className="expander-space" />;
const iconProps = { key: `es${item.indent}`, onClick: () => handleToggleExpand(item) };
if (item.hasChildren) {
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { viewModel } = this.state;
let popover = <div />;
if (this.state.headerItem !== undefined) {
Function _resolveDate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
_resolveDate(num, date = undefined) {
if (date !== undefined) {
this.selectDate = this.localeDayjs(date);
}
Function render
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { viewModel } = this.state;
const leftCustomHeader = (
<div>
Function _createInitHeaderEvents
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createInitHeaderEvents(header) {
const start = this.localeDayjs(new Date(header.time));
const startValue = start.format(DATETIME_FORMAT);
let endValue;
Function getDateLabel
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const getDateLabel = (schedulerData, viewType, startDate, endDate) => {
const { localeDayjs } = schedulerData;
const start = localeDayjs(new Date(startDate));
const end = localeDayjs(endDate);
let dateLabel = '';
- 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 _resolveDate
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_resolveDate(num, date = undefined) {
if (date !== undefined) {
this.selectDate = this.localeDayjs(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 AgendaEventItem
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function AgendaEventItem(props) {
const { eventItem, isStart, isEnd, eventItemClick, schedulerData, eventItemTemplateResolver } = props;
const { config, behaviors } = schedulerData;
let roundCls = 'round-none';
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { viewModel } = this.state;
const leftCustomHeader = (
<div>
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;