Showing 52 of 98 total issues
Function fileUploadXhr
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function fileUploadXhr(a) {
var formdata = new FormData();
for (var i=0; i < a.length; i++) {
formdata.append(a[i].name, a[i].value);
Function b
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var b = function () {
function l() {
return c
}
Function open
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return g() ? {open:function (e, g) {
function q(a) {
try {
var b = JSON.parse(a.data);
b.a === "ready" ? m.postMessage(o, l) : b.a === "error" ? g && (g(b.d), g = null) : b.a === "response" && (d(window, "message", q), d(window, "unload", p), p(), g && (g(null, b.d), g = null))
Function r
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
}, r = function (a, c, d) {
if (typeof b.gotMessageObserver == "function")try {
b.gotMessageObserver(a, d)
} catch (h) {
g("gotMessageObserver() raised an exception: " + h.toString())
Function getOrigPosition
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getOrigPosition: function () {
var current = F.current,
element = current.element,
orig = current.orig,
pos = {},
Function slide
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, slide: function (type, next) {
var $active = this.$element.find('.item.active')
, $next = next || $active[type]()
, isCycling = this.interval
, direction = type == 'next' ? 'left' : 'right'
Function fieldValue
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fieldValue = function(el, successful) {
var n = el.name, t = el.type, tag = el.tagName.toLowerCase();
if (successful === undefined) {
successful = true;
}
Function play
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
play: function ( action ) {
var clear = function () {
clearTimeout(F.player.timer);
},
set = function () {
Function beforeShow
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
beforeShow: function (opts) {
var text = F.current.title,
type = opts.type,
title,
target;
Function _afterZoomIn
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_afterZoomIn: function () {
var current = F.current;
if (!current) {
return;
Function fancybox
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
$.fn.fancybox = function (options) {
var index,
that = $(this),
selector = this.selector || '',
run = function(e) {
Function update
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
update: function (e) {
var type = (e && e.type),
anyway = !type || type === 'orientationchange';
if (anyway) {
Method current_person
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
def current_person
return @current_person if @current_person
if params[:auth_token]
@current_person = Person.find_by_auth_token params[:auth_token]
- 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 changeIn
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
changeIn: function () {
var current = F.current,
effect = current.nextEffect,
startPos = current.pos,
endPos = { opacity : 1 },
Function show
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
, show: function () {
var that = this
, e = $.Event('show')
this.$element.trigger(e)
Consider simplifying this complex logical expression. Open
Open
if (!e.ctrlKey && !e.altKey && !e.shiftKey && !e.metaKey && !(target && (target.type || $(target).is('[contenteditable]')))) {
$.each(keys, function(i, val) {
if (current.group.length > 1 && val[ code ] !== undefined) {
F[ i ]( val[ code ] );
Consider simplifying this complex logical expression. Open
Open
if (d.id && c) {
if (k[c]) {
var i = p(d.id, a, d.callbacks ? d.callbacks : []);
m[d.id] = {};
try {
Consider simplifying this complex logical expression. Open
Open
if (k[c]) {
var i = p(d.id, a, d.callbacks ? d.callbacks : []);
m[d.id] = {};
try {
if (d.callbacks && e(d.callbacks) && d.callbacks.length > 0)for (var j = 0; j < d.callbacks.length; j++) {
Avoid deeply nested control flow statements. Open
Open
for (j=0; j < files.length; j++) {
a.push({name: n, value: files[j], type: el.type});
}
Avoid deeply nested control flow statements. Open
Open
if (elements)
elements.push(el);