Showing 94 of 116 total issues
Function dirCheck
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
Avoid deeply nested control flow statements. Open
if ( option.selected ) {
// Get the specifc value for the option
value = jQuery(option).val();
// We don't need an array for one selects
Avoid deeply nested control flow statements. Open
if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
if (elem.removeEventListener)
elem.removeEventListener(type, jQuery.data(elem, "handle"), false);
else if (elem.detachEvent)
elem.detachEvent("on" + type, jQuery.data(elem, "handle"));
Avoid deeply nested control flow statements. Open
if ( !isXML ) {
elem.sizcache = doneName;
elem.sizset = i;
}
Consider simplifying this complex logical expression. Open
if ( s.dataType == "script" && type == "GET" && parts
&& ( parts[1] && parts[1] != location.protocol || parts[2] != location.host )){
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
Function PSEUDO
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
PSEUDO: function(match, curLoop, inplace, result, not){
Method request_finish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request_finish(env, st, hd, bd, timing)
Function prop
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
prop: function( elem, value, type, i, name ) {
Method request_finish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request_finish(env, status, headers, body, timing)
Method request_finish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request_finish(env, status, headers, body, timing)
Method request_finish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request_finish(env, status, headers, body, timing)
Method request_finish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request_finish(env, status, headers, body, timing)
Method request_finish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request_finish(env, status, headers, body, timing)
Method send_message_with_safe_check_with_insight
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def send_message_with_safe_check_with_insight(operation, message, db_name, log_message=nil, last_error_params=false)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(path, args, time, backtrace = [], result=nil)
Method request_finish
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def request_finish(env, status, headers, body, timing)
Method before
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def before(env)
super
tracer = env['st.tracer']
Kernel::set_trace_func proc {|event, file, line, name, binding,classname|
case event
- 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 compiled_source
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def compiled_source(filename)
templates = []
templates << ::File.join(::File.dirname(__FILE__), "views/#{filename}.html.erb")
if self.class.respond_to?(:template_root) && !self.class.template_root.nil?
# Push onto the front of the array to try because if there is a template root it is the most likely place to find the view.
- 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 configure
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def self.configure &block
yield @config
logger.debug("Rack::Insight::Config#configure:\n called from: #{caller[0]}\n with: #{@config}") if config[:verbosity] == true || config[:verbosity].respond_to?(:<) && config[:verbosity] <= 1
@logger = config[:logger]
if @logger.nil?
- 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 undefined;