Showing 60 of 537 total issues
Scheduler
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class Scheduler extends Component {
constructor(props) {
super(props);
const { schedulerData, dndSources, parentRef } = props;
Function _createHeaders
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createHeaders() {
const headers = [];
let start = this.localeDayjs(new Date(this.startDate));
let end = this.localeDayjs(new Date(this.endDate));
let header = start;
Function _handleRecurringEvents
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
_handleRecurringEvents() {
const recurringEvents = this.events.filter(x => !!x.rrule);
recurringEvents.forEach(item => {
this._detachEvent(item);
});
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 DragAndDrop
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
function DragAndDrop() {
const [state, dispatch] = useReducer(reducer, initialState);
const [taskDndSource, setTaskDndSource] = useState(new DnDSource(props => props.task, TaskItem, true, DnDTypes.TASK));
const [resourceDndSource, setResourceDndSource] = useState(new DnDSource(props => props.resource, ResourceItem, true, DnDTypes.RESOURCE));
- 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 render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { viewModel, taskDndSource, resourceDndSource } = this.state;
return (
<div>
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 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 _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 AddMore
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
function AddMore() {
const [state, dispatch] = useReducer(reducer, initialState);
const [popoverState, setPopoverState] = useState({
headerItem: undefined,
- 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 _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';