satuma777/evoltier

View on GitHub

Showing 6 of 10 total issues

Function run has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

    def run(self):
        best_solution = None
        success = False
        if self.min:
            best_eval = float('inf')
Severity: Minor
Found in evoltier/updater.py - About 3 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 __init__ has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def __init__(self, optimizer, obj_func, pop_size=1, threshold=None, max_iter=10000, out='result',
Severity: Major
Found in evoltier/updater.py - About 50 mins to fix

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

        def __init__(self, dim, theta=None, upper=None, lower=None, xp=np):
    Severity: Minor
    Found in evoltier/model/bernoulli.py - About 35 mins to fix

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

          def __init__(self, dim, mean=None, cov=None, sigma=None, xp=np):
      Severity: Minor
      Found in evoltier/model/multi_variable_gassian.py - About 35 mins to fix

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

            def compute_natural_grad(self, weight, sample, mean, cov, sigma):
        Severity: Minor
        Found in evoltier/optimizers/gaussian_natural_gradient.py - About 35 mins to fix

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

              def __init__(self, optimizer, obj_func, pop_size=1, threshold=None, max_iter=10000, out='result',
                           logging=False):
                  self.opt = optimizer
                  self.obj_func = obj_func
                  self.pop_size = pop_size
          Severity: Minor
          Found in evoltier/updater.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