Showing 224 of 303 total issues
Function setOffset
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setOffset: function(elem, options, i) {
var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
position = jQuery.css(elem, "position"),
curElem = jQuery(elem),
props = {};
Function getWidthOrHeight
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getWidthOrHeight(elem, dimension, extra) {
// Start with computed style
var styles = getStyles(elem),
Function showHide
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function showHide(elements, show) {
var display, elem,
values = [],
index = 0,
length = elements.length;
Function isValidFile
has 33 lines of code (exceeds 25 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(",");
Function handler
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handler: function(event) {
var notAsync, result,
saved = dataPriv.get(this, type);
if ((event.isTrigger & 1) && this[type]) {
Function fallback
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fallback: function fallback() {
// This code should pass in IE7... :(
var messageElement = void 0;
this.element.className = this.element.className + " dz-browser-not-supported";
Method main
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public static void main(String args[]) {
System.out.println("- Downloader started");
File baseDirectory = new File(args[0]);
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
- 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 drawImageIOSFix
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
var drawImageIOSFix = function drawImageIOSFix(ctx, img, sx, sy, sw, sh, dx, dy, dw, dh) {
Function load
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.fn.load = function(url, params, callback) {
var selector, type, response,
self = this,
off = url.indexOf(" ");
Function speed
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.speed = function(speed, easing, fn) {
var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
complete: fn || !fn && easing ||
isFunction(speed) && speed,
duration: speed,
Function removeClass
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
removeClass: function(value) {
var classes, elem, cur, curValue, clazz, j, finalValue,
i = 0;
if (isFunction(value)) {
Function set
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
set: function(elem, value, extra) {
var matches,
styles = getStyles(elem),
// Only read styles.position if the test has a chance to fail
Method answereComplaint
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@PostMapping("/answereComplaint")
public String answereComplaint(@ModelAttribute Complaint complaint, Model model, HttpSession session)
throws UnsupportedEncodingException{
int i = (int) session.getAttribute("complaintPos");
Function encode64
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
value: function encode64(input) {
var output = '';
var chr1 = undefined;
var chr2 = undefined;
var chr3 = '';
Function attr
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
attr: function(elem, name, value) {
var ret, hooks,
nType = elem.nodeType;
// Don't get/set attributes on text, comment and attribute nodes
Function readEntries
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var readEntries = function readEntries() {
return dirReader.readEntries(function (entries) {
if (entries.length > 0) {
for (var _iterator16 = entries, _isArray16 = true, _i17 = 0, _iterator16 = _isArray16 ? _iterator16 : _iterator16[Symbol.iterator]();;) {
var _ref15;
Function off
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
off: function(types, selector, fn) {
var handleObj, type;
if (types && types.preventDefault && types.handleObj) {
// ( event ) dispatched jQuery.Event
Function parseHTML
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
jQuery.parseHTML = function(data, context, keepScripts) {
if (typeof data !== "string") {
return [];
}
if (typeof context === "boolean") {
Function finish
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
finish: function(type) {
if (type !== false) {
type = type || "fx";
}
return this.each(function() {
Method banuser
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@PostMapping("/banUser")
public String banuser(@RequestParam(name = "username", required = true) String username,
@RequestParam(name = "motivation", required = true) String motivation,
@RequestParam(name = "bannedUntil", required = true) Date bannedUntil, HttpSession session, Model model)
throws UnsupportedEncodingException {