Showing 714 of 1,025 total issues
Method create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create
topic_saved, post_saved = false, false
# this is icky - move the topic/first post workings into the topic model?
Topic.transaction do
@topic = @forum.topics.build(:title => params[:topic][:title])
- 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 create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create
@suggested_assay_type = SuggestedAssayType.new(params[:suggested_assay_type])
@suggested_assay_type.contributor_id= User.current_user.try(:person_id)
saved = @suggested_assay_type.save
if @suggested_assay_type.link_from == "assays"
- 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 fetch_item
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def fetch_item item_id
yaml = Rails.cache.fetch("biomodels_search_#{item_id}") do
connection = SysMODB::SearchBiomodel.instance
biomodel_result = connection.getSimpleModel(item_id)
unless biomodel_result.blank?
- 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 create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create
compound = params[:compound]
compound_name = compound[:title]
unless compound_name.blank?
- 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 create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create
@study = Study.new(params[:study])
@study.policy.set_attributes_with_sharing params[:sharing], @study.projects
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
def update
@suggested_assay_type=SuggestedAssayType.find(params[:id])
@suggested_assay_type.attributes = params[:suggested_assay_type]
saved = @suggested_assay_type.save
if params[:commit_popup]
- 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 find_display_asset
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def find_display_asset asset=eval("@#{self.controller_name.singularize}");
name = asset.class.name.underscore
if asset
#if no version is specified, show the latest version
#otherwise, show the specified version, if (this version is correct for login and project member user or if (this is the latest version and the user doesn't login or is not project member')
- 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 log_publishing
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def log_publishing
User.with_current_user current_user do
c = self.controller_name.downcase
a = self.action_name.downcase
- 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 determine_filename
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def determine_filename f
return @@filename_cache[f.base_uri] unless @@filename_cache[f.base_uri].nil?
disp=f.meta["content-disposition"]
result=nil
unless disp.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
Method read
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def read ( how_much = nil )
how_much ||= size
if @part_no >= @parts.size
return 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 remove_roles
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def remove_roles roles
new_mask = self.roles_mask
roles.each do |role_details|
rolename = role_details[0]
project_ids = Array(role_details[1]).collect{|p| p.is_a?(Project) ? p.id : p.to_i}
- 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 populate_assay
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def populate_assay assay_json, filename
investigation_title = assay_json["investigation title"]
assay_type_title = assay_json["assay type title"]
study_title = assay_json["study title"]
- 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_version
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def update_version(version_number_to_update, attributes)
return false if version_number_to_update.nil? or version_number_to_update.to_i < 1
return false if attributes.nil? or attributes.empty?
return false unless (ver = find_version(version_number_to_update))
- 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 matching_models
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def matching_models
results = {}
if Seek::Config.solr_enabled && contains_extractable_spreadsheet?
Function initTicker
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var initTicker = function(){
var startPosition = 0;
// if autoDirection is "next", append a clone of the entire slider
if(slider.settings.autoDirection == 'next'){
el.append(slider.children.clone().addClass('bx-clone'));
Function tipShow
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
tipShow : function() {
var scrX = Number(this.xCord);
var scrY = Number(this.yCord);
var tp = parseInt(scrY+15);
var lt = parseInt(scrX+10);
Function imageSwapZoomOut
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function imageSwapZoomOut(curImage, newImage) {
$(curImage).css({'opacity':'1'});
$(newImage).css({'opacity':'0'});
$(newImage).css({'height':'250%', 'marginLeft':'-120px', 'marginTop':'-222px'});
$(curImage).css({'display':'inline'});
Function onkeydown
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.onkeydown = function(e) {
if (!this.navigationActive) return;
switch(e.keyCode) {
case 37: //Event.KEY_LEFT:
if (this.moveLeft()) e.preventDefault();
Method to_presentation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def to_presentation
presentation_attrs = attributes.delete_if { |k, v| !(::Presentation.new.attributes.include?(k))}
Presentation.new(presentation_attrs).tap do |presentation|
DataFile.reflect_on_all_associations.select { |a| [:has_many, :has_and_belongs_to_many, :has_one].include?(a.macro) && !a.through_reflection }.each do |a|
Function changeRowsPerPage
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function changeRowsPerPage(){
var current_href = window.location.href;
if (current_href.endsWith('#'))
current_href = current_href.substring(0,current_href.length-1);