BlueBrain/eFEL

View on GitHub

Showing 79 of 91 total issues

Function render_pep440_branch has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def render_pep440_branch(pieces: Dict[str, Any]) -> str:
"""TAG[[.dev0]+DISTANCE.gHEX[.dirty]] .
 
The ".dev0" means not master branch. Note that .dev0 sorts backwards
(a feature branch will appear "older" than the master branch).
Severity: Minor
Found in efel/_version.py - About 1 hr to fix

Function output_graphivz has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def output_graphivz(feature_library, filename, draw_dependencies=False,
output_dot=False):
'''create a PNG at filename of the dependencies'''
try:
import pygraphviz
Severity: Minor
Found in utils/efel_graph_dependency.py - About 1 hr to fix

Function render_pep440_branch has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def render_pep440_branch(pieces: Dict[str, Any]) -> str:
"""TAG[[.dev0]+DISTANCE.gHEX[.dirty]] .
 
The ".dev0" means not master branch. Note that .dev0 sorts backwards
(a feature branch will appear "older" than the master branch).
Severity: Minor
Found in versioneer.py - About 1 hr to fix

Function render_pep440_post_branch has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def render_pep440_post_branch(pieces: Dict[str, Any]) -> str:
"""TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] .
 
The ".dev0" means not master branch.
 
 
Severity: Minor
Found in versioneer.py - About 1 hr to fix

Function render_pep440_post_branch has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

def render_pep440_post_branch(pieces: Dict[str, Any]) -> str:
"""TAG[.postDISTANCE[.dev0]+gHEX[.dirty]] .
 
The ".dev0" means not master branch.
 
 
Severity: Minor
Found in efel/_version.py - About 1 hr to fix

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

def depol_block():
"""Check for a depolarization block"""
 
# if there is no depolarization block return 1
# if there is a depolarization block return None
Severity: Minor
Found in efel/pyfeatures/pyfeatures.py - About 1 hr to fix

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

def _get_feature_values_serial(
trace_featurenames: tuple[dict, list[str], bool]
) -> dict:
"""Single process of get_feature_values."""
trace, feature_names, raise_warnings = trace_featurenames
Severity: Minor
Found in efel/api.py - About 1 hr to fix

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

def halfwidth(
waveforms,
sampling_frequency,
return_idx=False
):
Severity: Minor
Found in efel/pyfeatures/extrafeats.py - About 1 hr to fix

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

def scan_setup_py() -> int:
"""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

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

def get_feature_library(dependency_file):
'''parse the `dependency_file` and gather all the features and their dependencies'''
feature_library = defaultdict(dict)
with open(dependency_file) as fd:
for line in fd:
Severity: Minor
Found in utils/efel_graph_dependency.py - About 1 hr to fix

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

def load_neo_file(file_name: str, stim_start=None, stim_end=None, **kwargs) -> list:
"""
Loads a data file using neo and converts it for eFEL readability.
 
Args:
Severity: Minor
Found in efel/io.py - About 1 hr to fix

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

def set_setting(self,
setting_name: str,
new_value: Union[int, float, str, bool]) -> None:
"""Set a certain setting to a new value.
 
 
Severity: Minor
Found in efel/settings.py - About 1 hr to fix

Function evaluate has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

def evaluate(individual, target_voltage1=-80, target_voltage2=-60):
"""
Evaluate a neuron model with parameters e_pas and g_pas, extracts
features from resulting traces and returns a tuple with
abs(voltage_base-target_voltage1) and
Severity: Minor
Found in examples/deap/deap_efel_eval2.py - About 1 hr to fix

    Function __init__ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    def __init__(self, conductances):
     
    # Properties of the cell soma
    self.soma = h.Section(name='soma')
    self.soma.nseg = 1
    Severity: Minor
    Found in examples/deap/GranuleCell1/GranuleCell1.py - About 1 hr to fix

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

      def render(pieces: Dict[str, Any], style: str) -> Dict[str, Any]:
      """Render the given version pieces into the requested style."""
      if pieces["error"]:
      return {"version": "unknown",
      "full-revisionid": pieces.get("long"),
      Severity: Minor
      Found in efel/_version.py - About 1 hr to fix

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

      def get_distance(
      trace: dict,
      feature_name: str,
      mean: float,
      std: float,
      Severity: Minor
      Found in efel/api.py - About 1 hr to fix

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

      def _initSettings() -> None:
      """Init the settings in cppcore."""
      settings_attrs = vars(_settings)
      for setting_name, setting_value in settings_attrs.items():
      if isinstance(setting_value, bool):
      Severity: Minor
      Found in efel/api.py - About 1 hr to fix

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

      def render(pieces: Dict[str, Any], style: str) -> Dict[str, Any]:
      """Render the given version pieces into the requested style."""
      if pieces["error"]:
      return {"version": "unknown",
      "full-revisionid": pieces.get("long"),
      Severity: Minor
      Found in versioneer.py - About 1 hr to fix

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

      def compare_features(orig_features, new_features):
      obj_values = []
      for step_number in orig_features:
      for feature_name, feature_value in orig_features[step_number].items():
      if feature_value is not None:
      Severity: Minor
      Found in examples/deap/GranuleCell1/GranuleCellDeap1-scoop.py - About 1 hr to fix

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

      def impedance():
      from scipy.ndimage.filters import gaussian_filter1d
       
      dt = _get_cpp_data("interp_step")
      Z_max_freq = _get_cpp_data("impedance_max_freq")
      Severity: Minor
      Found in efel/pyfeatures/pyfeatures.py - About 1 hr to fix
      Severity
      Category
      Status
      Source
      Language