BlueBrain/BluePyOpt

View on GitHub

Showing 233 of 415 total issues

File versioneer.py has 1416 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Version: 0.18

"""The Versioneer - like a rocketeer, but for versions.

The Versioneer
Severity: Major
Found in versioneer.py - About 3 days to fix

    File create_acc.py has 772 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    """create JSON/ACC files for Arbor from a set of BluePyOpt.ephys parameters"""
    
    # pylint: disable=R0914
    
    import io
    Severity: Major
    Found in bluepyopt/ephys/create_acc.py - About 1 day to fix

      File models.py has 685 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Cell template class"""
      
      """
      Copyright (c) 2016-2020, EPFL/Blue Brain Project
      
      
      Severity: Major
      Found in bluepyopt/ephys/models.py - About 1 day to fix

        File efeatures.py has 525 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        """eFeature classes"""
        
        """
        Copyright (c) 2016-2020, EPFL/Blue Brain Project
        
        
        Severity: Major
        Found in bluepyopt/ephys/efeatures.py - About 1 day to fix

          File protocols.py has 525 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """Protocol classes"""
          from .recordings import LFPRecording
          from .simulators import LFPySimulator
          from .stimuli import LFPStimulus
          
          
          Severity: Major
          Found in bluepyopt/ephys/protocols.py - About 1 day to fix

            File biophys.py has 503 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """Functions to create neuroml biophysiology"""
            
            """
            Copyright (c) 2016-2022, EPFL/Blue Brain Project
             This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
            Severity: Major
            Found in bluepyopt/neuroml/biophys.py - About 1 day to fix

              File l5pc_analysis.py has 477 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              """Run simple cell optimisation"""
              
              """
              Copyright (c) 2016-2020, EPFL/Blue Brain Project
              
              
              Severity: Minor
              Found in examples/l5pc/l5pc_analysis.py - About 7 hrs to fix

                File locations.py has 475 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                """Location classes"""
                
                """
                Copyright (c) 2016-2020, EPFL/Blue Brain Project
                
                
                Severity: Minor
                Found in bluepyopt/ephys/locations.py - About 7 hrs to fix

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

                  def define_fitness_calculator(main_protocol, features_filename, prefix=""):
                      """Define fitness calculator"""
                  
                      with open(os.path.join(os.path.dirname(__file__), '..', features_filename)) as protocol_file:
                          feature_definitions = json.load(protocol_file)
                  Severity: Minor
                  Found in examples/thalamocortical-cell/CellEvalSetup/evaluator.py - About 6 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 _translate_mech has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
                  Open

                      def _translate_mech(cls, mech_name, mech_params, arb_cats):
                          """Translate NMODL mechanism to Arbor ACC format
                  
                          Args:
                              mech_name (): NMODL mechanism name (suffix)
                  Severity: Minor
                  Found in bluepyopt/ephys/create_acc.py - About 6 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 _generate_parameters has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _generate_parameters(parameters, location_order, loc_desc):
                      """Create a list of parameters that need to be added to the hoc template"""
                      param_locations = defaultdict(list)
                      global_params = {}
                      for param in parameters:
                  Severity: Minor
                  Found in bluepyopt/ephys/create_hoc.py - About 6 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

                  File extra_features_utils.py has 407 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  """Extra features functions"""
                  
                  """
                  Copyright (c) 2016-2020, EPFL/Blue Brain Project
                  
                  
                  Severity: Minor
                  Found in bluepyopt/ephys/extra_features_utils.py - About 5 hrs to fix

                    File _version.py has 391 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    # This file helps to compute a version number in source trees obtained from
                    # git-archive tarball (such as those provided by githubs download-from-tag
                    # feature). Distribution tarballs (built by setup.py sdist) and build
                    # directories (produced by setup.py build) will contain a much shorter file
                    # that just contains the computed version number.
                    Severity: Minor
                    Found in bluepyopt/_version.py - About 5 hrs to fix

                      File stimuli.py has 362 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      """Stimuli classes"""
                      
                      """
                      Copyright (c) 2016-2020, EPFL/Blue Brain Project
                      
                      
                      Severity: Minor
                      Found in bluepyopt/ephys/stimuli.py - About 4 hrs to fix

                        Function create_protocols has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
                        Open

                        def create_protocols(protocol_definitions, do_replace_axon=None, sim='nrn'):
                        
                            protocols = {}
                        
                            if sim == 'nrn':
                        Severity: Minor
                        Found in examples/l5pc/l5pc_evaluator.py - About 4 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

                        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

                          File evaluator.py has 333 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          """
                          Copyright (c) 2016-2020, EPFL/Blue Brain Project
                          
                           This file is part of BluePyOpt <https://github.com/BlueBrain/BluePyOpt>
                          
                          
                          Severity: Minor
                          Found in examples/thalamocortical-cell/CellEvalSetup/evaluator.py - About 4 hrs to fix

                            Function define_parameters has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                            Open

                            def define_parameters(params_filename):
                                """Define parameters"""
                            
                                parameters = []
                            
                            
                            Severity: Minor
                            Found in examples/thalamocortical-cell/CellEvalSetup/template.py - About 3 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

                            File parameters.py has 313 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            """Parameter classes"""
                            
                            """
                            Copyright (c) 2016-2020, EPFL/Blue Brain Project
                            
                            
                            Severity: Minor
                            Found in bluepyopt/ephys/parameters.py - About 3 hrs to fix

                              Function _create_sim_desc has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  def _create_sim_desc(self, param_values,
                                                       ignored_globals=(), template=None,
                                                       disable_banner=False,
                                                       template_dir=None,
                                                       extra_params=None,
                              Severity: Minor
                              Found in bluepyopt/ephys/models.py - About 3 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

                              Severity
                              Category
                              Status
                              Source
                              Language