KarrLab/datanator_query_python

View on GitHub

Showing 190 of 190 total issues

Avoid too many return statements within this function.
Open

            return 'Invalid inchi string'
Severity: Major
Found in datanator_query_python/util/chem_util.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                    return 'Invalid inchi string'
    Severity: Major
    Found in datanator_query_python/util/chem_util.py - About 30 mins to fix

      Function each_under_category has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def each_under_category(self, src_tax_ids, target_tax_id):
              """Given a list of source organism IDs, check if each ID
              is the child of target organism.
              
              Args:
      Severity: Minor
      Found in datanator_query_python/query/query_taxon_tree.py - About 25 mins 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_subunit_by_id has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_subunit_by_id(self, _id):
              """Get protein subunit information by kinlaw_id.
              
              Args:
                  _id (:obj:`int`): kinlaw_id.
      Severity: Minor
      Found in datanator_query_python/query/query_sabiork.py - About 25 mins 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_canon_rank_distance has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_canon_rank_distance(self, _id, front_end=False):
              '''Given the ncbi_id, return canonically-ranked ancestors
                  along the lineage and their non-canonical distances
      
              Args:
      Severity: Minor
      Found in datanator_query_python/query/query_taxon_tree.py - About 25 mins 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_kinlaw_by_environment has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_kinlaw_by_environment(self, taxon=None, taxon_wildtype=None, ph_range=None, temp_range=None,
                                name_space=None, param_type=None, projection={'_id': 0}):
              """get kinlaw info based on experimental conditions
              
              Args:
      Severity: Minor
      Found in datanator_query_python/query/query_sabiork_old.py - About 25 mins 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 main has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

      def main():
          db = 'datanator'
          conf = config.TestConfig()
          username = conf.USERNAME
          password = conf.PASSWORD
      Severity: Minor
      Found in datanator_query_python/aggregate/tabu.py - About 25 mins 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 build_taxon_object has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def build_taxon_object(self, _id, _format="tax_id"):
              """Build taxon object from taxon_id.
              (https://github.com/KarrLab/datanator_pattern_design/blob/master/components/taxon.json)
      
              Args:
      Severity: Minor
      Found in datanator_query_python/util/mongo_util.py - About 25 mins 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_kinlawid_by_rxn has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_kinlawid_by_rxn(self, substrates, products, dof=0):
              ''' Find the kinlaw_id defined in sabio_rk using 
                  rxn participants' inchikey
      
                  Args:
      Severity: Minor
      Found in datanator_query_python/query/query_sabiork_old.py - About 25 mins 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_single_index_count has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_single_index_count(self, q, index, num, 
                                     excludes=[], includes=[],
                                     **kwargs):
              """Get single index up to num hits
              
      Severity: Minor
      Found in datanator_query_python/query/full_text_search.py - About 25 mins 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