alliance-genome/agr

View on GitHub

Showing 75 of 182 total issues

Function get_data has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
Open

    def get_data(self, disease_data):

        disease_annots = {}
        list_to_yield = []

Severity: Minor
Found in indexer/src/loaders/disease_loader.py - 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 get_data has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    def get_data(self, gene_data, batch_size, test_set):

        gene_dataset = {}
        list_to_yield = []

Severity: Minor
Found in indexer/src/loaders/gene_loader.py - About 6 hrs 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 108 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render() {
    const filteredData = this.props.data.filter((dat) => this.filterCallback(dat));
    const all_methods = this.props.data[0].predictionMethodsMatched.concat(
      this.props.data[0].predictionMethodsNotCalled,
      this.props.data[0].predictionMethodsNotMatched
Severity: Major
Found in webapp/src/components/orthology/orthologyFilteredTable.js - About 4 hrs to fix

    Function get_data has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        def get_data():
            path = "tmp";
            S3File("mod-datadumps", "disease-ontology.obo", path).download()
            do_data = TXTFile(path + "/disease-ontology.obo").get_data()
    
    
    Severity: Minor
    Found in indexer/src/loaders/do_loader.py - About 4 hrs 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

    File mapping_schema.py has 340 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    mapping_schema = {
        "settings": {
            "index": {
                "max_result_window": 15000,
                "analysis": {
    Severity: Minor
    Found in indexer/src/mapping/mapping_schema.py - About 4 hrs to fix

      Function get_data has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_data():
              path = "tmp";
              S3File("mod-datadumps/data", "so.obo", path).download()
              so_data = TXTFile(path + "/so.obo").get_data()
      
      
      Severity: Minor
      Found in indexer/src/loaders/so_loader.py - About 3 hrs 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

      File search_helper.py has 282 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import json
      
      
      def build_es_aggregation_body_request(es_query, category, category_filters):
          agg_query_body = {
      Severity: Minor
      Found in api/src/services/helpers/search_helper.py - About 2 hrs to fix

        Function get_data has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

            def get_data(self):
                omim_dataset = {}
        
                for row in self.omim_data:
                    if len(row) < 3:
        Severity: Minor
        Found in indexer/src/loaders/omim_loader.py - About 2 hrs 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 64 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render() {
            const speciesPresent = this.props.data.map((orthData) => {
              return orthData.gene2SpeciesName;
            });
            // refine the species order to keep only species present in orthologs
        Severity: Major
        Found in webapp/src/components/orthology/orthologyTable.js - About 2 hrs to fix

          Function get_data has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
          Open

              def get_data(mod_name, test_set, gene_master_dict):
                  path = "tmp"
                  filename = None
                  filename_comp = None
                  if test_set == True:
          Severity: Minor
          Found in indexer/src/loaders/ortho_loader.py - About 2 hrs 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 a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

            render() {
              if (this.props.loading) {
                return <span>loading...</span>;
              }
          
          
          Severity: Minor
          Found in webapp/src/containers/genePage/index.js - About 2 hrs 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 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            render() {
              if (this.props.loading) {
                return <span>loading...</span>;
              }
          
          
          Severity: Major
          Found in webapp/src/containers/genePage/index.js - About 2 hrs to fix

            Function MethodCell has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const MethodCell = (props) => {
              const {
                predictionMethodsMatched,
                predictionMethodsNotMatched
              } = props;
            Severity: Major
            Found in webapp/src/components/orthology/methodCell.js - About 2 hrs to fix

              Function load_from_mods has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                  def load_from_mods(self, test_set):
                      mods = [RGD(), MGI(), ZFIN(), SGD(), WormBase(), FlyBase(), Human()]
              
              
                      gene_master_dict = {} # Build a dictionary of sets for all indexed MODs/genes. Used for filtering orthology.
              Severity: Minor
              Found in indexer/src/loaders/aggregate_loader.py - About 1 hr 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 45 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render() {
                  let currentRoute=this.props.location.pathname.replace('/','');
                  currentRoute= currentRoute==''?'home' : currentRoute;
              
                  return (
              Severity: Minor
              Found in webapp/src/containers/layout/index.js - About 1 hr to fix

                Function parseGOOBO has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                def parseGOOBO(filename):
                    """
                    Parses a Gene Ontology dump in OBO v1.2 format.
                    Yields each 
                    Keyword arguments:
                Severity: Minor
                Found in indexer/src/loaders/obo_parser.py - About 1 hr 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 format_aggregation_results has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                def format_aggregation_results(aggregation_results, category, category_filters):
                    if category == '':
                        category_obj = {
                            'values': [],
                            'key': 'category'
                Severity: Minor
                Found in api/src/services/helpers/search_helper.py - About 1 hr 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 get_complete_url has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def get_complete_url (self, local_id, global_id):
                
                        complete_url = None
                
                        if 'MGI' in global_id:
                Severity: Minor
                Found in indexer/src/loaders/gene_loader.py - About 1 hr 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 attach_homolog_data has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                Open

                    def attach_homolog_data(self, genes):
                
                        for row in self.homolog_data:
                
                            gene_1 = self._process_gene_id_from_panther(row[0], genes)
                Severity: Minor
                Found in indexer/src/loaders/homolog_loader.py - About 1 hr 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 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    const diseases = this.props.data;
                    const filename = this.props.filename;
                
                    // the way the incoming data is grouped doesn't exactly align with the way
                Severity: Minor
                Found in webapp/src/components/disease/genePageDiseaseTable.js - About 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language