KarrLab/datanator_frontend

View on GitHub

Showing 165 of 403 total issues

Function render has 1192 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    return (
      <div className="content-container content-container-about-scene">
        <h1 className="page-title">About</h1>
        <div className="content-container-columns">
Severity: Major
Found in src/scenes/About/About.js - About 5 days to fix

    Function render has 992 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      render() {
        return (
          <div className="content-container full-width-content-container content-container-home-scene">
            <div className="section intro">
              <div className="section-inner-container">
    Severity: Major
    Found in src/scenes/Home/Home.js - About 4 days to fix

      File About.js has 1216 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 { SocialIcon } from "react-social-icons";
      import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
      Severity: Major
      Found in src/scenes/About/About.js - About 3 days to fix

        Function render has 580 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            return (
              <div className="content-block section" id="faq">
                <h2 className="content-block-heading">Frequently asked questions</h2>
                <div className="content-block-content">
        Severity: Major
        Found in src/scenes/Help/Faq.js - About 2 days to fix

          File Home.js has 1040 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React, { Component } from "react";
          import { Link } from "react-router-dom";
          import { HashLink } from "react-router-hash-link";
          import { scrollTo } from "~/utils/utils";
          
          
          Severity: Major
          Found in src/scenes/Home/Home.js - About 2 days to fix

            Function formatData has a Cognitive Complexity of 122 (exceeds 5 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;
            Severity: Minor
            Found in src/scenes/BiochemicalEntityDetails/Gene/RnaHalfLifeDataTable.js - About 2 days to fix

            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 a Cognitive Complexity of 81 (exceeds 5 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"]) {

            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 300 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                return (
                  <div className="content-block section" id="tutorial">
                    <h2 className="content-block-heading">Tutorial</h2>
                    <div className="content-block-content">
            Severity: Major
            Found in src/scenes/Help/Tutorial.js - About 1 day to fix

              Function getColDefs has 277 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                static getColDefs(query, organism, formattedData, taxonomicRanks) {
                  const colDefs = [];
              
                  // k_cat column
                  let hasKcat = false;

                File Faq.js has 594 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import React, { Component } from "react";
                import { Link } from "react-router-dom";
                import { HashLink } from "react-router-hash-link";
                import { scrollTo } from "~/utils/utils";
                
                
                Severity: Major
                Found in src/scenes/Help/Faq.js - About 1 day to fix

                  File RateConstantsDataTable.js has 571 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 { HtmlColumnHeader } from "../HtmlColumnHeader";

                    Function processDescriptionFromUniprot has a Cognitive Complexity of 54 (exceeds 5 allowed). Consider refactoring.
                    Open

                      static processDescriptionFromUniprot(query, data) {
                        if (data == null || data.length === 0) {
                          return MetadataSection.blankResponse;
                        }
                    
                    
                    Severity: Minor
                    Found in src/scenes/BiochemicalEntityDetails/Gene/MetadataSection.js - About 1 day to fix

                    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 181 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      render() {
                        return (
                          <div className="content-container content-container-help-scene">
                            <h1 className="page-title">Help</h1>
                            <div className="content-container-columns">
                    Severity: Major
                    Found in src/scenes/Help/Help.js - About 7 hrs to fix

                      Function getColDefs has 169 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        static getColDefs(query, organism, formattedData, taxonomicRanks) {
                          const colDefs = [
                            {
                              headerName: "Concentration",
                              field: "value",

                        Function formatMetadata has 160 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          static formatMetadata(query, organism, processedData) {
                            const sections = [];
                        
                            sections.push({
                              id: "id",
                        Severity: Major
                        Found in src/scenes/BiochemicalEntityDetails/Metabolite/MetadataSection.js - About 6 hrs to fix

                          File DataTable.js has 433 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          import React, { Component } from "react";
                          import { withRouter } from "react-router";
                          import PropTypes from "prop-types";
                          import axios from "axios";
                          import { getDataFromApi, genApiErrorHandler } from "~/services/RestApi";
                          Severity: Minor
                          Found in src/scenes/BiochemicalEntityDetails/DataTable/DataTable.js - About 6 hrs to fix

                            Function configChart has 157 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              configChart() {
                                this.chartConfig = {
                                  type: "boxplot",
                                  data: {
                                    labels: ["All", "Filtered", "Selected"],

                              Function componentDidMount has 148 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                componentDidMount() {
                                  // number of observations of each data type
                                  const dataTypeData = [];
                                  dataTypeData.push({
                                    label: ["Met. concs."],
                              Severity: Major
                              Found in src/scenes/Stats/Stats.js - About 5 hrs to fix

                                Function render has 147 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  render() {
                                    return (
                                      <div className="content-container content-container-stats-scene">
                                        <h1 className="page-title">
                                          Statistics:{" "}
                                Severity: Major
                                Found in src/scenes/Stats/Stats.js - About 5 hrs to fix

                                  File MetadataSection.js has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import React, { Component } from "react";
                                  import PropTypes from "prop-types";
                                  import { Link } from "react-router-dom";
                                  import BaseMetadataSection from "../MetadataSection";
                                  import { LoadExternalContent, LoadContent } from "../LoadContent";
                                  Severity: Minor
                                  Found in src/scenes/BiochemicalEntityDetails/Gene/MetadataSection.js - About 5 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language