sourcery_analytics.cli.data

Models holding data for the command line, such as analysis results.

class sourcery_analytics.cli.data.ThresholdBreachDict

Bases: TypedDict

A dictionary describing a single threshold breach within a single method.

metric_name: str
method_file: Union[str, Path]
method_lineno: int
method_name: str
metric_value: int
class sourcery_analytics.cli.data.ThresholdBreach(relative_path: Path, lineno: int, method_name: str, metric_name: str, metric_value: int, threshold_value: int)

Bases: object

A model describing a single threshold breach within a single method.

relative_path: Path
lineno: int
method_name: str
metric_name: str
metric_value: int
threshold_value: int
classmethod from_dict(threshold_breach_dict: ThresholdBreachDict, threshold_settings: ThresholdSettings) ThresholdBreach

Constructs a ThresholdBreach instance from a dictionary.