Showing 102 of 16,957 total issues
Function parsedOptions
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
parsedOptions(textValue) {
const words = textValue.split(" ");
let parsedOptions = this.defaultObjectValue();
// Iterate through the words in steps of 2, treating each pair as an option and its potential value
for (let i = 0; i < words.length; i += 2) {
- 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 tree
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def tree
all.each_with_object({}) do |db, data|
data[db.type] ||= []
use_parent = '#'
db.categories.each_with_index do |entry, index|
- 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 render
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return (
<div className="relative">
<div
className="sequence">
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 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 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 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 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 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 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;
window.jstree_rapid_timeout = null
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 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
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];
}
Function ratio
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
this.ratio = function(value, min, max, scope, reverse, logScale) {