Showing 759 of 1,838 total issues
Function clip
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var effectClip = $.effects.effect.clip = function( o, done ) {
// Create element
var el = $( this ),
props = [ "position", "top", "bottom", "left", "right", "height", "width" ],
mode = $.effects.setMode( el, o.mode || "hide" ),
Function _onProgress
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_onProgress: function (e, data) {
if (e.lengthComputable) {
var now = +(new Date()),
total,
loaded;
Function send
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
send: function (headers, completeCallback) {
var addParamChar = /\?/.test(s.url) ? '&' : '?';
function callback(status, statusText, responses, responseHeaders) {
xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
Function _generatePosition
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_generatePosition: function (event) {
var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.ui.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
// This is another very weird special case that only happens for relative elements:
Function createWrapper
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
createWrapper: function (element) {
// if the element is already wrapped, return it
if (element.parent().is('.ui-effects-wrapper')) {
return element.parent();
Method post
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function post()
{
$upload = isset($_FILES[$this->field_name]) ? $_FILES[$this->field_name] : [
'tmp_name' => null,
'name' => null,
Method post
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function post()
{
$upload = isset($_FILES[$this->field_name]) ? $_FILES[$this->field_name] : [
'tmp_name' => null,
'name' => null,
Function smallworld_getCountFriendMessagesEtcJS
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function smallworld_getCountFriendMessagesEtcJS() {
xoops_smallworld.ajax({
url: smallworld_url + "Get_Count.php?SmallworldGetUserMsgCount=1" + "&rndnum=" + Math.floor(Math.random() * 101),
cache: false,
dataType: "json",
- 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 handlePosts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function handlePosts()
{
$GLOBALS['xoopsLogger']->activated = false;
if ($GLOBALS['xoopsUser'] && $GLOBALS['xoopsUser'] instanceof \XoopsUser) {
$uid = $GLOBALS['xoopsUser']->uid();
- 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 rotateImage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function rotateImage()
{
// check file extension
switch ($this->imageMimetype) {
case 'image/png':
- 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 _hideDatepicker
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_hideDatepicker: function(input) {
var showAnim, duration, postProcess, onClose,
inst = this._curInst;
if (!inst || (input && inst !== $.data(input, "datepicker"))) {
Function buildImage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildImage: function (imageData, isSync) {
var gallery = this;
var nextIndex = this.getNextIndex(imageData.index);
// Construct new hidden span for the image
Function _mouseCapture
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseCapture: function(event, overrideHandle) {
var currentItem = null,
validHandle = false,
that = this;
Function scale
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
loadImage.scale = function (img, options) {
options = options || {};
var canvas = document.createElement('canvas'),
width = img.width,
height = img.height,
Function cancel
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
cancel: function() {
if(this.dragging) {
this._mouseUp({ target: null });
Function _createTitlebar
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_createTitlebar: function() {
var uiDialogTitle;
this.uiDialogTitlebar = $( "<div>" )
.addClass( "ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix" )
Function _dialogDatepicker
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_dialogDatepicker: function(input, date, onSelect, settings, pos) {
var id, browserWidth, browserHeight, scrollX, scrollY,
inst = this._dialogInst; // internal instance
if (!inst) {
Function _mouseStart
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_mouseStart: function(event) {
var o = this.options;
//Create and append the visible helper
Function _resetButton
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_resetButton: function() {
if ( this.type === "input" ) {
if ( this.options.label ) {
this.element.val( this.options.label );
}
Function pulsate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var effectPulsate = $.effects.effect.pulsate = function( o, done ) {
var elem = $( this ),
mode = $.effects.setMode( elem, o.mode || "show" ),
show = mode === "show",
hide = mode === "hide",