Showing 165 of 403 total issues
Function getColDefs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static getColDefs(query, organism, formattedData, taxonomicRanks) {
const colDefs = [
{
headerName: "Modifications",
field: "numModifications",
- 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 getColDefs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
static getColDefs(query, organism, formattedData, taxonomicRanks) {
const colDefs = [
{
headerName: "Abundance",
field: "abundance",
- 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 processRelatedMetabolites
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static processRelatedMetabolites(partLinks, metabolites, organism) {
metabolites.sort((a, b) => {
return naturalSort(a.name, b.name);
});
Function getResultsUrl
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getResultsUrl(query, pageCount, pageSize) {
const indexQueryArg = "metabolites_meta";
return (
"ftx/text_search/num_of_index/?" +
Function fetchResults
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchResults() {
const url = this.props["get-results-url"](
this.query,
this.pageCount,
this.props["page-size"]
Function getReactantNames
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getReactantNames(reactants, reactant_type) {
let structure_id = null;
let name_id = null;
if (reactant_type === "substrate") {
structure_id = "substrate_structure";
Function cellRenderer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
cellRenderer: function (params) {
const subunits = params.value;
if (subunits != null) {
return (
'<ul class="comma-separated-list">' +
Function fetchResults
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
fetchResults() {
const url = this.props["get-results-url"](
this.query,
this.pageCount,
this.props["page-size"]
Function calcTaxonomicRanks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
static calcTaxonomicRanks(organismData) {
const ranks = [];
for (let iLineage = 0; iLineage < organismData.length; iLineage++) {
const lineage = organismData[iLineage];
let rank;
Function updateVals
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateVals() {
const unorderedVals = new Set();
this.props.api.forEachNode((node) => {
const getter = this.props.filterValueGetter || this.props.valueGetter;
const value = getter(node);
Function constructor
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(props) {
super(props);
this.loBound = 0;
this.hiBound = 1;
Function formatScientificNotation
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
value,
sciMagUpThresh = 1,
sciMagDownThresh = 1,
sciDecimals = 1,
fixedDeminals = 1,
Avoid deeply nested control flow statements. Open
} else if ("values" in measurement) {
const cellLineValues = {};
for (const value of measurement.values) {
let cellLine;
Avoid deeply nested control flow statements. Open
if ("taxon_distance" in rawDatum) {
formattedDatum[
"taxonomicProximity"
] = DataTable.calcTaxonomicDistance(
rawDatum.taxon_distance,
Avoid deeply nested control flow statements. Open
if (datum.gene[0].olnNames[0].value) {
geneName = datum.gene[0].olnNames[0].value;
} else if (
datum.gene[0].olnNames[0].evidences &&
datum.gene[0].olnNames[0].evidences.length
Avoid deeply nested control flow statements. Open
if (organism != null) {
formattedDatum[
"taxonomicProximity"
] = DataTable.calcTaxonomicDistance(
measurement.taxon_distance,
Avoid deeply nested control flow statements. Open
for (const key in val) {
const v = val[key];
if (Number.isNaN(v)) {
val[key] = null;
} else if (
Function configChart
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
configChart() {
if (!this.props.data.values.length) {
return;
}
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (this.state.metadata && this.state.metadata.error404) {
return <Error404 />;
}
- 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 (Number.isNaN(v)) {
val[i] = null;
} else if (
v != null &&
v !== undefined &&