Showing 1,025 of 1,025 total issues
Method set_parameters_for_sharing_form
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_parameters_for_sharing_form object=nil
object ||= eval "@#{controller_name.singularize}"
policy = nil
policy_type = ""
Method new_object_based_on_existing_one
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def new_object_based_on_existing_one
@existing_assay = Assay.find(params[:id])
@assay = @existing_assay.clone_with_associations
params[:data_file_ids]=@existing_assay.data_file_masters.collect{|d|"#{d.id},None"}
params[:related_publication_ids]= @existing_assay.related_publications.collect{|p| "#{p.id},None"}
Method update
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def update
if params[:workflow]
[:contributor_id, :contributor_type, :original_filename, :content_type, :content_blob_id, :created_at, :updated_at, :last_used_at].each do |column_name|
params[:workflow].delete(column_name)
end
Method create
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
if handle_upload_data
@workflow = Workflow.new params[:workflow]
@workflow.policy.set_attributes_with_sharing params[:sharing], @workflow.projects
Method generate_triples
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def generate_triples subject, method, property,uri_or_literal,transformation,collection_transform,rdf_graph
resource = subject.rdf_resource
transform = transformation.strip unless transformation.nil?
collection_transform = collection_transform.strip unless collection_transform.nil?
items = subject.send(method)
Method create
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
compound = params[:compound]
compound_name = compound[:title]
unless compound_name.blank?
Method add
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add
if request.post?
if params[:id]=="drag_search" #needs to create the SavedSearch resource first
saved_search = SavedSearch.new(:user_id => current_user.id, :search_query => params[:search_query], :search_type => params[:search_type],:include_external_search=>params[:include_external_search]=="1")
if SavedSearch.find_by_user_id_and_search_query_and_search_type_and_include_external_search(current_user,params[:search_query],params[:search_type],params[:include_external_search]=="1").nil? && saved_search.save
Method populate_db
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def populate_db data
assay = nil
assay_json = data["assay"]
Method paginate
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def paginate(*args)
options=args.pop unless args.nil?
options ||= {}
default_page = options[:default_page] || @default_page
Method extract_as_table
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def extract_as_table treatments_heading_row, sample_col, treatments_first_col,treatments_last_col,sheet
table = []
sheet_name = sheet.attributes["name"]
cells = sheet.find("//ss:sheet[@name='#{sheet_name}']/ss:rows/ss:row/ss:cell[@row >= '#{(treatments_heading_row).to_s}' and (@column = '#{sample_col.to_s}' or (@column>='#{treatments_first_col.to_s}' and @column<='#{treatments_last_col.to_s}'))]")
Method fs_search_fields
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def fs_search_fields
flds = studied_factors.collect do |fs|
[fs.measured_item.title,
fs.substances.collect do |sub|
#FIXME: this makes the assumption that the synonym.substance appears like a Compound
- 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
Function EventCache
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
var EventCache = function(){
var listEvents = [];
return {
listEvents : listEvents,
add : function(node, sEventName, fHandler){
- 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 validates_associated
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validates_associated(*associations)
associations.each do |association|
class_eval do
validates_each(associations) do |record, associate_name, value|
associates = record.send(associate_name)
- 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
Function updateAssays
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function updateAssays() {
assay_text = '<ul class="related_asset_list">'
for (var i=0;i<assays_array.length;i++) {
assay=assays_array[i];
title=assay[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
Function generate_json_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function generate_json_data() {
var cells = $j('td.selected_cell');
var columns = $j('.col_heading.selected_heading').size();
var headings;
var rows = new 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"
Further reading
Method exp_conditions_search_fields
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def exp_conditions_search_fields
flds = experimental_conditions.collect do |ec|
[ec.measured_item.title,
ec.substances.collect do |sub|
#FIXME: this makes the assumption that the synonym.substance appears like a Compound
- 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 summarize_permissions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def summarize_permissions creators=[User.current_user.try(:person)], asset_managers = [], contributor=User.current_user.try(:person)
#build the hash containing contributor_type as key and the people in these groups as value,exception:'Public' holds the access_type as the value
people_in_group = {'Person' => [], 'FavouriteGroup' => [], 'WorkGroup' => [], 'Project' => [], 'Institution' => [], 'WhiteList' => [], 'BlackList' => [],'Network' => [], 'Public' => 0}
#the result return: a hash contain the access_type as key, and array of people as value
grouped_people_by_access_type = {}
- 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 model_scales_list
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def model_scales_list model, list_item
scales = model.scales
if scales.empty?
text_or_not_specified("")
else
- 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 csv_to_google_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def csv_to_google_data csv
res = ""
rows = CSV.parse(csv)
rows.each_with_index do |row,i|
if i==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 specimen_row_data
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def specimen_row_data specimen
id_column = Seek::Config.is_virtualliver ? 8 : 6
creators = []
specimen.creators.each do |creator|
creators << link_to(h(creator.name), person_path(creator.id))
- 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"