Showing 714 of 1,025 total issues
File models_controller.rb
has 452 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'libxml'
require 'bives'
class ModelsController < ApplicationController
File assays.js
has 450 lines of code (exceeds 250 allowed). Consider refactoring. Open
var sops_assets=new Array();
var models_assets=new Array();
var data_files_assets=new Array();
var organisms = new Array();
var assays_array = new Array();
File application_controller.rb
has 449 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'authenticated_system'
class ApplicationController < ActionController::Base
include Seek::Errors::ControllerErrorHandling
Method dictionary_definition
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
def dictionary_definition
# in the future this could be moved out to a file
{ refresh: 'famfamfam_silk/arrow_refresh_small.png',
arrow_up: 'famfamfam_silk/arrow_up.png',
arrow_down: 'famfamfam_silk/arrow_down.png',
Function Position
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function Position(x, y)
{
this.X = x;
this.Y = y;
- 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 Position
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
function Position(x, y)
{
this.X = x;
this.Y = y;
- 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 extended_xml
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def extended_xml builder,object
submitter = determine_submitter object
builder.tag! "submitter" do
api_partial(builder,submitter)
- 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_event
has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring. Open
def log_event
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
Function prototype
has 160 lines of code (exceeds 25 allowed). Consider refactoring. Open
Searcher.prototype = new function() {
// search is performed in chunks of 1000 for non-blocking user input
var CHUNK_SIZE = 1000;
// do not try to find more than 100 results
var MAX_RESULTS = 100;
Method tree_editor_display
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
def tree_editor_display type, show_edit=true, show_delete=true, selected_id=nil, related_resource_type="Person",selective_display=false, foldable=false
selected_display_items = nil
if selected_id && selective_display
- 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 policy.rb
has 400 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Policy < ActiveRecord::Base
has_many :permissions,
:dependent => :destroy,
:order => "created_at ASC",
Function ResizeableTextbox
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
function ResizeableTextbox(id, parent)
{
var MINWIDTH = 125;
var MINHEIGHT = 80;
var MINSIZE = 38;
- 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 37 (exceeds 5 allowed). Consider refactoring. Open
def create
if handle_upload_data
@data_file = DataFile.new params[:data_file]
- 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 indented_child_options
has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring. Open
def indented_child_options type, parent, depth=0, selected_id
result = []
unless parent.children.empty?
parent.children.sort { |a, b| a.title.downcase <=> b.title.downcase }.each do |child|
- 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 admins_controller.rb
has 399 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'delayed/command'
class AdminsController < ApplicationController
include CommonSweepers
Class User
has 41 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ActiveRecord::Base
acts_as_annotation_source
include SavageBeast::UserInit
acts_as_tagger
Function ResizeableContainer
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
function ResizeableContainer(contentID, parent)
{
var MINSIZE = 38;
var EDGE_THICKNESS = 7;
var EDGEDIFFSIZE = 2*EDGE_THICKNESS + 3;
- 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 append_list_assay_organisms
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
def append_list_assay_organisms assay_organisms
result=""
organism=nil
strain = 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 set_attributes_with_sharing
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def set_attributes_with_sharing sharing, projects
# if no data about sharing is given, it should be some user (not the owner!)
# who is editing the asset - no need to do anything with policy / permissions: return success
self.tap do |policy|
if sharing
- 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 get_resource_hash
has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring. Open
def get_resource_hash scale, external_resource_hash
internal_resource_hash = {}
if external_resource_hash.blank?
@results_scaled[scale].each do |item|
tab = item.respond_to?(:tab) ? item.tab : item.class.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"