public/assets/fullcalendar-a27fb9d257cc1270a14286cedb01a2357bcfe0c2906272a7b25da53b68691440.js
File fullcalendar-a27fb9d257cc1270a14286cedb01a2357bcfe0c2906272a7b25da53b68691440.js
has 8450 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* FullCalendar v3.0.0
* Docs & License: http://fullcalendar.io/
* (c) 2016 Adam Shaw
*/
Function EventManager
has 722 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function EventManager() { // assumed to be a calendar
var t = this;
// exports
Function Calendar_constructor
has 516 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Calendar_constructor(element, overrides) {
var t = this;
// Exports
Function Header
has 210 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Header(calendar) {
var t = this;
// exports
t.render = render;
Function renderSection
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderSection(position) {
var sectionEl = $('<div class="fc-' + position + '"/>');
var options = calendar.options;
var buttonStr = options.header[position];
Function _fetchEventSource
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function _fetchEventSource(source, callback) {
var i;
var fetchers = FC.sourceFetchers;
var res;
Function buildSegDragListener
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildSegDragListener: function(seg) {
var _this = this;
var view = this.view;
var calendar = view.calendar;
var el = seg.el;
Function limitRow
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
limitRow: function(row, levelLimit) {
var _this = this;
var rowStruct = this.rowStructs[row];
var moreNodes = []; // array of "more" <a> links and <td> DOM nodes
var col = 0; // col #, left-to-right (not chronologically)
Function renderSegRow
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderSegRow: function(row, rowSegs) {
var colCnt = this.colCnt;
var segLevels = this.buildSegLevels(rowSegs); // group into sub-arrays of levels
var levelCnt = Math.max(1, segLevels.length); // ensure at least one level
var tbody = $('<tbody/>');
Function mutateEvent
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mutateEvent(event, newProps, largeUnit) {
var miscProps = {};
var oldProps;
var clearEnd;
var startDelta;
Function buildEventFromInput
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildEventFromInput(input, source) {
var out = {};
var start, end;
var allDay;
Function buildSegResizeListener
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildSegResizeListener: function(seg, isStart) {
var _this = this;
var view = this.view;
var calendar = view.calendar;
var el = seg.el;
Function buildDayDragListener
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildDayDragListener: function() {
var _this = this;
var view = this.view;
var isSelectable = view.opt('selectable');
var dayClickHit; // null if invalid dayClick
Function mutateEvents
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mutateEvents(events, clearEnd, allDay, dateDelta, durationDelta, miscProps) {
var isAmbigTimezone = t.getIsAmbigTimezone();
var undoFunctions = [];
// normalize zero-length deltas to be null
Function fgSegHtml
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fgSegHtml: function(seg, disableResizing) {
var view = this.view;
var event = seg.event;
var isDraggable = view.isEventDraggable(event);
var isResizableFromStart = !disableResizing && seg.isStart && view.isEventResizableFromStart(event);
Function buildViewSpec
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildViewSpec: function(requestedViewType) {
var viewOverrides = this.overrides.views || {};
var specChain = []; // for the view. lowest to highest priority
var defaultsChain = []; // for the view. lowest to highest priority
var overridesChain = []; // for the view. lowest to highest priority
Function makeMoment
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function makeMoment(args, parseAsUTC, parseZone) {
var input = args[0];
var isSingleString = args.length == 1 && typeof input === 'string';
var isAmbigTime;
var isAmbigZone;
Function fgSegHtml
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fgSegHtml: function(seg, disableResizing) {
var view = this.view;
var event = seg.event;
var isDraggable = view.isEventDraggable(event);
var isResizableFromStart = !disableResizing && event.allDay &&
Function expandEvent
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function expandEvent(abstractEvent, _rangeStart, _rangeEnd) {
var events = [];
var dowHash;
var dow;
var i;
Function isSpanAllowed
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Calendar.prototype.isSpanAllowed = function(span, constraint, overlap, event) {
var constraintEvents;
var anyContainment;
var peerEvents;
var i, peerEvent;
Function position
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
position: function() {
var options = this.options;
var origin = this.el.offsetParent().offset();
var width = this.el.outerWidth();
var height = this.el.outerHeight();
Function listenToExternalDrag
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
listenToExternalDrag: function(el, ev, ui) {
var _this = this;
var calendar = this.view.calendar;
var meta = getDraggedElMeta(el); // extra data about event drop, including possible event to create
var dropLocation; // a null value signals an unsuccessful drag
Function formatRangeWithChunks
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function formatRangeWithChunks(date1, date2, chunks, separator, isRTL) {
var unzonedDate1 = date1.clone().stripZone(); // for formatSimilarChunk
var unzonedDate2 = date2.clone().stripZone(); // "
var chunkStr; // the rendering of the chunk
var leftI;
Function updateDayTable
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateDayTable: function() {
var view = this.view;
var date = this.start.clone();
var dayIndex = -1;
var dayIndices = [];
Function fgSegHtml
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fgSegHtml: function(seg) {
var view = this.view;
var classes = [ 'fc-list-item' ].concat(this.getSegCustomClasses(seg));
var bgColor = this.getSegBackgroundColor(seg);
var event = seg.event;
Function setOptions
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setOptions(newOptionHash) {
var optionCnt = 0;
var optionName;
for (optionName in newOptionHash) {
Function renderView
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderView(viewType, explicitScrollState) {
ignoreWindowResize++;
// if viewType is changing, remove the old view's rendering
if (currentView && viewType && currentView.type !== viewType) {
Function initialRender
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initialRender() {
element.addClass('fc');
// event delegation for nav links
element.on('click.fc', 'a[data-goto]', function(ev) {
Function distributeHeight
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function distributeHeight(els, availableHeight, shouldRedistribute) {
// *FLOORING NOTE*: we floor in certain places because zoom can give inaccurate floating-point dimensions,
// and it is better to be shorter than taller, to avoid creating unnecessary scrollbars.
Function bindHandlers
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
bindHandlers: function() {
var _this = this;
var touchStartIgnores = 1;
if (this.isTouch) {
Function renderNumberCellHtml
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderNumberCellHtml: function(date) {
var html = '';
var classes;
var weekCalcFirstDoW;
Function mergeProps
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function mergeProps(propObjs, complexProps) {
var dest = {};
var i, name;
var complexObjs;
var j, val;
Function showSegPopover
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
showSegPopover: function(row, col, moreLink, segs) {
var _this = this;
var view = this.view;
var moreWrap = moreLink.parent(); // the <div> wrapper around the <a>
var topEl; // the element we want to match the top coordinate of
Function startInteraction
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
startInteraction: function(ev, extraOptions) {
var isTouch = getEvIsTouch(ev);
if (ev.type === 'mousedown') {
if (this.isIgnoringMouse) {
Function buildGotoAnchorHtml
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildGotoAnchorHtml: function(gotoOptions, attrs, innerHtml) {
var date, type, forceOff;
var finalOptions;
if ($.isPlainObject(gotoOptions)) {
Function buildEventSource
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function buildEventSource(sourceInput) { // will return undefined if invalid source
var normalizers = FC.sourceNormalizers;
var source;
var i;
Function computeEventDrop
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
computeEventDrop: function(startSpan, endSpan, event) {
var calendar = this.view.calendar;
var dragStart = startSpan.start;
var dragEnd = endSpan.start;
var delta;
Function getDraggedElMeta
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getDraggedElMeta(el) {
var prefix = FC.dataAttrPrefix;
var eventProps; // properties for creating the event, not related to date/time
var startTime; // a Duration
var duration;
Function renderMoreLink
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderMoreLink: function(row, col, hiddenSegs) {
var _this = this;
var view = this.view;
return $('<a class="fc-more"/>')
Function renderDates
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderDates: function(isRigid) {
var view = this.view;
var rowCnt = this.rowCnt;
var colCnt = this.colCnt;
var html = '';
Function renderSlatRowHtml
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderSlatRowHtml: function() {
var view = this.view;
var isRTL = this.isRTL;
var html = '';
var slotTime = moment.duration(+this.minTime); // wish there was .clone() for durations
Function intersectRanges
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function intersectRanges(subjectRange, constraintRange) {
var subjectStart = subjectRange.start;
var subjectEnd = subjectRange.end;
var constraintStart = constraintRange.start;
var constraintEnd = constraintRange.end;
Function renderContentSkeleton
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderContentSkeleton: function() {
var cellHtml = '';
var i;
var skeletonEl;
Function setHeight
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setHeight: function(totalHeight, isAuto) {
var eventLimit;
var scrollerHeight;
var scrollbarWidths;
Function ListenerMixin
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var ListenerMixin = FC.ListenerMixin = (function() {
var guid = 0;
var ListenerMixin = {
listenerId: null,
Function sliceRangeByDay
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sliceRangeByDay: function(range) {
var daysPerRow = this.daysPerRow;
var normalRange = this.view.computeDayRange(range); // make whole-day range, considering nextDayThreshold
var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index
var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index
Function tryFetchEventSource
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function tryFetchEventSource(source, fetchId) {
_fetchEventSource(source, function(eventInputs) {
var isArraySource = $.isArray(source.events);
var i, eventInput;
var abstractEvent;
Function computeEventResize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
computeEventResize: function(type, startSpan, endSpan, event) {
var calendar = this.view.calendar;
var delta = this.diffDates(endSpan[type], startSpan[type]);
var resizeLocation; // zoned event date properties
var defaultDuration;
Function debounce
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function debounce(func, wait, immediate) {
var timeout, args, context, timestamp, result;
var later = function() {
var last = +new Date() - timestamp;
Function renderSegPopoverContent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderSegPopoverContent: function(row, col, segs) {
var view = this.view;
var isTheme = view.opt('theme');
var title = this.getCellDate(row, col).format(view.opt('dayPopoverFormat'));
var content = $(
Function populateOptionsHash
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
populateOptionsHash: function() {
var locale, localeDefaults;
var isRTL, dirDefaults;
locale = firstDefined( // explicit locale option given?
Function stop
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
stop: function(shouldRevert, callback) {
var _this = this;
var revertDuration = this.options.revertDuration;
function complete() { // might be called by .animate(), which might change `this` context
Function handleInteractionStart
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleInteractionStart: function(ev) {
var subjectEl = this.subjectEl;
var subjectRect;
var origPoint;
var point;
Function computeRange
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
computeRange: function(date) {
var intervalUnit = computeIntervalUnit(this.intervalDuration);
var intervalStart = date.clone().startOf(intervalUnit);
var intervalEnd = intervalStart.clone().add(this.intervalDuration);
var start, end;
Function sliceRangeByRow
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
sliceRangeByRow: function(range) {
var daysPerRow = this.daysPerRow;
var normalRange = this.view.computeDayRange(range); // make whole-day range, considering nextDayThreshold
var rangeFirst = this.getDateDayIndex(normalRange.start); // inclusive first index
var rangeLast = this.getDateDayIndex(normalRange.end.clone().subtract(1, 'days')); // inclusive last index
Function hitOver
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
hitOver: function(hit, isOrig, origHit) {
var dragHelperEls;
// starting hit could be forced (DayGrid.limit)
if (seg.hit) {
Function mutateEvents
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function mutateEvents(events, clearEnd, allDay, dateDelta, durationDelta, miscProps) {
Avoid deeply nested control flow statements. Open
Open
if (
button.hasClass(tm + '-state-active') ||
button.hasClass(tm + '-state-disabled')
) {
button.removeClass(tm + '-state-hover');
Avoid deeply nested control flow statements. Open
Open
if (endTime) {
end = date.clone().time(endTime);
}
Avoid deeply nested control flow statements. Open
Open
if (startTime) {
start = start.time(startTime);
}
Function reportExternalDrop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
reportExternalDrop: function(meta, dropLocation, el, ev, ui) {
Function formatSimilarChunk
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function formatSimilarChunk(date1, date2, unzonedDate1, unzonedDate2, chunk) {
Function triggerEventDrop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
triggerEventDrop: function(event, dateDelta, undoFunc, el, ev) {
Function reportEventResize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
reportEventResize: function(event, resizeLocation, largeUnit, el, ev) {
Function formatRange
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function formatRange(date1, date2, formatStr, separator, isRTL) {
Function formatRangeWithChunks
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function formatRangeWithChunks(date1, date2, chunks, separator, isRTL) {
Function triggerEventResize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
triggerEventResize: function(event, durationDelta, undoFunc, el, ev) {
Function reportEventDrop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
reportEventDrop: function(event, dropLocation, largeUnit, el, ev) {
Function triggerExternalDrop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
triggerExternalDrop: function(event, dropLocation, el, ev, ui) {
Avoid too many return
statements within this function. Open
Open
return a - b;
Avoid too many return
statements within this function. Open
Open
return true;
Avoid too many return
statements within this function. Open
Open
return '';
Avoid too many return
statements within this function. Open
Open
return false;