Skip to content

Code Metrics

Generated: 2026-07-04 18:24 UTC


Lines of Code

Files Code Comment Blank Total
Source 31 2 822 963 257 4 042
Tests 29 3 353 391 389 4 133
Combined 60 6 175 1 354 646 8 175
  • Comment/code ratio: 34%
  • Test/source ratio: 118.8%
Source by module (click to expand)
Module Files Code Comment Blank
terok_clearance/ 31 2 822 963 257
terok_clearance/cli/ 3 153 38 45
terok_clearance/cli/main.py 41 13 18
terok_clearance/cli/terminal_clearance.py 112 25 27
terok_clearance/client/ 3 848 194 31
terok_clearance/client/client.py 172 57 9
terok_clearance/client/subscriber.py 676 137 22
terok_clearance/domain/ 2 48 44 11
terok_clearance/domain/events.py 48 44 11
terok_clearance/hub/ 3 442 159 20
terok_clearance/hub/ingester.py 132 39 6
terok_clearance/hub/server.py 310 120 14
terok_clearance/notifications/ 5 619 219 53
terok_clearance/notifications/callback.py 150 28 6
terok_clearance/notifications/desktop.py 395 123 29
terok_clearance/notifications/factory.py 21 36 13
terok_clearance/notifications/protocol.py 53 32 5
terok_clearance/resources/ 1 82 1 1
terok_clearance/runtime/ 2 17 20 7
terok_clearance/runtime/service.py 17 20 7
terok_clearance/verdict/ 5 295 93 33
terok_clearance/verdict/client.py 102 7 2
terok_clearance/verdict/interface.py 31 31 11
terok_clearance/verdict/server.py 157 44 14
terok_clearance/verdict/socket.py 5 11 6
terok_clearance/wire/ 5 196 136 34
terok_clearance/wire/errors.py 59 9 7
terok_clearance/wire/interface.py 43 35 5
terok_clearance/wire/sanitize.py 26 69 8
terok_clearance/wire/socket.py 68 23 14
terok_clearance/__init__.py 71 33 2
terok_clearance/commands.py 51 26 20

Architecture

Module Dependency Graph

graph TD
    terok_clearance --> terok_clearance.commands
    terok_clearance.wire.errors --> terok_clearance.wire.interface
    terok_clearance.notifications.factory --> terok_clearance.notifications.desktop
    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.client.subscriber --> terok_clearance.client.client
    terok_clearance.cli.main --> terok_clearance.commands
    terok_clearance.commands --> terok_clearance.cli.terminal_clearance
    terok_clearance.domain.events
    terok_clearance.wire.socket
    terok_clearance.wire.interface
    terok_clearance.wire.sanitize
    terok_clearance.notifications.protocol
    terok_clearance.notifications.callback
    terok_clearance.notifications.desktop
    terok_clearance.hub.ingester
    terok_clearance.verdict.interface
    terok_clearance.verdict.client
    terok_clearance.client.client
    terok_clearance.runtime.service
    terok_clearance.cli.terminal_clearance

Module Boundaries

22 modules, 11 dependency edges — all boundaries validated.

Module Summary

22 modules (click to expand)
Module Deps Description
terok_clearance 1
terok_clearance.domain.events 0
terok_clearance.wire.socket 0
terok_clearance.wire.interface 0
terok_clearance.wire.errors 1
terok_clearance.wire.sanitize 0 without having to climb back up to renderer-specific helpers.
terok_clearance.notifications.protocol 0 notification tree; the three concrete backends are infrastructure.
terok_clearance.notifications.callback 0
terok_clearance.notifications.desktop 0
terok_clearance.notifications.factory 1
terok_clearance.hub.ingester 0 Hub — varlink server + reader ingestion + shield exec.
terok_clearance.hub.server 3
terok_clearance.verdict.interface 0 the hub handles all authz before forwarding a triple here.
terok_clearance.verdict.socket 1
terok_clearance.verdict.client 0
terok_clearance.verdict.server 1
terok_clearance.client.client 0 Client — varlink consumer library.
terok_clearance.client.subscriber 1
terok_clearance.runtime.service 0 Runtime — deployment helpers.
terok_clearance.cli.main 1
terok_clearance.commands 1
terok_clearance.cli.terminal_clearance 0

Test Coverage

Overall line coverage: 90.1% (1186/1316 statements).

Each rectangle is a source file. Area is proportional to the number of statements; colour encodes the coverage percentage (green = fully covered, red = uncovered). Files are grouped by the first 3 directory levels.

Cognitive Complexity

Threshold: 15 (functions above this are listed below)

  • Functions analyzed: 135
  • Median complexity: 1 · Average: 2.2 · Max: 29
  • Within threshold (15): 99% (133/135)
    0–  3 │ ██████████████████████████████ 111 (82.2%)
    4–  6 │ █████                           17 (12.6%)
    7–  9 │ █                                3 ( 2.2%)
   10– 12 │ █                                2 ( 1.5%)
   13– 15 │                                  0 ( 0.0%) ◄ threshold
   16– 18 │                                  0 ( 0.0%)
   19– 21 │                                  1 ( 0.7%)
   22– 25 │                                  0 ( 0.0%)
   26+    │                                  1 ( 0.7%)

2 functions exceeding threshold:

Complexity Function File
29 ClearanceClient::_run_stream src/terok_clearance/client/client.py
21 EventSubscriber::_on_event src/terok_clearance/client/subscriber.py

Dead Code Analysis

No dead code found at 80% confidence threshold.

Docstring Coverage

  • Needed: 10; Found: 9; Missing: 1; Coverage: 90.0%
  • Needed: 16; Found: 15; Missing: 1; Coverage: 93.8%
  • Needed: 11; Found: 10; Missing: 1; Coverage: 90.9%
  • Needed: 189 - Found: 186 - Missing: 3
  • Total coverage: 98.4% - Grade: Excellent

Generated by scc, complexipy, vulture, tach, and docstr-coverage.