Showing 3 of 7 total issues

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

def _write_arrays(array_gen: Iterable[Tuple[Array, Any]], outbytes: IO[bytes]):
def get_dimensions_from_array(value):
# Return the number of items per dimension
# For an array a[n][m], returns [n, m]
if isinstance(value, np.ndarray) or isinstance(value, list):
Severity: Minor
Found in sdds/writer.py - About 1 hr to fix

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

def _read_header(
inbytes: IO[bytes],
) -> Tuple[str, List[Definition], Optional[Description], Data]:
word_gen = _gen_words(inbytes)
version = next(word_gen) # First token is the SDDS version
Severity: Minor
Found in sdds/reader.py - About 1 hr to fix

Function _gen_real_lines has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def _gen_real_lines(inbytes: IO[bytes]) -> Generator[str, None, None]:
"""No comments and stripped lines."""
while True:
line = inbytes.readline().decode(ENCODING)
if not line:
Severity: Minor
Found in sdds/reader.py - About 25 mins to fix
Severity
Category
Status
Source
Language