File morphologies.py
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""Morphology classes"""
"""
Copyright (c) 2016-2020, EPFL/Blue Brain Project
Function extract_nrn_seclists
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
def extract_nrn_seclists(icell, seclists):
'''Extract section lists from an instantiated cell (axon replacement)
Args:
icell (): Instantiated cell model in the NEURON simulator.
- Read upRead up
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 11 (exceeds 5 allowed). Consider refactoring. Open
def instantiate(self, sim=None, icell=None):
"""Load morphology"""
logger.debug('Loading morphology %s', self.morphology_path)
- Read upRead up
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 4 allowed). Consider refactoring. Open
def __init__(
Function replace_axon
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def replace_axon(sim=None, icell=None):
"""Replace axon"""
nsec = len([sec for sec in icell.axonal])
- Read upRead up
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"