BlueBrain/BluePyOpt

View on GitHub
bluepyopt/ephys/morphologies.py

Summary

Maintainability
C
1 day
Test Coverage

File morphologies.py has 334 lines of code (exceeds 250 allowed). Consider refactoring.
Open

"""Morphology classes"""

"""
Copyright (c) 2016-2020, EPFL/Blue Brain Project

Severity: Minor
Found in bluepyopt/ephys/morphologies.py - About 4 hrs to fix

    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.
    Severity: Minor
    Found in bluepyopt/ephys/morphologies.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 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)
    
    
    Severity: Minor
    Found in bluepyopt/ephys/morphologies.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 4 allowed). Consider refactoring.
    Open

        def __init__(
    Severity: Major
    Found in bluepyopt/ephys/morphologies.py - About 1 hr to fix

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

      There are no issues that match your filters.

      Category
      Status