Showing 151 of 176 total issues
Avoid deeply nested control flow statements. Open
if (this.readyState == 4) {
var stringIds = this.getResponseHeader("X-MiniProfiler-Ids");
if (stringIds) {
var ids = stringIds.split(",");
Avoid deeply nested control flow statements. Open
if (this.miniprofiler.prev_onreadystatechange !== null)
return this.miniprofiler.prev_onreadystatechange.apply(
this,
arguments
);
Avoid deeply nested control flow statements. Open
if (k < 0) a = p;else {
for (--k; (k = p.indexOf("&#", k + 1)) >= 0;) {
var e = p.indexOf(";", k);
if (e >= 0) {
Avoid deeply nested control flow statements. Open
if (p = m.a) {
c = m.b;
if ("XMP" === c.tagName) {
d = document.createElement("PRE");
Avoid deeply nested control flow statements. Open
for (var r = [], j = n; --j >= 0;) {
r[j] = l[j];
}
Method other_patches
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.other_patches
patches = []
patches << 'mongo' if defined?(Mongo::Server::Connection) && Mongo.class == Module
patches << 'moped' if defined?(Moped::Node) && Moped::Node.class == Class
patches << 'plucky' if defined?(Plucky::Query) && Plucky::Query.class == Class
- 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
Consider simplifying this complex logical expression. Open
if (!(s < 65 || g > 122)) {
s < 65 || g > 90 || a.push([Math.max(65, g) | 32, Math.min(s, 90) | 32]);
s < 97 || g > 122 || a.push([Math.max(97, g) & -33, Math.min(s, 122) & -33]);
}
Consider simplifying this complex logical expression. Open
if (!(s < 65 || g > 122)) {
s < 65 || g > 90 || a.push([Math.max(65, g) | 32, Math.min(s, 90) | 32]);
s < 97 || g > 122 || a.push([Math.max(97, g) & -33, Math.min(s, 122) & -33]);
}
Method exec_insert
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def exec_insert(sql, name, binds, pk = nil, sequence_name = nil)
Method cleanup_cache
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def cleanup_cache
files = Dir.entries(@path)
@timer_struct_lock.synchronize {
files.each do |f|
f = @path + '/' + f
- 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 sql_patches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.sql_patches
patches = []
patches << 'mysql2' if defined?(Mysql2::Client) && Mysql2::Client.class == Class && patch_rails?
patches << 'pg' if defined?(PG::Result) && PG::Result.class == Class && patch_rails?
- 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 rails_route_from_path
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def rails_route_from_path(path, method)
if defined?(Rails) && defined?(ActionController::RoutingError)
hash = Rails.application.routes.recognize_path(path, method: method)
if hash && hash[:controller] && hash[:action]
"#{hash[:controller]}##{hash[:action]}"
- 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 record_sql
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def record_sql(query, elapsed_ms, params = nil)
return unless current && current.current_timer
c = current
c.current_timer.add_sql(
redact_sql_queries? ? nil : query,
- 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 method. Open
return client_settings.handle_cookie(dump_exceptions exceptions)
Avoid too many return
statements within this method. Open
return client_settings.handle_cookie(self.flamegraph(flamegraph, path, env))
Avoid too many return
statements within this method. Open
return tool_disabled_message(client_settings) if !advanced_debugging_enabled?
Avoid too many return
statements within this method. Open
return client_settings.handle_cookie(
text_result(message, status: status, headers: headers)
)
Avoid too many return
statements within this method. Open
return client_settings.handle_cookie(analyze_memory)
Avoid too many return
statements within this method. Open
return client_settings.handle_cookie(dump_env env)
Avoid too many return
statements within this method. Open
return client_settings.handle_cookie(help(client_settings, env))