Public report — Baileys, published 2 Oct 2026. Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches, dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase survey Measured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this survey Filed cd_61973d923e104742ac8a865a5884bcf3 Filed 2 October 2026, 01:44 UTC Public

WhiskeySockets/Baileys

Measured 2 October 2026, 01:27 UTC

55% At Risk

Medium · 44,248 LoC · 2 projects · rebuild ~0.3 person-years · weakest lens: Architecture (52%)

Findings by grade

65 critical 279 serious 33 minor 33 could not be resolved — could be critical — see Limitations

This survey was produced by

Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
2 October 2026, 01:27 UTC

A measurement, not a certificate. The Code Assurance Index does not certify, approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said here so the number is checked rather than believed.

Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸

50/53dimensions tool-verifieddeterministic · confidence 1.0 · 3 LLM-assisted, advisory
346findings with an exact file:lineof 377 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
53/132dimensions across the health lenses44248 LoC · 2 projects — wide & deep
Chapters

Executive summary

⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.

The system is currently at risk, scoring 55% overall. While the asset is medium-sized and relatively inexpensive to rebuild, its architectural fragility poses a significant threat to long-term delivery speed and operational stability. The business faces a choice between accepting a steady tax on every change or investing now to secure the platform.

The primary concern is architectural drift. The codebase lacks clear boundaries, with modules reaching into each other’s internals rather than using defined interfaces. This creates a high risk that any modification will ripple unexpectedly, causing delays and defects. The cost of this complexity acts as a velocity tax, making every change 9–21% more expensive than it should be. Over time, this compounds, slowing feature delivery and increasing the likelihood of outages.

A second theme is the immediate leverage of fixing import violations. By enforcing strict public entry points and breaking dependency cycles, the team can eliminate the most costly friction. This single action is the highest-leverage move available. It costs only a few engineer-days to implement but prevents a recurring annual drag on productivity. The return on investment is clear: the fix pays for itself within a year and becomes free thereafter, protecting the team’s capacity for future innovation.

Despite these risks, the system has genuine strengths. The code is largely non-boilerplate, indicating that the existing logic is substantive and not just scaffolding. The rebuild effort is modest, suggesting that the core domain modeling is sound and not overly complex. This balance means the system is not broken, but it is carrying hidden debt that needs attention.

Focus first on fixing the import violations and breaking dependency cycles. This addresses the weakest lens and provides the most immediate protection against delivery delays. The picture is partial, as domain modeling and event-driven patterns were not measured, but the architectural risks are clear and actionable. Addressing these now will stabilize the system and reduce the cost of change.

How the score is built — each lens's share of the headline Width is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Architecture 52% · 46% weightReadiness 56% · 25% weightMaturity 58% · 14% weightPerformance 60% · 8% weightSecurity 60% · 4% weightCode Health 61% · 2% weight

Raise Architecture 52 → 70 (the Healthy floor) ⇒ headline 55 → ~58.

Code composition — where the lines go
Tests 100%
New since the last scan (100+)

108 finding(s) are new versus the previous scan (2026-09-17) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.

  • D1 · messages-recv.makeMessagesRecvSocket (cyclomatic 375) src/Socket/messages-recv.ts
  • D1 · messages-send.makeMessagesSocket (cyclomatic 250) src/Socket/messages-send.ts
  • D1 · chats.makeChatsSocket (cyclomatic 146) src/Socket/chats.ts
  • D1 · event-buffer.append (cyclomatic 109) src/Utils/event-buffer.ts
  • D1 · socket.makeSocket (cyclomatic 105) src/Socket/socket.ts
  • D1 · process-message.processMessage (cyclomatic 79) src/Utils/process-message.ts
  • D1 · (anonymous) (cyclomatic 77) proto-extract/index.js
  • D1 · messages.generateWAMessageContent (cyclomatic 73) src/Utils/messages.ts
  • D1 · encode.encodeBinaryNodeInner (cyclomatic 69) src/WABinary/encode.ts
  • D1 · decode.decodeDecompressedBinaryNode (cyclomatic 57) src/WABinary/decode.ts
  • D1 · chat-utils.processSyncAction (cyclomatic 55) src/Utils/chat-utils.ts
  • D1 · messages.prepareWAMessageMedia (cyclomatic 39) src/Utils/messages.ts
  • D1 · history.processHistoryMessage (cyclomatic 38) src/Utils/history.ts
  • D1 · chat-utils.chatModificationToAppPatch (cyclomatic 38) src/Utils/chat-utils.ts
  • D1 · libsignal.makeLibSignalRepository (cyclomatic 38) src/Signal/libsignal.ts
  • D1 · decode-wa-message.decodeMessageNode (cyclomatic 36) src/Utils/decode-wa-message.ts
  • D1 · LIDMappingStore._getLIDsForPNsImpl (cyclomatic 35) src/Signal/lid-mapping.ts
  • D1 · decode-wa-message.decryptMessageNode (cyclomatic 27) src/Utils/decode-wa-message.ts
  • D1 · reporting-utils.extractReportingTokenContent (cyclomatic 27) src/Utils/reporting-utils.ts
  • D1 · auth-utils.addTransactionCapability (cyclomatic 26) src/Utils/auth-utils.ts
  • D1 · communities.makeCommunitiesSocket (cyclomatic 26) src/Socket/communities.ts
  • D1 · event-buffer.makeEventBuffer (cyclomatic 25) src/Utils/event-buffer.ts
  • D1 · groups.extractGroupMetadata (cyclomatic 25) src/Socket/groups.ts
  • D1 · messages.generateWAMessageFromContent (cyclomatic 24) src/Utils/messages.ts
  • D1 · noise-handler.makeNoiseHandler (cyclomatic 24) src/Utils/noise-handler.ts
  • D1 · messages-media.downloadEncryptedContent (cyclomatic 23) REDACTED
  • D1 · LIDMappingStore.storeLIDPNMappings (cyclomatic 20) src/Signal/lid-mapping.ts
  • D1 · LIDMappingStore._getPNsForLIDsImpl (cyclomatic 19) src/Signal/lid-mapping.ts
  • D1 · signal.extractE2ESessionFromRetryReceipt (cyclomatic 17) src/Utils/signal.ts
  • D1 · link-preview.getUrlInfo (cyclomatic 17) src/Utils/link-preview.ts
  • D1 · libsignal.signalStorage (cyclomatic 17) src/Signal/libsignal.ts
  • D1 · encode.serializeData (cyclomatic 17) src/WAM/encode.ts
  • D2 · messages-recv.makeMessagesRecvSocket (cognitive 484) src/Socket/messages-recv.ts
  • D2 · messages-send.makeMessagesSocket (cognitive 350) src/Socket/messages-send.ts
  • D2 · event-buffer.append (cognitive 213) src/Utils/event-buffer.ts
  • D2 · chats.makeChatsSocket (cognitive 199) src/Socket/chats.ts
  • D2 · (anonymous) (cognitive 147) proto-extract/index.js
  • D2 · process-message.processMessage (cognitive 130) src/Utils/process-message.ts
  • D2 · socket.makeSocket (cognitive 121) src/Socket/socket.ts
  • D2 · messages.generateWAMessageContent (cognitive 103) src/Utils/messages.ts
  • D2 · LIDMappingStore._getLIDsForPNsImpl (cognitive 85) src/Signal/lid-mapping.ts
  • D2 · encode.encodeBinaryNodeInner (cognitive 78) src/WABinary/encode.ts
  • D2 · reporting-utils.extractReportingTokenContent (cognitive 70) src/Utils/reporting-utils.ts
  • D2 · chat-utils.processSyncAction (cognitive 69) src/Utils/chat-utils.ts
  • D2 · decode-wa-message.decryptMessageNode (cognitive 55) src/Utils/decode-wa-message.ts
  • D2 · libsignal.makeLibSignalRepository (cognitive 52) src/Signal/libsignal.ts
  • D2 · history.processHistoryMessage (cognitive 49) src/Utils/history.ts
  • D2 · decode-wa-message.decodeMessageNode (cognitive 46) src/Utils/decode-wa-message.ts
  • D2 · decode.decodeDecompressedBinaryNode (cognitive 43) src/WABinary/decode.ts
  • D2 · messages.prepareWAMessageMedia (cognitive 39) src/Utils/messages.ts
  • D2 · communities.makeCommunitiesSocket (cognitive 37) src/Socket/communities.ts
  • D2 · auth-utils.addTransactionCapability (cognitive 35) src/Utils/auth-utils.ts
  • D2 · LIDMappingStore._getPNsForLIDsImpl (cognitive 30) src/Signal/lid-mapping.ts
  • D2 · messages-media.downloadEncryptedContent (cognitive 30) REDACTED
  • D2 · chat-utils.chatModificationToAppPatch (cognitive 30) src/Utils/chat-utils.ts
  • D2 · event-buffer.makeEventBuffer (cognitive 30) src/Utils/event-buffer.ts
  • D2 · noise-handler.makeNoiseHandler (cognitive 29) src/Utils/noise-handler.ts
  • D2 · LIDMappingStore.storeLIDPNMappings (cognitive 27) src/Signal/lid-mapping.ts
  • D2 · chat-utils.decodeSyncdMutations (cognitive 25) src/Utils/chat-utils.ts
  • D2 · groups.extractGroupMetadata (cognitive 24) src/Socket/groups.ts
  • D2 · messages.generateWAMessageFromContent (cognitive 23) src/Utils/messages.ts
  • D2 · encode.serializeData (cognitive 21) src/WAM/encode.ts
  • D2 · libsignal.signalStorage (cognitive 20) src/Signal/libsignal.ts
  • D2 · index.extractAllExpressions (cognitive 20) proto-extract/index.js
  • D2 · process-message.storeTcTokensFromHistorySync (cognitive 19) src/Utils/process-message.ts
  • D2 · link-preview.getUrlInfo (cognitive 18) src/Utils/link-preview.ts
  • D2 · messages-media.encryptedStream (cognitive 17) REDACTED
  • D2 · signal.extractDeviceJids (cognitive 17) src/Utils/signal.ts
  • D2 · chat-utils.decodePatches (cognitive 17) src/Utils/chat-utils.ts
  • D2 · tc-token-utils.storeTcTokensFromIqResult (cognitive 17) src/Utils/tc-token-utils.ts
  • D2 · use-multi-file-auth-state.useMultiFileAuthState (cognitive 16) src/Utils/use-multi-file-auth-state.ts
  • D3 · FunctionTooLong: messages-recv.makeMessagesRecvSocket src/Socket/messages-recv.ts
  • D3 · FunctionTooLong: messages-send.makeMessagesSocket src/Socket/messages-send.ts
  • D3 · FunctionTooLong: chats.makeChatsSocket src/Socket/chats.ts
  • D3 · FunctionTooLong: socket.makeSocket src/Socket/socket.ts
  • D3 · FileTooLong: Socket/messages-recv.ts src/Socket/messages-recv.ts
  • D3 · FunctionTooLong: business.makeBusinessSocket src/Socket/business.ts
  • D3 · FunctionTooLong: communities.makeCommunitiesSocket src/Socket/communities.ts
  • D3 · FunctionTooLong: event-buffer.append src/Utils/event-buffer.ts
  • D3 · FunctionTooLong: libsignal.makeLibSignalRepository src/Signal/libsignal.ts
  • D3 · FunctionTooLong: messages.generateWAMessageContent src/Utils/messages.ts
  • D3 · FunctionTooLong: chat-utils.chatModificationToAppPatch src/Utils/chat-utils.ts
  • D3 · FileTooLong: Socket/messages-send.ts src/Socket/messages-send.ts
  • D3 · FileTooLong: Socket/chats.ts src/Socket/chats.ts
  • D3 · FunctionTooLong: groups.makeGroupsSocket src/Socket/groups.ts
  • D3 · FileTooLong: Socket/socket.ts src/Socket/socket.ts
  • D3 · FunctionTooLong: chat-utils.processSyncAction src/Utils/chat-utils.ts
  • D3 · FileTooLong: Utils/messages.ts src/Utils/messages.ts
  • D3 · FileTooLong: Utils/chat-utils.ts src/Utils/chat-utils.ts
  • D3 · FunctionTooLong: messages.prepareWAMessageMedia src/Utils/messages.ts
  • D3 · FileTooLong: REDACTED REDACTED
  • D3 · FunctionTooLong: event-buffer.makeEventBuffer src/Utils/event-buffer.ts
  • D3 · FunctionTooLong: newsletter.makeNewsletterSocket src/Socket/newsletter.ts
  • D3 · FileTooLong: Utils/process-message.ts src/Utils/process-message.ts
  • D6 · Low cohesion: USyncUser (LCOM4 7) src/WAUSync/USyncUser.ts
  • D6 · Low cohesion: USyncQuery (LCOM4 4) src/WAUSync/USyncQuery.ts
  • D14 · Banned license: libsignal
  • D29 · REDACTED
  • D29 · REDACTED
  • D29 · REDACTED

A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.

Rebuild cost & value ~ Modeled — €17,000–€83,000
Cost to rebuild€17,000–€83,000 (0.2–0.5 person-years (276–875 h), ~1 engineer)
Domain complexityStandard — harder problems cost more per line
Quality factor0.8× (at 55% quality) — the last 20% of quality is most of the work
Size & shapeMedium · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)

This codebase represents roughly ~0.3 person-years of build effort (about ~€50,000 to rebuild). Its weakest lens is Architecture at 52% — the part of that asset most exposed by the findings below.

How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.8× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).

Top priorities

The highest-leverage moves; the full ranked list is in the Roadmap below.

1
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion.
+2.8 pts · Low effort · Project Cohesion
2
Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with lid-mapping.ts (2).
+1.9 pts · Low effort · Change Coupling
3
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
+3.4 pts · Medium effort · Import Boundaries

