sdoc.sdoc2.formatter.html.LabelHtmlFormatter   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 87.5%

Importance

Changes 0
Metric Value
wmc 1
eloc 9
dl 0
loc 26
ccs 7
cts 8
cp 0.875
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A LabelHtmlFormatter.generate() 0 8 1
1 1
from typing import Any
2
3 1
from sdoc.sdoc2.formatter.html.HtmlFormatter import HtmlFormatter
4 1
from sdoc.sdoc2.node.LabelNode import LabelNode
5 1
from sdoc.sdoc2.NodeStore import NodeStore
6
7
8 1
class LabelHtmlFormatter(HtmlFormatter):
9
    """
10
    HtmlFormatter for generating HTML code for labels.
11
    """
12
13
    # ------------------------------------------------------------------------------------------------------------------
14 1
    def generate(self, node: LabelNode, file: Any) -> None:
15
        """
16
        Generates the HTML code for a label node.
17
18
        :param LabelNode node: The label node.
19
        :param any file: The output file.
20
        """
21
        HtmlFormatter.generate(self, node, file)
22
23
24
# ----------------------------------------------------------------------------------------------------------------------
25
NodeStore.register_formatter('label', 'html', LabelHtmlFormatter)
26