Showing 282 of 417 total issues
Avoid too many return
statements within this function. Open
return diff === 0;
Avoid too many return
statements within this function. Open
return { top: top, left: left };
Avoid too many return
statements within this function. Open
return ( diff % first === 0 && diff / first >= 0 );
Avoid too many return
statements within this function. Open
return i === al ?
siblingCheck( a, bp[i], -1 ) :
siblingCheck( ap[i], b, 1 );
Avoid too many return
statements within this function. Open
if (s.match(/cm$/)) return this.numValue() * this.getDPI(viewPort) / 2.54;
Avoid too many return
statements within this function. Open
if (s.match(/mm$/)) return this.numValue() * this.getDPI(viewPort) / 25.4;
Avoid too many return
statements within this function. Open
if (s.match(/%$/)) return this.numValue() * svg.ViewPort.ComputeSize(viewPort);
Avoid too many return
statements within this function. Open
return this.numValue() * (Math.PI / 180.0);
Avoid too many return
statements within this function. Open
if (s.match(/pt$/)) return this.numValue() * this.getDPI(viewPort) * (1.0 / 72.0);
Avoid too many return
statements within this function. Open
if (s.match(/in$/)) return this.numValue() * this.getDPI(viewPort);
Avoid too many return
statements within this function. Open
return this.numValue();
Avoid too many return
statements within this function. Open
if (s.match(/pc$/)) return this.numValue() * 15;
Method ensure_result_groups!
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ensure_result_groups!
#Rails.logger.debug "Step 2 => #{self.class} - Perform the search"
return true unless self.result_groups.nil?
return true unless self.query.present? || self.parent_ids.present?
self.result_groups ||= build_result_groups(parent_and_child_lings_property_ids)
- 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 too_many_for_implication?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.too_many_for_implication?(result)
ids = result.parent || result.child
return false if ids.empty?
vals = [LingsProperty.with_id(ids).first]
group = get_group(vals)
- 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 load_stats
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def load_stats(lings, plain, depth)
unless plain
lings.each do |lings_with_params|
# If it is a multilanguage group map each subling
if depth > 0
- 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 avg
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def avg(cluster, cluster_i)
c1 = cluster.size > 1 ? cluster.left.key : cluster.key
c2 = cluster.size > 1 ? cluster.right.key : cluster.key
ci = cluster_i.key
left_size = cluster.left.size
- 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 hsv_to_rgb
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def hsv_to_rgb(h, s, v)
h_i = (h*6).to_i
f = h*6 - h_i
p = v * (1 - s)
q = v * (1 - f*s)
- 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 build_result_groups
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.build_result_groups(result)
parent_vals = LingsProperty.with_id(result.parent)
lps_by_ling_id = vals_by_ling_id(parent_vals)
- 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update
@example = current_group.examples.find(params[:id])
authorize! :update, @example
respond_to do |format|
- 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 order_columns
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def order_columns(fixed_array, params_array)
params_array = filter_default_columns params_array
hash_fixed = positions_hash fixed_array
hash_params = positions_hash params_array
- 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"