Showing 100 of 16,909 total issues
Function applyRules
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.applyRules = function(rules, data) {
var datum, i, k, results, rule, v;
rules = rules || [];
results = [];
for (k in data) {
Function renderBlock
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.renderBlock = function(parentElement, data, layout, conf) {
var block, scope;
scope = conf.outerRadius - conf.innerRadius;
block = parentElement.selectAll('.block').data(data).enter().append('g').attr('class', 'block').attr('transform', function(d) {
return 'rotate(' + layout.blocks[d.key].start * 360 / (2 * Math.PI) + ')';
Function determineBlastMethods
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
determineBlastMethods() {
var database_type = this.databaseType;
var sequence_type = this.sequenceType;
if (this.query.current.isEmpty()) {
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
var methods = this.state.methods;
var method = methods[0];
var multi = methods.length > 1;
Function warningJSX
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
warningJSX() {
return(
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="grid grid-cols-6 gap-4">
<div className="col-start-1 col-end-7 text-center">
Function ratioCalculate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ratioCalculate(value, min, max, scope, reverse, logScale) {
var fraction, scaleLogBase, x;
scaleLogBase = logScale ? 2.3 : 1;
if (
min === max ||
- 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 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 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 renderChords
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
this.renderChords = function(parentElement, name, conf, data, layout, ratio, getSource, getTarget) {
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
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 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 ratio
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
this.ratio = function(value, min, max, scope, reverse, logScale) {
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
for (trackId in store) {
svg.select('.' + trackId).remove();
delete store[trackId];
}
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) {
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)