Showing 67 of 149 total issues
Function _getSelection
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
_getSelection: function(model) {
const maxLen = model.get("seq").length;
const selection = [];
const sels = this.g.selcol.getSelForRow(model.get("id"));
const rows = find(sels, function(el) { return el.get("type") === "row"; });
- 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 saveSelection
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
saveSelection: function(that,name) {
let selection = that.g.selcol.pluck("seqId");
console.log(selection);
if (selection.length > 0) {
// filter those seqids
- 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 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function() {
this.setName("Extras");
var stats = this.g.stats;
var msa = this.msa;
this.addNode("Add consensus seq", () => {
Function guessFileFromText
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
{ guessFileFromText: function(text, opt) {
if (!(typeof text !== "undefined" && text !== null)) {
console.warn("invalid file format");
return ["", "error"];
}
Function colorer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
colorer: function(colorRange) {
let colorer = function() { return "none" };
if( typeof colorRange === 'string' ) {
colorer = function() { return colorRange };
Function addFeatures
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
addFeatures: function(features) {
if ((features.config != null)) {
const obj = features;
features = features.seqs;
if ((obj.config.colors != null)) {
Function render
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render: function() {
dom.removeAllChilds(this.el);
this.el.style.width = `${this.g.zoomer.getLabelWidth()}px`;
//@el.style.height = "#{@g.zoomer.get "rowHeight"}px"
- 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 getDummySequences
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
getDummySequences: function(len, seqLen) {
const seqs = [];
if (!(typeof len !== "undefined" && len !== null)) { len = BMath.getRandomInt(3,5); }
if (!(typeof seqLen !== "undefined" && seqLen !== null)) { seqLen = BMath.getRandomInt(50,200); }
- 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 a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
render: function() {
this.setName("Export");
this.addNode("Share view (URL)" + ShareSym, () => {
return Exporter.shareLink(this.msa, function(link) {
- 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 importFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
importFiles: function(files) {
return (() => {
var result = [];
var end = files.length - 1;
for (var i = 0; 0 < end ? i <= end : i >= end; 0 < end ? i++ : 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
Avoid deeply nested control flow statements. Open
if (showLowerCase) { c = c.toUpperCase(); }
Avoid deeply nested control flow statements. Open
if (seq_hidden[i]) {
colors.push("grey");
continue;
}
Avoid deeply nested control flow statements. Open
if ((typeof color !== "undefined" && color !== null)) {
colors.push(color);
}
Function invertCol
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
invertCol: function(columns) {
const selColumns = this.where({type:"column"}).reduce((memo,el) => {
return memo.concat(((() => {
const result = [];
let i = el.attributes.xStart;
- 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 getMinRows
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getMinRows: function() {
const len = (this.max(function(el) { return el.get("xEnd"); })).attributes.xEnd;
const rows = ((() => {
const result = [];
- 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 markerHidden
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
markerHidden: function(n,stepSize) {
const hidden = this.g.columns.get("hidden").slice(0);
const min = Math.max(0, n - stepSize);
let prevHidden = 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
Function _drawSelection
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_drawSelection: function() {
// hide during selection
if (this.dragStart.length > 0 && !this.prolongSelection) { return; }
this.ctx.fillStyle = "#666666";
- 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 (hidden.indexOf(j) >= 0) {
color = "grey";
}
Function assignRows
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
assignRows: function() {
const len = (this.max(function(el) { return el.get("xEnd"); })).attributes.xEnd;
const rows = (() => {
const result = [];
- 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 calcHiddenSeqs
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
calcHiddenSeqs: function(n) {
let nNew = n;
for (let i = 0; 0 < nNew ? i <= nNew : i >= nNew; 0 < nNew ? i++ : i--) {
if (this.at(i).get("hidden")) {
nNew++;
- 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"