KarrLab/wc_analysis

View on GitHub

Showing 7 of 11 total issues

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

    def get_digraph(self, submodel):
        """ Create a NetworkX network representing the reaction network in `submodel`

        To leverage the algorithms in NetworkX, map a reaction network on to a NetworkX
        directed graph.
Severity: Minor
Found in wc_analysis/model/fba.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 get_dead_end_species has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def get_dead_end_species(self, submodel, inactive_reactions):
        """ Find the dead end species in a reaction network

        Given a set of inactive reactions in submodel, determine species that are not consumed by
        any reaction, or are not produced by any reaction. Costs :math:`O(n*p)`, where :math:`n` is
Severity: Minor
Found in wc_analysis/model/fba.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 unbounded_paths has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

    def unbounded_paths(self, rxn_network, ex_species, obj_fn_species, min_non_finite_ub=1000.0):
        """ Find the unbounded paths from an extracellular species to some objective function species

        Return all paths in a reaction network that lack a finite flux upper bound
        and go from `ex_species` to an objective function component.
Severity: Minor
Found in wc_analysis/model/fba.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 run has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):
        """ Run multiple analyses

        Raises:
            :obj:`ValueError`: if the analysis is not supported
Severity: Minor
Found in wc_analysis/core.py - About 55 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 __init__ has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, knowledge_base=None, model=None, sim_results_path=None,
Severity: Minor
Found in wc_analysis/core.py - About 45 mins to fix

    Function __init__ has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def __init__(self, sim_results_path, model=None, knowledge_base=None, out_path=None, options=None):
    Severity: Minor
    Found in wc_analysis/core.py - About 35 mins to fix

      Function get_inactive_rxns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
      Open

          def get_inactive_rxns(self, submodel, dead_end_species):
              """ Find the inactive reactions in a reaction network
      
              Given the dead end species in a reaction network, find the reactions that must eventually
              become inactive. Reactions that consume species which are not produced must become inactive.
      Severity: Minor
      Found in wc_analysis/model/fba.py - About 35 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