RuleWarning.as_dict()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1.125

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 1
dl 0
loc 2
rs 10
c 0
b 0
f 0
ccs 1
cts 2
cp 0.5
crap 1.125
1
# Copyright 2022, Red Hat, Inc.
2
# SPDX-License-Identifier: LGPL-2.1-or-later
3 1
from openscap_report.dataclasses import asdict, dataclass
4
5 1
WARNING_JSON_KEYS = [
6
    "text",
7
    "category",
8
]
9
10
11 1
@dataclass
12 1
class RuleWarning:
13 1
    text: str
14 1
    category: str = ""
15
16 1
    def as_dict(self):
17
        return asdict(self)
18