---
title: "2026-08-27 TypeScript complexity audit"
description: "Audited monorepo TypeScript lint coverage and measured classic cyclomatic complexity without changing the worktree."
image: "https://docs.virdx.dev/img/virdx-social-card.png"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.virdx.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# 2026-08-27 TypeScript complexity audit

## Work Done

- Read the monorepo root guidance and local documentation for all seven projects tagged `lang:typescript`.
- Audited the root Biome configuration, project lint scripts and Nx targets, package lock, and repository-wide references to ESLint and Oxlint.
- Confirmed that Biome is the configured code linter and that Oxlint is neither installed nor configured.
- Used a pinned temporary `bunx oxlint@1.80.0` invocation with the ESLint-compatible `complexity` rule, classic variant, and `max: 0` to report every function. The scan covered all 455 tracked `.ts` and `.tsx` files without modifying the worktree.
- Measured 4,323 function-like units. The maximum was 131 in the dashboard frontend. The 99th percentile was approximately 21, and 44 functions exceeded 20.
- Recommended warning at complexity 20, prioritizing the 15 functions above 30, then enforcing 20 for new or changed code once existing debt is baselined.

## Lessons Learned: Pitfalls

- `bunx biome` is unsafe as a version check when workspace dependencies are not installed: it resolves the unrelated `biome` package rather than `@biomejs/biome`. The reliable evidence in this checkout was `bun.lock`, which resolves `@biomejs/biome` 2.4.16.
- `bunx nx` also could not inspect the project graph because the checkout had no installed workspace modules. Direct `project.json` inspection was sufficient and avoided altering tracked files.
- The root README project inventory is incomplete relative to current `project.json` tags, so project discovery must use tags rather than the README table alone.

## Lessons Learned: Improvements

- Document a read-only lint audit command that pins the exact package name and version, for example `bunx oxlint@1.80.0`, and stores temporary configuration outside the repository.
- Add a workspace note that `bunx biome` can resolve the wrong package when dependencies are absent; use `bunx @biomejs/biome` for an external check or install the workspace first.
- Keep the README inventory generated from Nx project metadata, or state clearly that it is illustrative rather than exhaustive.

Source: https://docs.virdx.dev/knowledge/inbox/2026-08-27-infrastructure-typescript-complexity-audit/index.mdx
