nd2reader/raw_metadata.py
File raw_metadata.py
has 477 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import re
import xmltodict
import six
import numpy as np
import warnings
RawMetadata
has 45 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class RawMetadata(object):
"""RawMetadata class parses and stores the raw metadata that is read from the binary file in dict format.
"""
def __init__(self, fh, label_map):
Function _parse_events
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def _parse_events(self):
"""Extract events
"""
- 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 _process_channels_metadata
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
def _process_channels_metadata(self, metadata):
validity = self._get_channel_validity_list(metadata)
# Channel information is contained in dictionaries with the keys a0, a1...an where the number
# indicates the order in which the channel is stored. So by sorting the dicts alphabetically
- 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"