Coverage¶
lcp.coverage ¶
Coverage module for analyzing documentation completeness.
UndocumentedSymbol
dataclass
¶
A symbol missing documentation.
Source code in src/lcp/coverage.py
to_dict ¶
KindStats
dataclass
¶
Statistics for a specific symbol kind.
Source code in src/lcp/coverage.py
CoverageSummary
dataclass
¶
Summary of documentation coverage.
Source code in src/lcp/coverage.py
to_dict ¶
Convert to dictionary.
Source code in src/lcp/coverage.py
CoverageReport
dataclass
¶
Documentation coverage report for a package.
Source code in src/lcp/coverage.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 | |
to_dict ¶
Convert to dictionary suitable for JSON serialization.
Source code in src/lcp/coverage.py
to_json ¶
to_markdown ¶
Convert to Markdown format.
Source code in src/lcp/coverage.py
to_file ¶
Write report to a file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str
|
Output file path. |
required |
format
|
str | None
|
Output format ('json' or 'markdown'). If None, inferred from extension. |
None
|
Source code in src/lcp/coverage.py
generate_coverage ¶
generate_coverage(package_name: str, include_private: bool = False, recursive: bool = True) -> CoverageReport
Generate documentation coverage report for a package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package_name
|
str
|
The name of an installed Python package to analyze. |
required |
include_private
|
bool
|
Include private symbols (starting with _). |
False
|
recursive
|
bool
|
Scan submodules recursively. |
True
|
Returns:
| Type | Description |
|---|---|
CoverageReport
|
A CoverageReport containing coverage statistics and undocumented symbols. |
Raises:
| Type | Description |
|---|---|
ImportError
|
If the package cannot be imported. |
Example
from lcp import generate_coverage report = generate_coverage("requests") print(f"Coverage: {report.summary.coverage_percent}%") report.to_file("coverage.json")
Source code in src/lcp/coverage.py
generate_coverage_from_scanned ¶
Generate coverage report from already scanned module data.
This is useful when you want to generate both LCP and coverage from the same scan, avoiding duplicate work.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scanned
|
ScannedModule
|
Pre-scanned module data from scan_package(). |
required |
Returns:
| Type | Description |
|---|---|
CoverageReport
|
A CoverageReport containing coverage statistics. |