BlueBrain/eFEL

View on GitHub

Showing 91 of 91 total issues

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

# Version: 0.29
 
"""The Versioneer - like a rocketeer, but for versions.
 
The Versioneer
Severity: Major
Found in versioneer.py - About 4 days to fix

    Function extract_stim_times_from_neo_data has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring.
    Open

    def extract_stim_times_from_neo_data(blocks, stim_start, stim_end) -> tuple:
    """
    Seeks for the stim_start and stim_end parameters inside the Neo data.
     
    Args:
    Severity: Minor
    Found in efel/io.py - About 1 day to fix

    File _version.py has 495 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 efel/_version.py - About 7 hrs to fix

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      for filename in ['example_trace1.txt', 'example_trace2.txt']:
      # Use numpy to read the trace data from the txt file
      data = numpy.loadtxt(filename)
       
      # Time is the first column
      Severity: Major
      Found in examples/parallel/scoop_example.py and 1 other location - About 7 hrs to fix
      examples/parallel/multiprocessing_example.py on lines 12..43

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

      for filename in ['example_trace1.txt', 'example_trace2.txt']:
      # Use numpy to read the trace data from the txt file
      data = numpy.loadtxt(filename)
       
      # Time is the first column
      Severity: Major
      Found in examples/parallel/multiprocessing_example.py and 1 other location - About 7 hrs to fix
      examples/parallel/scoop_example.py on lines 12..43

      File extrafeats.py has 385 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      """Extracellular features functions"""
       
      """
      Copyright (c) 2024, EPFL/Blue Brain Project
       
       
      Severity: Minor
      Found in efel/pyfeatures/extrafeats.py - About 5 hrs to fix

        File pyfeatures.py has 374 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        from __future__ import annotations
        """Python implementation of features"""
         
        """
        Copyright (c) 2015, Blue Brain Project/EPFL
        Severity: Minor
        Found in efel/pyfeatures/pyfeatures.py - About 5 hrs to fix

          File api.py has 370 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          """eFEL Python API functions.
           
          This module provides the user-facing Python API of eFEL.
          The convenience functions defined here call the underlying 'cppcore' library
          to hide the lower level API from the user.
          Severity: Minor
          Found in efel/api.py - About 4 hrs to fix

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            if step_number == 0:
            # actual current injections, one for each current step.
            stim = [h.IClamp(0.5, sec=cell.soma)]
             
            stim[0].delay = stimdata['stim0del']
            Severity: Major
            Found in examples/deap/GranuleCell1/GranuleCell1.py and 2 other locations - About 4 hrs to fix
            examples/deap/GranuleCell1/GranuleCell1.py on lines 120..125
            examples/deap/GranuleCell1/GranuleCell1.py on lines 126..131

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            elif step_number == 1:
            stim2 = [h.IClamp(0.5, sec=cell.soma)]
             
            stim2[0].delay = stimdata['stim1del']
            stim2[0].dur = stimdata['stim1dur']
            Severity: Major
            Found in examples/deap/GranuleCell1/GranuleCell1.py and 2 other locations - About 4 hrs to fix
            examples/deap/GranuleCell1/GranuleCell1.py on lines 113..119
            examples/deap/GranuleCell1/GranuleCell1.py on lines 126..131

            Similar blocks of code found in 3 locations. Consider refactoring.
            Open

            elif step_number == 2:
            stim3 = [h.IClamp(0.5, sec=cell.soma)]
             
            stim3[0].delay = stimdata['stim2del']
            stim3[0].dur = stimdata['stim2dur']
            Severity: Major
            Found in examples/deap/GranuleCell1/GranuleCell1.py and 2 other locations - About 4 hrs to fix
            examples/deap/GranuleCell1/GranuleCell1.py on lines 113..119
            examples/deap/GranuleCell1/GranuleCell1.py on lines 120..125

            Function get_cmdclass has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
            Open

            def get_cmdclass(cmdclass: Optional[Dict[str, Any]] = None):
            """Get the custom setuptools subclasses used by Versioneer.
             
            If the package uses a different cmdclass (e.g. one from numpy), it
            should be provide as an argument.
            Severity: Minor
            Found in versioneer.py - About 4 hrs to fix

            Function git_pieces_from_vcs has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            def git_pieces_from_vcs(
            tag_prefix: str,
            root: str,
            verbose: bool,
            runner: Callable = run_command
            Severity: Minor
            Found in efel/_version.py - About 3 hrs to fix

            Function git_pieces_from_vcs has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
            Open

            def git_pieces_from_vcs(
            tag_prefix: str,
            root: str,
            verbose: bool,
            runner: Callable = run_command
            Severity: Minor
            Found in versioneer.py - About 3 hrs to fix

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

            for trace_number, trace_results in enumerate(traces_results):
            print("Results for trace %d" % (trace_number + 1))
            # trace_result is a dictionary, with as keys the requested features
            for feature_name, feature_values in trace_results.items():
            print("Feature %s has the following values: %s" % \
            Severity: Major
            Found in examples/parallel/scoop_example.py and 1 other location - About 3 hrs to fix
            examples/parallel/multiprocessing_example.py on lines 56..61

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

            for trace_number, trace_results in enumerate(traces_results):
            print("Results for trace %d" % (trace_number + 1))
            # trace_result is a dictionary, with as keys the requested features
            for feature_name, feature_values in trace_results.items():
            print("Feature %s has the following values: %s" % \
            Severity: Major
            Found in examples/parallel/multiprocessing_example.py and 1 other location - About 3 hrs to fix
            examples/parallel/scoop_example.py on lines 55..60

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

            def uniform(lower_list, upper_list, dimensions):
            """Fill array """
             
            if hasattr(lower_list, '__iter__'):
            return [random.uniform(lower, upper) for lower, upper in
            Severity: Major
            Found in examples/deap/deap_efel.py and 1 other location - About 3 hrs to fix
            examples/deap/GranuleCell1/GranuleCellDeap1-scoop.py on lines 161..168

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

            def uniform(lower_list, upper_list, dimensions):
            """Fill array """
            if hasattr(lower_list, '__iter__'):
            return [random.uniform(lower, upper) for lower, upper in
            zip(lower_list, upper_list)]
            Severity: Major
            Found in examples/deap/GranuleCell1/GranuleCellDeap1-scoop.py and 1 other location - About 3 hrs to fix
            examples/deap/deap_efel.py on lines 62..70

            File isi.py has 299 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            """Features that are depending on the inter-spike intervals."""
            from __future__ import annotations
            import logging
            from typing_extensions import deprecated
            import warnings
            Severity: Minor
            Found in efel/pyfeatures/isi.py - About 3 hrs to fix

              Function git_versions_from_keywords has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

              def git_versions_from_keywords(
              keywords: Dict[str, str],
              tag_prefix: str,
              verbose: bool,
              ) -> Dict[str, Any]:
              Severity: Minor
              Found in versioneer.py - About 2 hrs to fix
              Severity
              Category
              Status
              Source
              Language