KarrLab/datanator_frontend

View on GitHub

Showing 403 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

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        formatResults(data, organism) {
          const results = data["sabio_reaction_entries"];
          const numResults = data["sabio_reaction_entries_total"]["value"];
      
          const formattedResults = [];
      Severity: Major
      Found in src/scenes/SearchResults/ReactionSearchResultsList.js and 1 other location - About 3 days to fix
      src/scenes/BiochemicalEntityDetails/Metabolite/ReactionSearchResultsList.js on lines 22..97

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 569.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

        formatResults(data, organism) {
          const results = data["sabio_reaction_entries"];
          const numResults = data["sabio_reaction_entries_total"]["value"];
      
          const formattedResults = [];
      src/scenes/SearchResults/ReactionSearchResultsList.js on lines 30..105

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 569.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      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;

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if (this.props.filtered.values != null) {
                      let measurements = this.props.filtered.values || [];
                      let dataForBoxPlot = measurements;
                      let dataForScatterPlot = [];
                      for (const measurement of measurements) {
                src/scenes/BiochemicalEntityDetails/MeasurementsBoxScatterPlot/MeasurementsBoxScatterPlot.js on lines 185..210

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 255.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if (this.props.selected.values != null) {
                      let measurements = this.props.selected.values || [];
                      let dataForBoxPlot = measurements;
                      let dataForScatterPlot = [];
                      for (const measurement of measurements) {
                src/scenes/BiochemicalEntityDetails/MeasurementsBoxScatterPlot/MeasurementsBoxScatterPlot.js on lines 157..182

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 255.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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";

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                      fetchResults() {
                        const url = this.props["get-results-url"](
                          this.query,
                          this.pageCount,
                          this.props["page-size"]
                    src/scenes/SearchResults/SearchResultsList.js on lines 74..106

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 227.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Identical blocks of code found in 2 locations. Consider refactoring.
                    Open

                      fetchResults() {
                        const url = this.props["get-results-url"](
                          this.query,
                          this.pageCount,
                          this.props["page-size"]
                    Severity: Major
                    Found in src/scenes/SearchResults/SearchResultsList.js and 1 other location - About 1 day to fix
                    src/scenes/BiochemicalEntityDetails/Metabolite/SearchResultsList.js on lines 74..105

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 227.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        for (const kiMet of kiMets) {
                          colDefs.push({
                            headerName: "K_I " + kiMet + " value",
                            headerComponentFramework: HtmlColumnHeader,
                            headerComponentParams: {
                    src/scenes/BiochemicalEntityDetails/Reaction/RateConstantsDataTable.js on lines 323..354

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 213.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    Similar blocks of code found in 2 locations. Consider refactoring.
                    Open

                        for (const kmMet of kmMets) {
                          colDefs.push({
                            headerName: "K_M " + kmMet + " value",
                            headerComponentFramework: HtmlColumnHeader,
                            headerComponentParams: {
                    src/scenes/BiochemicalEntityDetails/Reaction/RateConstantsDataTable.js on lines 366..397

                    Duplicated Code

                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                    Tuning

                    This issue has a mass of 213.

                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                    Refactorings

                    Further Reading

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language