File jquery.effects.core.js
has 549 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*!
* jQuery UI Effects 1.8.21
*
* Copyright 2012, AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT or GPL Version 2 licenses.
Function createWrapper
has 45 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();
Function animateClass
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
$.effects.animateClass = function(value, duration, easing, callback) {
if ($.isFunction(easing)) {
callback = easing;
easing = null;
}
Function _normalizeArguments
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _normalizeArguments(effect, options, speed, callback) {
// shift params for method overloading
if (typeof effect == 'object') {
callback = options;
speed = null;
Function easeInBack
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInBack: function (x, t, b, c, d, s) {
Function easeInOutBack
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutBack: function (x, t, b, c, d, s) {
Function easeOutBack
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutBack: function (x, t, b, c, d, s) {
Consider simplifying this complex logical expression. Open
if (
// ignore null and undefined values
value == null ||
// ignore functions (when does this occur?)
$.isFunction(value) ||
Function easeInCubic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInCubic: function (x, t, b, c, d) {
Function easeInQuart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInQuart: function (x, t, b, c, d) {
Function easeInCirc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInCirc: function (x, t, b, c, d) {
Function easeInOutElastic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutElastic: function (x, t, b, c, d) {
Function easeOutExpo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutExpo: function (x, t, b, c, d) {
Function easeInOutExpo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutExpo: function (x, t, b, c, d) {
Function swing
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
swing: function (x, t, b, c, d) {
Function easeOutQuad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutQuad: function (x, t, b, c, d) {
Function easeInQuint
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInQuint: function (x, t, b, c, d) {
Function easeInExpo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInExpo: function (x, t, b, c, d) {
Function easeInOutCirc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutCirc: function (x, t, b, c, d) {
Function easeOutElastic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutElastic: function (x, t, b, c, d) {
Function easeInSine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInSine: function (x, t, b, c, d) {
Function easeInOutBounce
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutBounce: function (x, t, b, c, d) {
Function easeOutSine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutSine: function (x, t, b, c, d) {
Function easeInOutSine
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutSine: function (x, t, b, c, d) {
Function easeInOutQuad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutQuad: function (x, t, b, c, d) {
Function easeOutCubic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutCubic: function (x, t, b, c, d) {
Function easeOutBounce
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutBounce: function (x, t, b, c, d) {
Function switchClass
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
switchClass: function(remove,add,speed,easing,callback) {
Function easeOutCirc
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutCirc: function (x, t, b, c, d) {
Function easeInBounce
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInBounce: function (x, t, b, c, d) {
Function easeInQuad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInQuad: function (x, t, b, c, d) {
Function easeOutQuart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutQuart: function (x, t, b, c, d) {
Function easeInOutQuint
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutQuint: function (x, t, b, c, d) {
Function easeInElastic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInElastic: function (x, t, b, c, d) {
Function toggleClass
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
toggleClass: function(classNames, force, speed, easing, callback) {
Function easeInOutCubic
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutCubic: function (x, t, b, c, d) {
Function easeOutQuint
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeOutQuint: function (x, t, b, c, d) {
Function easeInOutQuart
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
easeInOutQuart: function (x, t, b, c, d) {
Avoid too many return
statements within this function. Open
return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
Avoid too many return
statements within this function. Open
return colors[$.trim(color).toLowerCase()];
Avoid too many return
statements within this function. Open
return colors['transparent'];
Similar blocks of code found in 2 locations. Consider refactoring. Open
;jQuery.effects || (function($, undefined) {
$.effects = {};
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 7544.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76