Showing 714 of 1,025 total issues
Function roundRectangleIntersectLine
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
canvas_prototype.roundRectangleIntersectLine = function(
x, y, nodeX, nodeY, width, height, padding) {
//Manually change for seek to fix that safari quits unexpectedly
var cornerRadius = 0;
Method add_as_new
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
def add_as_new resource
#FIXME: this method is too long
begin
warning=nil
warning_code=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 build_all_bio_sample_json
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
def build_all_bio_sample_json sheet
# population order should NOT change, DB is populated only if @to_populate is set to be true
# probing number of rows with data in sheet
Method text_or_not_specified
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def text_or_not_specified text, options = {}
text=text.to_s if text.kind_of?(Numeric)
if text.nil? or text.chomp.empty?
not_specified_text||=options[:none_text]
not_specified_text||="No description specified" if options[:description]==true
- 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 handle_upload_data
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def handle_upload_data
blob_params = content_blob_params
# MERGENOTE - the manipulation and validation of the params still needs a bit of cleaning up
blob_params = update_params_for_batch(blob_params)
- 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 generate_triples
has a Cognitive Complexity of 25 (exceeds 5 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)
- 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_specimen
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def populate_specimen specimen_json
specimen_title = specimen_json["title"]
sex = specimen_json["sex"]
age = specimen_json["age"]
- 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_treatment
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
def populate_treatment treatment_json, specimen=nil, sample=nil
start_value = treatment_json["start value"]
end_value = treatment_json["end value"]
standard_deviation = treatment_json["standard deviation"]
- 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 dragObject
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
{
if(typeof(element) == "string")
element = document.getElementById(element);
if(element == null)
Function dragObject
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
{
if(typeof(element) == "string")
element = document.getElementById(element);
if(element == null)
File data_files_controller.rb
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'simple-spreadsheet-extractor'
class DataFilesController < ApplicationController
include IndexPager
Method populate_specimen
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
def populate_specimen specimen_json
specimen_title = specimen_json["title"]
sex = specimen_json["sex"]
age = specimen_json["age"]
Method parse_spreadsheet_xml
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def parse_spreadsheet_xml(spreadsheet_xml)
workbook = Workbook.new
doc = LibXML::XML::Parser.string(spreadsheet_xml).parse
doc.root.namespaces.default_prefix="ss"
- 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
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def populate
begin
@translucent_id = @node.find_first("id").content unless @node.find_first("id").nil?
@author_seek_id = @node.find_first("submitter").content unless @node.find_first("submitter").nil?
if @type=="Model"
- 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
Class Publication
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Publication < ActiveRecord::Base
include Seek::Rdf::RdfGeneration
title_trimmer
alias_attribute :description, :abstract
#searchable must come before acts_as_asset is called
Class Workflow
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class Workflow < ActiveRecord::Base
acts_as_asset
scope :default_order, order('title')
Class ModelsController
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class ModelsController < ApplicationController
include WhiteListHelper
include IndexPager
include DotGenerator
Method add_items_to_queue
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def self.add_items_to_queue items, t=5.seconds.from_now, priority=0, queuepriority=priority
if Seek::Config.auth_lookup_enabled
items = [items] if items.nil?
items = Array(items)
- 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 a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Search.prototype = $.extend({}, Navigation, new function() {
var suid = 1;
this.init = function() {
var _this = this;
- 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 authorized_list
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def authorized_list all_items, attribute, sort=true, max_length=75, count_hidden_items=false
items = all_items.select &:can_view?
if Seek::Config.is_virtualliver
title_only_items = (all_items - items).select &:title_is_public?
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"