Showing 714 of 1,025 total issues
Function imageSwapZoomIn
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function imageSwapZoomIn(curImage, newImage) {
$(curImage).css({'opacity':'1'});
$(newImage).css({'opacity':'0'});
$(newImage).css({'height':'25%', 'marginLeft':'200px', 'marginTop':'105px'});
$(curImage).css({'display':'inline'});
Method create_or_update_attributions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def self.create_or_update_attributions(resource, attributions_from_params, predicate = Relationship::ATTRIBUTED_TO)
# added this branching on .nil? because of the danger of loosing all attributions for a model (for example) if due to an incomplete post request attributions is nil
# the former code interpreted a nil parameter as an empty list => remove all attributions from an asset
unless attributions_from_params.nil?
Method create
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create
if handle_upload_data
@sop = Sop.new(params[:sop])
@sop.policy.set_attributes_with_sharing params[:sharing], @sop.projects
Method set_runlet_parameters
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def set_runlet_parameters
shared_input_values_for_all_runs = params[:sweep].delete(:shared_input_values_for_all_runs)
params[:sweep][:runs_attributes].each_with_index do |(run_id, run_attributes), iteration_index|
run_attributes[:workflow_id] = params[:sweep][:workflow_id]
Method new_object_based_on_existing_one
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def new_object_based_on_existing_one
@existing_sample = Sample.find(params[:id])
@sample = @existing_sample.clone_with_associations
unless @sample.specimen.can_view?
Method update_params_for_batch
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def update_params_for_batch(params)
data = []
data_urls = []
original_filenames = []
make_local_copy = []
Method url_response_code
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def url_response_code asset_url
url = URI.parse(URI.encode(asset_url.strip))
code=""
begin
if (["http","https"].include?(url.scheme))
Method get_compound_annotation
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_compound_annotation compound_name
url=URI.encode(webservice_base_url + "compounds?compoundName=")
compound_name = URI.escape(compound_name, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]"))
url.concat(compound_name)
doc = get_xml_doc url
Method fix_file_extensions
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def fix_file_extensions(run)
Dir.mktmpdir("#{run.id}", Rails.root.join("tmp")) do |tmp_dir|
tmp_zip = File.join(tmp_dir, "all.zip")
Zip::File.open(run.results.path) do |old_zip|
Zip::File.open(tmp_zip, Zip::File::CREATE) do |new_zip|
Method get_contents
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def get_contents uri,user,password,recursive=false
found=[]
content = propfind uri,user,password,1
Function relativeRows
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function relativeRows(minRow, maxRow, sheetNumber){
var current_page = null;
if (sheetNumber != null)
current_page = currentPage(sheetNumber);
Function check_show_existing_items
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function check_show_existing_items(organism_element_id, existing_items_element_id, url) {
var selected_ids = $F(organism_element_id).join();
if (selected_ids == '0') {
if ($(existing_items_element_id + "_spinner") != null)
Effect.Fade(existing_items_element_id + "_spinner");
Function additionalFieldForItem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function additionalFieldForItem(form_id, fs_or_ec_id){
var elements = $(form_id).getElements();
var item;
var substance_autocomplete;
for (var i=0;i<elements.length;i++)
Method sharing_params_to_policy
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def sharing_params_to_policy params=params
policy =Policy.new()
policy.sharing_scope = params["sharing_scope"].to_i unless params[:sharing_scope].blank?
policy.access_type = params[:access_type].blank? ? 0 : params["access_type"].to_i
policy.use_whitelist = params["use_whitelist"] == 'true' ? true : false
Method create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create
unless params[:avatar].blank? || params[:avatar][:image_file].blank?
file_specified = true
# the creation of the new Avatar instance needs to have only one parameter - therefore, the rest should be set separately
Method create
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def create
unless params[:model_image].blank? || params[:model_image][:image_file].blank?
file_specified = true
@model_image = ModelImage.new params[:model_image]
@model_image.model_id = params[:model_id]
Method detect_for_filter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def detect_for_filter(filter, resource, value)
case
#first the special cases
when filter == 'investigation' && resource.respond_to?(:assays)
resource.assays.collect { |a| a.study.investigation_id }.include? value.id
Method format_csv
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def format_csv(output, index = [])
row_limit = 500
html = ''
begin
Function dragObject
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
Function dragObject
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)