Coverage for pyEDAA/Reports/DocumentationCoverage/__init__.py: 100%
60 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-16 22:20 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-05-16 22:20 +0000
1# ==================================================================================================================== #
2# _____ ____ _ _ ____ _ #
3# _ __ _ _| ____| _ \ / \ / \ | _ \ ___ _ __ ___ _ __| |_ ___ #
4# | '_ \| | | | _| | | | |/ _ \ / _ \ | |_) / _ \ '_ \ / _ \| '__| __/ __| #
5# | |_) | |_| | |___| |_| / ___ \ / ___ \ _| _ < __/ |_) | (_) | | | |_\__ \ #
6# | .__/ \__, |_____|____/_/ \_\/_/ \_(_)_| \_\___| .__/ \___/|_| \__|___/ #
7# |_| |___/ |_| #
8# ==================================================================================================================== #
9# Authors: #
10# Patrick Lehmann #
11# #
12# License: #
13# ==================================================================================================================== #
14# Copyright 2021-2025 Electronic Design Automation Abstraction (EDA²) #
15# #
16# Licensed under the Apache License, Version 2.0 (the "License"); #
17# you may not use this file except in compliance with the License. #
18# You may obtain a copy of the License at #
19# #
20# http://www.apache.org/licenses/LICENSE-2.0 #
21# #
22# Unless required by applicable law or agreed to in writing, software #
23# distributed under the License is distributed on an "AS IS" BASIS, #
24# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
25# See the License for the specific language governing permissions and #
26# limitations under the License. #
27# #
28# SPDX-License-Identifier: Apache-2.0 #
29# ==================================================================================================================== #
30#
31"""Abstraction of code documentation coverage data model."""
32from enum import Flag
33from typing import Optional as Nullable
35from pyTooling.Decorators import export
36from pyTooling.MetaClasses import ExtendedType
38from pyEDAA.Reports import ReportException
41@export
42class DocCoverageException(ReportException):
43 pass
46@export
47class CoverageState(Flag):
48 Unknown = 0
49 Excluded = 1
50 Ignored = 2
51 Empty = 4
52 Covered = 8
54 Weak = 16
55 Incomplete = 32
56 Inherited = 64
57 Detailed = 128
59 Undocumented = 256
60 Documented = 512
62 Parameters = 1024
63 ReturnValue = 2048
64 Exceptions = 8192
65 Types = 16384
67# unrequiredButDocumented
68# wrongly documented
71@export
72class Base(metaclass=ExtendedType, slots=True):
73 _parent: Nullable["Base"]
74 _name: str
75 _status: CoverageState
77 def __init__(self, name: str, parent: Nullable["Base"] = None):
78 if name is None:
79 raise ValueError(f"Parameter 'name' must not be None.")
81 self._parent = parent
82 self._name = name
83 self._status = CoverageState.Unknown
85 @property
86 def Parent(self) -> Nullable["Base"]:
87 return self._parent
89 @property
90 def Name(self) -> str:
91 return self._name
93 @property
94 def Status(self) -> CoverageState:
95 return self._status
98@export
99class _Type(Base):
100 pass
103@export
104class Class(_Type):
105 pass
108@export
109class _Unit(Base):
110 pass
113@export
114class Module(_Unit):
115 pass
118@export
119class Package(_Unit):
120 pass