BlueBrain/BluePyOpt

View on GitHub

Showing 233 of 415 total issues

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

def _mating_selection(population, mu, tournament_n):
    """Returns the n_of_parents individuals with the best fitness"""

    parents = []
    for _ in range(mu):
Severity: Minor
Found in bluepyopt/deapext/tools/selIBEA.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

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

    def __init__(self, dt=None, ext_catalogues=None):
        """Constructor

        Args:
            dt (float): the integration time step used by Arbor.
Severity: Minor
Found in bluepyopt/ephys/simulators.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

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

    def __init__(self, protocol, model):
        """Calcium trace produced by **model** when stimulated by **protocol**.

        :param protocol: stdputil.Protocol
            The stimulation protocol.
Severity: Minor
Found in examples/graupnerbrunelstdp/stdputil.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

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

    def instantiate_synaptic_stimuli(self, cell_model, use_labels=False):
        """Instantiate synaptic stimuli"""

        for i, stim in enumerate(self.stimuli):
            if isinstance(stim, stimuli.SynapticStimulus):
Severity: Minor
Found in bluepyopt/ephys/protocols.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

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

def get_versions():
    """Get version information or return default if unable to do so."""
    # I am in _version.py, which lives at ROOT/VERSIONFILE_SOURCE. If we have
    # __file__, we can work backwards from there to the root. Some
    # py2exe/bbfreeze/non-CPython implementations don't do __file__, in which
Severity: Minor
Found in bluepyopt/_version.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

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

def filter_start_time(start_time, tasks):
    ret = collections.defaultdict(list)
    for engine_uuid, task_list in tasks.items():
        for task in task_list:
            if task['started'] > start_time:
Severity: Minor
Found in examples/l5pc/benchmark/task_stats.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

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

    def _load_mech_catalogue_meta(cls, ext_catalogues):
        """Load metadata of external and Arbor's built-in mechanism catalogues

        Args:
            ext_catalogues (): Mapping of catalogue name to directory
Severity: Minor
Found in bluepyopt/ephys/create_acc.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

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

def write_acc(
    output_dir,
    cell,
    parameters,
    template_filename="acc/*_template.jinja2",
Severity: Minor
Found in bluepyopt/ephys/create_acc.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

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

def get_root():
    """Get the project root directory.

    We require that all commands are run from the project root, i.e. the
    directory that contains setup.py, setup.cfg, and versioneer.py .
Severity: Minor
Found in versioneer.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

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

    def inst_distribution(self):
        """The instantiated distribution"""

        dist_dict = MissingFormatDict()

Severity: Minor
Found in bluepyopt/ephys/parameterscalers/parameterscalers.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

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

    def _is_linear(self, node):
        """Check if expression is linear in this node"""
        prev_frame = node
        for next_frame in reversed(self._stack[2:]):
            if not isinstance(next_frame, ast.BinOp) or \
Severity: Minor
Found in bluepyopt/ephys/parameterscalers/acc_iexpr.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

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

    def visit_UnaryOp(self, node):
        if isinstance(node.op, ast.UAdd):
            self.visit(node.value)
        elif isinstance(node.op, ast.USub):
            if isinstance(node.operand, ast.Constant):
Severity: Minor
Found in bluepyopt/ephys/parameterscalers/acc_iexpr.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

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

    def instantiate(self, sim=None):
        """Instantiate model in simulator"""

        self.instantiate_morphology(sim)

Severity: Minor
Found in bluepyopt/ephys/models.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