Showing 165 of 403 total issues
Function formatResults
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
formatResults(data, organism) {
const results = data["top_kos"]["buckets"];
const numResults = data["total_buckets"]["value"];
const formattedResults = [];
Function getColDefs
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getColDefs(query, organism, formattedData, taxonomicRanks) {
const colDefs = [
{
headerName: "Modifications",
field: "numModifications",
Function formatMetadata
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
static formatMetadata(query, organism, processedData) {
const sections = [];
sections.push({
id: "id",
Function getSideBarDef
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
static getSideBarDef(query, organism, formattedData) {
const sideBar = {
toolPanels: [
{
id: "columns",
Function render
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.state.metadata && this.state.metadata.error404) {
return <Error404 />;
}
File Tutorial.js
has 317 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import LazyLoad from "react-lazyload";
import one_home from "./images/1_home.png";
import search_top from "./images/searchBarTop.png";
import two_intermediate from "./images/2_intermediate.png";
Function configChart
has 85 lines of code (exceeds 25 allowed). Consider refactoring. Open
configChart() {
if (!this.props.data.values.length) {
return;
}
Function formatData
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
static formatData(query, organism, rawData) {
const formattedData = [];
for (const datum of rawData) {
let enzymeName = 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 a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
static getColDefs(query, organism, formattedData, taxonomicRanks) {
const colDefs = [
{
headerName: "Concentration",
field: "value",
- 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 ProteinModificationDataTable.js
has 302 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import {
getNumProperties,
upperCaseFirstLetter,
Function processRelatedReactions
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
static processRelatedReactions(organism, relatedReactions) {
const formattedResults = [];
for (const reaction of relatedReactions) {
const id = reaction.kinlaw_id;
File ProteinAbundanceDataTable.js
has 293 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import { getNumProperties, upperCaseFirstLetter } from "~/utils/utils";
import DataTable from "../DataTable/DataTable";
import { HtmlColumnHeader } from "../HtmlColumnHeader";
Function FullSiteRouter
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
let FullSiteRouter = () => {
return (
<ErrorBoundary>
<BrowserRouter>
<ScrollToTop />
Function getDataFromApi
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
getDataFromApi() {
const route = parseHistoryLocationPathname(this.props.history);
const query = route.query;
const organism = route.organism;
Function processMetadata
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
static processMetadata(query, organism, rawData) {
let processedData = {};
const met = rawData;
processedData = {};
processedData.synonyms = 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 updateFilters
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
updateFilters(event) {
const filters = [];
for (const colApi of event.columnApi.getAllGridColumns()) {
const colDef = colApi.colDef;
- 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 utils.js
has 286 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from "react";
function matchAll(string, regex) {
const matches = [];
string.replace(regex, function () {
File MetadataSection.js
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from "react";
import PropTypes from "prop-types";
import BaseMetadataSection from "../MetadataSection";
import { Link } from "react-router-dom";
import { LoadMetabolites } from "../LoadContent";
Function render
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (this.state.all.values == null) {
return <div></div>;
} else {
return (
Function configChart
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
configChart() {
if (!this.props.data.values.length) {
return;
}