Showing 332 of 436 total issues
Function init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
init: function (el, values, options, width, height) {
Function drawNormalRange
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
drawNormalRange: function (canvasLeft, canvasTop, canvasHeight, canvasWidth, rangey) {
Function init
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
init: function (el, values, options, width, height) {
Method file_type_count
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def file_type_count(current_user, file_type)
source_files = {}
selected_report_concepts = []
Variable.current.with_source(self.sources.collect{|s| s.id}).where( variable_type: 'file' ).each do |variable|
selected_report_concepts << ReportConcept.new( variable_id: variable.id )
- 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 map
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Array.prototype.map = function(fun /*, thisp*/)
{
var len = this.length;
if (typeof fun != "function")
throw new TypeError();
- 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 set_searches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_searches
@cases = current_user.all_searches.find_by_id(params[:cases_id])
@controls = current_user.all_searches.find_by_id(params[:controls_id])
@controls_per_case = (params[:controls_per_case].to_i <= 4 and params[:controls_per_case].to_i >= 1) ? params[:controls_per_case].to_i : 1
@sources = (@cases ? @cases.sources.to_a : []) & (@controls ? @controls.sources.to_a : [])
- 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 table_columns
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def table_columns(current_user, table, page = 1, per_page = -1, filter_unmapped = false, search = '')
result_hash = Aqueduct::Builder.wrapper(self, current_user).table_columns(table)
columns = result_hash[:columns]
error = result_hash[:error]
- 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
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
return (this.opts.element.outerWidth() === 0 ? 'auto' : this.opts.element.outerWidth() + 'px');
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
if (b.constructor === String) return b.localeCompare(a) === 0;
Avoid too many return
statements within this function. Open
return -1;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return this.opts.width;
Avoid too many return
statements within this function. Open
return this.opts.width();
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;