KarrLab/wc_sim

View on GitHub
wc_sim/testing/utils.py

Summary

Maintainability
C
1 day
Test Coverage
A
98%

File utils.py has 439 lines of code (exceeds 250 allowed). Consider refactoring.
Open

""" Utilities for testing

:Author: Arthur Goldberg <Arthur.Goldberg@mssm.edu>
:Date: 2019-10-26
:Copyright: 2019, Karr Lab
Severity: Minor
Found in wc_sim/testing/utils.py - About 6 hrs to fix

    Function check_simul_results has 9 arguments (exceeds 4 allowed). Consider refactoring.
    Open

    def check_simul_results(test_case, dynamic_model, results_dir, integration_framework=None,
    Severity: Major
    Found in wc_sim/testing/utils.py - About 1 hr to fix

      Function plot_expected_vs_simulated has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def plot_expected_vs_simulated(dynamic_model,
      Severity: Major
      Found in wc_sim/testing/utils.py - About 50 mins to fix

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

        def check_simul_results(test_case, dynamic_model, results_dir, integration_framework=None,
                                expected_initial_values=None,
                                expected_times=None, expected_species_trajectories=None,
                                expected_property_trajectories=None, rel_tol=1e-7):
            """ Evaluate whether a simulation predicted the expected results
        Severity: Minor
        Found in wc_sim/testing/utils.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

        There are no issues that match your filters.

        Category
        Status