choderalab/yank

View on GitHub
Yank/reports/notebook.py

Summary

Maintainability
D
2 days
Test Coverage

File notebook.py has 541 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""
YANK Health Report Notebook formatter

This module handles all the figure formatting and processing to minimize the code shown in the Health Report Jupyter
Notebook. All data processing and analysis is handled by the main multistate.analyzers package,
Severity: Major
Found in Yank/reports/notebook.py - About 1 day to fix

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

        def free_energy_trace(self, discard_from_start=1, n_trace=10):
            """
            Trace the free energy by keeping fewer and fewer samples in both forward and reverse direction
    
            Returns
    Severity: Minor
    Found in Yank/reports/notebook.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 restraint_distributions_plot has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
    Open

        def restraint_distributions_plot(self):
            ENERGIES_IDX = 0
            DISTANCES_IDX = 1
    
            # Find the phase that defines the restraint energies and distances.
    Severity: Minor
    Found in Yank/reports/notebook.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 generate_mixing_plot has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def generate_mixing_plot(self, mixing_cutoff=0.05, mixing_warning_threshold=0.90, cmap_override=None):
            """
            Generate the state diffusion mixing map as an image instead of array of number
    
            Parameters
    Severity: Minor
    Found in Yank/reports/notebook.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 generate_replica_mixing_plot has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        def generate_replica_mixing_plot(self, phase_stacked_replica_plots=False):
            """
            Generate the replica trajectory mixing plots. Show the state of each replica as a function of simulation time
    
            Parameters
    Severity: Minor
    Found in Yank/reports/notebook.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 generate_decorrelation_plots has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        def generate_decorrelation_plots(self, decorrelation_threshold=0.1):
            """
    
            Parameters
            ----------
    Severity: Minor
    Found in Yank/reports/notebook.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 generate_free_energy has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def generate_free_energy(self):
            fe_data = self.get_experiment_free_energy_data()
            delta_f = fe_data['free_energy_diff']
            delta_h = fe_data['enthalpy_diff']
            delta_f_err = fe_data['free_energy_diff_error']
    Severity: Minor
    Found in Yank/reports/notebook.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

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

        def generate_equilibration_plots(self, discard_from_start=1):
            """
            Create the equilibration scatter plots showing the trend lines, correlation time,
            and number of effective samples
    
    
    Severity: Minor
    Found in Yank/reports/notebook.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