Reference.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
ccs 1
cts 2
cp 0.5
crap 1.125
rs 10
c 0
b 0
f 0
1
# Copyright 2022, Red Hat, Inc.
2
# SPDX-License-Identifier: LGPL-2.1-or-later
3
4 1
from typing import List
5
6 1
from openscap_report.dataclasses import asdict, dataclass
7
8 1
REFERENCE_JSON_KEYS = [
9
    "name",
10
    "href",
11
    "ref_ids",
12
]
13
14
15 1
@dataclass
16 1
class Reference:
17 1
    name: str
18 1
    href: str
19 1
    ref_ids: List[str]
20
21 1
    def as_dict(self):
22
        return asdict(self)
23