Test Failed
Pull Request — master (#8)
by Jan
02:43
created

oscap_report.scap_results_parser.data_structures   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 39
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 36
dl 0
loc 39
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A Report.as_dict() 0 17 1
1
from dataclasses import dataclass
2
3
4
@dataclass
5
class Report:  # pylint: disable=R0902
6
    title: str = ""
7
    identity: str = ""
8
    profile_name: str = ""
9
    target: str = ""
10
    cpe_platforms: str = ""
11
    scanner: str = ""
12
    scanner_version: str = ""
13
    benchmark_url: str = ""
14
    benchmark_id: str = ""
15
    benchmark_version: str = ""
16
    start_time: str = ""
17
    end_time: str = ""
18
    test_system: str = ""
19
    score: float = 0.0
20
    score_max: float = 0.0
21
22
    def as_dict(self):
23
        return {
24
            "title": self.title,
25
            "profile_name": self.profile_name,
26
            "target": self.target,
27
            "identit": self.identity,
28
            "cpe_platforms": self.cpe_platforms,
29
            "scanner": self.scanner,
30
            "scanner_version": self.scanner_version,
31
            "benchmark_url": self.benchmark_url,
32
            "benchmark_id": self.benchmark_id,
33
            "benchmark_version": self.benchmark_version,
34
            "start_time": self.start_time,
35
            "end_time": self.end_time,
36
            "test_system": self.test_system,
37
            "score": self.score,
38
            "score_max": self.score_max,
39
        }
40