openscap_report.scap_results_parser.data_structures.oval_test   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Test Coverage

Coverage 94.44%

Importance

Changes 0
Metric Value
wmc 1
eloc 21
dl 0
loc 29
ccs 17
cts 18
cp 0.9444
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A OvalTest.as_dict() 0 2 1
1
# Copyright 2022, Red Hat, Inc.
2
# SPDX-License-Identifier: LGPL-2.1-or-later
3
4 1
from typing import Dict, List, Union
5
6 1
from openscap_report.dataclasses import asdict, dataclass, field
7
8 1
from .oval_object import OvalObject
9 1
from .oval_state import OvalState
10 1
from .oval_variable import OvalVariable
11
12
13 1
@dataclass
14 1
class OvalTest:  # pylint: disable=R0902
15 1
    test_id: str
16 1
    check_existence: str = ""
17 1
    check: str = ""
18 1
    test_type: str = ""
19 1
    comment: str = ""
20 1
    oval_object: OvalObject = None
21 1
    oval_states: List[OvalState] = field(default_factory=list)
22 1
    referenced_oval_endpoints: Dict[
23
        str, Union[OvalObject, OvalState, OvalVariable]
24
    ] = field(default_factory=dict)
25 1
    map_referenced_oval_endpoints: Dict[str, list] = field(default_factory=dict)
26
27 1
    def as_dict(self):
28
        return asdict(self)
29