Showing 5 of 5 total issues
Method has_image_thread
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
Open
def has_image_thread(field, opt = {})
field_id = [field, 'id'].join('_')
before_save_method = ['append_images', field].join('_')
# 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
File uploader.js
has 298 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
//= require image_thread/jquery/ui/jquery.ui.widget
//= require image_thread/load-image
//= require image_thread/jquery/jquery.fileupload
//= require image_thread/jquery/jquery.fileupload-process
//= require image_thread/jquery/jquery.fileupload-image
Method has_image_thread
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def has_image_thread(field, opt = {})
field_id = [field, 'id'].join('_')
before_save_method = ['append_images', field].join('_')
# Options
Function fail
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fail: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
Function add
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}