paradoxysm/dsigm

View on GitHub

Showing 5 of 5 total issues

GMM has 16 functions (exceeds 15 allowed). Consider refactoring.
Open

class GMM:
    """
    A Gaussian Mixture Model that fits a given number of
    components to maximize the log-likelihood of the model.

Severity: Minor
Found in dsigm/mixture/_gmm.py - About 2 hrs to fix

    Function _validate_init has a Cognitive Complexity of 18 (exceeds 10 allowed). Consider refactoring.
    Open

        def _validate_init(self):
            """
            Validate the attributes of the CoreCluster.
            """
            if self.cores.ndim != 1 or (self.cores.ndim == 0 and self.cores.size > 0):
    Severity: Minor
    Found in dsigm/_core.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 __init__ has 9 arguments (exceeds 5 allowed). Consider refactoring.
    Open

        def __init__(self, init_cores=5, init='kmeans',
    Severity: Major
    Found in dsigm/mixture/_sgmm.py - About 1 hr to fix

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

          def __init__(self, n_clusters=None, init_cores=10, stabilize=0.5, n_init=10,
      Severity: Major
      Found in dsigm/_dsigm.py - About 50 mins to fix

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

            def __init__(self, init_cores=5, init='kmeans',n_init=10, max_iter=100,
        Severity: Major
        Found in dsigm/mixture/_gmm.py - About 45 mins to fix
          Severity
          Category
          Status
          Source
          Language