Diagnosis — what's actually going on

Value concentrated against a weak lens · Medium · Value at risk
This is a Medium asset (~0.3 person-years to rebuild), and its weakest lens is Architecture at 52%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Medium, ~0.3 person-years rebuild (44,248 LoC) · weakest lens: Architecture 52%
→ Direct remediation budget at Architecture first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 4.2/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 9–21% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D6 code quality: averaging 4.2/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
The top fix pays for itself · Medium · Economics
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 0.3–1.6 engineer-days every year, paid as drag on the ~1,123 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 8–136 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 9–21% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 277 line(s) changed over a 90-day window ⇒ ~1,123/year · D1/D2/D6 code quality: averaging 4.2/10 ⇒ a 9–21% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 136 months.

Architecture — module dependency matrix

Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)

62 modules, 48 dependencies. Every dependency points down the layering — no cycles.

Showing the 40 most-connected modules; 22 more are not drawn.

Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
depends on →1 Signal.Group.ciphertext-message2 Signal.Group.keyhelper3 Signal.Group.sender-key-name4 Signal.Group.sender-key-record5 Signal.Group.sender-message-key6 Socket.Client.types7 Types.Chat8 Types.Contact9 Types.Events10 Types.Message11 Types.Mex12 Types.USync13 Utils.companion-reg-client-utils14 Utils.decode-wa-message15 Utils.identity-change-handler16 Utils.logger17 WABinary.jid-utils18 WAM19 WAUSync.USyncUser20 Signal.Group21 Signal.Group.sender-chain-key22 Signal.Group.sender-key-distribution-message23 Signal.Group.sender-key-message24 Signal.lid-mapping25 Socket26 Socket.Client.websocket27 Types.GroupMetadata28 Utils.message-retry-manager29 Utils.pre-key-manager30 WABinary31 WAUSync.Protocols.USyncContactProtocol32 WAUSync.Protocols.USyncUsernameProtocol33 WAUSync.Protocols.UsyncBotProfileProtocol34 WAUSync.Protocols.UsyncLIDProtocol35 Signal.Group.sender-key-state36 Types.Signal37 Signal38 Signal.Group.group_cipher39 Utils40 Signal.Group.group-session-builder
1 Signal.Group.ciphertext-message
2 Signal.Group.keyhelper
3 Signal.Group.sender-key-name
4 Signal.Group.sender-key-record
5 Signal.Group.sender-message-key
6 Socket.Client.types
7 Types.Chat
8 Types.Contact
9 Types.Events
10 Types.Message
11 Types.Mex
12 Types.USync
13 Utils.companion-reg-client-utils
14 Utils.decode-wa-message
15 Utils.identity-change-handler
16 Utils.logger
17 WABinary.jid-utils
18 WAM
19 WAUSync.USyncUser
20 Signal.Group1
21 Signal.Group.sender-chain-key1
22 Signal.Group.sender-key-distribution-message1
23 Signal.Group.sender-key-message1
24 Signal.lid-mapping1
25 Socket2
26 Socket.Client.websocket1
27 Types.GroupMetadata1
28 Utils.message-retry-manager1
29 Utils.pre-key-manager1
30 WABinary2
31 WAUSync.Protocols.USyncContactProtocol11
32 WAUSync.Protocols.USyncUsernameProtocol11
33 WAUSync.Protocols.UsyncBotProfileProtocol11
34 WAUSync.Protocols.UsyncLIDProtocol11
35 Signal.Group.sender-key-state11
36 Types.Signal1
37 Signal1111
38 Signal.Group.group_cipher211
39 Utils113211183
40 Signal.Group.group-session-builder2111
Dependency, pointing down the layeringAbove the diagonal — part of a cycleThe module itself
…up.ciphertext-message…ignal.Group.keyhelper…Group.sender-key-name…oup.sender-key-record…up.sender-message-key…c.Socket.Client.typessrc.Types.Chatsrc.Types.Contactsrc.Types.Eventssrc.Types.Messagesrc.Types.Mexsrc.Types.USync…nion-reg-client-utils…ils.decode-wa-message…entity-change-handlersrc.Utils.loggersrc.WABinary.jid-utilssrc.WAMsrc.WAUSync.USyncUsersrc.Signal.Group…roup.sender-chain-key…-distribution-message…up.sender-key-messagesrc.Signal.lid-mappingsrc.Socket…cket.Client.websocket…c.Types.GroupMetadata…message-retry-manager…Utils.pre-key-managersrc.WABinary….USyncContactProtocol…USyncUsernameProtocol…yncBotProfileProtocol…cols.UsyncLIDProtocol…roup.sender-key-statesrc.Types.Signalsrc.Signal…al.Group.group_ciphersrc.Utils…group-session-builder…up.ciphertext-message1…ignal.Group.keyhelper2…Group.sender-key-name3…oup.sender-key-record4…up.sender-message-key5…c.Socket.Client.types6src.Types.Chat7src.Types.Contact8src.Types.Events9src.Types.Message10src.Types.Mex11src.Types.USync12…nion-reg-client-utils13…ils.decode-wa-message14…entity-change-handler15src.Utils.logger16src.WABinary.jid-utils17src.WAM18src.WAUSync.USyncUser19src.Signal.Group20…roup.sender-chain-key21…-distribution-message22…up.sender-key-message23src.Signal.lid-mapping24src.Socket25…cket.Client.websocket26…c.Types.GroupMetadata27…message-retry-manager28…Utils.pre-key-manager29src.WABinary30….USyncContactProtocol31…USyncUsernameProtocol32…yncBotProfileProtocol33…cols.UsyncLIDProtocol34…roup.sender-key-state35src.Types.Signal36src.Signal37…al.Group.group_cipher38src.Utils39…group-session-builder40111112111121111111111111112111132111832111+22 more modules (most-connected shown)

At a glance — Code Health · 61% · Adequate · gated by D1, D2 ·

At a glance — Architecture · 52% · Adequate · gated by D26, R11 ·

At a glance — Maturity · 58% · Adequate · gated by M2 ·

At a glance — Readiness · 56% · Adequate · gated by P3 ·

At a glance — Security · 60% · Adequate · gated by D29, D30, D36 ·

At a glance — Performance · 60% · Adequate ·

Security & Compliance — OWASP Top-10 mapping

Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).

OWASP categoryFindingsSeverity
A03:2021 — Injection59High / Critical
A06:2021 — Vulnerable & Outdated Components28High / Critical
A02:2021 — Cryptographic Failures3High / Critical

Roadmap

First, eliminate all cross-package import violations by ensuring modules only access public exports, and break existing circular dependencies by extracting shared logic into independent modules. Next, address cohesion issues in oversized projects and resolve boundary-crossing change coupling, starting with lid-mapping.ts. Finally, integrate a SAST step into the CI pipeline to automatically fail builds on security regressions.

Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.

Do thisHelpsEffortDimension
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion.+2.8 ptsLowProject Cohesion
Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with lid-mapping.ts (2).+1.9 ptsLowChange Coupling
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.+3.4 ptsMediumImport Boundaries
Break each cycle by extracting the shared piece into a module both sides can import.+3.2 ptsMediumCircular Imports
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.+1.4 ptsLowREDACTED Scanning
Resolve the 1 Banned license finding(s) in License Compliance.+1.0 ptsLowLicense Compliance
Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.+1.8 ptsMediumSecurity & performance tooling
Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.+1.8 ptsMediumDeployment & Rollback

File quality

Per-file score 0–10 — a quality signature. Of 54 files carrying findings, judged against the Production bar: 22% slop · 58% mixed · 20% near-clean.

FileScoreBandWorst signal
REDACTED0.1SlopStatic Analysis (SAST): High: REDACTED
REDACTED0.6SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.1SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED1.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED1.3SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED2.7SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.0SlopStatic Analysis (SAST): High: REDACTED
src/Signal/lid-mapping.ts4.1MixedChange Coupling: Boundary-crossing change coupling: lid-mapping.ts ↔ messages-send.ts
REDACTED4.4MixedREDACTED Scanning: Leaked secret: REDACTED
REDACTED5.9MixedStatic Analysis (SAST): Medium: REDACTED
src/Socket/messages-recv.ts6.0MixedExplicit Debt: TodoComment
src/Socket/messages-send.ts6.0MixedExplicit Debt: TodoComment
src/Utils/event-buffer.ts6.0MixedExplicit Debt: TodoComment
src/Socket/socket.ts6.0MixedExplicit Debt: TodoComment
src/Utils/process-message.ts6.0MixedExplicit Debt: TodoComment

How the grades work

Every finding carries one of four grades. Three say how serious it is. The fourth says this survey could not settle it — and it is a grade, not a gap.

Critical — 65

A definite problem that already costs you something and drags the score down: a missing authorisation check, a dependency with a known exploit, a build that does not reproduce. Failure here tends to cause failures elsewhere.

Serious — 279

Likely wrong, but not failing yet. It degrades the codebase over a longer horizon and can cause failures elsewhere — not urgent this week, not something to carry for two years either.

Minor — 33

Recorded, with no effect on how the codebase functions. Present so the survey is complete, not because it needs doing.

Could not be resolved — 33

Something this survey could not settle from the outside, and which could be critical or serious. Either a control was required and no positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean result. These are excluded from the score rather than awarded a pass, so the number on the cover neither rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each one is named under Limitations.

Methodology & how to trust this report

Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 50 of 53 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 3 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.

Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.

What we checked — 53 dimensions across the health lenses
D1D2D3D5D6D9D10D12D13D14D15D16D17D19D21D26D27D28D29D30D34D35D36D37D43D44AX10AX3AX4M1M2M3M4P1P10P3P4P6PF3R1R10R11R2R3R4R5R6R7R8R9X24X25X29

Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.

How to trust any code-health report — three questions
  1. Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 346 of 377 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
  2. Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
  3. Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.

This report answers yes to all three. That's the bar to hold any assessment to.

Tools & methods

The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Watchdog duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivySecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3✓ deterministic
LLM (sampled · advisory)Documentation quality, ADR conformance, naming — sampled over a bounded sample; advisory, never a deterministic measurementLocal LLM◐ LLM · sampled · advisory

Every finding is locatable in findings.md. Run 01a0fa39-24c0-7ed5-b3ca-62787f8485a8.

The exact command behind every deep-scan dimension — tool, version, invocation and retained raw output — is in Appendix B — Reproduction & audit trail.

Run transparency — what happened this run

