deepa2/builder/core.py
File core.py
has 297 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
"""Defines core abstract classes and data structures for DeepA2 datasets.
This module defines core abstract classes and data structures for building
DeepA2 datasets. The core classess follow the director-builder design pattern.
The `Director` sets up a universal pipeline for transforming a raw dataset.
Function transform
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
def transform(
self,
export_path: Optional[str] = None,
active_features: Optional[List[str]] = None,
debug_size: Optional[int] = 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 process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
def process(self, batched_input: Dict[str, List]) -> Dict[str, List]:
"""
The Director provides a function that can be mapped over a dataset
(requiring batches of size 1).
"""
- 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 transform
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
def transform(