File core.py
has 583 lines of code (exceeds 250 allowed). Consider refactoring.
"""Provides common base classes that allow modules to talk to each other."""
from dataclasses import dataclass
from datetime import date, datetime
from enum import Enum, IntEnum
from itertools import chain
File rad69.py
has 350 lines of code (exceeds 250 allowed). Consider refactoring.
"""Retrieve data from servers using the rad69 protocol
see [rad69 document set]
(https://gazelle.ihe.net/content/rad-69-retrieve-imaging-document-set)
And the corresponding [transaction]
File qido_rs.py
has 339 lines of code (exceeds 250 allowed). Consider refactoring.
"""Models QIDO-RS: Query based on ID for dicom Objects by Restful Services.
See: [QIDO-RS reference](https://www.dicomstandard.org/using/dicomweb/query-qido-rs/)
and [QIDO-RS at NEMA]
File datastructures.py
has 311 lines of code (exceeds 250 allowed). Consider refactoring.
"""Additional datastructures that do not belong to any specific dicomtrolley
class or function
"""
from datetime import datetime
Function prune_all
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
def prune_all(
self,
addresses: List[TreeAddress],
strategy: PruneStrategy = PruneStrategy.WHERE_POSSIBLE,
):
File mint.py
has 270 lines of code (exceeds 250 allowed). Consider refactoring.
"""Models the MINT DICOM exchange protocol
See:
https://code.google.com/archive/p/medical-imaging-network-transport/downloads
"""
from typing import ClassVar, List, Sequence, Set
File caching.py
has 260 lines of code (exceeds 250 allowed). Consider refactoring.
"""Storing DICOM query results locally to avoid unneeded calls to server"""
from typing import Dict, Iterable, List, Optional, Sequence, Tuple
from dicomtrolley.core import (
Function send_c_find
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
def send_c_find(self, query):
"""Perform a CFIND with the given query
Raises
------
Function get_dicom_qr_trolley
has 7 arguments (exceeds 4 allowed). Consider refactoring.
def get_dicom_qr_trolley(
Function __init__
has 6 arguments (exceeds 4 allowed). Consider refactoring.
def __init__(
Function get_mint_trolley
has 5 arguments (exceeds 4 allowed). Consider refactoring.
def get_mint_trolley(
Function __init__
has 5 arguments (exceeds 4 allowed). Consider refactoring.
def __init__(
Function prune_leaf
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def prune_leaf(self, address: TreeAddress):
"""Prune node at this address only if it has no children
Raises
------
Function __next__
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
def __next__(self):
sized_chunk = bytearray()
while len(sized_chunk) < self.chunk_size:
try:
sized_chunk += next(self._chunk_iterator)
Avoid too many return
statements within this function.
return part
Function __init__
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
def __init__(
self,
initial_objects: Optional[List[DICOMObject]] = None,
expiry_seconds: Optional[int] = 600,
):