What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.

  • D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the dependency install for the repository root failed in the analyzer sandbox (error Error: https://registry.yarnpkg.com/%5E6.12.4: Not found), so the suite never ran. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo. In the meantime, commit (or publish into the working tree) the lcov/Cobertura report your CI produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and the real number is read on the next scan.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for the repository root failed in the analyzer sandbox (error Error: https://registry.yarnpkg.com/%5E6.12.4: Not found), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
  • D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the jest suite in the repository root was NOT MEASURED: the dependency install for the repository root failed in the analyzer sandbox (error Error: https://registry.yarnpkg.com/%5E6.12.4: Not found), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22 identifies the intentionally-exposed surface from `IsPackable` and `.Contracts` project names, MSBuild conventions read off the loaded project set. This target exposed no such projects, so the probe never ran; this says nothing about whether the repository has a public API. This repository commits no C#/VB source at all, so there was never an MSBuild project set to read these conventions off. That is OUR side and it is a COLLECTOR gap, not an environment fault: it declares a published package (package.json), but no published-package marker D22 reads admitted any project here, so this ecosystem's public API has no collector, and the remedy is to write one — no change to the scan image can close it.
  • AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • C2 Access Controls — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
  • C3 Audit Trail — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
  • C4 Data Retention — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
  • C5 Data-Subject Rights — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
  • ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
  • GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and none applies: this repository publishes a library and deploys nothing (no container, IaC or deployment manifest), so it holds no runtime state of its own. Any data-access dependency it declares is the store it is a CLIENT for, not one it operates. The DR control belongs to whoever runs that data.
  • S1 Web-Security Posture — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
  • X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java and Rust source only, and no C# was loaded and no Java or Rust was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Scala source only, and no C# was loaded and no Scala was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.

Repo exclusion declarations: 14 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.

Limitations & what we did not check

Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.

Per-dimension blind spots

For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
  • D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
  • D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
  • D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
  • D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
  • D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
  • D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
  • D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
  • D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a Dockerfile (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
  • AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
  • M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.

The LLM boundary

LLM-set scores this run (3): D19, D21, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.

Dimensions

D1 · Cyclomatic Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How tangled the control flow is — methods with many branches are hard to test and change.

Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

32 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was messages-recv.makeMessagesRecvSocket at 375.

messages-recv.makeMessagesRecvSocket (cyclomatic 375)src/Socket/messages-recv.ts:110
messages-send.makeMessagesSocket (cyclomatic 250)src/Socket/messages-send.ts:73
chats.makeChatsSocket (cyclomatic 146)src/Socket/chats.ts:79
event-buffer.append (cyclomatic 109)src/Utils/event-buffer.ts:288
socket.makeSocket (cyclomatic 105)src/Socket/socket.ts:72

+ 27 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 messages-recv.makeMessagesRecvSocket (cyclomatic 375) finding(s) in Cyclomatic Complexity — start with messages-recv.ts. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 messages-send.makeMessagesSocket (cyclomatic 250) finding(s) in Cyclomatic Complexity — start with messages-send.ts. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 chats.makeChatsSocket (cyclomatic 146) finding(s) in Cyclomatic Complexity — start with chats.ts. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.

D2 · Cognitive Complexity2.0 / 10Critical✓ Tool-verified

What it measures: How hard the code is for a person to follow, beyond raw branching.

Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.

Maturity: Documented → Verified → Prevented · effective 2.0 / 10 · rule-coverage 100% · ceiling Prevented

40 method(s) exceeded the cognitive complexity threshold of 15; the worst was messages-recv.makeMessagesRecvSocket at 484.

messages-recv.makeMessagesRecvSocket (cognitive 484)src/Socket/messages-recv.ts:110
messages-send.makeMessagesSocket (cognitive 350)src/Socket/messages-send.ts:73
event-buffer.append (cognitive 213)src/Utils/event-buffer.ts:288
chats.makeChatsSocket (cognitive 199)src/Socket/chats.ts:79
(anonymous) (cognitive 147)proto-extract/index.js:97

+ 34 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 messages-recv.makeMessagesRecvSocket (cognitive 484) finding(s) in Cognitive Complexity — start with messages-recv.ts. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 messages-send.makeMessagesSocket (cognitive 350) finding(s) in Cognitive Complexity — start with messages-send.ts. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 event-buffer.append (cognitive 213) finding(s) in Cognitive Complexity — start with event-buffer.ts. — One of this dimension's main actionable groups (1 warning-level).
  4. Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.

D3 · God Classes8.5 / 10Strong✓ Tool-verified

What it measures: Over-large classes that try to do too much ("god classes").

Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.5 / 10 · rule-coverage 100% · ceiling Prevented

23 over-large unit(s) detected — types, modules or files that carry too much.

FunctionTooLong: messages-recv.makeMessagesRecvSocket · ×15src/Socket/messages-recv.ts:110
FileTooLong: Socket/messages-recv.ts · ×8src/Socket/messages-recv.ts

What to do

  1. Resolve the 15 FunctionTooLong finding(s) in God Classes — start with event-buffer.ts (2), messages.ts (2), chat-utils.ts (2). — One of this dimension's main actionable groups (15 warning-level).
  2. Resolve the 8 FileTooLong finding(s) in God Classes — start with messages-recv.ts, messages-send.ts, chats.ts. — One of this dimension's main actionable groups (8 warning-level).
  3. Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.

D5 · Coupling10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.

Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.

Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

2 production modules (npm), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 0 module(s) off the main sequence, with abstractness counted on 1 of the 2 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).

✓ On the Gold path — maintain.

Detailed fixes: d5_recommendation.md.

D6 · Cohesion (LCOM4)8.7 / 10Strong✓ Tool-verified

What it measures: Whether a class's methods are focused on a single responsibility.

Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.

Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.

Maturity: Documented → Verified → Prevented · effective 8.7 / 10 · rule-coverage 100% · ceiling Verified

2 of 18 classes have LCOM4 above 3.

Low cohesion: USyncUser (LCOM4 7) · ×2src/WAUSync/USyncUser.ts:1

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with USyncUser.ts, USyncQuery.ts. — One of this dimension's main actionable groups (2 warning-level).
  2. Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.

D9 · Test Distribution8.9 / 10Strong✓ Tool-verified

What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.

Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.

Maturity: Documented → Verified → Prevented · effective 8.9 / 10 · rule-coverage 100% · ceiling Documented

356 test methods: 326 unit, 0 integration, 0 BDD, 30 e2e. The JavaScript/TypeScript suite contributes 356 `it`/`test` case(s) across 32 test file(s) declaring at least one; its tier split is read from package names and paths only.

What to do

  1. Improve Test Distribution — currently 8.9/10. — 356 test methods: 326 unit, 0 integration, 0 BDD, 30 e2e. The JavaScript/TypeScript suite contributes 356 `it`/`test` case(s) across 32 test file(s) declaring at least one; its tier split is read from package names and paths only.

Detailed fixes: d9_recommendation.md.

D10 · Test Quality10.0 / 10Stronggated by 1 serious finding✓ Tool-verified

What it measures: Whether the tests truly assert behaviour rather than just running the code.

Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Prevented

0 skipped, 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 356 tests.

No assertions: alice and bob exchange messages bidirectionallysrc/__tests__/e2e/messaging.test-e2e.ts:30

What to do

  1. Resolve the 1 No assertions finding(s) in Test Quality — start with messaging.test-e2e.ts. — One of this dimension's main actionable groups (1 warning-level).
  2. Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.

D12 · Dependency Hygiene9.4 / 10Exemplary✓ Tool-verified

What it measures: Whether dependencies are current, secure, and not bloated.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Verified

11 outdated direct production npm dependency(ies) of 16 graded, 0 pinning defect(s), across 2 package.json (2 of them the product) and 3 committed lockfile(s). Development dependencies are deliberately not graded: this dimension grades what SHIPS. Whether any of these packages is DEPRECATED or UNMAINTAINED is not graded — registry.npmjs.org's latest-version answer carries neither, and release age does not stand in for a maintenance status. Whether any is UNUSED is not graded either: that is a source question, and the frontend dependency lens (R8) answers it in this same run. Known CVEs in this dependency graph are D30's question, read from the manifest there.

Outdated (npm): @cacheable/node-cache · ×11

✓ On the Gold path — maintain.

Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.

D13 · REDACTED Scanning5.0 / 10Adequate✓ Tool-verified

What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.

Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.

Maturity: Documented → Verified → Prevented · effective 5.0 / 10 · rule-coverage 100% · ceiling Prevented

1 secret(s) detected.

REDACTED

What to do

  1. Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.

D14 · License Compliance8.0 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether the licenses of third-party packages are compatible with your policy.

Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.

Maturity: Documented → Verified → Prevented · effective 8.0 / 10 · rule-coverage 100% · ceiling Verified

1 of 16 shipped npm package(s) use a banned license. Licences were resolved from registry.npmjs.org over the 16 production dependency(ies) this repository's committed lockfile resolves, across 2 product package.json manifest(s). Its 31 `devDependencies` declaration(s) are excluded: a consumer installs none of them. ★ DEPTH: this is the DIRECT production set the lockfile resolves, NOT the transitive closure — only one of the four lock dialects this pass reads states a full graph, so a banned licence pulled in only by a dependency's OWN dependencies is outside this verdict, exactly as the JVM arm's declaration-site verdict is. ★ Each licence is the one the registry publishes for the package's CURRENT release rather than for the pinned version, which is the same caveat the Hex and RubyGems arms carry. This repository publishes itself under MIT, which is its own choice and is not judged here.

Banned license: libsignal

What to do

  1. Resolve the 1 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (1 issue-level).
  2. Enforce License Compliance in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.

Detailed fixes: d14_recommendation.md · top locations in Appendix A, every location in findings.md.

D15 · Churn × Complexity Hotspots8.4 / 10Strong✓ Tool-verified

What it measures: Files that change often and are also complex — the riskiest hotspots.

Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.

Maturity: Documented → Verified → Prevented · effective 8.4 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: src/Socket/chats.ts (2×146=292)

Hotspot: src/Socket/chats.tssrc/Socket/chats.ts:79

What to do

  1. Resolve the 1 Hotspot finding(s) in Churn × Complexity Hotspots — start with chats.ts. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.

D16 · Bus Factor9.4 / 10Exemplary✓ Tool-verified

What it measures: Whether knowledge is concentrated in too few people (the "bus factor").

Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.

Maturity: Documented → Verified → Prevented · effective 9.4 / 10 · rule-coverage 100% · ceiling Documented

3 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/WAM/constants.ts. Counted over 52 of the 101 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Off-boarding risk: anonymized user #1
Further sole-owners (lower concentration)

✓ On the Gold path — maintain.

Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.

D17 · Explicit Debt9.8 / 10Stronggated by 56 serious findings✓ Tool-verified

What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.

Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Prevented

56 deducted task-comment markers across 43786 LoC (0.1/KLoC) → score 9.8. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.

TodoComment · ×55src/Signal/libsignal.ts:266
HackCommentsrc/Utils/messages.ts:353

What to do

  1. Resolve the 55 TodoComment finding(s) in Explicit Debt — start with messages-send.ts (11), messages-recv.ts (9), process-message.ts (7). — One of this dimension's main actionable groups (55 warning-level).
  2. Resolve the 1 HackComment finding(s) in Explicit Debt — start with messages.ts. — One of this dimension's main actionable groups (1 warning-level).
  3. Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.

Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.

D19 · Documentation QualityAdequate◐ Sampled · advisory

What it measures: Whether the project's documentation is clear, complete, and useful.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Adequate / 10 · rule-coverage 100% · ceiling Documented

The repository's root README gives a strong overview and a CAUTION about breaking changes plus links to the new wiki guide, Get Support, Sponsor, and Disclaimer. The .github/README.md (a README of the github/) is a temporary placeholder that documents itself rather than the project; it contains an important 'You can still access the old guide here' note and ends with a clipped disclaimer section before the full Usage & Guide outline appears. The proto-extract/README.md, which documents its own directory, is thin on content but clearly states what it does (proto extraction) and how to install.

What to do

  1. Improve Documentation Quality — currently 6.0/10. — The repository's root README gives a strong overview and a CAUTION about breaking changes plus links to the new wiki guide, Get Support, Sponsor, and Disclaimer. The .github/README.md (a README of the github/) is a temporary placeholder that documents itself rather than the project; it contains an important 'You can still access the old guide here' note and ends with a clipped disclaimer section before the full Usage & Guide outline appears. The proto-extract/README.md, which documents its own directory, is thin on content but clearly states what it does (proto extraction) and how to install.

Detailed fixes: d19_recommendation.md.

D21 · Naming ConsistencyExemplary◐ Sampled · advisory

What it measures: Whether names — types, methods, variables — are clear and consistent.

Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.

Maturity: Documented → Verified → Prevented · effective Exemplary / 10 · rule-coverage 100% · ceiling Verified

0 naming inconsistencies across 0 sampled symbols.

✓ On the Gold path — maintain.

Detailed fixes: d21_recommendation.md.

D26 · Project Cohesion0.0 / 10Critical✓ Tool-verified

What it measures: Whether each project is a focused, coherent unit rather than an oversized grab-bag.

Method: Project size overshoot penalties (LoC / public-type count / namespace count, 2-of-3 flag) weighted by log magnitude. Exhaustive across projects, deterministic, LLM-independent.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

1 of 2 build units (npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

What to do

  1. Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.

D27 · Navigability8.8 / 10Strong✓ Tool-verified

What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.

Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps.

Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.

Maturity: Documented → Verified → Prevented · effective 8.8 / 10 · rule-coverage 100% · ceiling Documented

44 % of calls cross a namespace and 13 % go through an interface, but 76 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

What to do

  1. Improve Navigability — currently 8.8/10. — 44 % of calls cross a namespace and 13 % go through an interface, but 76 % of collaborators are co-located — so following a call takes several hops. Baseline: small — navigation cost is tolerated.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)9.0 / 10Adequategated by 1 critical finding✓ Tool-verified

What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.

Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.

Maturity: Documented → Verified → Prevented · effective 9.0 / 10 · rule-coverage 100% · ceiling Documented

1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.

REDACTED
REDACTED

What to do

  1. Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
  2. Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).

Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.

D29 · Static Analysis (SAST)0.6 / 10Critical✓ Tool-verified

What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.

Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.

Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).

Maturity: Documented → Verified → Prevented · effective 0.6 / 10 · rule-coverage 100% · ceiling Documented

59 finding(s): 0 critical, 38 high, 21 medium, 0 low. 28 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. Separately, one or more rules could not re-parse an embedded snippet in 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 7 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4). — One of this dimension's main actionable groups (4 issue-level).
  2. Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 issue-level).
  3. No action in Static Analysis (SAST) — all 28 REDACTED finding(s) are reported here at file:line but scored by D36 (supply-chain provenance), so none is charged to this dimension. — One of this dimension's main actionable groups (28 issue-level, 0 of them charged here).

Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.

D30 · Dependency Vulnerabilities0.0 / 10Critical✓ Tool-verified

What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.

Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.

Maturity: Documented → Verified → Prevented · effective 0.0 / 10 · rule-coverage 100% · ceiling Documented

28 finding(s): 4 critical, 17 high, 6 medium, 1 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 17 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (15), REDACTED (2). — One of this dimension's main actionable groups (17 issue-level).
  2. Resolve the 4 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 issue-level).
  3. Resolve the 4 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 warning-level).

Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.

D34 · Knowledge Freshness10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.

Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

Every significant source file has living knowledge — recently and meaningfully worked. Counted over 52 of the 101 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

✓ On the Gold path — maintain.

Detailed fixes: d34_recommendation.md.

D35 · Change Coupling9.8 / 10Adequategated by 2 critical findings✓ Tool-verified

What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.

Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.

Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.

Maturity: Documented → Verified → Prevented · effective 9.8 / 10 · rule-coverage 100% · ceiling Documented

Strongest change-coupling: lid-mapping.ts↔messages-send.ts 52%; lid-mapping.ts↔socket.ts 52%

Boundary-crossing change coupling: lid-mapping.ts ↔ messages-send.ts · ×2src/Signal/lid-mapping.ts

What to do

  1. Resolve the 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with lid-mapping.ts (2). — One of this dimension's main actionable groups (2 issue-level).

Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.

D36 · Supply-chain Provenance & Signing2.5 / 10Weak✓ Tool-verified

What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.

Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.

Maturity: Documented → Verified → Prevented · effective 2.5 / 10 · rule-coverage 100% · ceiling Documented

1/4 supply-chain integrity signals present (provenance, signing, SBOM, pinned actions).

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

+ 2 more group(s) — more in Appendix A; the complete list is findings.md.

What to do

  1. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  2. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).

Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.

D37 · Vulnerability-disclosure Policy10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.

Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

A vulnerability-disclosure policy (SECURITY.md) is published with a reporting contact.

✓ On the Gold path — maintain.

Detailed fixes: d37_recommendation.md.

D43 · Malicious Dependencies10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.

Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

No dependency in any ecosystem this repository declares is published as malicious.

✓ On the Gold path — maintain.

Detailed fixes: d43_recommendation.md.

D44 · Platform End-of-Life10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.

Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.

