BlueBrain/BluePyOpt

View on GitHub

Showing 233 of 415 total issues

Function generate_reinitrng_hoc_block has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def generate_reinitrng_hoc_block(self):
        """"Create re_init_rng code blocks for this channel"""

        reinitrng_hoc_block = ''

Severity: Minor
Found in bluepyopt/ephys/mechanisms.py - About 35 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 plot_individual_params has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def plot_individual_params(
        opt,
        ax,
        params,
        marker,
Severity: Minor
Found in examples/l5pc/l5pc_analysis.py - About 35 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 run_protocols has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def run_protocols(self, protocols, param_values=None):
        """Run stimulus protocols"""

        # TODO Put all of this in a decorator ?
        import traceback
Severity: Minor
Found in examples/l5pc/hocmodel.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def instantiate(self, morph, decor, labels):
        cable_cell = arbor.cable_cell(
            morphology=morph, decor=decor, labels=labels
        )

Severity: Minor
Found in bluepyopt/ephys/simulators.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def instantiate(self, sim=None, icell=None):
        """Find the instantiate compartment"""

        if self.sec_index is None:
            raise EPhysLocInstantiateException(
Severity: Minor
Found in bluepyopt/ephys/locations.py - About 35 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 _deserializer has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def _deserializer(value):
        """_deserializer"""
        if (isinstance(value, list) and value and
           isinstance(value[0], dict) and SENTINAL in value[0]):
            return [instantiator(v) for v in value]
Severity: Minor
Found in bluepyopt/ephys/serializer.py - About 35 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 create_acc has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def create_acc(self, param_values,
                   ignored_globals=(), template='acc/*_template.jinja2',
                   disable_banner=False,
                   template_dir=None,
                   ext_catalogues=None,
Severity: Minor
Found in bluepyopt/ephys/models.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(
        self,
        name,
        electrode=None,
        morph=None,
Severity: Minor
Found in bluepyopt/ephys/models.py - About 35 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 __str__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __str__(self):
        """Return string representation"""

        content = '%s:\n' % self.name

Severity: Minor
Found in bluepyopt/ephys/models.py - About 35 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 _generate_channels_by_location has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

def _generate_channels_by_location(mechs, location_order, loc_desc):
    """Create a OrderedDictionary of all channel mechs for hoc template."""
    channels = OrderedDict((location, []) for location in location_order)
    point_channels = OrderedDict((location, []) for location in location_order)
    for mech in mechs:
Severity: Minor
Found in bluepyopt/ephys/create_hoc.py - About 35 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 __str__ has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __str__(self):
        """Return string representation"""

        content = "%s:\n" % self.name

Severity: Minor
Found in bluepyopt/ephys/models.py - About 35 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 scale has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    def scale(self, values, segment, sim=None):
        """Scale a value based on a segment"""

        # find section
        target_sec = None
Severity: Minor
Found in bluepyopt/ephys/parameterscalers/parameterscalers.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(
        self,
        name,
        morph=None,
        mechs=None,
Severity: Minor
Found in bluepyopt/ephys/models.py - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

    def __init__(
            self,
            name=None,
            distribution=None,
            comment='',
Severity: Minor
Found in bluepyopt/ephys/parameterscalers/parameterscalers.py - About 35 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

Avoid too many return statements within this function.
Open

    return {"version": "0+unknown", "full-revisionid": None,
Severity: Major
Found in bluepyopt/_version.py - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return feature_value, mean_wf
    Severity: Major
    Found in bluepyopt/ephys/efeatures.py - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          return {
      Severity: Major
      Found in versioneer.py - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                    return feature_value
        Severity: Major
        Found in bluepyopt/ephys/efeatures.py - About 30 mins to fix

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

              def instantiate(self, sim=None, icell=None):
                  """Instantiate"""
          
                  for location in self.locations:
                      isec_list = location.instantiate(sim=sim, icell=icell)
          Severity: Minor
          Found in bluepyopt/ephys/mechanisms.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,
                  centroids,
                  offspring_size,
                  sigma,
          Severity: Minor
          Found in bluepyopt/deapext/CMA_SO.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