Showing 235 of 235 total issues
Consider simplifying this complex logical expression. Open
if ((value < other && !valIsNull) || !othIsReflexive ||
(othIsNull && !valIsUndef && valIsReflexive) ||
(othIsUndef && valIsReflexive)) {
return -1;
}
Function baseIsMatch
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function baseIsMatch(object, matchData, customizer) {
var index = matchData.length,
length = index,
noCustomizer = !customizer;
Function baseDifference
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function baseDifference(array, values) {
var length = array ? array.length : 0,
result = [];
if (!length) {
Function base
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Path.prototype.base = function(current) {
var __this = this;
return _.reduce(this.parentsArray(current), function(acum, elem) {
var elemUrl;
var elemSelfLink = __this.config.getUrlFromElem(elem);
Function base
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Path.prototype.base = function(current) {
var __this = this;
return _.reduce(this.parentsArray(current), function(acum, elem) {
var elemUrl;
var elemSelfLink = __this.config.getUrlFromElem(elem);
Function intersection
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
var intersection = restParam(function(arrays) {
var othLength = arrays.length,
othIndex = othLength,
caches = Array(length),
indexOf = getIndexOf(),
Function methodName
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
lodash.prototype[methodName] = function() {
var args = retUnwrapped ? [1] : arguments,
chainAll = this.__chain__,
value = this.__wrapped__,
isHybrid = !!this.__actions__.length,
Function packageAnimations
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function packageAnimations(element, event, options, animations, fnName) {
var operations = groupEventedAnimations(element, event, options, animations, fnName);
if (operations.length === 0) {
var a,b;
if (fnName === 'beforeSetClass') {
Function createHybridWrapper
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
function createHybridWrapper(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary, arity) {
Function random
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function random(min, max, floating) {
if (floating && isIterateeCall(min, max, floating)) {
max = floating = undefined;
}
var noMin = min == null,
Method register_peer
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
def register_peer(peer_params, user = nil)
torrent = Torrent.where(info_hash: peer_params[:info_hash]).first
peer = Peer.find_or_create_by!(torrent_id: torrent, peer_id: peer_params[:peer_id])
peer.torrent = torrent
peer.update_attributes(
Function executeAnimationFn
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function executeAnimationFn(fn, element, event, options, onDone) {
var args;
switch (event) {
case 'animate':
args = [element, options.from, options.to, onDone];
Function groupEventedAnimations
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function groupEventedAnimations(element, event, options, animations, fnName) {
var operations = [];
forEach(animations, function(ani) {
var animation = ani[fnName];
if (!animation) return;
Function baseMerge
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function baseMerge(object, source, customizer, stackA, stackB) {
if (!isObject(object)) {
return object;
}
var isSrcArr = isArrayLike(source) && (isArray(source) || isTypedArray(source)),
Function okCallback
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var okCallback = function(response) {
var resData = response.data;
var fullParams = response.config.params;
var elem = parseResponse(resData, operation, route, fetchUrl, response, deferred);
if (elem) {
Function okCallback
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var okCallback = function(response) {
var resData = response.data;
var fullParams = response.config.params;
var elem = parseResponse(resData, operation, route, fetchUrl, response, deferred);
if (elem) {
Function binaryIndexBy
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function binaryIndexBy(array, value, iteratee, retHighest) {
value = iteratee(value);
var low = 0,
high = array ? array.length : 0,
Function start
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
start: function() {
var runner;
var currentAnimation = startingAnimator.start();
currentAnimation.done(function() {
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (typeof func != 'function') {
if (typeof n == 'function') {
var temp = n;
n = func;
func = temp;
- 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 58.
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
Identical blocks of code found in 2 locations. Consider refactoring. Open
if (typeof func != 'function') {
if (typeof n == 'function') {
var temp = n;
n = func;
func = temp;
- 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 58.
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