Maturity: Documented → Verified → Prevented · effective 10.0 / 10 · rule-coverage 100% · ceiling Documented

0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 0 platform declaration(s) and 11 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.

✓ On the Gold path — maintain.

Detailed fixes: d44_recommendation.md.

Frontend & cross-cutting dimensions

R = React/JS · M = Maturity · P = Readiness.

AX10 · Code composition10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.

Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.

Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.

What to do

  • The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).

Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.

AX4 · Dependency direction10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.

Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.

M1 · Documentation (README)8.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.

Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.

What to do

  • Add a 'Testing' section to the root README — how to run the test suite.
  • Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
M2 · Architecture documentation2.0 / 10Critical✓ Tool-verified

Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.

Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.

  • No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.

What to do

  • Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.

Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.

M4 · Documentation accuracy5.0 / 10Adequate◐ Sampled · advisory

Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).

Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.

  • README claims a 'Sponsor' link but the evidence shows no sponsorship page — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
  • README claims a new guide at https://baileys.wiki but there is no such guide in the evidence — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.

What to do

  • Reconcile the README with reality: README claims a 'Sponsor' link but the evidence shows no sponsorship page; README claims a new guide at https://baileys.wiki but there is no such guide in the evidence.
P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether an automated pipeline builds and tests every change.

Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.

P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.

Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.

P3 · Security & performance tooling0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).

Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.

  • No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 15204 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.

What to do

  • Add a SAST step to CI running what this repository's stack ships: CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security — so a security regression fails the build instead of landing.
  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.

Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.

  • The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.

What to do

  • Nothing pauses a release for a human: publish as a draft release (or gate the release job on a protected tag/manual dispatch) so a bad build can be stopped before users can download it.
P6 · Release Hygiene8.0 / 10Strong✓ Tool-verified

Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.

Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.

  • The changelog this check read carries 1 versioned entry, against a bar of 3. Counted as either an `x.y.z` string or a version-shaped section heading (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.

What to do

  • Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
PF3 · Async & latency hygiene6.0 / 10Adequate✓ Tool-verified

Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.

Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `main` is async and calls appendFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:108

What to do

  • TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
R1 · Type Safety9.9 / 10Exemplary✓ Tool-verified

React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.

Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.

What to do

  • Migrate the remaining .js/.jsx files to TypeScript.
R10 · Code Duplication9.8 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.

Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.

  • src/Socket/communities.ts:251 · src/Socket/groups.ts:124 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Socket/communities.ts:251
  • src/Socket/communities.ts:22 · src/Socket/groups.ts:18 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Socket/communities.ts:22
  • src/Socket/business.ts:301 · src/Socket/business.ts:341 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/Socket/business.ts:301
  • REDACTED:36 · REDACTED:69 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:36
  • src/Utils/process-message.ts:239 · src/Utils/process-message.ts:269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/Utils/process-message.ts:239
  • src/Signal/lid-mapping.ts:112 · src/Signal/lid-mapping.ts:247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/Signal/lid-mapping.ts:112
  • src/Socket/communities.ts:177 · src/Socket/groups.ts:112 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Socket/communities.ts:177
  • src/Socket/communities.ts:456 · src/Socket/groups.ts:359 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/Socket/communities.ts:456
  • src/Socket/communities.ts:100 · src/Socket/groups.ts:75 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Socket/communities.ts:100
  • proto-extract/index.js:133 · proto-extract/index.js:218 — the two spans are one implementation copied and then locally edited — 63 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — proto-extract/index.js:133
  • src/Socket/chats.ts:286 · src/Socket/chats.ts:299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/Socket/chats.ts:286
  • src/Socket/groups.ts:369 · src/Socket/messages-recv.ts:857 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — src/Socket/groups.ts:369
  • src/Socket/socket.ts:342 · src/Socket/socket.ts:365 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Socket/socket.ts:342
  • src/Socket/socket.ts:415 · src/Socket/socket.ts:683 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Socket/socket.ts:415
  • src/Utils/noise-handler.ts:31 · src/Utils/noise-handler.ts:41 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/Utils/noise-handler.ts:31
  • src/Utils/chat-utils.ts:452 · src/Utils/chat-utils.ts:535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/Utils/chat-utils.ts:452
  • src/WABinary/encode.ts:147 · src/WABinary/encode.ts:162 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/WABinary/encode.ts:147
  • src/WAM/encode.ts:100 · src/WAM/encode.ts:108 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/WAM/encode.ts:100
  • src/Socket/messages-recv.ts:621 · src/Socket/messages-recv.ts:1413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — src/Socket/messages-recv.ts:621
  • REDACTED:87 · REDACTED:100 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — REDACTED:87
  • src/Utils/chat-utils.ts:328 · src/Utils/chat-utils.ts:451 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — src/Utils/chat-utils.ts:328

What to do

  • Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
R11 · Import Boundaries0.0 / 10Critical✓ Tool-verified

React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).

Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.

  • src/Defaults/index.ts:1 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Defaults/index.ts:1
  • src/Signal/Group/group_cipher.ts:1 imports libsignal/src/crypto, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — src/Signal/Group/group_cipher.ts:1
  • src/Signal/Group/keyhelper.ts:2 imports libsignal/src/curve, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — src/Signal/Group/keyhelper.ts:2
  • src/Signal/Group/sender-chain-key.ts:1 imports libsignal/src/crypto, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — src/Signal/Group/sender-chain-key.ts:1
  • src/Signal/Group/sender-key-distribution-message.ts:1 reaches into another package with a relative path (../../../WAProto/index.js) — import the package by name instead. — src/Signal/Group/sender-key-distribution-message.ts:1
  • src/Signal/Group/sender-key-message.ts:1 imports libsignal/src/curve, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — src/Signal/Group/sender-key-message.ts:1
  • src/Signal/Group/sender-key-message.ts:2 reaches into another package with a relative path (../../../WAProto/index.js) — import the package by name instead. — src/Signal/Group/sender-key-message.ts:2
  • src/Signal/Group/sender-message-key.ts:1 imports libsignal/src/crypto, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — src/Signal/Group/sender-message-key.ts:1
  • src/Signal/libsignal.ts:4 imports libsignal/src/protobufs, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — src/Signal/libsignal.ts:4
  • src/Socket/chats.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Socket/chats.ts:3
  • src/Socket/communities.ts:1 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Socket/communities.ts:1
  • src/Socket/groups.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Socket/groups.ts:2
  • src/Socket/messages-recv.ts:5 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Socket/messages-recv.ts:5
  • src/Socket/messages-send.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Socket/messages-send.ts:3
  • src/Socket/socket.ts:5 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Socket/socket.ts:5
  • src/Types/Events.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Types/Events.ts:2
  • src/Types/Message.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Types/Message.ts:3
  • src/Types/Signal.ts:1 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Types/Signal.ts:1
  • src/Types/Socket.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Types/Socket.ts:3
  • src/Utils/browser-utils.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/browser-utils.ts:2
  • src/Utils/chat-utils.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/chat-utils.ts:3
  • REDACTED:2 imports libsignal/src/curve, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — REDACTED:2
  • src/Utils/decode-wa-message.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/decode-wa-message.ts:2
  • src/Utils/generics.ts:4 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/generics.ts:4
  • src/Utils/history.ts:4 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/history.ts:4
  • REDACTED:12 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — REDACTED:12
  • src/Utils/messages.ts:5 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/messages.ts:5
  • src/Utils/noise-handler.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/noise-handler.ts:2
  • src/Utils/process-message.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/process-message.ts:2
  • src/Utils/reporting-utils.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/reporting-utils.ts:2
  • src/Utils/sync-action-utils.ts:1 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/sync-action-utils.ts:1
  • src/Utils/use-multi-file-auth-state.ts:4 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/use-multi-file-auth-state.ts:4
  • src/Utils/validate-connection.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/Utils/validate-connection.ts:3
  • src/WABinary/generic-utils.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead. — src/WABinary/generic-utils.ts:2
  • src/index.ts:3 reaches into another package with a relative path (../WAProto/index.js) — import the package by name instead. — src/index.ts:3

What to do

  • Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
R2 · Cyclomatic Complexity5.0 / 10Adequate✓ Tool-verified

React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.

Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.

  • (anonymous) has cyclomatic complexity 102 and cognitive complexity 151; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Socket/messages-send.ts:676
  • append has cyclomatic complexity 89 and cognitive complexity 189; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/event-buffer.ts:288
  • processMessage has cyclomatic complexity 79 and cognitive complexity 131; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/process-message.ts:293
  • generateWAMessageContent has cyclomatic complexity 75 and cognitive complexity 114; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/messages.ts:395
  • processSyncAction has cyclomatic complexity 48 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/chat-utils.ts:823
  • processHistoryMessage has cyclomatic complexity 38 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/history.ts:47
  • sendMessagesAgain has cyclomatic complexity 36 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Socket/messages-recv.ts:1314
  • decodeMessageNode has cyclomatic complexity 36 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/decode-wa-message.ts:141
  • handleGroupNotification has cyclomatic complexity 35 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Socket/messages-recv.ts:801
  • _getLIDsForPNsImpl has cyclomatic complexity 31 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Signal/lid-mapping.ts:134
  • handleLegacyMexNewsletterNotification has cyclomatic complexity 31 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Socket/messages-recv.ts:353
  • prepareWAMessageMedia has cyclomatic complexity 30 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/messages.ts:124
  • (anonymous) has cyclomatic complexity 29 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Socket/messages-send.ts:245
  • chatModificationToAppPatch has cyclomatic complexity 28 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/chat-utils.ts:556
  • decrypt has cyclomatic complexity 27 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/decode-wa-message.ts:276
  • processNotification has cyclomatic complexity 27 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Socket/messages-recv.ts:1035
  • (anonymous) has cyclomatic complexity 26 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/reporting-utils.ts:124
  • (anonymous) has cyclomatic complexity 26 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Socket/messages-recv.ts:1620
  • (anonymous) has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Socket/chats.ts:1205
  • generateWAMessageFromContent has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — src/Utils/messages.ts:682

What to do

  • Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
R3 · Large Files4.0 / 10Weak✓ Tool-verified

React / JS · Code Health — How many source files exceed the large-file threshold.

Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.

  • 15 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: src/WAM/constants.ts (22882), src/Socket/messages-recv.ts (1918), src/Socket/chats.ts (1357), REDACTED (1300), src/Socket/messages-send.ts (1249), src/Socket/socket.ts (1038) (+9 more).

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage9.3 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.

Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.

  • src/__tests__/Socket/identity-change-handling.test.ts:5 imports '../../WABinary', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/__tests__/Socket/identity-change-handling.test.ts
  • src/__tests__/Utils/offline-node-processor.test.ts:3 imports '../../WABinary', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/__tests__/Utils/offline-node-processor.test.ts
  • src/__tests__/Utils/reporting-utils.test.ts:2 imports '../../../WAProto', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/__tests__/Utils/reporting-utils.test.ts
  • src/__tests__/Utils/stanza-ack.test.ts:2 imports '../../WABinary', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/__tests__/Utils/stanza-ack.test.ts
  • src/__tests__/Utils/tc-token.test.ts:15 imports '../../WABinary', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — src/__tests__/Utils/tc-token.test.ts
  • No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×6) — src/WABinary/decode.ts, src/WABinary/encode.ts, REDACTED, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R5 · Dependency Freshness9.5 / 10Exemplary✓ Tool-verified

React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).

Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.

What to do

  • Bump outdated dependencies to current versions to limit upgrade debt.
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.

Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.

  • This repository declares test tooling, and the ✓ above records that declaration — but src/__tests__/Socket/identity-change-handling.test.ts and 4 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — src/__tests__/Socket/identity-change-handling.test.ts
R7 · Dead Code9.4 / 10Exemplary✓ Tool-verified

