Showing 377 of 529 total issues
Method delete_with_child_media_resources
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def delete_with_child_media_resources
begin
ActiveRecord::Base.transaction do
@media_set = MediaSet.find params[:id]
@media_set.child_media_resources.each{|mr| raise unless mr.destroy}
- 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 PageView
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var PageView = function pageView(container, id, scale,
navigateTo, defaultViewport) {
Function open
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
open: function pdfViewOpen(url, scale, password,
pdfDataRangeTransport, args) {
Function drawFigures
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function drawFigures(width, height, backgroundColor, figures, context) {
Function appendToOperatorList
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
annotations, opList, pdfManager, partialEvaluator, intent) {
Function setupSlider
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
var setupSlider = function (elm, min, max, onMove, onChange) {
Function ProgressBarClosure
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var ProgressBar = (function ProgressBarClosure() {
function clamp(v, min, max) {
return Math.min(Math.max(v, min), max);
}
- 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 updateMatch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
updateMatch: function(found) {
var state = FindStates.FIND_NOTFOUND;
var wrapped = this.offset.wrapped;
this.offset.wrapped = false;
if (found) {
- 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 presentationModeMouseDown
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
mouseDown: function presentationModeMouseDown(evt) {
var self = PresentationMode;
if (self.contextMenuOpen) {
self.contextMenuOpen = false;
evt.preventDefault();
- 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 checkSetPresenceInImageData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(function checkSetPresenceInImageData() {
if (window.CanvasPixelArray) {
if (typeof window.CanvasPixelArray.prototype.set !== 'function') {
window.CanvasPixelArray.prototype.set = function(arr) {
for (var i = 0, ii = this.length; i < ii; i++) {
- 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 pdfHistory_pushToHistory
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_pushToHistory: function pdfHistory_pushToHistory(params,
addPrevious, overwrite) {
if (!this.initialized) {
return;
}
- 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 checkXMLHttpRequestResponseCompatibility
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
(function checkXMLHttpRequestResponseCompatibility() {
var xhrPrototype = XMLHttpRequest.prototype;
var xhr = new XMLHttpRequest();
if (!('overrideMimeType' in xhr)) {
// IE10 might have response, but not overrideMimeType
- 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 original_filename_duplicates
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.original_filename_duplicates
files_md5 = Set.new
duplicate_ids = Set.new
- 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 original_md5file_duplicates
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.original_md5file_duplicates
files_md5 = Set.new
duplicate_ids = Set.new
- 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 for_context
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def for_context(context = Context.find("core"), build_if_not_exists = true)
meta_keys = context.meta_keys
meta_key_ids = context.meta_key_ids
mds = where(:meta_key_id => meta_key_ids).eager_load(:meta_key)
- 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 filter_permissions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def filter_permissions(resources, current_user, filter)
filter.each_pair do |k,v|
v[:ids].each do |id|
resources = case k
when :owner
- 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 import_audio_video_metadata
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def import_audio_video_metadata(full_path_file)
# TODO: merge with import_image_metadata, make fields configurable in :options hash
self.meta_data ||= {}
# The Tracks: entries describe video, audio or subtitle tracks present in the container. We extract 10
- 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 thumb_base64
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def thumb_base64(size = :small)
size = size.to_sym
preview = case content_type
when /video/ then
- 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 name
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def name
a = []
a << last_name unless last_name.blank?
a << first_name unless first_name.blank?
r = a.join(", ")
- 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 active_layout
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def active_layout
if params[:layout] == "miniature"
"miniature"
elsif params[:layout] == "list"
"list"
- 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"