Showing 679 of 1,357 total issues
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 jQuery.makeArray( selector, this );
Avoid too many return
statements within this function. Open
return ret;
Avoid too many return
statements within this function. Open
return rootjQuery.ready( selector );
Avoid too many return
statements within this function. Open
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
Avoid too many return
statements within this function. Open
return ret === null ?
undefined :
ret;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return this;
Avoid too many return
statements within this function. Open
return value;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this method. Open
render :text => "Build #{params[:build].inspect} not found", :status => 404 and return unless @build
Method update_contents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_contents
@central_contents = File.exist?(@central_config_file) ? File.read(@central_config_file) : nil
@config_contents_inside_config_folder = File.exist?(@config_file_inside_config_folder) ? File.read(@config_file_inside_config_folder) : nil
@local_contents = File.exist?(@local_config_file) ? File.read(@local_config_file) : nil
end
- 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 human_time
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def human_time(time)
epoch = Time.at(0)
today = Time.now.beginning_of_day
this_year = today.beginning_of_year
- 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 serialize
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def serialize
@start_time = Time.now
lock = FileLock.new(CruiseControl::Configuration.projects_root.join("build_serialization.lock"))
begin
lock.lock
- 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 to_html
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_html( *rules )
rules = DEFAULT_RULES if rules.empty?
# make our working copy
text = self.dup
- 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 up_to_date?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def up_to_date?(reasons = [], revision_number = last_locally_known_revision.number)
result = true
latest_revision = self.latest_revision
if latest_revision > Revision.new(revision_number)
- 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 add_release_label
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_release_label(to_revision , label)
return false if ( to_revision.nil? or label.to_s.strip.empty? )
release_label_log = artifact('release_label.log')
release_label_log_path = release_label_log.expand_path.to_s
begin
- 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 show_revisions_in_build
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def show_revisions_in_build(revisions)
return '' if revisions.empty?
if revisions.length == 1
revision = revisions[0]
text = "<div><span class='build_author'>#{revision.author}</span>" + ' committed the checkin</div>'
- 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_to_text
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_to_text(build, with_elapsed_time = true)
text = build_label(build)
if build.failed?
text += ' FAILED'
elsif build.incomplete?
- 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"