React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).

Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.

  • Unreachable from the 6 application, 4 tooling and 35 test entry point(s) detected in this repo. Gate removals on `yarn run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (6 application, 4 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×2) — src/WABinary/decode.ts, src/WABinary/encode.ts
  • no import path from any entry point (6 application, 4 tooling, 35 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (src/WABinary/decode.ts, src/WABinary/encode.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it — src/WABinary/jid-utils.ts
  • Nothing imports this binding — it is safe to review for removal. (×7) — src/Types/Label.ts:27, src/WABinary/generic-utils.ts:35, src/WABinary/generic-utils.ts:50, …

What to do

  • Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
R8 · Dependency Hygiene9.5 / 10Exemplary✓ Tool-verified

React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.

Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.

  • Declared in proto-extract/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports6.1 / 10Adequate✓ Tool-verified

React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.

Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.

  • src/Defaults/index.ts → src/Signal/libsignal.ts → src/Signal/Group/index.ts → src/Signal/Group/group-session-builder.ts → src/Signal/Group/sender-key-record.ts → src/Utils/generics.ts → REDACTED → src/Defaults/index.ts (one verified cycle inside a mutually-dependent group of 24 files) — src/Defaults/index.ts

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged

Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.

Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.

X25 · Inert configuration knob10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere. Either way, every caller who supplies a value silently gets something else.

Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.

X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.

Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.

Reference — by lens

The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.

LensScoreRatingImpact
Code Health61%Adequate — gated by D1, D2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture52%Adequate — gated by D26, R11Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity58%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness56%Adequate — gated by P3Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security60%Adequate — gated by D29, D30, D36Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60%AdequateStrongest area.
Unscored — 1 check(s) recorded observations but carry no score

These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.

  • X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for

These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.

  • C3 Audit Trail — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 74 check(s) not relevant to this codebase

These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.

  • AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
  • AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
  • AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
  • AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
  • AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
  • AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
  • AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
  • AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
  • AX2 Stateful singletons — Not applicable: TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
  • AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — the dev server did not expose a crawlable HTTP endpoint in time — no runtime evidence This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, firstName, dateOfBirth, phoneNumber, …) or stored credential on a TypeORM/MikroORM/sequelize-typescript/NestJS-Mongoose entity, a Mongoose schema, a Sequelize or Drizzle table, a Knex migration or a Prisma model — and no database or data-store client in the source either, so this repository keeps no data at rest for these controls to protect. If it does persist personal data (through a hosted backend configured outside this repository, for instance), the controls belong to wherever that data is stored.
  • C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
  • D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
  • D20 ADR Quality — N/A — ADRs are expected on deployable products with a user-facing host, not consumed libraries; no ADR log is required here.
  • D22 Internal API Consistency — The exposed public-API surface could not be collected — no C#/VB projects loaded.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — No inline comments to assess — comment value is not applicable here.
  • D25 ADR Conformance — no ADRs to check
  • D31 IaC & Container Security — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.
  • D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
  • D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
  • D4 Code Duplication — This repository's production source (.mts, .ts) is not read by D4's token comparison, which compares .NET source: duplication in it is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream. Not scored here — read the R10 card for this repository's duplication.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
  • D8 Code Coverage — Coverage not measured — JavaScript/TypeScript suite
  • DM1 Domain Modelling — not scored — this repository shows none of the 3 signals this lens looks for
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
  • IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P2 Observability — This repository's JavaScript/TypeScript source (2 module(s), 100 file(s) read) declares no entry point and bootstraps no server, and nothing here deploys a service — it is a library, run inside whatever hosts it, so production observability (structured logging, tracing/metrics, health checks) is N/A. If it grows a binary or a service, the dimension reactivates.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript source, so there is no service whose uptime a failing dependency could take down
  • P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
  • P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `jest --coverage --coverageReporters=lcovonly`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
  • PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for tinybench, mitata, benchmark.js, benny or vitest `bench(...)` calls in files that import them (or `*.bench.*` files), or one of those in a package.json, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
  • PF2 Allocation hygiene — Not applicable: TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
  • S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X10 Duplicated predicate — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
  • X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X28 Index access outside its own emptiness guard — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X30 Support guard that admits what it rejects — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.

Critical — 65 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • + 3 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · High CVE · ×17
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D35 · Change Coupling · Boundary-crossing change coupling · ×2
  • Boundary-crossing change coupling: lid-mapping.ts ↔ messages-send.ts src/Signal/lid-mapping.ts — `src/Signal/lid-mapping.ts` (context Signal) and `src/Socket/messages-send.ts` (context Socket) sit in DIFFERENT parts of the tree yet change together 52% of the time (11 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `3730684e` feat: add cleanup handlers to prevent memory leaks on socket close (#…; `50d410d1` chore: lint; `29318cf6` chore: lint and re-organize — run `git show` on any of them.
  • Boundary-crossing change coupling: lid-mapping.ts ↔ socket.ts src/Signal/lid-mapping.ts — `src/Signal/lid-mapping.ts` (context Signal) and `src/Socket/socket.ts` (context Socket) sit in DIFFERENT parts of the tree yet change together 52% of the time (11 of the 21 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 11 shared commits counted here, the most recent 3 are `3730684e` feat: add cleanup handlers to prevent memory leaks on socket close (#…; `50d410d1` chore: lint; `7ee0b617` chore: lint — run `git show` on any of them.
D13 · REDACTED Scanning · Leaked secret · ×1
  • REDACTED
D14 · License Compliance · Banned license · ×1
  • Banned license: libsignal — `libsignal` 6.0.0 is published on registry.npmjs.org under `GPL-3.0`, which this policy bans, and it is a PRODUCTION dependency this repository's committed lockfile resolves — so it is installed by everything that depends on this repository, not just by its build toolchain. A package offering SEVERAL licences is a choice and is only charged when every one of them is banned. Replace the package, or record an accepted exception.
D28 · Secrets (history) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R9 · Circular Imports · Import cycle (7 files) · ×1
  • Import cycle (7 files) src/Defaults/index.ts — src/Defaults/index.ts → src/Signal/libsignal.ts → src/Signal/Group/index.ts → src/Signal/Group/group-session-builder.ts → src/Signal/Group/sender-key-record.ts → src/Utils/generics.ts → REDACTED → src/Defaults/index.ts (one verified cycle inside a mutually-dependent group of 24 files)
Serious — 279 finding(s)
D17 · Explicit Debt · TodoComment · ×55
  • TodoComment src/Signal/libsignal.ts:266 — // TODO: use usync to handle this entire mess — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/socket.ts:275 — // todo: validate users, throw WARNING on no valid users — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:140 — // TODO: explore full length of data that whatsapp provides — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:318 — // todo: investigate - the idea here is that <user> should have an inline lid field with the lid being the pn equivalent — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:324 — // TODO: LID MAP this stuff (lid protocol will now return lid with devices) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:504 — //TODO: for later, abstract the logic to send a Peer Message instead of just PDO - useful for App State Key Resync with phone — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:706 — // todo: expand for reactions and other types — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:712 — // todo: should we rely on the cache specially if the cache is outdated and the metadata has new fields? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:716 — // TODO: start storing group participant list + addr mode in Signal & stop relying on this — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:725 — // TODO: check out what if the sender key memory doesn't include the LID stuff now? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:782 — //todo: revamp all this logic — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:817 — // TODO: investigate if this is true — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-send.ts:1358 — //TODO: CACHE — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-recv.ts:524 — // TODO: is this really true though — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-recv.ts:802 — // TODO: Support PN/LID (Here is only LID now) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-recv.ts:858 — // TODO: Store LID MAPPINGS — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/groups.ts:370 — // TODO: Store LID MAPPINGS — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-recv.ts:930 — // TODO: LIDMAPPING SUPPORT — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-recv.ts:1049 — // TODO: HANDLE PARTICIPANT_PN — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-recv.ts:1079 — // TODO: WAJIDHASH stuff proper support inhouse — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-recv.ts:1587 — // TODO: temporary fix for crashes and issues resulting of failed msmsg decryption — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-recv.ts:1751 — // TODO: investigate sending receipts to LIDs and not PNs — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/messages-recv.ts:1764 — // TODO: investigate — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Utils/process-message.ts:389 — // TODO: investigate — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment src/Socket/groups.ts:71 — // TODO: properly parse LID / PN DATA — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 30 more in this group — see findings.md.
R11 · Import Boundaries · Boundary violation [package · ×35
  • Boundary violation [package:relative-cross-package] src/Defaults/index.ts:1 — src/Defaults/index.ts:1 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:third-party-deep-import] src/Signal/Group/group_cipher.ts:1 — src/Signal/Group/group_cipher.ts:1 imports libsignal/src/crypto, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] src/Signal/Group/keyhelper.ts:2 — src/Signal/Group/keyhelper.ts:2 imports libsignal/src/curve, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] src/Signal/Group/sender-chain-key.ts:1 — src/Signal/Group/sender-chain-key.ts:1 imports libsignal/src/crypto, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:relative-cross-package] src/Signal/Group/sender-key-distribution-message.ts:1 — src/Signal/Group/sender-key-distribution-message.ts:1 reaches into another package with a relative path (../../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:third-party-deep-import] src/Signal/Group/sender-key-message.ts:1 — src/Signal/Group/sender-key-message.ts:1 imports libsignal/src/curve, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:relative-cross-package] src/Signal/Group/sender-key-message.ts:2 — src/Signal/Group/sender-key-message.ts:2 reaches into another package with a relative path (../../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:third-party-deep-import] src/Signal/Group/sender-message-key.ts:1 — src/Signal/Group/sender-message-key.ts:1 imports libsignal/src/crypto, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:third-party-deep-import] src/Signal/libsignal.ts:4 — src/Signal/libsignal.ts:4 imports libsignal/src/protobufs, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:relative-cross-package] src/Socket/chats.ts:3 — src/Socket/chats.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Socket/communities.ts:1 — src/Socket/communities.ts:1 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Socket/groups.ts:2 — src/Socket/groups.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Socket/messages-recv.ts:5 — src/Socket/messages-recv.ts:5 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Socket/messages-send.ts:3 — src/Socket/messages-send.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Socket/socket.ts:5 — src/Socket/socket.ts:5 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Types/Events.ts:2 — src/Types/Events.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Types/Message.ts:3 — src/Types/Message.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Types/Signal.ts:1 — src/Types/Signal.ts:1 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Types/Socket.ts:3 — src/Types/Socket.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Utils/browser-utils.ts:2 — src/Utils/browser-utils.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Utils/chat-utils.ts:3 — src/Utils/chat-utils.ts:3 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:third-party-deep-import] REDACTED:2 — REDACTED:2 imports libsignal/src/curve, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
  • Boundary violation [package:relative-cross-package] src/Utils/decode-wa-message.ts:2 — src/Utils/decode-wa-message.ts:2 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Utils/generics.ts:4 — src/Utils/generics.ts:4 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • Boundary violation [package:relative-cross-package] src/Utils/history.ts:4 — src/Utils/history.ts:4 reaches into another package with a relative path (../../WAProto/index.js) — import the package by name instead.
  • + 10 more in this group — see findings.md.
D3 · God Classes · FunctionTooLong · ×15
  • FunctionTooLong: messages-recv.makeMessagesRecvSocket src/Socket/messages-recv.ts:110 — FunctionTooLong — makeMessagesRecvSocket runs 1354 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1254 over it, 13.54× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: messages-send.makeMessagesSocket src/Socket/messages-send.ts:73 — FunctionTooLong — makeMessagesSocket runs 883 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 783 over it, 8.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: chats.makeChatsSocket src/Socket/chats.ts:79 — FunctionTooLong — makeChatsSocket runs 864 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 764 over it, 8.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: socket.makeSocket src/Socket/socket.ts:72 — FunctionTooLong — makeSocket runs 698 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 598 over it, 6.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: business.makeBusinessSocket src/Socket/business.ts:16 — FunctionTooLong — makeBusinessSocket runs 252 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 152 over it, 2.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: communities.makeCommunitiesSocket src/Socket/communities.ts:22 — FunctionTooLong — makeCommunitiesSocket runs 249 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 149 over it, 2.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: event-buffer.append src/Utils/event-buffer.ts:288 — FunctionTooLong — append runs 237 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 137 over it, 2.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: libsignal.makeLibSignalRepository src/Signal/libsignal.ts:50 — FunctionTooLong — makeLibSignalRepository runs 224 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 124 over it, 2.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: messages.generateWAMessageContent src/Utils/messages.ts:395 — FunctionTooLong — generateWAMessageContent runs 203 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: chat-utils.chatModificationToAppPatch src/Utils/chat-utils.ts:556 — FunctionTooLong — chatModificationToAppPatch runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: groups.makeGroupsSocket src/Socket/groups.ts:18 — FunctionTooLong — makeGroupsSocket runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: chat-utils.processSyncAction src/Utils/chat-utils.ts:823 — FunctionTooLong — processSyncAction runs 148 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: messages.prepareWAMessageMedia src/Utils/messages.ts:124 — FunctionTooLong — prepareWAMessageMedia runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: event-buffer.makeEventBuffer src/Utils/event-buffer.ts:73 — FunctionTooLong — makeEventBuffer runs 117 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 17 over it, 1.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: newsletter.makeNewsletterSocket src/Socket/newsletter.ts:44 — FunctionTooLong — makeNewsletterSocket runs 114 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 14 over it, 1.14× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · FileTooLong · ×8
  • FileTooLong: Socket/messages-recv.ts src/Socket/messages-recv.ts — FileTooLong — 1454 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: makeMessagesRecvSocket (110-2174). The bar is 500 significant lines; this is 954 over it, 2.91× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Socket/messages-send.ts src/Socket/messages-send.ts — FileTooLong — 954 significant lines (blank, comment-only and punctuation-only lines excluded), about 93% of them inside a single declaration: makeMessagesSocket (73-1419). The bar is 500 significant lines; this is 454 over it, 1.91× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Socket/chats.ts src/Socket/chats.ts — FileTooLong — 937 significant lines (blank, comment-only and punctuation-only lines excluded), about 92% of them inside a single declaration: makeChatsSocket (79-1533). The bar is 500 significant lines; this is 437 over it, 1.87× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Socket/socket.ts src/Socket/socket.ts — FileTooLong — 764 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: makeSocket (72-1190). The bar is 500 significant lines; this is 264 over it, 1.53× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: Utils/messages.ts src/Utils/messages.ts — FileTooLong — 735 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 235 over it, 1.47× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Utils/chat-utils.ts src/Utils/chat-utils.ts — FileTooLong — 707 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 207 over it, 1.41× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: REDACTED REDACTED — FileTooLong — 648 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 148 over it, 1.30× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: Utils/process-message.ts src/Utils/process-message.ts — FileTooLong — 518 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 18 over it, 1.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
D29 · Static Analysis (SAST) · REDACTED · ×6
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R4 · Test Coverage · No test reaches this file · ×6
  • No test reaches this file src/WABinary/decode.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/WABinary/encode.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file REDACTED — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/WABinary/jid-utils.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file src/Types/Label.ts — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
  • No test reaches this file engine-requirements.js — No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
R4 · Test Coverage · This test file cannot be loaded · ×5
  • This test file cannot be loaded src/__tests__/Socket/identity-change-handling.test.ts — src/__tests__/Socket/identity-change-handling.test.ts:5 imports '../../WABinary', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/__tests__/Utils/offline-node-processor.test.ts — src/__tests__/Utils/offline-node-processor.test.ts:3 imports '../../WABinary', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/__tests__/Utils/reporting-utils.test.ts — src/__tests__/Utils/reporting-utils.test.ts:2 imports '../../../WAProto', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/__tests__/Utils/stanza-ack.test.ts — src/__tests__/Utils/stanza-ack.test.ts:2 imports '../../WABinary', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
  • This test file cannot be loaded src/__tests__/Utils/tc-token.test.ts — src/__tests__/Utils/tc-token.test.ts:15 imports '../../WABinary', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
D30 · Dependency Vulnerabilities · Medium CVE · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (9 lines × 2 locations) · ×4
  • Duplicated block (9 lines × 2 locations) src/Socket/groups.ts:369 — src/Socket/groups.ts:369 · src/Socket/messages-recv.ts:857 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
  • Duplicated block (9 lines × 2 locations) src/Socket/socket.ts:342 — src/Socket/socket.ts:342 · src/Socket/socket.ts:365 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (9 lines × 2 locations) src/Socket/socket.ts:415 — src/Socket/socket.ts:415 · src/Socket/socket.ts:683 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (9 lines × 2 locations) src/Utils/noise-handler.ts:31 — src/Utils/noise-handler.ts:31 · src/Utils/noise-handler.ts:41 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
R10 · Code Duplication · Duplicated block (8 lines × 2 locations) · ×3
  • Duplicated block (8 lines × 2 locations) src/Utils/chat-utils.ts:452 — src/Utils/chat-utils.ts:452 · src/Utils/chat-utils.ts:535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (8 lines × 2 locations) src/WABinary/encode.ts:147 — src/WABinary/encode.ts:147 · src/WABinary/encode.ts:162 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (8 lines × 2 locations) src/WAM/encode.ts:100 — src/WAM/encode.ts:100 · src/WAM/encode.ts:108 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Medium vulnerability · ×2
  • REDACTED
  • REDACTED
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: USyncUser (LCOM4 7) src/WAUSync/USyncUser.ts:1 — USyncUser's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: USyncQuery (LCOM4 4) src/WAUSync/USyncQuery.ts:21 — USyncQuery's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
R10 · Code Duplication · Duplicated block (23 lines × 2 locations) · ×2
  • Duplicated block (23 lines × 2 locations) REDACTED:36 — REDACTED:36 · REDACTED:69 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (23 lines × 2 locations) src/Utils/process-message.ts:239 — src/Utils/process-message.ts:239 · src/Utils/process-message.ts:269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (14 lines × 2 locations) · ×2
  • Duplicated block (14 lines × 2 locations) src/Socket/communities.ts:177 — src/Socket/communities.ts:177 · src/Socket/groups.ts:112 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
  • Duplicated block (14 lines × 2 locations) src/Socket/communities.ts:456 — src/Socket/communities.ts:456 · src/Socket/groups.ts:359 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (7 lines × 2 locations) · ×2
  • Duplicated block (7 lines × 2 locations) src/Socket/messages-recv.ts:621 — src/Socket/messages-recv.ts:621 · src/Socket/messages-recv.ts:1413 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
  • Duplicated block (7 lines × 2 locations) REDACTED:87 — REDACTED:87 · REDACTED:100 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
D1 · Cyclomatic Complexity · messages-recv.makeMessagesRecvSocket (cyclomatic 375) · ×1
  • messages-recv.makeMessagesRecvSocket (cyclomatic 375) src/Socket/messages-recv.ts:110 — messages-recv.makeMessagesRecvSocket has cyclomatic complexity 375 (threshold 15). Of this number, 25 points are the body's own statements and 350 belong to 37 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · messages-send.makeMessagesSocket (cyclomatic 250) · ×1
  • messages-send.makeMessagesSocket (cyclomatic 250) src/Socket/messages-send.ts:73 — messages-send.makeMessagesSocket has cyclomatic complexity 250 (threshold 15). Most of this is not in the body itself: 3 of the 250 points are its own statements and the rest belongs to 26 function literals inside it that branch (lines 676, 241, 1328, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · chats.makeChatsSocket (cyclomatic 146) · ×1
  • chats.makeChatsSocket (cyclomatic 146) src/Socket/chats.ts:79 — chats.makeChatsSocket has cyclomatic complexity 146 (threshold 15). Most of this is not in the body itself: 2 of the 146 points are its own statements and the rest belongs to 32 function literals inside it that branch (lines 1205, 583, 874, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · event-buffer.append (cyclomatic 109) · ×1
  • event-buffer.append (cyclomatic 109) src/Utils/event-buffer.ts:288 — event-buffer.append has cyclomatic complexity 109 (threshold 15). Of this number, 100 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · socket.makeSocket (cyclomatic 105) · ×1
  • socket.makeSocket (cyclomatic 105) src/Socket/socket.ts:72 — socket.makeSocket has cyclomatic complexity 105 (threshold 15). Most of this is not in the body itself: 9 of the 105 points are its own statements and the rest belongs to 39 function literals inside it that branch (lines 589, 556, 627, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · process-message.processMessage (cyclomatic 79) · ×1
  • process-message.processMessage (cyclomatic 79) src/Utils/process-message.ts:293 — process-message.processMessage has cyclomatic complexity 79 (threshold 15). Of this number, 78 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · (anonymous) (cyclomatic 77) · ×1
  • (anonymous) (cyclomatic 77) proto-extract/index.js:97 — (anonymous) has cyclomatic complexity 77 (threshold 15). Most of this is not in the body itself: 6 of the 77 points are its own statements and the rest belongs to 36 function items inside it that branch (AssignmentExpression::(anonymous), stringifyMessageSpecMember, Property, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · messages.generateWAMessageContent (cyclomatic 73) · ×1
  • messages.generateWAMessageContent (cyclomatic 73) src/Utils/messages.ts:395 — messages.generateWAMessageContent has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · encode.encodeBinaryNodeInner (cyclomatic 69) · ×1
  • encode.encodeBinaryNodeInner (cyclomatic 69) src/WABinary/encode.ts:14 — encode.encodeBinaryNodeInner has cyclomatic complexity 69 (threshold 15). Most of this is not in the body itself: 12 of the 69 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 179, 99, 149, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · decode.decodeDecompressedBinaryNode (cyclomatic 57) · ×1
  • decode.decodeDecompressedBinaryNode (cyclomatic 57) src/WABinary/decode.ts:20 — decode.decodeDecompressedBinaryNode has cyclomatic complexity 57 (threshold 15). Most of this is not in the body itself: 11 of the 57 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 193, 79, 71, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · chat-utils.processSyncAction (cyclomatic 55) · ×1
  • chat-utils.processSyncAction (cyclomatic 55) src/Utils/chat-utils.ts:823 — chat-utils.processSyncAction has cyclomatic complexity 55 (threshold 15). Of this number, 52 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · messages.prepareWAMessageMedia (cyclomatic 39) · ×1
  • messages.prepareWAMessageMedia (cyclomatic 39) src/Utils/messages.ts:124 — messages.prepareWAMessageMedia has cyclomatic complexity 39 (threshold 15). Of this number, 30 points are the body's own statements and 9 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · history.processHistoryMessage (cyclomatic 38) · ×1
  • history.processHistoryMessage (cyclomatic 38) src/Utils/history.ts:47 — history.processHistoryMessage has cyclomatic complexity 38 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
D1 · Cyclomatic Complexity · chat-utils.chatModificationToAppPatch (cyclomatic 38) · ×1
  • chat-utils.chatModificationToAppPatch (cyclomatic 38) src/Utils/chat-utils.ts:556 — chat-utils.chatModificationToAppPatch has cyclomatic complexity 38 (threshold 15). Of this number, 28 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · libsignal.makeLibSignalRepository (cyclomatic 38) · ×1
  • libsignal.makeLibSignalRepository (cyclomatic 38) src/Signal/libsignal.ts:50 — libsignal.makeLibSignalRepository has cyclomatic complexity 38 (threshold 15). Of this number, 28 points are the body's own statements and 10 belong to 5 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · decode-wa-message.decodeMessageNode (cyclomatic 36) · ×1
  • decode-wa-message.decodeMessageNode (cyclomatic 36) src/Utils/decode-wa-message.ts:141 — decode-wa-message.decodeMessageNode has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LIDMappingStore._getLIDsForPNsImpl (cyclomatic 35) · ×1
  • LIDMappingStore._getLIDsForPNsImpl (cyclomatic 35) src/Signal/lid-mapping.ts:134 — LIDMappingStore._getLIDsForPNsImpl has cyclomatic complexity 35 (threshold 15). Of this number, 31 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · decode-wa-message.decryptMessageNode (cyclomatic 27) · ×1
  • decode-wa-message.decryptMessageNode (cyclomatic 27) src/Utils/decode-wa-message.ts:264 — decode-wa-message.decryptMessageNode has cyclomatic complexity 27 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · reporting-utils.extractReportingTokenContent (cyclomatic 27) · ×1
  • reporting-utils.extractReportingTokenContent (cyclomatic 27) src/Utils/reporting-utils.ts:124 — reporting-utils.extractReportingTokenContent has cyclomatic complexity 27 (threshold 15). Of this number, 25 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · auth-utils.addTransactionCapability (cyclomatic 26) · ×1
  • auth-utils.addTransactionCapability (cyclomatic 26) src/Utils/auth-utils.ts:116 — auth-utils.addTransactionCapability has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 10 of the 26 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 218, 253, 303, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · communities.makeCommunitiesSocket (cyclomatic 26) · ×1
  • communities.makeCommunitiesSocket (cyclomatic 26) src/Socket/communities.ts:22 — communities.makeCommunitiesSocket has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 4 of the 26 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 214, 304, 42, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · event-buffer.makeEventBuffer (cyclomatic 25) · ×1
  • event-buffer.makeEventBuffer (cyclomatic 25) src/Utils/event-buffer.ts:73 — event-buffer.makeEventBuffer has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 4 function literals inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · groups.extractGroupMetadata (cyclomatic 25) · ×1
  • groups.extractGroupMetadata (cyclomatic 25) src/Socket/groups.ts:304 — groups.extractGroupMetadata has cyclomatic complexity 25 (threshold 15). Of this number, 18 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · messages.generateWAMessageFromContent (cyclomatic 24) · ×1
  • messages.generateWAMessageFromContent (cyclomatic 24) src/Utils/messages.ts:682 — messages.generateWAMessageFromContent has cyclomatic complexity 24 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · noise-handler.makeNoiseHandler (cyclomatic 24) · ×1
  • noise-handler.makeNoiseHandler (cyclomatic 24) src/Utils/noise-handler.ts:52 — noise-handler.makeNoiseHandler has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 182, 147, 230, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · messages-media.downloadEncryptedContent (cyclomatic 23) · ×1
  • messages-media.downloadEncryptedContent (cyclomatic 23) REDACTED:553 — messages-media.downloadEncryptedContent has cyclomatic complexity 23 (threshold 15). Of this number, 19 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LIDMappingStore.storeLIDPNMappings (cyclomatic 20) · ×1
  • LIDMappingStore.storeLIDPNMappings (cyclomatic 20) src/Signal/lid-mapping.ts:30 — LIDMappingStore.storeLIDPNMappings has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · LIDMappingStore._getPNsForLIDsImpl (cyclomatic 19) · ×1
  • LIDMappingStore._getPNsForLIDsImpl (cyclomatic 19) src/Signal/lid-mapping.ts:269 — LIDMappingStore._getPNsForLIDsImpl has cyclomatic complexity 19 (threshold 15). Of this number, 15 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · signal.extractE2ESessionFromRetryReceipt (cyclomatic 17) · ×1
  • signal.extractE2ESessionFromRetryReceipt (cyclomatic 17) src/Utils/signal.ts:92 — signal.extractE2ESessionFromRetryReceipt has cyclomatic complexity 17 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
D1 · Cyclomatic Complexity · link-preview.getUrlInfo (cyclomatic 17) · ×1
  • link-preview.getUrlInfo (cyclomatic 17) src/Utils/link-preview.ts:33 — link-preview.getUrlInfo has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D1 · Cyclomatic Complexity · libsignal.signalStorage (cyclomatic 17) · ×1
  • libsignal.signalStorage (cyclomatic 17) src/Signal/libsignal.ts:434 — libsignal.signalStorage has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 6 function literals inside it that branch (lines 443, 490, 464, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · encode.serializeData (cyclomatic 17) · ×1
  • encode.serializeData (cyclomatic 17) src/WAM/encode.ts:86 — encode.serializeData has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D10 · Test Quality · No assertions · ×1
  • No assertions: alice and bob exchange messages bidirectionally src/__tests__/e2e/messaging.test-e2e.ts:30 — This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
D15 · Churn × Complexity Hotspots · Hotspot · ×1
  • Hotspot: src/Socket/chats.ts src/Socket/chats.ts:79 — src/Socket/chats.ts changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 146 in chats.makeChatsSocket at line 79. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-05-06..2026-08-04, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-05-06 20:41:35 +03:00' --until='2026-08-04 20:41:35 +03:00' --full-history --no-merges -- src/Socket/chats.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
D17 · Explicit Debt · HackComment · ×1
  • HackComment src/Utils/messages.ts:353 — // hacky copy — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
D2 · Cognitive Complexity · messages-recv.makeMessagesRecvSocket (cognitive 484) · ×1
  • messages-recv.makeMessagesRecvSocket (cognitive 484) src/Socket/messages-recv.ts:110 — messages-recv.makeMessagesRecvSocket has cognitive complexity 484 (threshold 15). Drivers by points: if/else 165 (280 pts), boolean chains 88, ternaries 24 (50 pts), error handling 16 (35 pts), loops 15 (22 pts), match/switch 6 (9 pts) (nesting depth added 170). Of this number, 26 points are the body's own statements and 458 belong to 37 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · messages-send.makeMessagesSocket (cognitive 350) · ×1
  • messages-send.makeMessagesSocket (cognitive 350) src/Socket/messages-send.ts:73 — messages-send.makeMessagesSocket has cognitive complexity 350 (threshold 15). Drivers by points: if/else 122 (183 pts), boolean chains 75, ternaries 25 (53 pts), loops 12 (21 pts), error handling 7 (18 pts) (nesting depth added 109). Most of this is not in the body itself: 2 of the 350 points are its own statements and the rest belongs to 26 function literals inside it that branch (lines 676, 241, 1328, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · event-buffer.append (cognitive 213) · ×1
  • event-buffer.append (cognitive 213) src/Utils/event-buffer.ts:288 — event-buffer.append has cognitive complexity 213 (threshold 15). Drivers by points: if/else 54 (140 pts), loops 17 (38 pts), boolean chains 29, ternaries 2 (5 pts), match/switch 1 (nesting depth added 110). Of this number, 197 points are the body's own statements and 16 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chats.makeChatsSocket (cognitive 199) · ×1
  • chats.makeChatsSocket (cognitive 199) src/Socket/chats.ts:79 — chats.makeChatsSocket has cognitive complexity 199 (threshold 15). Drivers by points: if/else 79 (118 pts), boolean chains 37, ternaries 16 (25 pts), loops 9 (14 pts), error handling 2 (4 pts), match/switch 1 (nesting depth added 55). Most of this is not in the body itself: 1 of the 199 points is its own statement and the rest belongs to 32 function literals inside it that branch (lines 583, 1205, 412, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · (anonymous) (cognitive 147) · ×1
  • (anonymous) (cognitive 147) proto-extract/index.js:97 — (anonymous) has cognitive complexity 147 (threshold 15). Drivers by points: if/else 37 (99 pts), boolean chains 22, ternaries 5 (15 pts), loops 6 (11 pts) (nesting depth added 77). Most of this is not in the body itself: 8 of the 147 points are its own statements and the rest belongs to 36 function items inside it that branch (AssignmentExpression::(anonymous), stringifyMessageSpecMember, AssignmentExpression, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · process-message.processMessage (cognitive 130) · ×1
  • process-message.processMessage (cognitive 130) src/Utils/process-message.ts:293 — process-message.processMessage has cognitive complexity 130 (threshold 15). Drivers by points: if/else 28 (70 pts), boolean chains 18, loops 4 (15 pts), ternaries 4 (15 pts), error handling 2 (8 pts), match/switch 2 (4 pts) (nesting depth added 72). Of this number, 126 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
D2 · Cognitive Complexity · socket.makeSocket (cognitive 121) · ×1
  • socket.makeSocket (cognitive 121) src/Socket/socket.ts:72 — socket.makeSocket has cognitive complexity 121 (threshold 15). Drivers by points: if/else 55 (65 pts), boolean chains 30, error handling 12 (15 pts), ternaries 5 (6 pts), loops 4 (5 pts) (nesting depth added 15). Most of this is not in the body itself: 8 of the 121 points are its own statements and the rest belongs to 39 function literals inside it that branch (lines 589, 556, 327, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · messages.generateWAMessageContent (cognitive 103) · ×1
  • messages.generateWAMessageContent (cognitive 103) src/Utils/messages.ts:395 — messages.generateWAMessageContent has cognitive complexity 103 (threshold 15). Drivers by points: if/else 52 (80 pts), boolean chains 16, ternaries 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LIDMappingStore._getLIDsForPNsImpl (cognitive 85) · ×1
  • LIDMappingStore._getLIDsForPNsImpl (cognitive 85) src/Signal/lid-mapping.ts:134 — LIDMappingStore._getLIDsForPNsImpl has cognitive complexity 85 (threshold 15). Drivers by points: if/else 18 (43 pts), ternaries 8 (24 pts), loops 5 (12 pts), boolean chains 6 (nesting depth added 48). Of this number, 81 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · encode.encodeBinaryNodeInner (cognitive 78) · ×1
  • encode.encodeBinaryNodeInner (cognitive 78) src/WABinary/encode.ts:14 — encode.encodeBinaryNodeInner has cognitive complexity 78 (threshold 15). Drivers by points: if/else 39 (46 pts), boolean chains 19, loops 7 (8 pts), ternaries 3 (4 pts), match/switch 1 (nesting depth added 9). Most of this is not in the body itself: 13 of the 78 points are its own statements and the rest belongs to 13 function literals inside it that branch (lines 179, 164, 64, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · reporting-utils.extractReportingTokenContent (cognitive 70) · ×1
  • reporting-utils.extractReportingTokenContent (cognitive 70) src/Utils/reporting-utils.ts:124 — reporting-utils.extractReportingTokenContent has cognitive complexity 70 (threshold 15). Drivers by points: if/else 24 (68 pts), boolean chains 1, loops 1 (nesting depth added 44). Of this number, 66 points are the body's own statements and 4 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat-utils.processSyncAction (cognitive 69) · ×1
  • chat-utils.processSyncAction (cognitive 69) src/Utils/chat-utils.ts:823 — chat-utils.processSyncAction has cognitive complexity 69 (threshold 15). Drivers by points: if/else 29 (35 pts), ternaries 11 (23 pts), boolean chains 11 (nesting depth added 18). Of this number, 63 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · decode-wa-message.decryptMessageNode (cognitive 55) · ×1
  • decode-wa-message.decryptMessageNode (cognitive 55) src/Utils/decode-wa-message.ts:264 — decode-wa-message.decryptMessageNode has cognitive complexity 55 (threshold 15). Drivers by points: if/else 11 (27 pts), ternaries 3 (10 pts), error handling 2 (7 pts), boolean chains 6, match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · libsignal.makeLibSignalRepository (cognitive 52) · ×1
  • libsignal.makeLibSignalRepository (cognitive 52) src/Signal/libsignal.ts:50 — libsignal.makeLibSignalRepository has cognitive complexity 52 (threshold 15). Drivers by points: if/else 23 (36 pts), boolean chains 6, loops 3 (4 pts), ternaries 2 (4 pts), error handling 1, match/switch 1 (nesting depth added 16). Of this number, 36 points are the body's own statements and 16 belong to 5 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · history.processHistoryMessage (cognitive 49) · ×1
  • history.processHistoryMessage (cognitive 49) src/Utils/history.ts:47 — history.processHistoryMessage has cognitive complexity 49 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 17, loops 4 (8 pts), match/switch 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · decode-wa-message.decodeMessageNode (cognitive 46) · ×1
  • decode-wa-message.decodeMessageNode (cognitive 46) src/Utils/decode-wa-message.ts:141 — decode-wa-message.decodeMessageNode has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (31 pts), boolean chains 9, ternaries 6 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · decode.decodeDecompressedBinaryNode (cognitive 43) · ×1
  • decode.decodeDecompressedBinaryNode (cognitive 43) src/WABinary/decode.ts:20 — decode.decodeDecompressedBinaryNode has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (20 pts), boolean chains 8, match/switch 4 (6 pts), loops 4, ternaries 2 (4 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 12 of the 43 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 71, 193, 55, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · messages.prepareWAMessageMedia (cognitive 39) · ×1
  • messages.prepareWAMessageMedia (cognitive 39) src/Utils/messages.ts:124 — messages.prepareWAMessageMedia has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (24 pts), boolean chains 12, error handling 2, loops 1 (nesting depth added 6). Of this number, 29 points are the body's own statements and 10 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · communities.makeCommunitiesSocket (cognitive 37) · ×1
  • communities.makeCommunitiesSocket (cognitive 37) src/Socket/communities.ts:22 — communities.makeCommunitiesSocket has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 11 (20 pts), if/else 7, boolean chains 4, loops 2 (4 pts), error handling 1 (2 pts) (nesting depth added 12). Most of this is not in the body itself: 5 of the 37 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 214, 42, 304, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · auth-utils.addTransactionCapability (cognitive 35) · ×1
  • auth-utils.addTransactionCapability (cognitive 35) src/Utils/auth-utils.ts:116 — auth-utils.addTransactionCapability has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 6, loops 4 (5 pts), error handling 2 (3 pts) (nesting depth added 9). Most of this is not in the body itself: 13 of the 35 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 253, 218, 303, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · LIDMappingStore._getPNsForLIDsImpl (cognitive 30) · ×1
  • LIDMappingStore._getPNsForLIDsImpl (cognitive 30) src/Signal/lid-mapping.ts:269 — LIDMappingStore._getPNsForLIDsImpl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, loops 2 (3 pts), ternaries 3 (nesting depth added 11). Of this number, 26 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · messages-media.downloadEncryptedContent (cognitive 30) · ×1
  • messages-media.downloadEncryptedContent (cognitive 30) REDACTED:553 — messages-media.downloadEncryptedContent has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (13 pts), ternaries 7 (10 pts), boolean chains 5, error handling 2 (nesting depth added 7). Of this number, 23 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat-utils.chatModificationToAppPatch (cognitive 30) · ×1
  • chat-utils.chatModificationToAppPatch (cognitive 30) src/Utils/chat-utils.ts:556 — chat-utils.chatModificationToAppPatch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20, boolean chains 10. Of this number, 25 points are the body's own statements and 5 belong to 2 function literals inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D2 · Cognitive Complexity · event-buffer.makeEventBuffer (cognitive 30) · ×1
  • event-buffer.makeEventBuffer (cognitive 30) src/Utils/event-buffer.ts:73 — event-buffer.makeEventBuffer has cognitive complexity 30 (threshold 15). Drivers by points: if/else 18 (25 pts), boolean chains 2, loops 2, error handling 1 (nesting depth added 7). Of this number, 21 points are the body's own statements and 9 belong to 4 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · noise-handler.makeNoiseHandler (cognitive 29) · ×1
  • noise-handler.makeNoiseHandler (cognitive 29) src/Utils/noise-handler.ts:52 — noise-handler.makeNoiseHandler has cognitive complexity 29 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 2, ternaries 2, loops 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 29 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 147, 182, 230, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · LIDMappingStore.storeLIDPNMappings (cognitive 27) · ×1
  • LIDMappingStore.storeLIDPNMappings (cognitive 27) src/Signal/lid-mapping.ts:30 — LIDMappingStore.storeLIDPNMappings has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 6 (7 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat-utils.decodeSyncdMutations (cognitive 25) · ×1
  • chat-utils.decodeSyncdMutations (cognitive 25) src/Utils/chat-utils.ts:228 — chat-utils.decodeSyncdMutations has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), error handling 2 (4 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · groups.extractGroupMetadata (cognitive 24) · ×1
  • groups.extractGroupMetadata (cognitive 24) src/Socket/groups.ts:304 — groups.extractGroupMetadata has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (11 pts), boolean chains 8, if/else 4 (5 pts) (nesting depth added 3). Of this number, 18 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
D2 · Cognitive Complexity · messages.generateWAMessageFromContent (cognitive 23) · ×1
  • messages.generateWAMessageFromContent (cognitive 23) src/Utils/messages.ts:682 — messages.generateWAMessageFromContent has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 11, if/else 6 (9 pts), ternaries 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · encode.serializeData (cognitive 21) · ×1
  • encode.serializeData (cognitive 21) src/WAM/encode.ts:86 — encode.serializeData has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · libsignal.signalStorage (cognitive 20) · ×1
  • libsignal.signalStorage (cognitive 20) src/Signal/libsignal.ts:434 — libsignal.signalStorage has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 2 (4 pts), error handling 1 (nesting depth added 4). Most of this is not in the body itself: 0 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 443, 490, 464, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · index.extractAllExpressions (cognitive 20) · ×1
  • index.extractAllExpressions (cognitive 20) proto-extract/index.js:10 — index.extractAllExpressions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (10 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · process-message.storeTcTokensFromHistorySync (cognitive 19) · ×1
  • process-message.storeTcTokensFromHistorySync (cognitive 19) src/Utils/process-message.ts:60 — process-message.storeTcTokensFromHistorySync has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 4 (6 pts), boolean chains 2, error handling 1 (2 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · link-preview.getUrlInfo (cognitive 18) · ×1
  • link-preview.getUrlInfo (cognitive 18) src/Utils/link-preview.ts:33 — link-preview.getUrlInfo has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 2 (4 pts) (nesting depth added 4). Of this number, 14 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
D2 · Cognitive Complexity · messages-media.encryptedStream (cognitive 17) · ×1
  • messages-media.encryptedStream (cognitive 17) REDACTED:385 — messages-media.encryptedStream has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 2 (3 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · signal.extractDeviceJids (cognitive 17) · ×1
  • signal.extractDeviceJids (cognitive 17) src/Utils/signal.ts:181 — signal.extractDeviceJids has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · chat-utils.decodePatches (cognitive 17) · ×1
  • chat-utils.decodePatches (cognitive 17) src/Utils/chat-utils.ts:479 — chat-utils.decodePatches has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · tc-token-utils.storeTcTokensFromIqResult (cognitive 17) · ×1
  • tc-token-utils.storeTcTokensFromIqResult (cognitive 17) src/Utils/tc-token-utils.ts:178 — tc-token-utils.storeTcTokensFromIqResult has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · use-multi-file-auth-state.useMultiFileAuthState (cognitive 16) · ×1
  • use-multi-file-auth-state.useMultiFileAuthState (cognitive 16) src/Utils/use-multi-file-auth-state.ts:33 — use-multi-file-auth-state.useMultiFileAuthState has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (5 pts), error handling 3, loops 2 (3 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 4). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 118, 106, 50, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
PF3 · Async & latency hygiene · Sync-over-async blocking · ×1
  • Sync-over-async blocking REDACTED:108 — `main` is async and calls appendFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R10 · Code Duplication · Duplicated block (153 lines × 2 locations) · ×1
  • Duplicated block (153 lines × 2 locations) src/Socket/communities.ts:251 — src/Socket/communities.ts:251 · src/Socket/groups.ts:124 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (53 lines × 2 locations) · ×1
  • Duplicated block (53 lines × 2 locations) src/Socket/communities.ts:22 — src/Socket/communities.ts:22 · src/Socket/groups.ts:18 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block (34 lines × 2 locations) · ×1
  • Duplicated block (34 lines × 2 locations) src/Socket/business.ts:301 — src/Socket/business.ts:301 · src/Socket/business.ts:341 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
R10 · Code Duplication · Duplicated block (21 lines × 2 locations) · ×1
  • Duplicated block (21 lines × 2 locations) src/Signal/lid-mapping.ts:112 — src/Signal/lid-mapping.ts:112 · src/Signal/lid-mapping.ts:247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (13 lines × 2 locations) · ×1
  • Duplicated block (13 lines × 2 locations) src/Socket/communities.ts:100 — src/Socket/communities.ts:100 · src/Socket/groups.ts:75 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R10 · Code Duplication · Duplicated block with local edits (11 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (11 matched lines × 2 locations) proto-extract/index.js:133 — proto-extract/index.js:133 · proto-extract/index.js:218 — the two spans are one implementation copied and then locally edited — 63 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication · Duplicated block (10 lines × 2 locations) · ×1
  • Duplicated block (10 lines × 2 locations) src/Socket/chats.ts:286 — src/Socket/chats.ts:286 · src/Socket/chats.ts:299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
R10 · Code Duplication · Duplicated block (5 lines × 2 locations) · ×1
  • Duplicated block (5 lines × 2 locations) src/Utils/chat-utils.ts:328 — src/Utils/chat-utils.ts:328 · src/Utils/chat-utils.ts:451 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 102, cognitive 151) · ×1
  • Complex function (anonymous) (cyclomatic 102, cognitive 151) src/Socket/messages-send.ts:676 — (anonymous) has cyclomatic complexity 102 and cognitive complexity 151; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function append (cyclomatic 89, cognitive 189) · ×1
  • Complex function append (cyclomatic 89, cognitive 189) src/Utils/event-buffer.ts:288 — append has cyclomatic complexity 89 and cognitive complexity 189; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function processMessage (cyclomatic 79, cognitive 131) · ×1
  • Complex function processMessage (cyclomatic 79, cognitive 131) src/Utils/process-message.ts:293 — processMessage has cyclomatic complexity 79 and cognitive complexity 131; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateWAMessageContent (cyclomatic 75, cognitive 114) · ×1
  • Complex function generateWAMessageContent (cyclomatic 75, cognitive 114) src/Utils/messages.ts:395 — generateWAMessageContent has cyclomatic complexity 75 and cognitive complexity 114; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function processSyncAction (cyclomatic 48, cognitive 59) · ×1
  • Complex function processSyncAction (cyclomatic 48, cognitive 59) src/Utils/chat-utils.ts:823 — processSyncAction has cyclomatic complexity 48 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function processHistoryMessage (cyclomatic 38, cognitive 49) · ×1
  • Complex function processHistoryMessage (cyclomatic 38, cognitive 49) src/Utils/history.ts:47 — processHistoryMessage has cyclomatic complexity 38 and cognitive complexity 49; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function sendMessagesAgain (cyclomatic 36, cognitive 59) · ×1
  • Complex function sendMessagesAgain (cyclomatic 36, cognitive 59) src/Socket/messages-recv.ts:1314 — sendMessagesAgain has cyclomatic complexity 36 and cognitive complexity 59; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function decodeMessageNode (cyclomatic 36, cognitive 52) · ×1
  • Complex function decodeMessageNode (cyclomatic 36, cognitive 52) src/Utils/decode-wa-message.ts:141 — decodeMessageNode has cyclomatic complexity 36 and cognitive complexity 52; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleGroupNotification (cyclomatic 35, cognitive 22) · ×1
  • Complex function handleGroupNotification (cyclomatic 35, cognitive 22) src/Socket/messages-recv.ts:801 — handleGroupNotification has cyclomatic complexity 35 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function _getLIDsForPNsImpl (cyclomatic 31, cognitive 81) · ×1
  • Complex function _getLIDsForPNsImpl (cyclomatic 31, cognitive 81) src/Signal/lid-mapping.ts:134 — _getLIDsForPNsImpl has cyclomatic complexity 31 and cognitive complexity 81; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function handleLegacyMexNewsletterNotification (cyclomatic 31, cognitive 44) · ×1
  • Complex function handleLegacyMexNewsletterNotification (cyclomatic 31, cognitive 44) src/Socket/messages-recv.ts:353 — handleLegacyMexNewsletterNotification has cyclomatic complexity 31 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function prepareWAMessageMedia (cyclomatic 30, cognitive 31) · ×1
  • Complex function prepareWAMessageMedia (cyclomatic 30, cognitive 31) src/Utils/messages.ts:124 — prepareWAMessageMedia has cyclomatic complexity 30 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 29, cognitive 56) · ×1
  • Complex function (anonymous) (cyclomatic 29, cognitive 56) src/Socket/messages-send.ts:245 — (anonymous) has cyclomatic complexity 29 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function chatModificationToAppPatch (cyclomatic 28, cognitive 31) · ×1
  • Complex function chatModificationToAppPatch (cyclomatic 28, cognitive 31) src/Utils/chat-utils.ts:556 — chatModificationToAppPatch has cyclomatic complexity 28 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function decrypt (cyclomatic 27, cognitive 55) · ×1
  • Complex function decrypt (cyclomatic 27, cognitive 55) src/Utils/decode-wa-message.ts:276 — decrypt has cyclomatic complexity 27 and cognitive complexity 55; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function processNotification (cyclomatic 27, cognitive 26) · ×1
  • Complex function processNotification (cyclomatic 27, cognitive 26) src/Socket/messages-recv.ts:1035 — processNotification has cyclomatic complexity 27 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 26, cognitive 67) · ×1
  • Complex function (anonymous) (cyclomatic 26, cognitive 67) src/Utils/reporting-utils.ts:124 — (anonymous) has cyclomatic complexity 26 and cognitive complexity 67; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 26, cognitive 47) · ×1
  • Complex function (anonymous) (cyclomatic 26, cognitive 47) src/Socket/messages-recv.ts:1620 — (anonymous) has cyclomatic complexity 26 and cognitive complexity 47; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function (anonymous) (cyclomatic 25, cognitive 31) · ×1
  • Complex function (anonymous) (cyclomatic 25, cognitive 31) src/Socket/chats.ts:1205 — (anonymous) has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity · Complex function generateWAMessageFromContent (cyclomatic 24, cognitive 23) · ×1
  • Complex function generateWAMessageFromContent (cyclomatic 24, cognitive 23) src/Utils/messages.ts:682 — generateWAMessageFromContent has cyclomatic complexity 24 and cognitive complexity 23; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files · Large Files · ×1
  • Large Files — 15 file(s) over 400 lines (counted as significant lines — blank lines excluded — over production source only, tests excluded), largest first: src/WAM/constants.ts (22882), src/Socket/messages-recv.ts (1918), src/Socket/chats.ts (1357), REDACTED (1300), src/Socket/messages-send.ts (1249), src/Socket/socket.ts (1038) (+9 more).
R6 · Tooling · The declared test suite includes a file that cannot be loaded · ×1
  • The declared test suite includes a file that cannot be loaded src/__tests__/Socket/identity-change-handling.test.ts — This repository declares test tooling, and the ✓ above records that declaration — but src/__tests__/Socket/identity-change-handling.test.ts and 4 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
R7 · Dead Code · Dead file (~308 LoC) · ×1
  • Dead file (~308 LoC) src/WABinary/decode.ts — no import path from any entry point (6 application, 4 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~258 LoC) · ×1
  • Dead file (~258 LoC) src/WABinary/encode.ts — no import path from any entry point (6 application, 4 tooling, 35 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
R7 · Dead Code · Dead file (~128 LoC) · ×1
  • Dead file (~128 LoC) src/WABinary/jid-utils.ts — no import path from any entry point (6 application, 4 tooling, 35 test roots considered), but 2 in-repo import(s) from 2 other file(s) do name it (src/WABinary/decode.ts, src/WABinary/encode.ts) — every one of those referrers is itself unreachable, so this file is dead only as a member of that cluster: if any referrer is in fact alive, this row falls with it
R8 · Dependency Hygiene · Unused dependency 'request-promise-core' · ×1
  • Unused dependency 'request-promise-core' — Declared in proto-extract/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Minor — 22 finding(s)
M4 · Documentation accuracy · README/code drift · ×2
  • README/code drift — README claims a 'Sponsor' link but the evidence shows no sponsorship page — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
  • README/code drift — README claims a new guide at https://baileys.wiki but there is no such guide in the evidence — reported by the model that read the README against this repository; no term search was run for this one, so nothing here has been checked against the tree. Treat it as a reading to confirm, not as a measured contradiction: verify it against the code before acting on it, and if the footprint it describes does exist, this row is wrong.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 2 significant file(s) lose their only recent owner: src/Utils/reporting-utils.ts, src/Utils/identity-change-handler.ts. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 1 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (3 single-owned of 52 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 52 of the 101 production source files in this repository met that bar). They are anonymized user #2 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 2 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `(repository root)` (43731 LoC, 142 public types across 13 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
D30 · Dependency Vulnerabilities · Low CVE · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P3 · Security & performance tooling · No SAST · ×1
  • No SAST — No static application security testing detected. For this repository's stack, add CodeQL's javascript-typescript pack, `semgrep --config=p/typescript`, or eslint-plugin-security as a CI step. What was searched, so you can tell an absence from a miss: the 15204 CI workflow file(s) in this repository, and the scanner and linter configuration checked in beside them. A scan that runs outside CI, one configured in your forge's web UI rather than in a committed file, or a tool whose name is none of those this check carries, is not seen — if that is your case the row is wrong, and saying so is more useful than adding a second scanner.
P4 · Deployment & Rollback · No release approval gate · ×1
  • No release approval gate — The release is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever the release trigger points at is published to users unreviewed, so a mistagged or unverified commit ships and the only remedy is a follow-up release.
P6 · Release Hygiene · Changelog looks stale/thin · ×1
  • Changelog looks stale/thin — The changelog this check read carries 1 versioned entry, against a bar of 3. Counted as either an `x.y.z` string or a version-shaped section heading (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
R7 · Dead Code · Unused export 'LabelColor' · ×1
  • Unused export 'LabelColor' src/Types/Label.ts:27 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getAllBinaryNodeChildren' · ×1
  • Unused export 'getAllBinaryNodeChildren' src/WABinary/generic-utils.ts:35 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getBinaryNodeChildString' · ×1
  • Unused export 'getBinaryNodeChildString' src/WABinary/generic-utils.ts:50 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getBinaryNodeChildUInt' · ×1
  • Unused export 'getBinaryNodeChildUInt' src/WABinary/generic-utils.ts:59 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'assertNodeErrorFree' · ×1
  • Unused export 'assertNodeErrorFree' src/WABinary/generic-utils.ts:66 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'reduceBinaryNodeToDictionary' · ×1
  • Unused export 'reduceBinaryNodeToDictionary' src/WABinary/generic-utils.ts:73 — Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code · Unused export 'getBinaryNodeMessages' · ×1
  • Unused export 'getBinaryNodeMessages' src/WABinary/generic-utils.ts:90 — Nothing imports this binding — it is safe to review for removal.
X7 · Silent fallback defaults · Silent fallback default in catch · ×1
  • Silent fallback default in catch src/Utils/tc-token-utils.ts:48 — `readTcTokenIndex` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Minor — 11 finding(s)
D12 · Dependency Hygiene · Outdated (npm) · ×11
  • Outdated (npm): @cacheable/node-cache — @cacheable/node-cache is pinned at 1.6.0; registry.npmjs.org publishes 3.1.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): @hapi/boom — @hapi/boom is pinned at 9.1.4; registry.npmjs.org publishes 10.0.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): acorn — acorn is pinned at 8.16.0; registry.npmjs.org publishes 8.18.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): acorn-walk — acorn-walk is pinned at 6.2.0; registry.npmjs.org publishes 8.3.5 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): lru-cache — lru-cache is pinned at 11.2.1; registry.npmjs.org publishes 11.5.3 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): music-metadata — music-metadata is pinned at 11.12.3; registry.npmjs.org publishes 11.16.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): p-queue — p-queue is pinned at 9.0.0; registry.npmjs.org publishes 9.3.3 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): pino — pino is pinned at 9.7.0; registry.npmjs.org publishes 10.3.1 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): protobufjs — protobufjs is pinned at 7.5.6; registry.npmjs.org publishes 8.8.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): whatsapp-rust-bridge — whatsapp-rust-bridge is pinned at 0.5.4; registry.npmjs.org publishes 0.5.5 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.
  • Outdated (npm): ws — ws is pinned at 8.18.3; registry.npmjs.org publishes 8.22.0 as the latest release. Upgrading is a judgement call — read that package's changelog for what changed between the two — but a direct production dependency several releases behind is where security and compatibility debt accumulates silently.

Appendix B — Reproduction & audit trail

Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-35f452c33b0a4815a6f7dfeb499f0fb0/history.json --exit-code 0 --source .1artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/watchdog-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-35f452c33b0a4815a6f7dfeb499f0fb0/tree.json --exit-code 0 --source .1artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/watchdog-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off .59artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update28artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy: not applicable — No Infrastructure-as-Code or container manifests found (Dockerfile, Docker Compose, Terraform, Kubernetes/Helm, CloudFormation, ARM, Bicep, Ansible); nothing to scan.0—
D32 · Data Compliance (PII/GDPR)semgrep—semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** . --skip-db-update0artifacts/raw/trivy-fs.json

Run 01a0fa39-24c0-7ed5-b3ca-62787f8485a8 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.

⬇ Findings, MITRE CWE-tagged .sarif⬇ Health changelog .md