BlueBrain/BluePyOpt

View on GitHub

Showing 233 of 415 total issues

Function create_acc has 13 arguments (exceeds 4 allowed). Consider refactoring.
Open

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

    Function rename_prot has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def rename_prot(name):
        if 'RMP' in name:
            name = "(No stim)"
        elif 'Rin_dep' in name:
            #name = name.replace('.Rin','Hyp_-40')
    Severity: Minor
    Found in examples/thalamocortical-cell/CellEvalSetup/tools.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 run has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        def run(
            self,
            tstop=None,
            dt=None,
            cvode_active=None,
    Severity: Minor
    Found in bluepyopt/ephys/simulators.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 scan_setup_py has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def scan_setup_py():
        """Validate the contents of setup.py against Versioneer's expectations."""
        found = set()
        setters = False
        errors = 0
    Severity: Minor
    Found in versioneer.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 get_cmdclass has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def get_cmdclass():
        """Get the custom setuptools/distutils subclasses used by Versioneer."""
        if "versioneer" in sys.modules:
            del sys.modules["versioneer"]
            # this fixes the "python setup.py develop" case (also 'install' and
    Severity: Minor
    Found in versioneer.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 do_vcs_install has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

    def do_vcs_install(manifest_in, versionfile_source, ipy):
        """Git-specific installation logic for Versioneer.
    
        For Git, this means creating/changing .gitattributes to mark _version.py
        for export-subst keyword substitution.
    Severity: Minor
    Found in versioneer.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 12 arguments (exceeds 4 allowed). Consider refactoring.
    Open

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

      Function integrate has 12 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      def integrate(sampstim, nsamples, dt, vRest, Trec, Tfac,
      Severity: Major
      Found in examples/tsodyksmarkramstp/tmodeint.py - About 1 hr to fix

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

            def __init__(
                self,
                centroids,
                offspring_size,
                sigma,
        Severity: Minor
        Found in bluepyopt/deapext/CMA_MO.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 _separate_global_properties has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def _separate_global_properties(cls, loc, mechs):
                """Separates global properties from a label-specific dict of mechanisms
        
                Args:
                    loc (): An Arbor label describing the location
        Severity: Minor
        Found in bluepyopt/ephys/create_acc.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 _setup_efel has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def _setup_efel(self):
                """Set up efel before extracting the feature"""
        
                import efel
                efel.reset()
        Severity: Minor
        Found in bluepyopt/ephys/efeatures.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 generic_visit has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

            def generic_visit(self, node):
                self._stack.append(node)  # keep track of visitor stack
        
                node = super(ArbIExprValueEliminator, self).generic_visit(node)
        
        
        Severity: Minor
        Found in bluepyopt/ephys/parameterscalers/acc_iexpr.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 main has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        def main(args):
            """Main"""
            if args.sim == 'nrn':
                sim = ephys.simulators.NrnSimulator()
            else:
        Severity: Minor
        Found in examples/expsyn/expsyn.py - About 1 hr to fix

          Function plot_validation has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          def plot_validation(opt, parameters):
              """Plot validation"""
          
              soma_loc = ephys.locations.NrnSeclistCompLocation(
                  name='soma',
          Severity: Minor
          Found in examples/l5pc/l5pc_analysis.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 run has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def run(self,
                      max_ngen=10,
                      offspring_size=None,
                      continue_cp=False,
                      cp_filename=None,
          Severity: Minor
          Found in bluepyopt/deapext/optimisations.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 instantiate_recordings has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              def instantiate_recordings(self, cell_model, use_labels=False):
                  """Instantiate recordings"""
          
                  # Attach voltage probe sampling at 10 kHz (every 0.1 ms)
                  for i, rec in enumerate(self.recordings):
          Severity: Minor
          Found in bluepyopt/ephys/protocols.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 add_segment_groups has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          def add_segment_groups(cell):
              """Add the segment groups to be consistent with naming in biophys.
          
              Arguments:
                  cell (neuroml.Cell): neuroml cell
          Severity: Minor
          Found in bluepyopt/neuroml/morphology.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 10 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, evaluator=None,
          Severity: Major
          Found in bluepyopt/deapext/optimisations.py - About 1 hr to fix

            Function get_arguments has 10 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            def get_arguments(
            Severity: Major
            Found in bluepyopt/neuroml/biophys.py - About 1 hr to fix

              Function define_fitness_calculator has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              def define_fitness_calculator(protocols, feature_file):
              
                  with open(feature_file, "r") as f:
                      feature_definitions = json.load(f)
              
              
              Severity: Minor
              Found in examples/l5pc_lfpy/l5pc_lfpy_evaluator.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

              Severity
              Category
              Status
              Source
              Language