Showing 119 of 7,605 total issues
Function handleLoadTree
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleLoadTree(category) {
var tree_id = '#' + category + '_database_tree';
// hack that is needed to sync the selected tree db with the hidden main db
window.jstree_node_change_timeout = null;
Function Highlight
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
circosJS.Highlight = function() {
circosJS.Track.call(this);
this.parseData = circosJS.parseSpanStringData;
this.renderDatumContainer = (function(_this) {
return function(instance, parentElement, name, data, conf) {
Function removeTracks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
circosJS.Core.prototype.removeTracks = function(trackIds) {
var id, l, len, ref, store, svg, trackId, type;
svg = d3.select(this.conf.container);
ref = this.tracks;
for (type in ref) {
Function renderChords
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
this.renderChords = function(parentElement, name, conf, data, layout, ratio, getSource, getTarget) {
Method init_database
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def init_database
fail DATABASE_DIR_NOT_SET unless config[:database_dir]
config[:database_dir] = File.expand_path(config[:database_dir])
unless File.exist?(config[:database_dir]) &&
- 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 Layout
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
circosJS.Layout = function(conf, data) {
var block_nb, gap, k, offset, ref, ref1, size, v;
if (data == null) {
circosJS.log(2, 'no layout data', '');
}
- 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 retrieve
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def retrieve(loci)
# Exit early if loci is nil.
return unless loci
# String -> 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 parse_advanced
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def parse_advanced(param_line)
param_list = (param_line || '').split(' ')
res = {}
param_list.each_with_index do |word, i|
- 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 ratio
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
this.ratio = function(value, min, max, scope, reverse, logScale) {
Method open_in_browser
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def open_in_browser(server_url)
return if using_ssh? || verbose?
if RUBY_PLATFORM =~ /linux/ && xdg?
sys("xdg-open #{server_url}")
elsif RUBY_PLATFORM =~ /darwin/
- 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
Avoid deeply nested control flow statements. Open
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
Avoid deeply nested control flow statements. Open
if (rule.condition(v.parent, datum, i)) {
results3.push(datum[rule.parameter] = rule.value);
} else {
results3.push(void 0);
}
Avoid deeply nested control flow statements. Open
for (trackId in store) {
svg.select('.' + trackId).remove();
delete store[trackId];
}
Function ratio
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
this.ratio = function(value, min, max, scope, reverse, logScale) {
Consider simplifying this complex logical expression. Open
if ('source_id' in sample && 'source_start' in sample && 'source_end' && 'target_id' in sample && 'target_start' in sample && 'target_end' in sample) {
data = data.map(function(datum) {
var elts;
elts = [datum.source_id, datum.source_start, datum.source_end, datum.target_id, datum.target_start, datum.target_end];
if (datum.value != null) {
Function composeEmail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function composeEmail(dbsArr, program, numQueries, url, isOpenAccess) {
Function processConf
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
this.processConf = function(conf, defaultConf, meta, instance, utils) {
Method make_blast_database
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def make_blast_database(action, file, title, type, non_parse_seqids = false)
Function asMailtoHref
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function asMailtoHref(querydb, program, numQueries, url, isOpenAccess) {
Function build
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
this.build = function(instance, conf, data, rules, backgrounds) {