BlueBrain/eFEL

View on GitHub

Showing 91 of 91 total issues

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

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

def get_versions(verbose: bool = False) -> Dict[str, Any]:
"""Get the project version from whatever source is available.
 
Returns dict with two keys: 'version' and 'full'.
"""
Severity: Minor
Found in versioneer.py - About 2 hrs to fix

Function run_command has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def run_command(
commands: List[str],
args: List[str],
cwd: Optional[str] = None,
verbose: bool = False,
Severity: Minor
Found in efel/_version.py - About 2 hrs to fix

Function run_command has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
Open

def run_command(
commands: List[str],
args: List[str],
cwd: Optional[str] = None,
verbose: bool = False,
Severity: Minor
Found in versioneer.py - About 2 hrs to fix

Function git_get_keywords has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def git_get_keywords(versionfile_abs: str) -> Dict[str, str]:
"""Extract version information from the given file."""
# the code embedded in _version.py can just fetch the value of these
# keywords. When used from setup.py, we don't want to import _version.py,
# so we do it with a regexp instead. This function is not used from
Severity: Minor
Found in efel/_version.py - About 2 hrs to fix

Function git_get_keywords has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

def git_get_keywords(versionfile_abs: str) -> Dict[str, str]:
"""Extract version information from the given file."""
# the code embedded in _version.py can just fetch the value of these
# keywords. When used from setup.py, we don't want to import _version.py,
# so we do it with a regexp instead. This function is not used from
Severity: Minor
Found in versioneer.py - About 2 hrs to fix

Function calculate_features has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def calculate_features(
waveforms,
sampling_frequency,
upsample=None,
feature_names=None,
Severity: Minor
Found in efel/pyfeatures/extrafeats.py - About 2 hrs to fix

Function initburst_sahp has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

def initburst_sahp() -> np.ndarray | None:
"""SlowAHP voltage after initial burst."""
# Required cpp features
voltage = get_cpp_feature("voltage")
time = get_cpp_feature("time")
Severity: Minor
Found in efel/pyfeatures/isi.py - About 2 hrs to fix

Function do_vcs_install has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

def do_vcs_install(versionfile_source: str, ipy: Optional[str]) -> None:
"""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

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
Severity
Category
Status
Source
Language