Showing 57 of 69 total issues
File data_structures_utils.py
has 660 lines of code (exceeds 250 allowed). Consider refactoring. Open
# Data structure manipulations and conversions
import contextlib
import io
import json
import ntpath
Function assert_arrays
has a Cognitive Complexity of 56 (exceeds 5 allowed). Consider refactoring. Open
def assert_arrays(params, shape=None, transpose=False):
# type: (object, object) -> object
if shape is None or not (
isinstance(shape, tuple)
and len(shape) in range(3)
- Read upRead up
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 assert_equal_objects
has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring. Open
def assert_equal_objects(obj1, obj2, attributes_dict=None, logger=None):
def print_not_equal_message(attr, field1, field2, logger):
# logger.error("\n\nValueError: Original and read object field "+ attr + " not equal!")
# raise_value_error("\n\nOriginal and read object field " + attr + " not equal!")
logger.warning(
- Read upRead up
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 bidsio.py
has 420 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Authors: Adam Li and Patrick Myers.
Version: 1.0
"""
File bids_patient.py
has 414 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Authors: Adam Li and Patrick Myers.
Version: 1.0
"""
File elecs.py
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
import collections
import re
import warnings
from typing import List, Dict, Union, Tuple
File bids_helper.py
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Authors: Adam Li and Patrick Myers.
Version: 1.0
"""
File bids_run.py
has 325 lines of code (exceeds 250 allowed). Consider refactoring. Open
"""
Authors: Adam Li and Patrick Myers.
Version: 1.0
"""
File basedataobject.py
has 283 lines of code (exceeds 250 allowed). Consider refactoring. Open
import copy
import warnings
from abc import ABC, abstractmethod
from typing import List, Dict, Union, Tuple
File saveas.py
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
import datetime
import os
import warnings
from typing import List, Dict, Union
Function find_seizure_offset
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def find_seizure_offset(
cls,
event_onsets: List[int],
event_durations: List[float],
event_keys: List[int],
- Read upRead up
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 find_seizure_onset
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def find_seizure_onset(
cls,
event_onsets: List[int],
event_durations: List[float],
event_keys: List[int],
- Read upRead up
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 copy_object_attributes
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def copy_object_attributes(
obj1, obj2, attr1, attr2=None, deep_copy=False, check_none=False
):
attr1 = ensure_list(attr1)
if attr2 is None:
- Read upRead up
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 convert_to_bids
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def convert_to_bids(
edf_fpath,
bids_root,
bids_basename,
coords_fpath=None,
- Read upRead up
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 _check_cez_labels_in_chans
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def _check_cez_labels_in_chans(self):
"""
Check the cez labels for contact level.
:return: None
- Read upRead up
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 label_channel_types
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def label_channel_types(cls, labels: List[str]):
"""
Load in the channel types and try to infer them.
The possibilities are: EEG, STIM, EOG, EKG, Misc. that are from MNE-Python.
- Read upRead up
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 9 arguments (exceeds 4 allowed). Consider refactoring. Open
def __init__(
Function get_seeg_ngbhrs
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def get_seeg_ngbhrs(chanlabels, contact: str):
"""
Helper function to get neighboring contacts for SEEG contacts using regex.
Parameters
- Read upRead up
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 obj_to_dict
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def obj_to_dict(obj):
"""
:param obj: Python object to introspect
:return: dictionary after recursively taking obj fields and their values
"""
- Read upRead up
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 _pyedf_saveas_edf
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
def _pyedf_saveas_edf(