Showing 714 of 1,025 total issues
Method acts_as_asset
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
def acts_as_asset
attr_accessor :parent_name
include Seek::Taggable
acts_as_scalable
Class Assay
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Assay < ActiveRecord::Base
include Seek::Rdf::RdfGeneration
include Seek::OntologyTypeHandling
include Seek::OntologyExtensionWithSuggestedType
Method get_stats
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
def get_stats
collection = []
type = nil
title = nil
@page=params[:id]
Method associate_tissue_and_cell_type
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def associate_tissue_and_cell_type tissue_and_cell_type_id,tissue_and_cell_type_title
tissue_and_cell_type=nil
if !tissue_and_cell_type_title.blank?
if ( tissue_and_cell_type_id =="0" )
found = TissueAndCellType.where(:title => tissue_and_cell_type_title).first
- 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 administer_update
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def administer_update
had_no_projects = @person.work_groups.empty?
passed_params= {:roles => User.admin_logged_in?,
:roles_mask => User.admin_logged_in?,
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
def update
#FIXME: would be better to resolve the differences, rather than keep clearing and reading the assets and organisms
#DOES resolve differences for assets now
organisms = params[:assay_organism_ids]||[]
- 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 reset_password
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def reset_password
user = User.find_by_reset_password_code(params[:reset_code] || "")
respond_to do |format|
if user
- 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_and_authorize_requested_item
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def find_and_authorize_requested_item
begin
name = self.controller_name.singularize
action = translate_action(action_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
Method included
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.included klass
klass.class_eval do
include ActsAsCachedTree
after_update :touch_for_hierarchy_updates
#add institution to ancestor projects
Function displayNormal
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
function displayNormal() {
var xmlHttp;
try { // Firefox, Opera 8.0+, Safari
xmlHttp = new XMLHttpRequest();
if (xmlHttp.overrideMimeType) {
Method new_or_update_mapping_links
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
def new_or_update_mapping_links compound, compound_annotation
#create the mappings and mapping_links
sabiork_id = compound_annotation["sabiork_id"]
chebi_ids = compound_annotation["chebi_ids"]
kegg_ids = compound_annotation["kegg_ids"]
File publications_controller.rb
has 268 lines of code (exceeds 250 allowed). Consider refactoring. Open
class PublicationsController < ApplicationController
include IndexPager
include DotGenerator
include Seek::AssetsCommon
Method initialize_default_folders
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def self.initialize_default_folders project, yaml_path=File.join(Rails.root,"config","default_data","default_project_folders.yml")
raise Exception.new("This #{I18n.t('project')} already has folders defined") unless ProjectFolder.root_folders(project).empty?
yaml = YAML.load(ERB.new(File.read(yaml_path)).result)
folders={}
- 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 uniq_people_permissions_and_privileged_people
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def uniq_people_permissions_and_privileged_people(permissions, privileged_people)
uniq_permissions_by_contributor permissions
people_from_permissions = permissions.select{|p| p.contributor_type == 'Person'}.collect(&:contributor)
- 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 18 (exceeds 5 allowed). Consider refactoring. Open
def update
# remove protected columns (including a "link" to content blob - actual data cannot be updated!)
if params[:data_file]
[:contributor_id, :contributor_type, :original_filename, :content_type, :content_blob_id, :created_at, :updated_at, :last_used_at].each do |column_name|
params[:data_file].delete(column_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
Method create
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def create
if handle_upload_data
@presentation = Presentation.new(params[:presentation])
@presentation.policy.set_attributes_with_sharing params[:sharing], @presentation.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 18 (exceeds 5 allowed). Consider refactoring. Open
def update
valid = true
unless params[:author].blank?
person_ids = params[:author].values.reject {|id_string| id_string == ""}
if person_ids.uniq.size == person_ids.size
- 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 paginate_after_fetch
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def paginate_after_fetch(collection, *args)
options=args.pop unless args.nil?
options ||= {}
reorder = options[:reorder].nil? ? true : options[:reorder]
- 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
File config.rb
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'simple_crypt'
module Seek
Function goToSlide
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
el.goToSlide = function(slideIndex, direction){
// if plugin is currently in motion, ignore request
if(slider.working || slider.active.index == slideIndex) return;
// declare that plugin is in motion
slider.working = true;