Showing 165 of 403 total issues
Function getColDefs
has 144 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getColDefs(query, organism, formattedData, taxonomicRanks) {
const colDefs = [
{
headerName: "Half-life",
headerComponentFramework: HtmlColumnHeader,
Function getColDefs
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
static getColDefs(query, organism, formattedData, taxonomicRanks) {
const colDefs = [];
// k_cat column
let hasKcat = false;
- 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
File MetadataSection.js
has 392 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import { formatChemicalFormula, strCompare, castToArray } from "~/utils/utils";
import BaseMetadataSection from "../MetadataSection";
import LazyLoad from "react-lazyload";
File Reaction.test.js
has 389 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { RateConstantsDataTable } from "~/scenes/BiochemicalEntityDetails/Reaction/RateConstantsDataTable";
import testRawData from "~/__tests__/fixtures/reaction-constants-adenylate-kinase";
import { MetadataSection } from "~/scenes/BiochemicalEntityDetails/Reaction/MetadataSection";
import { shallow } from "enzyme";
import { getListDomElements, getSectionFromList } from "~/utils/testing_utils";
Function processMetadata
has 132 lines of code (exceeds 25 allowed). Consider refactoring. Open
static processMetadata(query, organism, rawData) {
let processedData = {};
const met = rawData;
processedData = {};
processedData.synonyms = null;
File ConcentrationDataTable.js
has 385 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import { upperCaseFirstLetter } from "~/utils/utils";
import DataTable from "../DataTable/DataTable";
import Tooltip from "@material-ui/core/Tooltip";
File Stats.js
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import { HashLink } from "react-router-hash-link";
import { scrollTo } from "~/utils/utils";
import BarPlot from "./Plot/BarPlot";
import FrequencyPlot from "./Plot/FrequencyPlot";
Function processDescriptionFromUniprot
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
static processDescriptionFromUniprot(query, data) {
if (data == null || data.length === 0) {
return MetadataSection.blankResponse;
}
Function replaceNanWithNull
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
function replaceNanWithNull(value) {
if (Number.isNaN(value)) {
return null;
}
- 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 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getColDefs(query, organism, formattedData, taxonomicRanks) {
const colDefs = [
{
headerName: "Processing",
field: "processing",
Function formatDocuments
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
formatDocuments(uniprotId, organism, taxonDistance, rawData, formattedData) {
for (const rawDatum of rawData) {
if ("abundances" in rawDatum && rawDatum.abundances) {
for (const measurement of rawDatum.abundances) {
let proteinName = rawDatum.protein_name;
- 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 formatDocuments
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
formatDocuments(organism, taxonDistance, rawData, formattedData) {
for (const rawDatum of rawData) {
if ("modifications" in rawDatum && rawDatum.modifications) {
for (const measurement of rawDatum.modifications) {
if (
- 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 formatData
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
static formatData(query, organism, rawData) {
const formattedData = [];
for (const rawDatum of rawData) {
if ("halflives" in rawDatum && rawDatum.halflives) {
const measurements = rawDatum.halflives;
Function formatData
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
static formatData(query, organism, rawData) {
const formattedData = [];
for (const metabolite of rawData) {
if ("concentrations" in metabolite && metabolite.concentrations) {
for (const metConc of metabolite["concentrations"]) {
File RnaHalfLifeDataTable.js
has 365 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import {
upperCaseFirstLetter,
isOrthoDbId,
Function getColDefs
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getColDefs(query, organism, formattedData, taxonomicRanks) {
const colDefs = [
{
headerName: "Abundance",
field: "abundance",
Function getMetadataFromApi
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMetadataFromApi() {
const route = parseHistoryLocationPathname(this.props.history);
const query = route.query;
const organism = route.organism;
Function render
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const entityTooltip = (
<div>
<p>
Enter the id or name of a metabolite, gene, or reaction to search for
Function formatResults
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
formatResults(data, organism) {
const results = data["top_kos"]["buckets"];
const numResults = data["total_buckets"]["value"];
const formattedResults = [];
- 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 formatMetadata
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
static formatMetadata(query, organism, processedData) {
const sections = [];
sections.push({
id: "id",