Code Quality Report¶
Generated: 2026-04-27 23:16 UTC
Lines of Code¶
| Files | Code | Comment | Blank | Total | |
|---|---|---|---|---|---|
| Source | 41 | 2 694 | 1 064 | 274 | 4 032 |
| Tests | 30 | 3 192 | 332 | 424 | 3 948 |
| Combined | 71 | 5 886 | 1 396 | 698 | 7 980 |
- Comment/code ratio: 39%
- Test/source ratio: 118.5%
Source by module (click to expand)
| Module | Files | Code | Comment | Blank |
|---|---|---|---|---|
cli/ |
4 | 266 | 64 | 65 |
cli/main.py |
— | 40 | 13 | 17 |
cli/registry.py |
— | 118 | 29 | 21 |
cli/terminal_clearance.py |
— | 108 | 22 | 27 |
client/ |
4 | 717 | 156 | 17 |
client/client.py |
— | 170 | 52 | 9 |
client/identity_resolver.py |
— | 88 | 52 | 4 |
client/subscriber.py |
— | 459 | 52 | 4 |
domain/ |
5 | 104 | 71 | 19 |
domain/container_info.py |
— | 44 | 8 | 3 |
domain/events.py |
— | 23 | 18 | 5 |
domain/identity.py |
— | 27 | 8 | 1 |
domain/inspector.py |
— | 10 | 37 | 10 |
hub/ |
3 | 406 | 158 | 16 |
hub/ingester.py |
— | 132 | 39 | 6 |
hub/server.py |
— | 274 | 119 | 10 |
notifications/ |
6 | 329 | 176 | 51 |
notifications/callback.py |
— | 149 | 28 | 6 |
notifications/desktop.py |
— | 86 | 87 | 25 |
notifications/factory.py |
— | 14 | 18 | 7 |
notifications/null.py |
— | 27 | 11 | 8 |
notifications/protocol.py |
— | 53 | 32 | 5 |
notifier/ |
2 | 57 | 49 | 14 |
notifier/app.py |
— | 57 | 40 | 13 |
resources/ |
3 | 132 | 0 | 11 |
resources/systemd/ |
3 | 132 | 0 | 11 |
runtime/ |
3 | 261 | 132 | 27 |
runtime/installer.py |
— | 244 | 118 | 20 |
runtime/service.py |
— | 17 | 14 | 7 |
verdict/ |
6 | 246 | 135 | 28 |
verdict/client.py |
— | 91 | 7 | 2 |
verdict/interface.py |
— | 30 | 29 | 11 |
verdict/server.py |
— | 65 | 49 | 4 |
verdict/shield_exec.py |
— | 55 | 39 | 5 |
verdict/socket.py |
— | 5 | 11 | 6 |
wire/ |
4 | 140 | 78 | 25 |
wire/errors.py |
— | 59 | 9 | 7 |
wire/interface.py |
— | 43 | 35 | 5 |
wire/socket.py |
— | 38 | 34 | 13 |
__init__.py |
— | 36 | 45 | 1 |
Architecture¶
Module Dependency Graph¶
graph TD
terok_clearance.domain.inspector --> terok_clearance.domain.container_info
terok_clearance.wire.errors --> terok_clearance.wire.interface
terok_clearance.notifications.factory --> terok_clearance.notifications.desktop
terok_clearance.notifications.factory --> terok_clearance.notifications.null
terok_clearance.hub.server --> terok_clearance.hub.ingester
terok_clearance.hub.server --> terok_clearance.runtime.service
terok_clearance.hub.server --> terok_clearance.verdict.client
terok_clearance.verdict.socket --> terok_clearance.wire.socket
terok_clearance.verdict.server --> terok_clearance.runtime.service
terok_clearance.verdict.server --> terok_clearance.verdict.shield_exec
terok_clearance.client.subscriber --> terok_clearance.client.client
terok_clearance.notifier.app --> terok_clearance.client.identity_resolver
terok_clearance.notifier.app --> terok_clearance.client.subscriber
terok_clearance.notifier.app --> terok_clearance.notifications.factory
terok_clearance.notifier.app --> terok_clearance.runtime.service
terok_clearance.cli.main --> terok_clearance.cli.registry
terok_clearance.cli.registry --> terok_clearance.cli.terminal_clearance
terok_clearance
terok_clearance.domain.events
terok_clearance.domain.identity
terok_clearance.domain.container_info
terok_clearance.wire.socket
terok_clearance.wire.interface
terok_clearance.notifications.protocol
terok_clearance.notifications.null
terok_clearance.notifications.callback
terok_clearance.notifications.desktop
terok_clearance.hub.ingester
terok_clearance.verdict.shield_exec
terok_clearance.verdict.interface
terok_clearance.verdict.client
terok_clearance.client.client
terok_clearance.client.identity_resolver
terok_clearance.runtime.service
terok_clearance.runtime.installer
terok_clearance.cli.terminal_clearance
Module Boundaries¶
29 modules, 17 dependency edges — all boundaries validated.
Module Summary¶
29 modules (click to expand)
| Module | Deps | Description |
|---|---|---|
terok_clearance |
0 | |
terok_clearance.domain.events |
0 | |
terok_clearance.domain.identity |
0 | |
terok_clearance.domain.container_info |
0 | else that cares. |
terok_clearance.domain.inspector |
1 | where runtime selection is owned. |
terok_clearance.wire.socket |
0 | |
terok_clearance.wire.interface |
0 | |
terok_clearance.wire.errors |
1 | |
terok_clearance.notifications.protocol |
0 | notification tree; the three concrete backends are infrastructure. |
terok_clearance.notifications.null |
0 | |
terok_clearance.notifications.callback |
0 | |
terok_clearance.notifications.desktop |
0 | |
terok_clearance.notifications.factory |
2 | |
terok_clearance.hub.ingester |
0 | Hub — varlink server + reader ingestion + shield exec. |
terok_clearance.hub.server |
3 | |
terok_clearance.verdict.shield_exec |
0 | the hub handles all authz before forwarding a triple here. |
terok_clearance.verdict.interface |
0 | |
terok_clearance.verdict.socket |
1 | |
terok_clearance.verdict.client |
0 | |
terok_clearance.verdict.server |
2 | |
terok_clearance.client.client |
0 | Client — varlink consumer library. |
terok_clearance.client.subscriber |
1 | |
terok_clearance.client.identity_resolver |
0 | which runtime is in use. |
terok_clearance.runtime.service |
0 | Runtime — deployment helpers. |
terok_clearance.runtime.installer |
0 | |
terok_clearance.notifier.app |
4 | provides), falling back to NullInspector when standalone. |
terok_clearance.cli.main |
1 | |
terok_clearance.cli.registry |
1 | |
terok_clearance.cli.terminal_clearance |
0 |
Test Coverage¶
Coverage is collected from unit tests in CI and uploaded to Codecov.
Coverage Treemap¶
Each rectangle represents a source file. Size is proportional to the number of lines; colour shows the coverage percentage (green = high, red = low).
Cognitive Complexity¶
Threshold: 15 (functions above this are listed below)
- Functions analyzed: 146
- Median complexity: 1.0 · Average: 1.8 · Max: 24
- Within threshold (15): 99% (145/146)
0– 3 │ ██████████████████████████████ 120 (82.2%)
4– 6 │ █████ 21 (14.4%)
7– 9 │ 1 ( 0.7%)
10– 12 │ █ 3 ( 2.1%)
13– 15 │ 0 ( 0.0%) ◄ threshold
16– 18 │ 0 ( 0.0%)
19– 21 │ 0 ( 0.0%)
22– 25 │ 1 ( 0.7%)
1 functions exceeding threshold:
| Complexity | Function | File |
|---|---|---|
| 24 | ClearanceClient::_run_stream |
terok_clearance/client/client.py |
Dead Code Analysis¶
No dead code found at 80% confidence threshold.
Docstring Coverage¶
- Needed: 10; Found: 9; Missing: 1; Coverage: 90.0%
- Needed: 15; Found: 14; Missing: 1; Coverage: 93.3%
- Needed: 9; Found: 8; Missing: 1; Coverage: 88.9%
- Needed: 213 - Found: 210 - Missing: 3
- Total coverage: 98.6% - Grade: Excellent
Generated by scc, complexipy, vulture, tach, and docstr-coverage.