Showing 6 of 18 total issues
Function _create
has 267 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_create: function() {
var self = this;
var o = self.options;
//each picture
$('.ip_slide').each(function( index, value ) {
File jQuery.iPicture.init.js
has 291 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*
* jQuery UI iPicture² 1.0.0
*
* Copyright 2011 D'Alia Sara
* Dual licensed under the MIT or GPL Version 2 licenses.
Function drop
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
drop: function( event, ui ) {
plus++;
var countTurn=0;
var div = $('<div class="more more32 '+o.button+'" title="Click or drag"></div>' )
.attr("data-button", o.button)
Function turnTooltip
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function turnTooltip(countTurn, bgPar, pTurn){
switch(countTurn){
case 0:
bgPar.css('left','0').css('right','-55px').css('top','40px');
pTurn.css('left','60px').css('right','-40px').css('top','30px');
Method define_look_image_method
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def define_look_image_method(style)
self.class.send :define_method, "#{style}_look_image" do |look, *options|
options = options.first || {}
if look.look_images.empty?
image_tag "noimage/#{style}.png", options
- 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
Method save_tooltip
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def save_tooltip
unless params[:tooltip].blank?
@look_image.tooltip.present? ? @look_image.tooltip.update_attributes(params[:tooltip]) : (@look_image.tooltip = Spree::Tooltip.create(params[:tooltip]))
add_tooltip_locations
end
- 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"