Showing 224 of 303 total issues
Function Animation
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Animation(elem, properties, options) {
var result,
stopped,
index = 0,
length = Animation.prefilters.length,
Function isValidFile
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
Dropzone.isValidFile = function (file, acceptedFiles) {
if (!acceptedFiles) {
return true;
} // If there are no accepted mime types, it's OK
acceptedFiles = acceptedFiles.split(",");
- 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 trigger
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
trigger: function(event, data, elem, onlyHandlers) {
var i, cur, tmp, bubbleType, ontype, handle, special, lastElement,
eventPath = [elem || document],
type = hasOwn.call(event, "type") ? event.type : event,
Function _updateFilesUploadProgress
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function _updateFilesUploadProgress(files, xhr, e) {
var progress = void 0;
if (typeof e !== 'undefined') {
progress = 100 * e.loaded / e.total;
Function CHILD
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
"CHILD": function(type, what, argument, first, last) {
var simple = type.slice(0, 3) !== "nth",
forward = type.slice(-4) !== "last",
ofType = what === "of-type";
Function _uploadData
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function _uploadData(files, dataBlocks) {
var _this15 = this;
var xhr = new XMLHttpRequest();
Function Sizzle
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Sizzle(selector, context, results, seed) {
var m, i, elem, nid, match, groups, newSelector,
newContext = context && context.ownerDocument,
// nodeType defaults to 9, since context defaults to document
Function contentLoaded
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
var contentLoaded = function contentLoaded(win, fn) {
var done = false;
var top = true;
var doc = win.document;
var root = doc.documentElement;
- 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 send
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
send: function(headers, complete) {
var i,
xhr = options.xhr();
xhr.open(
Function matcherFromGroupMatchers
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function matcherFromGroupMatchers(elementMatchers, setMatchers) {
var bySet = setMatchers.length > 0,
byElement = elementMatchers.length > 0,
superMatcher = function(seed, context, xml, results, outermost) {
var elem, j, matcher,
Function add
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function(elem, types, handler, data, selector) {
var handleObjIn, eventHandle, tmp,
events, t, handleObj,
special, handlers, type, namespaces, origType,
Function createThumbnailFromUrl
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function createThumbnailFromUrl(file, width, height, resizeMethod, fixOrientation, callback, crossOrigin) {
var _this13 = this;
// Not using `new Image` here because of a bug in latest Chrome versions.
// See https://github.com/enyo/dropzone/pull/226
Function uploadFiles
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function uploadFiles(files) {
var _this14 = this;
this._transformFiles(files, function (transformedFiles) {
if (files[0].upload.chunked) {
Function resolve
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function resolve(depth, deferred, handler, special) {
return function() {
var that = this,
args = arguments,
mightThrow = function() {
Function addedfile
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
addedfile: function addedfile(file) {
var _this2 = this;
if (this.element === this.previewsContainer) {
this.element.classList.add("dz-started");
Function Dropzone
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Dropzone(el, options) {
_classCallCheck(this, Dropzone);
var _this = _possibleConstructorReturn(this, (Dropzone.__proto__ || Object.getPrototypeOf(Dropzone)).call(this));
Consider simplifying this complex logical expression. Open
Open
if (forward && useCache) {
// Seek `elem` from a previously-cached index
// ...in a gzip-friendly way
Function done
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function done(status, nativeStatusText, responses, headers) {
var isSuccess, success, error, response, modified,
statusText = nativeStatusText;
// Ignore repeat invocations
Function setMatcher
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setMatcher(preFilter, selector, matcher, postFilter, postFinder, postSelector) {
if (postFilter && !postFilter[expando]) {
postFilter = setMatcher(postFilter);
}
if (postFinder && !postFinder[expando]) {
Function superMatcher
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
superMatcher = function(seed, context, xml, results, outermost) {
var elem, j, matcher,
matchedCount = 0,
i = "0",
unmatched = seed && [],