Public report of cure-lab/ArbiterOS, published 17 November 2026. It has the same score, grades and number of findings as the full report. The details of security findings (where they are in the code, which known vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive report Measured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey → Signed and filed in the standard's public register, 17 November 2026, 20:19 UTC · Survey ID cd_db16fd3e435e4e788e228c41776af1d9

cure-lab/ArbiterOS

Measured 17 November 2026, 20:18 UTC, at code version 78a8f98

First survey, so nothing to compare with yet Code coverage: not measured

Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureTestRunFailed).

CAI score 32.2out of 100 At risk

The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.

A large codebase: 360,486 lines of product code in 6 projects, tests not counted · Estimated rebuild effort: about 3.5 person-years · Weakest lens: Production Readiness, 26.6

Findings by how serious they are

230 critical 2101 serious 624 minor

5 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
17 November 2026, 20:18 UTC

A measurement, not a certificate. The Code Assurance Index records a number together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that implements it, and today the Canine Code Analyzer is the only one that does.

A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.

The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸

86of 86 dimensions measured by tools.
2932of 2955 findings point to an exact file and line, so you can open each one in the code. The other 23 concern the repository as a whole, such as missing documentation.
86dimensions across 8 lenses, read from 360,486 lines of product code in 6 projects.
Chapters

Executive summary

cure-lab/ArbiterOS is rated At risk because critical security findings are open, most of them in the packages it uses. Its score is held back in part because it has uses of packages that aren't listed. It scores 32.2 out of 100, which the At risk rating leaves unchanged.

Production Readiness, at 26.6, is the weakest lens and counts most in the score. The best first step is replacing the three packages under a banned licence, worth about 4.7 points. Moving database and web code out of the business core comes next, worth about 4.4 points. Raising Production Readiness to 70 would lift the score to about 37.1.

122 known security holes in the packages the code depends on can be used by attackers. Twenty passwords or keys are open to anyone who can read the repository, and sixteen weaknesses in the code could be used by an attacker. Updating the vulnerable packages, replacing each exposed password or key and fixing the weaknesses the scanner points to would close these risks. Setting a waiting period for automatic updates would fix the three automatic dependency updates that take new releases at once, and the 13 unsafe settings in infrastructure or container files need changing to safe values. The 25 controls that only work with a mouse need to work with the keyboard, or to become a real button.

The product code is 360,486 lines, about €510,000 to rebuild.

A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Production Readiness 26.6 · counts for 45%Domain Modelling 28.2 · counts for 25%Architecture 38.7 · counts for 14%Code Health 43.4 · counts for 8%Accessibility 47.8 · counts for 4%Security and Compliance 57.3 · counts for 2%Performance 60.0 · counts for 1%Maturity 69.0 · counts for 1%

If Production Readiness rose from 26.6 to 70, the lowest score rated Strong, the score would rise from 32.2 to about 37.1.

Code composition: what the lines of code are
Product code 76%Tests 24%
Rebuild cost: about €510,000 · Estimate
Cost to rebuild€170,000 to €850,000, for 2,805 to 8,898 hours of work, about 3.5 person-years for 2 to 7 engineers
Difficulty of the problemStandard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.7 at a score of 32. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 360,486 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.

Top priorities

The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.

1
Resolve the 3 Banned license finding(s) in License Compliance.
Raises the score by about 4.7 points · Low effort · License Compliance
2
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
Raises the score by about 4.4 points · Medium effort · Domain ↔ infrastructure boundary
3
Resolve the 3 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED (3).
Raises the score by about 1.4 points · Low effort · Project Cohesion

Diagnosis: what the measurements show together

Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.

Where the investment is most exposed · Value at risk
This code would cost about €510,000 to build again, about 3.5 person-years of work. Its weakest lens is Production Readiness, at 26.6 (Weak). Production Readiness is about whether the product is ready to run in production and to change without breaking. Because the weakest lens counts most in the score, work on Production Readiness also moves the score most.
Based on: the rebuild estimate · the Production Readiness grade · how much each lens counts
What to do: Start with the Production Readiness actions in Top priorities.
If you do one thing first · First action
Resolve the 3 Banned license finding(s) in License Compliance. Of all the actions in this report, it raises the score most for the work it takes: about 4.7 points for low effort, because it clears the 3 License Compliance findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 5.8 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 12% on every change. The history of the code shows how much it changes: about 622,596 lines over the last 90 days, which is about 2,524,973 lines a year. At that pace, the extra work comes to an estimated 347.1 to 2082.5 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.

arch @langfuse/ee ee @langfuse/shared shared @langfuse/ee->@langfuse/shared @repo/eslint-config eslint-config arbiteros-kernel arbiteros-kernel web web web->@langfuse/ee web->@langfuse/shared worker worker worker->@langfuse/shared

Architecture: which parts of the code depend on which

The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.

951 modules, with 507 dependencies between them. Every module uses only modules listed above it, so there are no loops.

The table shows the 40 modules with the most connections; 911 more are left out to keep it readable.

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 ArbiterOS-Kernel.arbiteros_kernel.policy2 ArbiterOS-Kernel.arbiteros_kernel.policy.policy3 ArbiterOS-Kernel.arbiteros_kernel.policy_check4 langfuse.packages.shared.src.errors.BaseError5 langfuse.packages.shared.src.server.queries.clickhouse-sql.clickhouse-filter6 langfuse.packages.shared.src.server.services.StorageService7 langfuse.packages.shared.src.tableDefinitions.types8 langfuse.packages.shared.src.types9 langfuse.web.src.components10 langfuse.web.src.components.layouts.app-layout.utils.navigationFilters11 langfuse.web.src.components.trace2.components12 langfuse.web.src.components.trace2.components.IOPreview13 langfuse.web.src.components.trace2.components.IOPreview.components.ViewModeToggle14 langfuse.web.src.components.trace2.components._shared15 langfuse.web.src.components.trace2.contexts16 langfuse.web.src.components.ui17 langfuse.web.src.components.ui.AdvancedJsonViewer.types18 langfuse.web.src.components.ui.AdvancedJsonViewer.utils.treeStructure19 langfuse.web.src.ee.features.billing.components.SpendAlerts20 langfuse.web.src.features.score-analytics.components.charts21 langfuse.web.src.features.score-analytics.hooks.useScoreAnalyticsQuery22 langfuse.web.src.hooks23 langfuse.web.src.utils.date-range-utils24 langfuse.worker.src.backgroundMigrations.IBackgroundMigration25 langfuse.worker.src.features.evaluation.observationEval26 langfuse.worker.src.services.IngestionService27 langfuse.worker.src.utils.PeriodicExclusiveRunner28 ArbiterOS-Kernel.arbiteros_kernel29 langfuse.packages.shared.src.server30 langfuse.packages.shared.src.server.repositories31 langfuse.web.src.components.table.data-table-toolbar32 langfuse.web.src.components.trace2.components.IOPreview.components33 langfuse.web.src.components.trace2.components.TraceLogView34 langfuse.web.src.components.trace2.lib35 langfuse.web.src.components.ui.AdvancedJsonViewer.components36 langfuse.web.src.components.ui.AdvancedJsonViewer.hooks37 langfuse.web.src.components.ui.AdvancedJsonViewer.utils38 langfuse.web.src.features.score-analytics.lib39 langfuse.worker.src.features.evaluation40 langfuse.web.src.components.table
1 ArbiterOS-Kernel.arbiteros_kernel.policy
2 ArbiterOS-Kernel.arbiteros_kernel.policy.policy
3 ArbiterOS-Kernel.arbiteros_kernel.policy_check
4 langfuse.packages.shared.src.errors.BaseError
5 langfuse.packages.shared.src.server.queries.clickhouse-sql.clickhouse-filter
6 langfuse.packages.shared.src.server.services.StorageService
7 langfuse.packages.shared.src.tableDefinitions.types
8 langfuse.packages.shared.src.types
9 langfuse.web.src.components
10 langfuse.web.src.components.layouts.app-layout.utils.navigationFilters
11 langfuse.web.src.components.trace2.components
12 langfuse.web.src.components.trace2.components.IOPreview
13 langfuse.web.src.components.trace2.components.IOPreview.components.ViewModeToggle
14 langfuse.web.src.components.trace2.components._shared
15 langfuse.web.src.components.trace2.contexts
16 langfuse.web.src.components.ui
17 langfuse.web.src.components.ui.AdvancedJsonViewer.types
18 langfuse.web.src.components.ui.AdvancedJsonViewer.utils.treeStructure
19 langfuse.web.src.ee.features.billing.components.SpendAlerts
20 langfuse.web.src.features.score-analytics.components.charts
21 langfuse.web.src.features.score-analytics.hooks.useScoreAnalyticsQuery
22 langfuse.web.src.hooks
23 langfuse.web.src.utils.date-range-utils
24 langfuse.worker.src.backgroundMigrations.IBackgroundMigration
25 langfuse.worker.src.features.evaluation.observationEval
26 langfuse.worker.src.services.IngestionService
27 langfuse.worker.src.utils.PeriodicExclusiveRunner
28 ArbiterOS-Kernel.arbiteros_kernel1
29 langfuse.packages.shared.src.server11
30 langfuse.packages.shared.src.server.repositories1126
31 langfuse.web.src.components.table.data-table-toolbar11
32 langfuse.web.src.components.trace2.components.IOPreview.components1
33 langfuse.web.src.components.trace2.components.TraceLogView2
34 langfuse.web.src.components.trace2.lib3
35 langfuse.web.src.components.ui.AdvancedJsonViewer.components2
36 langfuse.web.src.components.ui.AdvancedJsonViewer.hooks4
37 langfuse.web.src.components.ui.AdvancedJsonViewer.utils109
38 langfuse.web.src.features.score-analytics.lib21
39 langfuse.worker.src.features.evaluation11
40 langfuse.web.src.components.table1
Uses a module listed above itPart of a loopThe module itself
1 ArbiterOS-Kernel.arbiteros_kernel.policy2 ArbiterOS-Kernel.arbiteros_kernel.policy.policy3 ArbiterOS-Kernel.arbiteros_kernel.policy_check4 langfuse.packages.shared.src.errors.BaseError5 langfuse.packages.shared.src.server.queries.clickhouse-sql.clickhouse-filter6 langfuse.packages.shared.src.server.services.StorageService7 langfuse.packages.shared.src.tableDefinitions.types8 langfuse.packages.shared.src.types9 langfuse.web.src.components10 langfuse.web.src.components.layouts.app-layout.utils.navigationFilters11 langfuse.web.src.components.trace2.components12 langfuse.web.src.components.trace2.components.IOPreview13 langfuse.web.src.components.trace2.components.IOPreview.components.ViewModeToggle14 langfuse.web.src.components.trace2.components._shared15 langfuse.web.src.components.trace2.contexts16 langfuse.web.src.components.ui17 langfuse.web.src.components.ui.AdvancedJsonViewer.types18 langfuse.web.src.components.ui.AdvancedJsonViewer.utils.treeStructure19 langfuse.web.src.ee.features.billing.components.SpendAlerts20 langfuse.web.src.features.score-analytics.components.charts21 langfuse.web.src.features.score-analytics.hooks.useScoreAnalyticsQuery22 langfuse.web.src.hooks23 langfuse.web.src.utils.date-range-utils24 langfuse.worker.src.backgroundMigrations.IBackgroundMigration25 langfuse.worker.src.features.evaluation.observationEval26 langfuse.worker.src.services.IngestionService27 langfuse.worker.src.utils.PeriodicExclusiveRunner28 ArbiterOS-Kernel.arbiteros_kernel29 langfuse.packages.shared.src.server30 langfuse.packages.shared.src.server.repositories31 langfuse.web.src.components.table.data-table-toolbar32 langfuse.web.src.components.trace2.components.IOPreview.components33 langfuse.web.src.components.trace2.components.TraceLogView34 langfuse.web.src.components.trace2.lib35 langfuse.web.src.components.ui.AdvancedJsonViewer.components36 langfuse.web.src.components.ui.AdvancedJsonViewer.hooks37 langfuse.web.src.components.ui.AdvancedJsonViewer.utils38 langfuse.web.src.features.score-analytics.lib39 langfuse.worker.src.features.evaluation40 langfuse.web.src.components.tableArbiterOS-Kernel.arbiteros_kernel.policy1ArbiterOS-Kernel.arbiteros_kernel.policy.policy2ArbiterOS-Kernel.arbiteros_kernel.policy_check3langfuse.packages.shared.src.errors.BaseError4langfuse.packages.shared.src.server.queries.clickhouse-sql.clickhouse-filter5langfuse.packages.shared.src.server.services.StorageService6langfuse.packages.shared.src.tableDefinitions.types7langfuse.packages.shared.src.types8langfuse.web.src.components9langfuse.web.src.components.layouts.app-layout.utils.navigationFilters10langfuse.web.src.components.trace2.components11langfuse.web.src.components.trace2.components.IOPreview12langfuse.web.src.components.trace2.components.IOPreview.components.ViewModeToggle13langfuse.web.src.components.trace2.components._shared14langfuse.web.src.components.trace2.contexts15langfuse.web.src.components.ui16langfuse.web.src.components.ui.AdvancedJsonViewer.types17langfuse.web.src.components.ui.AdvancedJsonViewer.utils.treeStructure18langfuse.web.src.ee.features.billing.components.SpendAlerts19langfuse.web.src.features.score-analytics.components.charts20langfuse.web.src.features.score-analytics.hooks.useScoreAnalyticsQuery21langfuse.web.src.hooks22langfuse.web.src.utils.date-range-utils23langfuse.worker.src.backgroundMigrations.IBackgroundMigration24langfuse.worker.src.features.evaluation.observationEval25langfuse.worker.src.services.IngestionService26langfuse.worker.src.utils.PeriodicExclusiveRunner27ArbiterOS-Kernel.arbiteros_kernel28langfuse.packages.shared.src.server29langfuse.packages.shared.src.server.repositories30langfuse.web.src.components.table.data-table-toolbar31langfuse.web.src.components.trace2.components.IOPreview.components32langfuse.web.src.components.trace2.components.TraceLogView33langfuse.web.src.components.trace2.lib34langfuse.web.src.components.ui.AdvancedJsonViewer.components35langfuse.web.src.components.ui.AdvancedJsonViewer.hooks36langfuse.web.src.components.ui.AdvancedJsonViewer.utils37langfuse.web.src.features.score-analytics.lib38langfuse.worker.src.features.evaluation39langfuse.web.src.components.table401111126111232410921111+911 more modules (most-connected shown)

At a glance — Code Health · 43.4 · Weak · gated by D1, D2, R10, X5 ·

At a glance — Architecture · 38.7 · Weak · gated by D26, R9, AX7 ·

At a glance — Maturity · 69.0 · Adequate · gated by M2 ·

At a glance — Readiness · 26.6 · Weak · gated by D12, R8, P5, P7 ·

At a glance — Security · 57.3 · Adequate · gated by D28, D29, C1 ·

At a glance — Domain Modelling · 28.2 · Weak · gated by DM6 ·

At a glance — Accessibility · 47.8 · Weak · gated by AC4 ·

At a glance — Performance · 60.0 · 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:2025 — Software Supply Chain Failures191High / Critical
A05:2025 — Injection74High / Critical
A02:2025 — Security Misconfiguration33High / Critical
A07:2025 — Authentication Failures21High / Critical
A01:2025 — Broken Access Control2Medium

Roadmap

Top priorities: Resolve the 3 Banned license finding(s) in License Compliance; Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository); Resolve the 1 finding(s) in DR & Backup.

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

Do thisHelpsEffortDimension
Resolve the 3 Banned license finding(s) in License Compliance.+4.7 ptsLowLicense Compliance
Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).+4.4 ptsMediumDomain ↔ infrastructure boundary
Resolve the 3 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with REDACTED (3).+1.4 ptsLowProject Cohesion
Resolve the 1 finding(s) in DR & Backup.+2.7 ptsMediumDR & Backup
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.+2.7 ptsMediumDependency Hygiene
Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.+1.6 ptsMediumOutbound HTTP resilience
Break each cycle by extracting the shared piece into a module both sides can import.+1.3 ptsMediumCircular Imports
Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.+1.2 ptsMediumSlice cohesion

File quality

Per-file score 0–10 — a quality signature. Of 711 files carrying findings, judged against the Production bar: 1% slop · 52% mixed · 47% near-clean.

FileScoreBandWorst signal
REDACTED0.0SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.2SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.2SlopDependency Vulnerabilities: Critical CVE: REDACTED
REDACTED0.3SlopIaC & Container Security: High IaC: REDACTED
REDACTED2.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.2SlopStatic Analysis (SAST): High: REDACTED
REDACTED3.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.7SlopIaC & Container Security: High IaC: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.0MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.2MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.3MixedStatic Analysis (SAST): High: REDACTED
REDACTED4.4MixedSecrets (history): High secret: REDACTED
REDACTED4.8MixedSecrets (history): REDACTED: REDACTED
REDACTED4.8MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED4.9MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): Medium: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.3MixedStatic Analysis (SAST): Medium: REDACTED

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 — 230

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 — 2101

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 — 624

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

Could not be resolved — 5

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

This survey 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. All 86 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.9, the weighted average across measured dimensions.

Every figure here is one of two 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. 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.

What we checked — 86 dimensions across the health lenses
D1D2D3D4D5D6D10D11D12D13D14D15D16D17D19D21D24D26D27D28D29D30D31D32D34D35D43D44AC1AC2AC3AC4AC5AC6AX10AX3AX5AX6AX7C1C2C3C4DM6DM9GD1IC1M1M2M3M4P1P2P3P4P5P7P8PF3R1R10R11R2R3R4R6R7R8R9S1X1X12X16X17X19X2X21X23X24X25X28X29X3X30X4X5

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, 2932 of 2955 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 or a scanner, 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
Canine Code Analyzer 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

Every finding is locatable in findings.md. Run 01a1eb29-1c19-7b40-90d7-8204a17dc425.

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.

  • D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1,789 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 13 test source file(s) (.py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
  • D11 Test Reliability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Test reliability for the jest suite in langfuse/web/ was NOT MEASURED: the jest run in langfuse/web/ produced no per-test report (Error: Invalid environment variables). This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
  • D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares REDACTED, but the licence verdict published here was taken over its Python distribution dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
  • D15 Churn × Complexity Hotspots — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. A hotspot's complexity is meant to be the worst body its churn actually touched. For arbiteros_kernel/policy/relational_policy.py, REDACTED, REDACTED, arbiteros_kernel/policy_check.py, arbiteros_kernel/instruction_parsing/types.py, … that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
  • D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We 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 an ADMISSION gap, not an environment fault: it declares a published package (ArbiterOS-Kernel/pyproject.toml), but no published-package marker D22 reads admitted any project here. D22 DOES collect the public API of every language in this tree, and admits a project only when its manifest makes that ecosystem's publication act in a form the marker recognises — so what is missing is not a collector but an admission rule for the publication act this repository makes, if it makes one. The remedy is a better discriminator for that marker — not a collector, and no change to the scan image can close it. The marker's rules are measured to refuse applications, so one refused repository is the rule working as calibrated; several are the evidence that it is too strict. For npm the surface is what a published REDACTED's entry points (exports, main, module, types) export, followed through the source; an entry that names build output the tree does not commit (dist/, build/) is not followed back to source, because only a tsconfig outDir/rootDir pair states that mapping and a bundler's input lives in executable configuration this engine does not evaluate.
  • D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
  • D31 IaC & Container Security — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Checkov ran but its report could not be read (checkov produced no output — not a clean result). Every misconfiguration only checkov reports — most of its Terraform, CloudFormation, Bicep and Ansible policies — is absent from this card, so its absence here is not evidence those resources are configured correctly.
  • D32 Data Compliance (PII/GDPR) — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. `langfuse/packages/shared/src/domain/scores.ts`, `langfuse/packages/shared/src/server/repositories/events.ts`, `langfuse/packages/shared/src/server/repositories/observations.ts`, `langfuse/packages/shared/src/server/repositories/scores.ts`, `langfuse/packages/shared/src/server/repositories/traces.ts`, … (+8 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
  • AC2 Forms & labels — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 18 further occurrence(s) are not listed individually; the score already reflects all 58.
  • AX7 Slice cohesion — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 798 further occurrence(s) are not listed individually; the score already reflects all 838.
  • AXR1 Runtime accessibility — not measured this run — We 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. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 18 — an image could not be pulled) — clickhouse Pulling minio Pulling redis Pulling postgres Pulling minio Error Get "https://cgr.dev/v2/": Forbidden redis Error context canceled clickhouse Error context canceled postgres Error context canceled Error response from daemon: Get "https://cgr.dev/v2/": Forbidden; the earlier `compose pull` step reported: langfuse-web Skipped - No image to be pulled langfuse-worker Skipped - No image to be pulled clickhouse Pulling minio Pulling redis Pulling postgres Pulling minio Error Get "https://cgr.dev/v2/": Forbidden clickhouse Error context canceled postgres Error context canceled redis Error context canceled Error response from daemon: Get "https://cgr.dev/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped.
  • DM9 Scattered domain decisions — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Arm two tells a construction that PRODUCES a measurement from one that merely passes it along, and this repository's frontend does not compute that fact. A measurement built independently in two places would not appear above.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • P2 Observability — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 96 further occurrence(s) are not listed individually; the score already reflects all 136.
  • R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 1222 further occurrence(s) are not listed individually; the score already reflects all 1262.
  • R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 500 further occurrence(s) are not listed individually; the score already reflects all 540.
  • R3 Large Files — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 133 further occurrence(s) are not listed individually; the score already reflects all 173.
  • R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 803 further occurrence(s) are not listed individually; the score already reflects all 843.
  • R7 Dead Code — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 196 further occurrence(s) are not listed individually; the score already reflects all 236.
  • X10 Duplicated predicate — not measured this run — We 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. 158 further occurrence(s) are not listed individually; the score already reflects all 198.
  • X27 Collection changed while being enumerated — not measured this run — We 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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
  • X3 Exception handling — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 101 further occurrence(s) are not listed individually; the score already reflects all 141.
  • X4 Structured logging — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 92 further occurrence(s) are not listed individually; the score already reflects all 132.
  • X7 Silent fallback defaults — not measured this run — We 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. 3 further occurrence(s) are not listed individually; the score already reflects all 43.

Repo exclusion declarations: 2 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

We assess the repository exactly as committed, and only the repository. By design we do 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.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • 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.
  • D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
  • D11 Test Reliability: Flakiness is inferred from history/markers — we run the suite once (for coverage), not the repeated runs under varied conditions that reveal nondeterminism, so a flaky test never recorded as failing is invisible here.
  • 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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
  • D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
  • 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 REDACTED, 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.
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
  • 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 REDACTED (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.
  • AC1 Text alternatives: Alt-text is detected structurally — the scan sees that an alternative EXISTS, not whether it meaningfully describes the image, and decorative-vs-missing is judged by attribute shape; runtime-injected images and a non-role=img decorative svg are out of scope. This is accessibility readiness, never a WCAG conformance claim.
  • AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
  • AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
  • AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
  • AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
  • AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
  • 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.
  • C3 Audit Trail: This control is scored from in-repo evidence only — a working control configured outside the repository leaves no signal a static scan can credit.
  • C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
  • DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
  • M4 Documentation accuracy: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • 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".
  • P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.

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

390 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was EventsTable.ObservationsEventsTable at 199. A further 7 method(s) were over the threshold but excluded as flat dispatchers (a long switch/match over independent cases: many branches, almost no nesting), the largest being getQueue.getQueue at 33 — they are counted neither in the figure above nor in this dimension's score. 7 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: langfuse/packages/shared/src/server/redis/getQueue.ts (getQueue.getQueue at 33), langfuse/web/src/features/public-api/server/RateLimitService.ts (RateLimitService.getPlanBasedRateLimitConfig at 33), langfuse/packages/shared/src/server/clickhouse/schemaUtils.ts (schemaUtils.getClickhouseEntityType at 20), langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx (TraceGraphCanvas.TraceGraphCanvas::getNodeStyle at 19), langfuse/web/src/features/score-analytics/components/charts/MetricCard.tsx (MetricCard.MetricCard at 18), and 2 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.

EventsTable.ObservationsEventsTable (cyclomatic 199)langfuse/web/src/features/events/components/EventsTable.tsx:315
observations.ObservationsTable (cyclomatic 177)langfuse/web/src/components/table/use-cases/observations.tsx:280
WidgetForm.WidgetForm (cyclomatic 173)langfuse/web/src/features/widgets/components/WidgetForm.tsx:156
buildGraphCanvasData.buildGraphFromStepData (cyclomatic 136)langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:111
MyCustomHandler.async_post_call_success_hook (cyclomatic 116)REDACTED:6313

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

What to do

  1. Bring the 25 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with EventsTable.ObservationsEventsTable (cyclomatic 199), observations.ObservationsTable (cyclomatic 177), WidgetForm.WidgetForm (cyclomatic 173). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 25 together lifts Cyclomatic Complexity from 2.0 to about 3.7/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

506 method(s) exceeded the cognitive complexity threshold of 15; the worst was MyCustomHandler.async_post_call_success_hook at 245.

router.extractFirstJsonObject (cognitive 29) · ×2langfuse/web/src/features/error-analysis/server/router.ts:67
MyCustomHandler.async_post_call_success_hook (cognitive 245)REDACTED:6313
index.ExperienceSummaryPage (cognitive 238)langfuse/web/src/pages/project/[projectId]/experience/index.tsx:113
buildGraphCanvasData.buildGraphFromStepData (cognitive 227)langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:111
EventsTable.ObservationsEventsTable (cognitive 203)langfuse/web/src/features/events/components/EventsTable.tsx:315

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

What to do

  1. Bring the 43 bodies over 60 down to 60 or less in Cognitive Complexity — start with MyCustomHandler.async_post_call_success_hook (cognitive 245), index.ExperienceSummaryPage (cognitive 238), buildGraphCanvasData.buildGraphFromStepData (cognitive 227). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 43 together lifts Cognitive Complexity from 2.0 to about 3.2/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.

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

D3 · God Classes5.4 / 10Adequate✓ 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 5.4 / 10 · rule-coverage 100% · ceiling Prevented

438 god class(es) detected.

FunctionTooLong: observations.ObservationsTable · ×308langfuse/web/src/components/table/use-cases/observations.tsx:280
FileTooLong: REDACTED · ×85REDACTED
ClassTooLong: BillingService · ×25REDACTED:67
MethodTooLong: BillingService.changePlan · ×16REDACTED:779
TooManyMethods: PolicyEngine · ×4ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:305

What to do

  1. Resolve the 308 FunctionTooLong finding(s) in God Classes — start with index.tsx (13), REDACTED (5), buildGraphCanvasData.ts (3). — One of this dimension's main actionable groups (308 warning-level).
  2. Resolve the 85 FileTooLong finding(s) in God Classes — start with router.ts (5), index.tsx (3), REDACTED (2). — One of this dimension's main actionable groups (85 warning-level).
  3. Resolve the 25 ClassTooLong finding(s) in God Classes — start with REDACTED, WidgetForm.tsx, REDACTED. — One of this dimension's main actionable groups (25 warning-level).

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

D4 · Code Duplication9.7 / 10Stronggated by 121 serious findings✓ Tool-verified

What it measures: How much of the production code is copy-pasted: the share of production lines inside a reported copy (every copy of a duplicated block or of an edited member, each line once), 10 at none and 0 at a quarter of the lines.

Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), scored on the share of production lines inside a reported copy (each line once; 10 at none, 0 at a quarter). Deterministic.

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

78 duplicated block group(s) detected. 0.8 % of the production lines (2,862 of 360,486) are in a reported copy. A further 43 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. Measured on part of this repository only: .ts, .tsx (93% of production source) was not exposed to THIS dimension's token comparison and is not in this count; duplication there is measured by R10 Code Duplication, the frontend lens's card running the same clone algorithm over the JS/TS token stream.

Duplicated block (9 lines × 2) · ×7ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_trigger.py:318
Duplicated block (12 lines × 2) · ×6ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:133
Duplicated block (10 lines × 2) · ×6ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:467
Duplicated block (8 lines × 2) · ×6REDACTED:1073
Edited copy of a member (8 corresponding lines) · ×4REDACTED:240

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

What to do

  1. Resolve the 7 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with langfuse_replay.py (2), alignment_trigger.py, delete_policy.py. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 6 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with policy_engine_bat.py (2), langfuse_replay.py, allow_deny_policy.py. — One of this dimension's main actionable groups (6 warning-level).
  3. Resolve the 6 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with policy_engine_bat.py (2), bash.py, relational_policy.py. — One of this dimension's main actionable groups (6 warning-level).

Detailed fixes: d4_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

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

Off the main sequence: @langfuse/shared

✓ On the Gold path — maintain.

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

D6 · Cohesion (LCOM4)9.5 / 10Stronggated by 2 serious findings✓ 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 9.5 / 10 · rule-coverage 100% · ceiling Verified

2 of 50 classes have LCOM4 above 3.

Low cohesion: DataGenerator (LCOM4 5) · ×2langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:48

What to do

  1. Resolve the 2 Low cohesion finding(s) in Cohesion (LCOM4) — start with data-generators.ts, SlackService.ts. — One of this dimension's main actionable groups (2 warning-level).

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

D10 · Test Quality9.9 / 10Stronggated by 7 serious findings✓ 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 9.9 / 10 · rule-coverage 100% · ceiling Prevented

3 skipped, 2 zero-assertion, 2 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1789 tests. Measured on the JavaScript/TypeScript suite only — at least 13 test source file(s) (.py) went unread, so its test quality is unmeasured and is not in these counts.

Skipped test: extracts tools from OTel metadata attributes · ×3langfuse/worker/src/__tests__/extractToolsBackend.test.ts:62
No assertions: performance summary · ×2langfuse/web/src/__tests__/json-utils.clienttest.ts:632
Fixed-sleep synchronisation: handle no matching queue worker · ×2langfuse/worker/src/__tests__/redisConsumer.test.ts:48
Mock-dominated test: should report wait time and processing time metrics correctly · ×11langfuse/worker/src/services/ClickhouseWriter/ClickhouseWriter.unit.test.ts:262

What to do

  1. Resolve the 3 Skipped test finding(s) in Test Quality — start with extractToolsBackend.test.ts (3). — One of this dimension's main actionable groups (3 warning-level).
  2. Resolve the 2 No assertions finding(s) in Test Quality — start with json-utils.clienttest.ts, promptCache.servertest.ts. — One of this dimension's main actionable groups (2 warning-level).
  3. Resolve the 2 Fixed-sleep synchronisation finding(s) in Test Quality — start with redisConsumer.test.ts, rate-limit.servertest.ts. — One of this dimension's main actionable groups (2 warning-level).

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

D11 · Test Reliability10.0 / 10Exemplary✓ Tool-verified

What it measures: Whether the tests pass reliably, with no flakiness.

Method: Suite re-run N times within tiered wall-clock budgets (unit to e2e); tests failing non-deterministically across runs flagged; guarded tests retried when #if guards detected.

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

0 flaky across 1 measured tier(s). JavaScript/TypeScript (jest via `pnpm install --frozen-lockfile --ignore-scripts` in langfuse/web/; vitest via `pnpm install --frozen-lockfile --ignore-scripts` in langfuse/worker/ (48 tests)): measured (0 flaky).

✓ On the Gold path — maintain.

Detailed fixes: d11_recommendation.md.

D12 · Dependency Hygiene9.7 0.5 / 10Critical✓ Tool-verified

What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.

Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.

Maturity: Documented → Verified → Prevented · effective 0.5 / 10 · rule-coverage 5% · ceiling Verified

6 outdated, 0 yanked pinned Python distributions. 8 of 172 shipped distributions were graded against pypi.org (0 not published there, 164 declared without an exact pin, which installs the newest release the declaration admits and so cannot be behind one). Only EXACT pins are graded for currency: a floor or a range already installs the newest release it admits, so reporting one would report this repository for being current. Whether a deliberate upper cap has itself gone stale is a different and weaker question, and is not asked. Whether any distribution is UNMAINTAINED is not graded — PyPI publishes no maintenance status, and release age does not stand in for one. Lockfiles are not read (poetry.lock, REDACTED, Pipfile.lock, pdm.lock), so a lock-resolved install is outside this verdict. Known CVEs in this dependency graph are D30's question.

Outdated: cisco-ai-skill-scanner · ×6

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

D13 · REDACTED Scanning10.0 / 10Exemplary○ Nothing flagged

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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

REDACTED scan ran and found no leaked secrets. 2 detection(s) on lines whose every credible literal is a keyboard-row or short-ascending-run composition (`1234567890abcdef`) were excluded — a value a hand typed for a documentation example was never minted, and there is no issuer at which it could be revoked.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance4.0 / 10Weak✓ 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 4.0 / 10 · rule-coverage 100% · ceiling Verified

3 of 218 shipped Python distribution(s) use a banned license. Licences were resolved from PyPI over the distributions a consumer installs — this repository's 172 declared runtime requirement(s) closed transitively over each distribution's published `requires_dist` (46 reached that way). Requirements it states ONLY under an extra, a PEP 735 dependency group, a Poetry dev group or a dev-named requirements file are excluded: pip does not install any of them for a consumer. ★ This repository commits no dependency lockfile that this pass reads, so each licence is the one PyPI publishes for the distribution's CURRENT release rather than for a pinned version. 18 of them publish no licence on PyPI this pass can read; that is missing data, not a violation, and none of them is charged. ★ COVERAGE OF THIS VERDICT: it grades this repository's Python distribution dependencies and nothing else. The repository also declares REDACTED, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.

Banned license: psycopg · ×3

What to do

  1. Resolve the 3 Banned license finding(s) in License Compliance. — One of this dimension's main actionable groups (3 issue-level).

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

D15 · Churn × Complexity Hotspots7.6 / 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 7.6 / 10 · rule-coverage 100% · ceiling Documented

Top hotspots: REDACTED (18×116=2088); REDACTED (13×116=1508); arbiteros_kernel/instruction_parsing/types.py (15×28=420)

Hotspot: REDACTED · ×17REDACTED:6313

What to do

  1. Resolve the 17 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (2), REDACTED (2), policy_check.py (2). — One of this dimension's main actionable groups (17 warning-level).

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

D16 · Bus Factor9.8 / 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.8 / 10 · rule-coverage 100% · ceiling Documented

12 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is REDACTED. Counted over 1052 of the 1924 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 Debt10.0 / 10Stronggated by 74 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 10.0 / 10 · rule-coverage 100% · ceiling Prevented

74 deducted task-comment markers across 359574 LoC (0.0/KLoC) → score 10.0. 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 · ×73langfuse/worker/src/services/ClickhouseWriter/index.ts:428
HackCommentlangfuse/web/src/features/slack/server/oauth-handlers.ts:38

What to do

  1. Resolve the 73 TodoComment finding(s) in Explicit Debt — start with events.ts (5), extractToolsBackend.test.ts (3), models.ts (3). — One of this dimension's main actionable groups (73 warning-level).
  2. Resolve the 1 HackComment finding(s) in Explicit Debt — start with oauth-handlers.ts. — One of this dimension's main actionable groups (1 warning-level).

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

D19 · Documentation Quality10.0 / 10Exemplary○ Nothing flagged

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

Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.

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

2 of 2 documentation facets pass in full. 46 document(s) read across 9 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D21 · Naming Consistency2.9 / 10Weak✓ Tool-verified

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

Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.

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

4 naming inconsistencies among 56 declarations measured against a convention their peers follow.

`parseMetadataCHRecordToDomain` spells `CH` where 14 names in the project spell it `Ch`langfuse/packages/shared/src/server/utils/metadata_conversion.ts:4
`PutLlmConnectionV1Body` spells `Llm` where 22 names in the project spell it `LLM`langfuse/web/src/features/public-api/types/llm-connections.ts:56
`transformDbLlmConnectionToAPI` spells `Llm` where 22 names in the project spell it `LLM`langfuse/web/src/features/public-api/types/llm-connections.ts:107
`bulkUpdateOrganizationsRawSQL` spells `SQL` where 16 names in the project spell it `Sql`REDACTED:146

What to do

  1. Resolve the 1 `parseMetadataCHRecordToDomain` spells `CH` where 14 names in the… finding(s) in Naming Consistency — start with metadata_conversion.ts. — One of this dimension's main actionable groups (1 recommendation-level).
  2. Resolve the 1 `PutLlmConnectionV1Body` spells `Llm` where 22 names in the project… finding(s) in Naming Consistency — start with llm-connections.ts. — One of this dimension's main actionable groups (1 recommendation-level).
  3. Resolve the 1 `transformDbLlmConnectionToAPI` spells `Llm` where 22 names in the… finding(s) in Naming Consistency — start with llm-connections.ts. — One of this dimension's main actionable groups (1 recommendation-level).

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

D24 · Comment Value5.1 5.0 / 10Weak✓ Tool-verified

What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).

Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.

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

539 of 11023 judged comments only repeat the code they sit on (4.9 %). 434 comment(s) in another language or script were not judged.

redundant comment · ×384langfuse/packages/shared/scripts/seeder/seed-media.ts:104
doc comments repeat the names · ×3langfuse/packages/shared/src/server/ingestion/processEventBatch.ts:85

What to do

  1. Resolve the 384 redundant comment finding(s) in Comment Value — start with REDACTED (20), index.tsx (10), score-configs.ts (6). — One of this dimension's main actionable groups (384 recommendation-level).

Detailed fixes: d24_recommendation.md · top locations in Appendix A, every location in findings.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.

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

3 of 4 build units (Python, npm) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion · ×3REDACTED:1

What to do

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

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

D27 · Navigability9.9 / 10Exemplary✓ 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. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.

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

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

51 % of calls cross a namespace and 0 % go through an interface, but 95 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: small — navigation cost is tolerated.

✓ On the Gold path — maintain.

Detailed fixes: d27_recommendation.md.

D28 · Secrets (history)0.0 / 10Critical✓ 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 0.0 / 10 · rule-coverage 100% · ceiling Documented

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

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 15 High secret finding(s) in Secrets (history) — start with REDACTED (15). — One of this dimension's main actionable groups (15 issue-level).
  2. Resolve the 5 REDACTED finding(s) in Secrets (history) — start with REDACTED (4), REDACTED. — One of this dimension's main actionable groups (5 issue-level).
  3. 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.0 / 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.0 / 10 · rule-coverage 100% · ceiling Documented

74 finding(s): 0 critical, 19 high, 48 medium, 7 low. semgrep hit a parse error in 25 file(s) — `REDACTED`, `install.sh` (lines 38–332), `langfuse/packages/shared/src/domain/scores.ts` (line 113), `langfuse/packages/shared/src/server/repositories/events.ts` (line 3012), `langfuse/packages/shared/src/server/repositories/observations.ts` (line 1919), … (+20 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 3 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

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

What to do

  1. Resolve the 6 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (2). — One of this dimension's main actionable groups (6 issue-level).
  2. Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
  3. Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).

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. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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

191 finding(s): 31 critical, 91 high, 60 medium, 9 low.

REDACTED
REDACTED
REDACTED
REDACTED
REDACTED

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

What to do

  1. Resolve the 88 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (58), REDACTED (15), REDACTED (14). — One of this dimension's main actionable groups (88 issue-level).
  2. Resolve the 27 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (15), REDACTED (6), REDACTED (6). — One of this dimension's main actionable groups (27 issue-level).
  3. Resolve the 4 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).

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

D31 · IaC & Container Security4.2 / 10Weak✓ Tool-verified

What it measures: Whether Dockerfiles / Terraform / Kubernetes config follow security best practices.

Method: IaC/container misconfiguration scan via trivy config (REDACTED/Terraform/K8s/Helm/CloudFormation); severity rules to 0-10 moderate normalizer. NotApplicable without manifests. Exhaustive, deterministic.

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

33 finding(s): 0 critical, 13 high, 13 medium, 7 low.

REDACTED
REDACTED
REDACTED

What to do

  1. Resolve the 13 High IaC finding(s) in IaC & Container Security — start with REDACTED (7), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (13 issue-level).
  2. Resolve the 13 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (7), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (13 warning-level).
  3. Resolve the 7 Low IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (7 recommendation-level).

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

D32 · Data Compliance (PII/GDPR)8.1 / 10Strong✓ Tool-verified

What it measures: Likely personal-data (PII / GDPR) handling concerns — logging or storing data without safeguards.

Method: Heuristic PII/GDPR LEAK scan via semgrep across the repo, using our own ruleset: personal data crossing a boundary it should not — reaching a log/console sink, a URL or query string, or unprotected browser storage. Matches map to severity and a 0-10 wide normalizer. A clean sweep is unscored rather than an unearned 10, and is a statement about the leak paths checked only — this dimension does not inventory the personal data a repository holds (the personal-data map and the C1-C5 compliance cards do that), so it never reports that a repository has no personal-data surface. Reported LOUDLY as a measurement gap if the ruleset is missing from the analyzer image. Exhaustive over the leak paths, advisory-leaning; degrades on parse failure.

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

2 finding(s): 0 critical, 0 high, 2 medium, 0 low. semgrep could not parse 13 file(s) — `langfuse/packages/shared/src/domain/scores.ts`, `langfuse/packages/shared/src/server/repositories/events.ts`, `langfuse/packages/shared/src/server/repositories/observations.ts`, `langfuse/packages/shared/src/server/repositories/scores.ts`, `langfuse/packages/shared/src/server/repositories/traces.ts`, … (+8 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.

REDACTED

What to do

  1. Resolve the 2 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).

Detailed fixes: d32_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 1052 of the 1924 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 Coupling10.0 / 10Exemplary✓ 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 10.0 / 10 · rule-coverage 100% · ceiling Documented

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_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. Reported 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. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.

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 5 platform declaration(s) and 172 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.

AC1 · Text alternatives5.0 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether non-text content carries a text alternative — img/area/input[type=image] have alt, a meaningful svg has a title or aria-label, video has a captions track, and object/embed/canvas have a name or fallback content. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: every img/area/input[type=image] checked for alt, svg[role=img] for a title/aria-label, video for a captions <track>. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: image/media elements — img, area, input[type=image], svg, video, object, embed, canvas — across the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and dynamic-attribute elements are skipped. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is NOT read by any producer, so it contributes no element to this population; where such a frontend is present the card discloses it as an analyzer gap rather than scoring around it.

  • Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). (×2) — langfuse/web/src/components/ui/AdvancedJsonViewer/components/MediaButtonGroup.tsx:46, langfuse/web/src/components/ui/LangfuseMediaView.tsx:161

What to do

  • Add a text alternative — alt on images (alt="" for purely decorative ones), a title or aria-label on meaningful svg, an aria-label or inner fallback content on canvas, and a captions <track> on video.
AC2 · Forms & labels4.5 / 10Weak✓ Tool-verified

Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.

Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×10) — langfuse/web/src/components/ModelParameters/index.tsx:231, langfuse/web/src/components/ModelParameters/index.tsx:347, langfuse/web/src/components/ModelParameters/index.tsx:396, …
  • This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×9) — langfuse/web/src/components/ModelParameters/index.tsx:497, langfuse/web/src/components/date-picker.tsx:79, langfuse/web/src/components/date-picker.tsx:238, …
  • This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it. (×12) — langfuse/web/src/components/PagedSettingsContainer.tsx:54, langfuse/web/src/components/date-range-dropdowns.tsx:52, langfuse/web/src/components/projectNavigation.tsx:29, …
  • This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label. (×2) — langfuse/web/src/components/layouts/breadcrumb.tsx:153, langfuse/web/src/components/layouts/breadcrumb.tsx:240
  • This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed. (×2) — langfuse/web/src/components/table/data-table-ai-filters.tsx:117, langfuse/web/src/features/filters/components/filter-builder.tsx:545
  • A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one. — langfuse/web/src/components/table/data-table-controls.tsx:556
  • A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one). (×3) — langfuse/web/src/components/trace2/components/IOPreview/components/CorrectedOutputField.tsx:182, langfuse/web/src/components/trace2/components/TraceTimeline/TimelineRow.tsx:72, langfuse/web/src/features/datasets/components/MappingCard.tsx:134
  • This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id. — langfuse/web/src/features/datasets/components/DatasetItemField.tsx:58

What to do

  • Give every control a programmatic label (a <label for> / wrapping <label> / aria-label) and every button text — a placeholder is not a label.
AC3 · Page structure7.4 / 10Strong✓ Tool-verified

Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.

Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>. — langfuse/web/src/app/layout.tsx:12
  • A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope). — langfuse/web/src/features/filters/components/filter-builder.tsx:598

What to do

  • Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
AC4 · Keyboard semantics2.2 / 10Critical✓ Tool-verified

Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.

Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".

  • A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler. (×18) — langfuse/web/src/components/EnvLabel.tsx:14, langfuse/web/src/components/date-picker.tsx:508, langfuse/web/src/components/date-picker.tsx:525, …
  • This <div> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler. — langfuse/web/src/components/onboarding/DatasetItemsOnboarding.tsx:43
  • A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}. (×2) — langfuse/web/src/components/table/data-table-controls.tsx:1524, langfuse/web/src/features/scores/components/multi-select-key-values.tsx:229
  • This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it. — langfuse/web/src/features/prompts/components/prompt-history.tsx:109
  • This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. (×4) — langfuse/web/src/features/score-analytics/components/charts/HeatmapCell.tsx:125, langfuse/web/src/features/score-analytics/components/charts/HeatmapLegend.tsx:71, langfuse/web/src/features/score-analytics/components/charts/HeatmapLegend.tsx:101, …

What to do

  • Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
AC5 · ARIA correctness10.0 / 10Exemplary○ Nothing flagged

Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.

Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.

Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

AC6 · Visual & motion safety6.3 / 10Adequate✓ Tool-verified

Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.

Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.

Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.

  • This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. (×2) — langfuse/web/src/components/table/data-table-ai-filters.tsx:149, langfuse/web/src/features/filters/components/filter-builder.tsx:586
  • <span> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — langfuse/web/src/components/table/peek.tsx:112
  • <span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — langfuse/web/src/components/trace2/components/_layout/TracePanelNavigationButton.tsx:42, langfuse/web/src/features/cloud-status-notification/components/CloudStatusMenu.tsx:39
  • <button> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — langfuse/web/src/components/ui/AdvancedJsonViewer/components/ExpandButton.tsx:36
  • <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — langfuse/web/src/components/ui/AdvancedJsonViewer/components/SearchBar.tsx:96
  • <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). (×2) — langfuse/web/src/features/dashboard/components/TabsComponent.tsx:21, langfuse/web/src/pages/project/[projectId]/users/[userId].tsx:133
  • <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2). — langfuse/web/src/features/evals/components/template-selector.tsx:181
  • <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. (×2) — langfuse/web/src/features/slack/components/SlackConnectionCard.tsx:95, langfuse/web/src/features/slack/components/SlackTestMessageButton.tsx:107

What to do

  • Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
AX10 · Code composition4.0 / 10Weak✓ 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.

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.

AX5 · Architecture & structure10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.

Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.

AX6 · Interface segregation10.0 / 10Exemplary✓ Tool-verified

Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').

Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.

AX7 · Slice cohesion1.0 / 10Critical✓ Tool-verified

Other · Architecture — Whether feature slices stay independent (no direct cross-slice references) — the discipline that makes vertical-slice architecture pay off.

Method: Roslyn scan (vertical-slice gated): feature slices resolved from namespaces (.Features.*, .Slices.*) or project names; cross-slice type references detected. Deterministic, traceable.

  • `DatasetNameSchema` (slice 'datasets') depends on `withFolderPathValidation` from slice 'folders'. — langfuse/packages/shared/src/features/datasets/validation.ts:7
  • `PromptNameSchema` (slice 'prompts') depends on `withFolderPathValidation` from slice 'folders'. — langfuse/packages/shared/src/features/prompts/validation.ts:12
  • `AnnotationQueueItemPage` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemPage.tsx:34
  • `QueueItemTableMultiSelectAction` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx:53
  • `AnnotationQueueItemsTable` (slice 'annotation-queues') depends on `useColumnVisibility` from slice 'column-visibility'. — langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx:411
  • `AnnotationQueueItemsTable` (slice 'annotation-queues') depends on `useColumnOrder` from slice 'column-visibility'. — langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx:416
  • `AnnotationQueuesItem` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/components/AnnotationQueuesItem.tsx:26
  • `AnnotationQueuesTable` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/components/AnnotationQueuesTable.tsx:58
  • `AnnotationQueuesTable` (slice 'annotation-queues') depends on `getScoreDataTypeIcon` from slice 'scores'. — langfuse/web/src/features/annotation-queues/components/AnnotationQueuesTable.tsx:135
  • `AnnotationQueuesTable` (slice 'annotation-queues') depends on `useColumnVisibility` from slice 'column-visibility'. — langfuse/web/src/features/annotation-queues/components/AnnotationQueuesTable.tsx:223
  • `AnnotationQueuesTable` (slice 'annotation-queues') depends on `useColumnOrder` from slice 'column-visibility'. — langfuse/web/src/features/annotation-queues/components/AnnotationQueuesTable.tsx:228
  • `CreateNewAnnotationQueueItem` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/components/CreateNewAnnotationQueueItem.tsx:35
  • `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:64
  • `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `useEntitlementLimit` from slice 'entitlements'. — langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:72
  • `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `usePostHogClientCapture` from slice 'posthog-analytics'. — langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:74
  • `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `showErrorToast` from slice 'notifications'. — langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:190
  • `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `MultiSelectKeyValues` from slice 'scores'. — langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:299
  • `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `getScoreDataTypeIcon` from slice 'scores'. — langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:309
  • `DeleteAnnotationQueueButton` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/components/DeleteAnnotationQueueButton.tsx:26
  • `UserAssignmentSection` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/components/UserAssignmentSection.tsx:25
  • `UserAssignmentSection` (slice 'annotation-queues') depends on `showSuccessToast` from slice 'notifications'. — langfuse/web/src/features/annotation-queues/components/UserAssignmentSection.tsx:47
  • `TraceAnnotationProcessor` (slice 'annotation-queues') depends on `useIsAuthenticatedAndProjectMember` from slice 'auth'. — langfuse/web/src/features/annotation-queues/components/processors/TraceAnnotationProcessor.tsx:41
  • `AnnotationDrawerSectionProps` (slice 'annotation-queues') depends on `ScoreTarget` from slice 'scores'. — langfuse/web/src/features/annotation-queues/components/shared/AnnotationDrawerSection.tsx:19
  • `AnnotationDrawerSection` (slice 'annotation-queues') depends on `AnnotationForm` from slice 'scores'. — langfuse/web/src/features/annotation-queues/components/shared/AnnotationDrawerSection.tsx:38
  • `CommentsSection` (slice 'annotation-queues') depends on `CommentList` from slice 'comments'. — langfuse/web/src/features/annotation-queues/components/shared/CommentsSection.tsx:18
  • `useSelectedUsers` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/hooks/useSelectedUsers.ts:13
  • `QueueItems` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/pages/AnnotationQueueItems.tsx:33
  • `QueueItems` (slice 'annotation-queues') depends on `getScoreDataTypeIcon` from slice 'scores'. — langfuse/web/src/features/annotation-queues/pages/AnnotationQueueItems.tsx:104
  • `AnnotationQueues` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/pages/AnnotationQueues.tsx:13
  • `queueAssignmentRouter` (slice 'annotation-queues') depends on `throwIfNoProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/server/annotationQueueAssignmentsRouter.ts:26
  • `queueAssignmentRouter` (slice 'annotation-queues') depends on `auditLog` from slice 'audit-logs'. — langfuse/web/src/features/annotation-queues/server/annotationQueueAssignmentsRouter.ts:79
  • `queueItemRouter` (slice 'annotation-queues') depends on `throwIfNoProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/server/annotationQueueItemsRouter.ts:91
  • `queueItemRouter` (slice 'annotation-queues') depends on `createBatchActionJob` from slice 'table'. — langfuse/web/src/features/annotation-queues/server/annotationQueueItemsRouter.ts:281
  • `queueItemRouter` (slice 'annotation-queues') depends on `auditLog` from slice 'audit-logs'. — langfuse/web/src/features/annotation-queues/server/annotationQueueItemsRouter.ts:313
  • `queueRouter` (slice 'annotation-queues') depends on `throwIfNoProjectAccess` from slice 'rbac'. — langfuse/web/src/features/annotation-queues/server/annotationQueuesRouter.ts:28
  • `queueRouter` (slice 'annotation-queues') depends on `auditLog` from slice 'audit-logs'. — langfuse/web/src/features/annotation-queues/server/annotationQueuesRouter.ts:352
  • `RequestResetPasswordEmailButton` (slice 'auth-credentials') depends on `usePostHogClientCapture` from slice 'posthog-analytics'. — REDACTED:24
  • `resetPasswordSchema` (slice 'auth-credentials') depends on `passwordSchema` from slice 'auth'. — langfuse/web/src/features/auth-credentials/components/ResetPasswordPage.tsx:33
  • `ResetPasswordPage` (slice 'auth-credentials') depends on `usePostHogClientCapture` from slice 'posthog-analytics'. — langfuse/web/src/features/auth-credentials/components/ResetPasswordPage.tsx:53
  • `createUserEmailPassword` (slice 'auth-credentials') depends on `createProjectMembershipsOnSignup` from slice 'auth'. — langfuse/web/src/features/auth-credentials/lib/credentialsServerUtils.ts:45

What to do

  • Keep slices independent: share cross-slice needs via an explicit contract/shared-kernel, not direct references between slices.
C1 · Data Protection3.5 / 10Weak✓ Tool-verified

Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.

Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.

What to do

  • Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, Azure Key Vault, GCP KMS / REDACTED Manager, HashiCorp Vault) and encrypt the most sensitive columns (typeorm-encrypted, prisma-field-encryption, mongoose-field-encryption or MongoDB CSFLE) — partial coverage still leaves gaps.
  • Enforce HTTPS (serve through https.createServer / NestJS httpsOptions, or redirect plain HTTP with express-sslify behind your TLS terminator) so data in transit is always encrypted.
C2 · Access Controls7.0 / 10Strong✓ Tool-verified

Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.

Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.

  • Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect. — langfuse/packages/shared/src/server/ingestion/processEventBatch.ts:148

What to do

  • Name the access rules — roles/permissions declared once (a @Roles/@Permissions decorator with its guard, a CASL ability, a casbin model, or Supabase CREATE POLICY) and consulted where access is checked, so the rule set is reviewable and testable on its own.
C3 · Audit Trail7.5 / 10Strong✓ Tool-verified

Other · Security — Whether changes to sensitive data are recorded (who, what, when) for compliance + incident response.

Method: Roslyn scan: audit-trail mechanism graded (SaveChanges interceptor/immutable AuditLog/[Audited] strong; bare IAuditable/AddAuditing weak). Deterministic.

  • An audit mechanism is present, but the trail is not yet complete — missing: an ORM write hook every change flows through (a TypeORM/MikroORM subscriber, a Sequelize or Mongoose hook, Prisma middleware or a query extension, or an event-store append), per-model coverage (@Audited, or a change-history plugin such as mongoose-history or sequelize-paper-trail applied to each model).

What to do

  • Back the audit convention with a structural mechanism: an ORM write hook (a TypeORM/MikroORM subscriber, a Sequelize or Mongoose hook, Prisma middleware) writing every sensitive change to an audit-log table, and apply it to each model that needs a who-changed-what trail.
C4 · Data Retention10.0 / 10Exemplary✓ Tool-verified

Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).

Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.

DM6 · Domain ↔ infrastructure boundary2.8 / 10Weak✓ Tool-verified

Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (TypeORM/Prisma/MikroORM/Sequelize/Mongoose) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.

Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.

Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.

  • `langfuse/packages/shared/src/domain/automations.ts` (domain layer) depends on `@prisma/client` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — langfuse/packages/shared/src/domain/automations.ts:1
  • `langfuse/packages/shared/src/domain/dataset-items.ts` (domain layer) depends on `../db` (import of `langfuse/packages/shared/src/db.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — langfuse/packages/shared/src/domain/dataset-items.ts:1
  • `langfuse/packages/shared/src/domain/dataset-run-items.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — langfuse/packages/shared/src/domain/dataset-run-items.ts:2
  • `langfuse/packages/shared/src/domain/observations.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — langfuse/packages/shared/src/domain/observations.ts:2
  • `langfuse/packages/shared/src/domain/prompts.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — langfuse/packages/shared/src/domain/prompts.ts:2
  • `langfuse/packages/shared/src/domain/traces.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — langfuse/packages/shared/src/domain/traces.ts:2
  • `langfuse/packages/shared/src/domain/webhooks.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it. — langfuse/packages/shared/src/domain/webhooks.ts:2

What to do

  • Keep the ORM/table mapping on a boundary data-model + mapper; leave the domain entity framework-free (map row↔domain through a repository).
DM9 · Scattered domain decisions9.2 / 10Exemplary✓ Tool-verified

Other · Domain Modelling — Whether one domain rule is decided — or one measurement produced — in more than one place, rather than living on the type that owns it.

Method: Neutral body surface plus Roslyn (DDD-gated), two arms. DECISION (Roslyn only): a predicate over a domain type's members judged in two or more types, where none of those decisions live on the owning type — operands of comparisons and relational property patterns only, so a member merely passed as an argument is not judged. DERIVATION: a plain all-numeric carrier of ≥2 members, with no base type and exactly one constructor, CONSTRUCTED as the result of a method (returned or assigned, never inline as an argument) in two or more types other than its own — the same measurement produced twice, which centralising the judgement does not fix. DERIVATION runs on every language whose frontend declares the produced-or-passed fact per construction (Roslyn and the Java sidecar today); a target with only the derivation arm carries an engine gap naming the decision arm as not assessed, and a frontend that declares nothing keeps the dimension not measured rather than clean. Single-member rules, test code and generated code are out of population for both. Advisory.

  • ArbiterOS-Kernel.redteam._automation.toolemu_v1.build_from_trajectories.ConvertedStep's [kind, raw_message_index] are judged in ArbiterOS-Kernel.redteam._automation.toolemu_v1.apply_review_results, ArbiterOS-Kernel.redteam._automation.toolemu_v1.build_from_trajectories — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
  • langfuse.packages.shared.src.server.queries.clickhouse-sql.clickhouse-filter.Filter's [field, operator] are judged in langfuse.packages.shared.src.server.queries.clickhouse-sql.event-query-builder.EventsQueryBuilder, langfuse.packages.shared.src.server.repositories.dashboards, langfuse.packages.shared.src.server.repositories.traces, langfuse.packages.shared.src.server.services.sessions-ui-table-events-service, langfuse.packages.shared.src.server.services.sessions-ui-table-service, langfuse.packages.shared.src.server.services.traces-ui-table-service — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.

What to do

  • Move each repeated judgement onto the type that owns the members it reads, so the rule has one home and cannot drift.
GD1 · Unfinished & placeholder code10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Unreviewed-generation residue in this repository's JavaScript/TypeScript: functions whose whole body still throws a "not implemented" error, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings and JSX of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.

Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.

  • A placeholder string ("Lorem ipsum") is still in shipped code — typical of generated boilerplate that was never filled in. — langfuse/web/src/features/comments/lib/mentionParser.clienttest.ts:287

What to do

  • Finish or delete the functions that still throw "not implemented", and replace placeholder text before shipping.
IC1 · Incompleteness & stubs7.1 / 10Strong✓ Tool-verified

Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's JavaScript/TypeScript: functions that only throw a "not implemented" error, functions that take inputs and return a constant or do nothing, async functions that never await, dead `if (false)` branches, and skeleton classes most of whose methods are holes.

Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.

  • Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition. (×9) — langfuse/web/src/components/table/data-table-pagination.tsx:161, langfuse/web/src/ee/features/billing/utils/stripeCatalogue.ts:30, langfuse/web/src/ee/features/billing/utils/stripeCatalogue.ts:50, …
  • `onChange` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it. (×2) — langfuse/web/src/features/datasets/components/DatasetSchemaHoverCard.tsx:80, langfuse/web/src/pages/project/[projectId]/settings/models/[modelId].tsx:302
  • `convertFile` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — langfuse/worker/src/scripts/convertDefaultModelPricesToTiers.ts:116
  • A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. (×8) — langfuse/web/src/__tests__/async/otel-api.servertest.ts:221, langfuse/web/src/__tests__/async/score-comparison-analytics.servertest.ts:461, langfuse/web/src/__tests__/async/score-comparison-analytics.servertest.ts:3162, …
  • A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead. — REDACTED:1

What to do

  • Clear the softer debt: re-enable or delete skipped tests, decide whether each empty function is a deliberate no-op (and say so in a comment), and replace blanket `eslint-disable` / `@ts-nocheck` with targeted, justified suppressions.
M1 · Documentation (README)8.7 / 10Strong✓ Tool-verified

Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.

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

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
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.
  • `langfuse/CONTRIBUTING.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `@langfuse/ee`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — langfuse/CONTRIBUTING.md:65

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
  • Update langfuse/CONTRIBUTING.md so it draws the parts the code has today: add @langfuse/ee.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.

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

M4 · Documentation accuracy10.0 / 10Exemplary○ Nothing flagged

Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.

Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.

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.

P2 · Observability9.4 / 10Exemplary✓ Tool-verified

Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.

Method: Filesystem/Roslyn scan: structured-logging frameworks (Serilog, NLog), OpenTelemetry, and health-check endpoint patterns. Exhaustive, deterministic.

  • Only 4/5 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `langfuse/ee`.
  • `langfuse/packages/shared/src/server/webhooks/redirectHandler.ts` reports through `console.*` at line 86 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/packages/shared/src/server/webhooks/redirectHandler.ts:86
  • `langfuse/packages/shared/src/server/webhooks/redirectHandler.ts` reports through `console.*` at line 87 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/packages/shared/src/server/webhooks/redirectHandler.ts:87
  • `langfuse/packages/shared/src/server/utils/headerUtils.ts` reports through `console.*` at line 77 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/packages/shared/src/server/utils/headerUtils.ts:77
  • `langfuse/packages/shared/src/server/ingestion/extractToolsBackend.ts` reports through `console.*` at line 334 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/packages/shared/src/server/ingestion/extractToolsBackend.ts:334
  • `langfuse/packages/shared/src/features/scores/interfaces/application/validation.ts` reports through `console.*` at line 69 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/packages/shared/src/features/scores/interfaces/application/validation.ts:69
  • `langfuse/packages/shared/src/features/scores/interfaces/application/validation.ts` reports through `console.*` at line 111 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/packages/shared/src/features/scores/interfaces/application/validation.ts:111
  • `langfuse/packages/shared/src/features/scores/interfaces/api/v2/validation.ts` reports through `console.*` at line 21 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/packages/shared/src/features/scores/interfaces/api/v2/validation.ts:21
  • `langfuse/packages/shared/src/features/scores/interfaces/api/v1/validation.ts` reports through `console.*` at line 23 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/packages/shared/src/features/scores/interfaces/api/v1/validation.ts:23
  • `langfuse/web/src/instrumentation.ts` reports through `console.*` at line 11 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/instrumentation.ts:11
  • `langfuse/web/src/workers/json-parser.worker.ts` reports through `console.*` at line 59 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/workers/json-parser.worker.ts:59
  • `langfuse/web/src/utils/shutdown.ts` reports through `console.*` at line 24 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/utils/shutdown.ts:24
  • `langfuse/web/src/utils/shutdown.ts` reports through `console.*` at line 33 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/utils/shutdown.ts:33
  • `langfuse/web/src/pages/_app.tsx` reports through `console.*` at line 241 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/pages/_app.tsx:241
  • `langfuse/web/src/pages/project/[projectId]/traces/setup.tsx` reports through `console.*` at line 36 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/pages/project/[projectId]/traces/setup.tsx:36
  • `langfuse/web/src/pages/auth/sso-initiate.tsx` reports through `console.*` at line 33 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/pages/auth/sso-initiate.tsx:33
  • `langfuse/web/src/pages/account/settings/index.tsx` reports through `console.*` at line 158 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/pages/account/settings/index.tsx:158
  • `langfuse/web/src/hooks/useParsedObservation.ts` reports through `console.*` at line 78 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/hooks/useParsedObservation.ts:78
  • `langfuse/web/src/hooks/useParsedObservation.ts` reports through `console.*` at line 81 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/hooks/useParsedObservation.ts:81
  • `langfuse/web/src/hooks/useParsedObservation.ts` reports through `console.*` at line 168 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/hooks/useParsedObservation.ts:168
  • `langfuse/web/src/hooks/useParsedObservation.ts` reports through `console.*` at line 265 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/hooks/useParsedObservation.ts:265
  • `langfuse/web/src/hooks/useParsedTrace.ts` reports through `console.*` at line 75 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/hooks/useParsedTrace.ts:75
  • `langfuse/web/src/hooks/useParsedTrace.ts` reports through `console.*` at line 78 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/hooks/useParsedTrace.ts:78
  • `langfuse/web/src/hooks/useParsedTrace.ts` reports through `console.*` at line 161 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/hooks/useParsedTrace.ts:161
  • `langfuse/web/src/features/widgets/components/WidgetTable.tsx` reports through `console.*` at line 92 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/widgets/components/WidgetTable.tsx:92
  • `langfuse/web/src/features/widgets/chart-library/PivotTable.tsx` reports through `console.*` at line 302 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/widgets/chart-library/PivotTable.tsx:302
  • `langfuse/web/src/features/widgets/chart-library/PivotTable.tsx` reports through `console.*` at line 318 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/widgets/chart-library/PivotTable.tsx:318
  • `langfuse/web/src/features/trace-graph-view/buildStepData.ts` reports through `console.*` at line 127 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/trace-graph-view/buildStepData.ts:127
  • `langfuse/web/src/features/slack/components/SlackConnectionCard.tsx` reports through `console.*` at line 174 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/slack/components/SlackConnectionCard.tsx:174
  • `langfuse/web/src/features/slack/components/SlackConnectionCard.tsx` reports through `console.*` at line 247 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/slack/components/SlackConnectionCard.tsx:247
  • `langfuse/web/src/features/slack/components/SlackDisconnectButton.tsx` reports through `console.*` at line 136 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/slack/components/SlackDisconnectButton.tsx:136
  • `langfuse/web/src/features/rbac/components/CreateProjectMemberButton.tsx` reports through `console.*` at line 136 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/rbac/components/CreateProjectMemberButton.tsx:136
  • `langfuse/web/src/features/public-api/components/ApiKeyList.tsx` reports through `console.*` at line 237 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/public-api/components/ApiKeyList.tsx:237
  • `langfuse/web/src/features/public-api/components/ApiKeyList.tsx` reports through `console.*` at line 250 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/public-api/components/ApiKeyList.tsx:250
  • `langfuse/web/src/features/public-api/components/CreateApiKeyButton.tsx` reports through `console.*` at line 86 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/public-api/components/CreateApiKeyButton.tsx:86
  • `langfuse/web/src/features/public-api/components/CreateApiKeyButton.tsx` reports through `console.*` at line 102 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/public-api/components/CreateApiKeyButton.tsx:102
  • `langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx` reports through `console.*` at line 482 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:482
  • `langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx` reports through `console.*` at line 628 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:628
  • `langfuse/web/src/features/public-api/components/LLMApiKeyList.tsx` reports through `console.*` at line 225 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/public-api/components/LLMApiKeyList.tsx:225
  • `langfuse/web/src/features/prompts/server/actions/createPrompt.ts` reports through `console.*` at line 119 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline. — langfuse/web/src/features/prompts/server/actions/createPrompt.ts:119

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
  • Route service-code `console.*` output through the module's structured logger (with named fields), so delivery outcomes and failures reach the log pipeline with a level.
P3 · Security & performance tooling7.0 / 10Strong✓ 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.

  • `REDACTED` schedules updates, but no `package-ecosystem` entry covers `uv`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list. — REDACTED:7

What to do

  • Dependabot is configured but does not watch `uv` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback10.0 / 10Exemplary✓ 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.

P5 · DR & Backup0.0 / 10Critical✓ Tool-verified

Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.

Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.

  • A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
P7 · Outbound HTTP resilience3.0 / 10Weak✓ Tool-verified

Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.

Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.

  • `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — langfuse/worker/src/features/mixpanel/mixpanelClient.ts:66

What to do

  • Bound every outbound call: pass `signal: AbortSignal.timeout(ms)` to `fetch`, set `timeout` on the axios instance (`axios.create({ timeout })`), and add retries with back-off (`axios-retry`, `p-retry`) and a breaker (`opossum`, `cockatiel`) around dependencies that fail.
P8 · Schema migrations10.0 / 10Exemplary○ Nothing flagged

Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.

Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.

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 each language's code model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.

  • `fs.existsSync` in `uploadAndCreateMediaRecord` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — langfuse/packages/shared/scripts/seeder/seed-media.ts:105
  • `fs.readFileSync` in `uploadAndCreateMediaRecord` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — langfuse/packages/shared/scripts/seeder/seed-media.ts:112
  • `gzipSync` in `sendBatch` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — langfuse/worker/src/features/mixpanel/mixpanelClient.ts:60

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 Safety10.0 / 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.

R10 · Code Duplication2.4 / 10Critical✓ Tool-verified

React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): 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. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.

  • 150 duplicated blocks under langfuse/web/src/features/ have copies in at least two of the sibling directories annotation-queues, automations, background-migrations, batch-actions, batch-exports, blobstorage-integration (+41 more sibling(s) not listed) — 84 of them are reported below, and 66 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 150 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 150 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 150 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/web/src/features/organizations/components/RenameOrganization.tsx:45
  • 149 duplicated blocks under langfuse/web/src/ have copies in at least two of the sibling directories components, ee, features, hooks, pages, server (+1 more sibling(s) not listed) — 87 of them are reported below, and 62 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 149 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 149 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 149 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/web/src/components/table/use-cases/observations.tsx:757
  • 81 duplicated blocks under langfuse/ have copies in at least two of the sibling directories packages, web, worker — 46 of them are reported below, and 35 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 81 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 81 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 81 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/web/src/features/error-analysis/server/router.ts:178
  • 16 duplicated blocks under langfuse/web/src/pages/api/public/ have copies in at least two of the sibling directories annotation-queues, comments, datasets, metrics, models, observations (+7 more sibling(s) not listed) — 12 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 16 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 16 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 16 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/web/src/pages/api/public/projects/[projectId]/memberships/index.ts:14
  • 13 duplicated blocks under langfuse/packages/shared/src/ have copies in at least two of the sibling directories domain, features, interfaces, server, tableDefinitions, utils — 5 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/packages/shared/src/features/evals/observationForEval.ts:18
  • 9 of the duplicated blocks reported below have copies in at least two of the sibling directories session, table, trace2, ui under langfuse/web/src/components/. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/web/src/components/table/utils/jsonExpansionUtils.ts:49
  • 9 duplicated blocks under langfuse/worker/src/ have copies in at least two of the sibling directories backgroundMigrations, ee, features, queues, utils — 4 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/worker/src/backgroundMigrations/backfillExperimentsHistoric.ts:443
  • 8 duplicated blocks under langfuse/packages/shared/src/server/services/email/ have copies in at least two of the sibling directories batchExportSuccess, cloudSpendAlert, commentMention, organizationInvitation, passwordReset, usageThresholdSuspension (+1 more sibling(s) not listed) — 7 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 8 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts:9
  • 6 of the duplicated blocks reported below have copies in at least two of the sibling directories ObservationDetailView, TraceDetailView, TraceLogView, TraceTimeline, _shared under langfuse/web/src/components/trace2/components/. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailViewHeader.tsx:136
  • 6 of the duplicated blocks reported below have copies in at least two of the sibling directories batch-data-retention-cleaner, batch-project-cleaner, batch-trace-deletion-cleaner, blobstorage, media-retention-cleaner, mixpanel (+1 more sibling(s) not listed) under langfuse/worker/src/features/. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/worker/src/features/mixpanel/handleMixpanelIntegrationProjectJob.ts:214
  • 5 duplicated blocks under langfuse/packages/shared/src/server/ have copies in at least two of the sibling directories llm, otel, queries, repositories, services — 1 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — langfuse/packages/shared/src/server/repositories/traces.ts:910
  • langfuse/web/src/components/table/use-cases/observations.tsx:757 · langfuse/web/src/features/events/components/EventsTable.tsx:653 — the two spans are one implementation copied and then locally edited — 2630 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/components/table/use-cases/observations.tsx:757
  • langfuse/web/src/components/table/use-cases/observations.tsx:2025 · langfuse/web/src/features/events/components/EventsTable.tsx:1995 — the two spans are one implementation copied and then locally edited — 1183 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/components/table/use-cases/observations.tsx:2025
  • langfuse/web/src/components/trace2/ObservationPreview.tsx:68 · langfuse/web/src/components/trace2/TracePreview.tsx:90 — the two spans are one implementation copied and then locally edited — 844 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/components/trace2/ObservationPreview.tsx:68
  • langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleMultiSectionViewer.tsx:34 · langfuse/web/src/components/ui/AdvancedJsonViewer/VirtualizedMultiSectionViewer.tsx:41 — the two spans are one implementation copied and then locally edited — 882 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleMultiSectionViewer.tsx:34
  • langfuse/web/src/features/playground/page/components/PlaygroundTools/index.tsx:144 · langfuse/web/src/features/playground/page/components/StructuredOutputSchemaSection.tsx:154 — the two spans are one implementation copied and then locally edited — 692 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/features/playground/page/components/PlaygroundTools/index.tsx:144
  • langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleJsonViewer.tsx:19 · langfuse/web/src/components/ui/AdvancedJsonViewer/VirtualizedJsonViewer.tsx:20 — the two spans are one implementation copied and then locally edited — 625 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleJsonViewer.tsx:19
  • langfuse/web/src/components/session/TraceEventsRow.tsx:17 · langfuse/web/src/components/session/TraceRow.tsx:23 — the two spans are one implementation copied and then locally edited — 807 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/components/session/TraceEventsRow.tsx:17
  • langfuse/web/src/features/evals/components/eval-templates-table.tsx:56 · langfuse/web/src/features/evals/components/evaluator-table.tsx:139 — the two spans are one implementation copied and then locally edited — 675 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/features/evals/components/eval-templates-table.tsx:56
  • langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:607 · langfuse/worker/src/backgroundMigrations/backfillEventsHistoricFromParts.ts:458 — 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. — langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:607
  • langfuse/web/src/components/session/index.tsx:227 · langfuse/web/src/components/session/index.tsx:544 — the two spans are one implementation copied and then locally edited — 626 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. — langfuse/web/src/components/session/index.tsx:227
  • langfuse/web/src/components/ui/command.tsx:18 · langfuse/web/src/components/ui/input-command.tsx:16 — the two spans are one implementation copied and then locally edited — 644 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/components/ui/command.tsx:18
  • langfuse/web/src/features/score-analytics/components/charts/ScoreTimeSeriesBooleanChart.tsx:1 · langfuse/web/src/features/score-analytics/components/charts/ScoreTimeSeriesCategoricalChart.tsx:1 — these 2 files are line-for-line copies of one another — 119 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — langfuse/web/src/features/score-analytics/components/charts/ScoreTimeSeriesBooleanChart.tsx:1
  • langfuse/web/src/features/datasets/components/DatasetRunItemsByItemTable.tsx:43 · langfuse/web/src/features/datasets/components/DatasetRunItemsByRunTable.tsx:63 — the two spans are one implementation copied and then locally edited — 594 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/features/datasets/components/DatasetRunItemsByItemTable.tsx:43
  • langfuse/web/src/pages/auth/sign-in.tsx:548 · langfuse/web/src/pages/auth/sign-up.tsx:60 — the two spans are one implementation copied and then locally edited — 523 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/pages/auth/sign-in.tsx:548
  • langfuse/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx:183 · langfuse/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx:156 — the two spans are one implementation copied and then locally edited — 440 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx:183
  • langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:213 · langfuse/packages/shared/src/utils/chatml/adapters/openai.ts:141 — the two spans are one implementation copied and then locally edited — 677 tokens are still identical, in the same order in both files, 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. — langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:213
  • langfuse/web/src/components/ui/dropdown-menu.tsx:15 · langfuse/web/src/components/ui/select.tsx:9 — the two spans are one implementation copied and then locally edited — 613 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/components/ui/dropdown-menu.tsx:15
  • langfuse/worker/src/features/database-read-stream/event-stream.ts:37 · langfuse/worker/src/features/database-read-stream/trace-stream.ts:27 — the two spans are one implementation copied and then locally edited — 543 tokens are still identical, in the same order in both files, 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. — langfuse/worker/src/features/database-read-stream/event-stream.ts:37
  • langfuse/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx:36 · langfuse/web/src/features/playground/page/components/CreateOrEditLLMToolDialog.tsx:36 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — langfuse/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx:36
  • langfuse/web/src/features/score-analytics/components/cards/DistributionBooleanCard.tsx:106 · langfuse/web/src/features/score-analytics/components/cards/DistributionNumericCard.tsx:136 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — langfuse/web/src/features/score-analytics/components/cards/DistributionBooleanCard.tsx:106
  • langfuse/web/src/features/datasets/components/EditDatasetItem.tsx:22 · langfuse/web/src/features/datasets/components/EditDatasetItemDialog.tsx:25 — the two spans are one implementation copied and then locally edited — 436 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/features/datasets/components/EditDatasetItem.tsx:22
  • langfuse/web/src/features/organizations/components/RenameOrganization.tsx:45 · langfuse/web/src/features/projects/components/RenameProject.tsx:42 — the two spans are one implementation copied and then locally edited — 476 tokens are still identical, in the same order in both files, 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. — langfuse/web/src/features/organizations/components/RenameOrganization.tsx:45
  • langfuse/packages/shared/src/server/repositories/dashboards.ts:104 · langfuse/packages/shared/src/server/repositories/dashboards.ts:202 — 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. — langfuse/packages/shared/src/server/repositories/dashboards.ts:104
  • langfuse/packages/shared/src/server/queries/clickhouse-sql/clickhouse-filter.ts:44 · langfuse/packages/shared/src/server/queries/clickhouse-sql/clickhouse-filter.ts:271 — the two spans are one implementation copied and then locally edited — 559 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. — langfuse/packages/shared/src/server/queries/clickhouse-sql/clickhouse-filter.ts:44
  • langfuse/web/src/features/score-analytics/components/cards/DistributionCategoricalCard.tsx:209 · langfuse/web/src/features/score-analytics/components/cards/DistributionNumericCard.tsx:148 — 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. — langfuse/web/src/features/score-analytics/components/cards/DistributionCategoricalCard.tsx:209
  • langfuse/worker/src/backgroundMigrations/migrateDatasetRunItemsFromPostgresToClickhouseRmt.ts:1 · langfuse/worker/src/backgroundMigrations/migrateTracesFromPostgresToClickhouse.ts:1 — these 2 files are line-for-line copies of one another — 92 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — langfuse/worker/src/backgroundMigrations/migrateDatasetRunItemsFromPostgresToClickhouseRmt.ts:1
  • langfuse/worker/src/backgroundMigrations/migrateScoresFromPostgresToClickhouse.ts:1 · langfuse/worker/src/backgroundMigrations/migrateTracesFromPostgresToClickhouse.ts:1 — these 2 files are line-for-line copies of one another — 92 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — langfuse/worker/src/backgroundMigrations/migrateScoresFromPostgresToClickhouse.ts:1
  • langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:362 · langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:607 — 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. — langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:362
  • langfuse/web/src/features/error-analysis/server/router.ts:178 · langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:403 — 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. — langfuse/web/src/features/error-analysis/server/router.ts:178

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 Boundaries9.5 / 10Exemplary✓ 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.

  • langfuse/packages/shared/src/server/clickhouse/client.ts:3 imports @clickhouse/client/dist/config, 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. — langfuse/packages/shared/src/server/clickhouse/client.ts:3
  • langfuse/packages/shared/src/server/repositories/clickhouse.ts:11 imports @clickhouse/client/dist/config, 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. — langfuse/packages/shared/src/server/repositories/clickhouse.ts:11
  • langfuse/packages/shared/src/server/services/email/batchExportSuccess/sendBatchExportSuccessEmail.ts:2 imports nodemailer/lib/shared/index.js, 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. — langfuse/packages/shared/src/server/services/email/batchExportSuccess/sendBatchExportSuccessEmail.ts:2
  • langfuse/packages/shared/src/server/services/email/cloudSpendAlert/sendCloudSpendAlertEmail.ts:2 imports nodemailer/lib/shared/index.js, 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. — langfuse/packages/shared/src/server/services/email/cloudSpendAlert/sendCloudSpendAlertEmail.ts:2
  • langfuse/packages/shared/src/server/services/email/commentMention/sendCommentMentionEmail.ts:2 imports nodemailer/lib/shared/index.js, 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. — langfuse/packages/shared/src/server/services/email/commentMention/sendCommentMentionEmail.ts:2
  • REDACTED:2 imports nodemailer/lib/shared/index.js, 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
  • langfuse/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts:2 imports nodemailer/lib/shared/index.js, 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. — langfuse/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts:2
  • langfuse/packages/shared/src/server/services/email/usageThresholdWarning/sendUsageThresholdWarningEmail.ts:2 imports nodemailer/lib/shared/index.js, 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. — langfuse/packages/shared/src/server/services/email/usageThresholdWarning/sendUsageThresholdWarningEmail.ts:2

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 Complexity6.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.

  • StatisticsCard has cyclomatic complexity 107 and cognitive complexity 93; 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. — langfuse/web/src/features/score-analytics/components/cards/StatisticsCard.tsx:39
  • buildGraphFromStepData has cyclomatic complexity 103 and cognitive complexity 193; 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. — langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:111
  • convertObservationPartial has cyclomatic complexity 94 and cognitive complexity 93; 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. — langfuse/packages/shared/src/server/repositories/observations_converters.ts:120
  • buildTurnMetadataSummary has cyclomatic complexity 81 and cognitive complexity 116; 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. — langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:1222
  • inferErrorTypeKeyFromText has cyclomatic complexity 76 and cognitive complexity 28; 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. — langfuse/web/src/features/error-analysis/server/router.ts:393
  • inferErrorTypeKeyFromText has cyclomatic complexity 75 and cognitive complexity 29; 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. — langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:182
  • verifyClickhouseObservation has cyclomatic complexity 72 and cognitive complexity 78; 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. — langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:291
  • extractInputAndOutput has cyclomatic complexity 70 and cognitive complexity 97; 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. — langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1165
  • (anonymous) has cyclomatic complexity 65 and cognitive complexity 105; 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. — langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:923
  • autoErrorAnalysisQueueProcessor has cyclomatic complexity 65 and cognitive complexity 99; 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. — langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:674
  • createEvalJobs has cyclomatic complexity 61 and cognitive complexity 125; 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. — langfuse/worker/src/features/evaluation/evalService.ts:166
  • (anonymous) has cyclomatic complexity 57 and cognitive complexity 57; 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. — langfuse/web/src/features/score-analytics/hooks/useScoreAnalyticsQuery.ts:246
  • buildHierarchyGraphFromStepData has cyclomatic complexity 56 and cognitive complexity 89; 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. — langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:701
  • fetchLLMCompletion has cyclomatic complexity 56 and cognitive complexity 71; 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. — langfuse/packages/shared/src/server/llm/fetchLLMCompletion.ts:118
  • PolicyGovernancePage has cyclomatic complexity 52 and cognitive complexity 48; 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. — langfuse/web/src/pages/project/[projectId]/policy.tsx:163
  • ObservationDetailView has cyclomatic complexity 51 and cognitive complexity 43; 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. — langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:82
  • InnerEvaluatorForm has cyclomatic complexity 51 and cognitive complexity 43; 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. — langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:257
  • (anonymous) has cyclomatic complexity 50 and cognitive complexity 99; 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. — langfuse/web/src/features/error-analysis/server/router.ts:1068
  • handleBatchActionJob has cyclomatic complexity 50 and cognitive complexity 68; 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. — langfuse/worker/src/features/batchAction/handleBatchActionJob.ts:137
  • DataTableToolbar has cyclomatic complexity 50 and cognitive complexity 39; 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. — langfuse/web/src/components/table/data-table-toolbar.tsx:133
  • SpanContent has cyclomatic complexity 49 and cognitive complexity 38; 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. — langfuse/web/src/components/trace2/components/SpanContent.tsx:43
  • buildTracesBaseQuery has cyclomatic complexity 46 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. — langfuse/web/src/features/public-api/server/traces.ts:44
  • LogViewToolbar has cyclomatic complexity 46 and cognitive complexity 38; 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. — langfuse/web/src/components/trace2/components/TraceLogView/LogViewToolbar.tsx:77
  • (anonymous) has cyclomatic complexity 44 and cognitive complexity 43; 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. — langfuse/web/src/features/filters/components/filter-builder.tsx:600
  • ObservationsEventsTable has cyclomatic complexity 42 and cognitive complexity 41; 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. — langfuse/web/src/features/events/components/EventsTable.tsx:315
  • SSOButtons has cyclomatic complexity 42 and cognitive complexity 41; 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. — langfuse/web/src/pages/auth/sign-in.tsx:180
  • buildMatchingEvents has cyclomatic complexity 41 and cognitive complexity 43; 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. (×2) — langfuse/web/src/__tests__/async/dashboard-v1-v2-consistency.servertest.ts:78, langfuse/web/src/__tests__/async/sessions-ui-table.servertest.ts:59
  • ObservationGovernanceAnalysisPanel has cyclomatic complexity 41 and cognitive complexity 38; 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. — REDACTED:45
  • WidgetForm has cyclomatic complexity 40 and cognitive complexity 37; 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. — langfuse/web/src/features/widgets/components/WidgetForm.tsx:156
  • applyErrorTypeFilters has cyclomatic complexity 39 and cognitive complexity 58; 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. — langfuse/web/src/features/error-analysis/server/errorTypeFilters.ts:83
  • detect has cyclomatic complexity 39 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. — langfuse/packages/shared/src/utils/chatml/adapters/langgraph.ts:272
  • ErrorAnalysisSettings has cyclomatic complexity 39 and cognitive complexity 30; 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. — langfuse/web/src/features/error-analysis/components/ErrorAnalysisSettings.tsx:66
  • usePreviewData has cyclomatic complexity 39 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. — langfuse/web/src/features/evals/hooks/usePreviewData.ts:38
  • extractUsageDetails has cyclomatic complexity 38 and cognitive complexity 73; 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. — langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1878
  • ObservationsTable has cyclomatic complexity 38 and cognitive complexity 37; 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. — langfuse/web/src/components/table/use-cases/observations.tsx:280
  • TimelineBar has cyclomatic complexity 38 and cognitive complexity 27; 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. — langfuse/web/src/components/trace2/components/TraceTimeline/TimelineBar.tsx:16
  • (top-level) has cyclomatic complexity 37 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. — langfuse/web/src/initialize.ts:1
  • detect has cyclomatic complexity 37 and cognitive complexity 46; 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. — langfuse/packages/shared/src/utils/chatml/adapters/openai.ts:369
  • (anonymous) has cyclomatic complexity 37 and cognitive complexity 39; 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. — langfuse/worker/src/services/IngestionService/index.ts:1803
R3 · Large Files6.3 / 10Adequate✓ 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.

  • REDACTED has 16409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • langfuse/packages/shared/src/server/repositories/events.ts has 2843 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/packages/shared/src/server/repositories/events.ts:1
  • langfuse/web/src/components/table/use-cases/observations.tsx has 2352 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/components/table/use-cases/observations.tsx:1
  • langfuse/web/src/features/events/components/EventsTable.tsx has 2262 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/events/components/EventsTable.tsx:1
  • langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts has 2174 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1
  • langfuse/web/src/features/error-analysis/server/router.ts has 2069 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/error-analysis/server/router.ts:1
  • langfuse/packages/shared/src/server/repositories/scores.ts has 1960 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/packages/shared/src/server/repositories/scores.ts:1
  • langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts has 1920 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts:1
  • langfuse/packages/shared/src/server/repositories/observations.ts has 1892 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/packages/shared/src/server/repositories/observations.ts:1
  • REDACTED has 1847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — REDACTED:1
  • langfuse/web/src/features/datasets/server/dataset-router.ts has 1825 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/datasets/server/dataset-router.ts:1
  • langfuse/worker/src/services/IngestionService/index.ts has 1757 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/worker/src/services/IngestionService/index.ts:1
  • langfuse/web/src/features/widgets/components/WidgetForm.tsx has 1733 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/widgets/components/WidgetForm.tsx:1
  • langfuse/packages/shared/src/server/repositories/dataset-items.ts has 1694 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/packages/shared/src/server/repositories/dataset-items.ts:1
  • langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts has 1559 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:1
  • langfuse/packages/shared/src/server/repositories/traces.ts has 1556 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/packages/shared/src/server/repositories/traces.ts:1
  • langfuse/web/src/features/query/dataModel.ts has 1531 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/query/dataModel.ts:1
  • langfuse/web/src/components/table/data-table-controls.tsx has 1483 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/components/table/data-table-controls.tsx:1
  • langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx has 1429 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:1
  • langfuse/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.ts has 1422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.ts:1
  • langfuse/web/src/features/evals/server/router.ts has 1394 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/evals/server/router.ts:1
  • langfuse/web/src/features/prompts/server/routers/promptRouter.ts has 1393 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/prompts/server/routers/promptRouter.ts:1
  • langfuse/web/src/features/policy-governance/server/router.ts has 1362 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/policy-governance/server/router.ts:1
  • langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx has 1344 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:1
  • langfuse/web/src/components/ui/PrettyJsonView.tsx has 1271 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/components/ui/PrettyJsonView.tsx:1
  • langfuse/packages/shared/scripts/seeder/utils/data-generators.ts has 1237 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:1
  • langfuse/web/src/components/table/use-cases/traces.tsx has 1228 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/components/table/use-cases/traces.tsx:1
  • langfuse/worker/src/queues/autoErrorAnalysisQueue.ts has 1209 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:1
  • langfuse/web/src/pages/project/[projectId]/experience/index.tsx has 1192 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/pages/project/[projectId]/experience/index.tsx:1
  • langfuse/web/src/features/query/server/queryBuilder.ts has 1184 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/query/server/queryBuilder.ts:1
  • langfuse/worker/src/features/evaluation/evalService.ts has 1177 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/worker/src/features/evaluation/evalService.ts:1
  • langfuse/web/src/pages/project/[projectId]/policy.tsx has 1121 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/pages/project/[projectId]/policy.tsx:1
  • langfuse/packages/shared/src/server/repositories/dataset-run-items.ts has 1116 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:1
  • langfuse/web/src/features/evals/components/inner-evaluator-form.tsx has 1116 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:1
  • langfuse/web/src/components/session/index.tsx has 1048 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/components/session/index.tsx:1
  • langfuse/web/src/features/dashboard/server/dashboard-router.ts has 1041 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/dashboard/server/dashboard-router.ts:1
  • langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx has 1021 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx:1
  • langfuse/web/src/features/filters/components/filter-builder.tsx has 1010 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/features/filters/components/filter-builder.tsx:1
  • langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx has 1005 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx:1
  • langfuse/web/src/server/api/routers/scores.ts has 1003 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — langfuse/web/src/server/api/routers/scores.ts:1

What to do

  • Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
R4 · Test Coverage5.3 / 10Adequate✓ 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.

  • 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. (×40) — langfuse/web/src/features/events/components/EventsTable.tsx:1, langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts:1, langfuse/web/src/features/widgets/components/WidgetForm.tsx:1, …

What to do

  • Add tests that import the unreached modules (directly or through their public entry).
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified

React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED 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: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.

R7 · Dead Code6.4 / 10Adequate✓ 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.

  • 1 file(s) (~7 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an index.html script) so reachability can see this package. — langfuse
  • Unreachable from the 201 application, 23 tooling and 204 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
  • no import path from any entry point (201 application, 23 tooling, 204 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 (×28) — langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts, REDACTED, langfuse/web/src/utils/chatml/jumptoplayground.clienttest.ts, …
  • no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/components/table/use-cases/score-configs.tsx) — 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 — langfuse/web/src/features/score-configs/components/UpsertScoreConfigDialog.tsx
  • no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/components/ui/AdvancedJsonViewer/AdvancedJsonViewer.tsx) — 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 (×4) — langfuse/web/src/components/ui/AdvancedJsonViewer/hooks/useTreeState.ts, langfuse/web/src/components/ui/AdvancedJsonViewer/VirtualizedJsonViewer.tsx, langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleJsonViewer.tsx, …
  • no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/features/score-configs/components/ScoreConfigSettings.tsx) — 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 — langfuse/web/src/components/table/use-cases/score-configs.tsx
  • no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/components/ui/AdvancedJsonSection/AdvancedJsonSection.tsx) — 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 — langfuse/web/src/components/ui/AdvancedJsonViewer/AdvancedJsonViewer.tsx
  • no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/features/batch-exports/components/BatchExportsSettingsPage.tsx) — 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 — langfuse/web/src/features/batch-exports/components/BatchExportsTable.tsx
  • no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/features/batch-actions/components/BatchActionsSettingsPage.tsx) — 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 — langfuse/web/src/features/batch-actions/components/BatchActionsTable.tsx
  • no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (REDACTED) — 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 — langfuse/packages/shared/scripts/seeder/seed-dataset-versions.ts

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 Hygiene0.0 / 10Critical✓ 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.

  • Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. (×3) — langfuse/web/src/features/error-analysis/server/errorTypeFilters.ts:1, langfuse/web/src/features/widgets/components/DashboardGrid.tsx:3, langfuse/worker/src/ee/usageThresholds/thresholdProcessing.ts:1
  • Declared in langfuse/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. (×2) — langfuse/package.json:40, langfuse/package.json:41
  • Declared in REDACTED 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. (×3) — REDACTED:41, REDACTED:31, REDACTED:48
  • Declared in langfuse/packages/config-eslint/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. — langfuse/packages/config-eslint/package.json:18
  • Declared in langfuse/packages/shared/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. (×5) — langfuse/packages/shared/package.json:73, langfuse/packages/shared/package.json:134, langfuse/packages/shared/package.json:137, …
  • Declared in REDACTED 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. (×20) — REDACTED:29, REDACTED:43, REDACTED:46, …
  • Declared in langfuse/worker/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. (×6) — langfuse/worker/package.json:30, langfuse/worker/package.json:34, langfuse/worker/package.json:78, …

What to do

  • Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
R9 · Circular Imports0.0 / 10Critical✓ 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.

  • langfuse/packages/shared/src/db.ts → langfuse/packages/shared/src/index.ts → langfuse/packages/shared/src/domain/dataset-items.ts → langfuse/packages/shared/src/db.ts (one verified cycle inside a mutually-dependent group of 142 files) — langfuse/packages/shared/src/db.ts:13
  • langfuse/packages/shared/src/server/instrumentation/index.ts → langfuse/packages/shared/src/server/logger.ts → langfuse/packages/shared/src/server/instrumentation/index.ts — langfuse/packages/shared/src/server/instrumentation/index.ts:8
  • langfuse/web/src/utils/api.ts → langfuse/web/src/server/api/root.ts → langfuse/web/src/features/dashboard/server/dashboard-router.ts → langfuse/web/src/features/dashboard/lib/score-analytics-utils.ts → langfuse/web/src/utils/api.ts (one verified cycle inside a mutually-dependent group of 134 files) — langfuse/web/src/utils/api.ts:25
  • langfuse/web/src/components/session/TraceRow.tsx → langfuse/web/src/components/session/index.tsx → langfuse/web/src/components/session/TraceRow.tsx — langfuse/web/src/components/session/TraceRow.tsx:1
  • langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/CreateEvaluatorDialog.tsx → langfuse/web/src/features/evals/components/evaluator-form.tsx → langfuse/web/src/features/evals/components/inner-evaluator-form.tsx → langfuse/web/src/features/events/components/EventsTable.tsx → langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/index.tsx → langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/CreateEvaluatorDialog.tsx — langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/CreateEvaluatorDialog.tsx:15
  • langfuse/web/src/features/datasets/components/DatasetCompareRunsTable.tsx → langfuse/web/src/features/datasets/components/DatasetRunAggregateColumnHelpers.tsx → langfuse/web/src/features/datasets/components/DatasetCompareRunsTable.tsx (one verified cycle inside a mutually-dependent group of 3 files) — langfuse/web/src/features/datasets/components/DatasetCompareRunsTable.tsx:8
  • langfuse/web/src/features/events/server/eventsRouter.ts → langfuse/web/src/features/events/server/eventsService.ts → langfuse/web/src/features/events/server/eventsRouter.ts — langfuse/web/src/features/events/server/eventsRouter.ts:14
  • langfuse/web/src/features/scores/schema.ts → langfuse/web/src/features/scores/types.ts → langfuse/web/src/features/scores/schema.ts — langfuse/web/src/features/scores/schema.ts:1
  • langfuse/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts → langfuse/web/src/server/api/routers/generations/getAllQueries.ts → langfuse/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts — langfuse/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts:14
  • langfuse/web/src/utils/date-range-utils.ts → langfuse/web/src/utils/fill-time-series-gaps.ts → langfuse/web/src/utils/date-range-utils.ts — langfuse/web/src/utils/date-range-utils.ts:803
  • langfuse/worker/src/app.ts → langfuse/worker/src/utils/shutdown.ts → langfuse/worker/src/app.ts (one verified cycle inside a mutually-dependent group of 3 files) — langfuse/worker/src/app.ts:19

What to do

  • Break each cycle by extracting the shared piece into a module both sides can import.
S1 · Web-Security Posture8.0 / 10Strong✓ Tool-verified

Other · Security — Read from this repository's JavaScript/TypeScript source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. Of the server controls, two are read where the source shows them: every session or sign-in cookie the code sets is read for HttpOnly, Secure and SameSite at the line that sets it (a raw `Set-Cookie` header, Express, Fastify, Hono, Koa, Next.js, `cookie.serialize`, express-session and cookie-session), and every Node listener for HTTPS enforcement. HSTS, security response headers and input validation are NOT assessed for JavaScript/TypeScript: each is scored as an absence, an absence is only reportable over the production HTTP server, and in this ecosystem the file that opens the port is build output or a framework launcher rather than a file in the source tree. Their absence here is not a finding about this repository.

Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.

  • MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. — langfuse/worker/src/features/batch-data-retention-cleaner/index.ts:56

What to do

  • Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.

Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.

X12 · Unreachable branch10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.

Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.

X16 · Unfloored truncation loop10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.

Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.

X17 · Uncapped recursion over a caller-supplied document1.5 / 10Critical✓ Tool-verified

Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.

Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.

  • `useColumnVisibility` is exported, takes a document from its caller (line 41) and hands it to `setVisibility`, which calls itself at line 29 (`setVisibility`) with a piece of `column` — and nowhere in `setVisibility` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `setVisibility` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — langfuse/web/src/features/column-visibility/hooks/useColumnVisibility.ts:29
  • `countAllDescendants` is exported and takes `value: unknown` from its caller, and it calls itself at line 229 (`countAllDescendants`) with a piece of `value` — and nowhere in `countAllDescendants` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `countAllDescendants` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — langfuse/web/src/components/ui/AdvancedJsonViewer/utils/jsonTypes.ts:229
  • `countJsonRows` is exported and takes `data: unknown` from its caller, and it calls itself at line 40 (`countJsonRows`) with a piece of `data` (and at line 52) — and nowhere in `countJsonRows` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `countJsonRows` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — langfuse/web/src/components/ui/AdvancedJsonViewer/utils/rowCount.ts:40
  • `unnestObservation` is exported and takes `nestedObservation: NestedObservation` from its caller, and it calls itself at line 194 (`unnestObservation`) with a piece of `nestedObservation` — and nowhere in `unnestObservation` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `unnestObservation` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — langfuse/web/src/components/trace2/lib/helpers.ts:194
  • `flattenJsonToPathArrays` is exported and takes `obj: Record<string, unknown>` from its caller, and it calls itself at line 30 (`flattenJsonToPathArrays`) with a piece of `obj` — and nowhere in `flattenJsonToPathArrays` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `flattenJsonToPathArrays` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — langfuse/packages/shared/src/server/otel/utils.ts:30
  • `extractValueFromObject` is exported, takes a document from its caller (line 66) and hands it to `parseMultiEncodedJson`, which calls itself at line 45 (`parseMultiEncodedJson`) with a piece of `value` — and nowhere in `parseMultiEncodedJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `parseMultiEncodedJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — langfuse/packages/shared/src/features/evals/utilities.ts:45
  • `generateJsonPathSuggestions` is exported and takes `data: unknown` from its caller, and it calls itself at line 291 (`generateJsonPathSuggestions`) with a piece of `data` (and at line 302) — and nowhere in `generateJsonPathSuggestions` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `generateJsonPathSuggestions` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — langfuse/packages/shared/src/features/batchAction/applyFieldMapping.ts:291
  • `async_pre_call_hook` is public, takes a document from its caller (line 5926) and hands it to `_to_json`, which calls itself at line 1512 (`_to_json`) with a piece of `obj` (and at line 1514) — and nowhere in `_to_json` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_to_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — REDACTED:1512
  • `canonicalize_args` is public and takes `args: Any` from its caller, and it calls itself at line 150 (`canonicalize_args`) with a piece of `args` (and at line 153) — and nowhere in `canonicalize_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:150
  • `redact_args` is public and takes `args: Any` from its caller, and it calls itself at line 167 (`redact_args`) with a piece of `args` (and at line 170) — and nowhere in `redact_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:167
  • `canonicalize_args` is public and takes `args: Any` from its caller, and it calls itself at line 88 (`canonicalize_args`) with a piece of `args` (and at line 91) — and nowhere in `canonicalize_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:88
  • `redact_args` is public and takes `args: Any` from its caller, and it calls itself at line 105 (`redact_args`) with a piece of `args` (and at line 108) — and nowhere in `redact_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:105
  • `canonicalize_tool_args` is public and takes `args: Any` from its caller, and it calls itself at line 610 (`self.canonicalize_tool_args`) with a piece of `args` (and at line 614) — and nowhere in `canonicalize_tool_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize_tool_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:610
  • `check_taint_sink_for_tool` is public, takes a document from its caller (line 904) and hands it to `_collect_strings`, which calls itself at line 937 (`_collect_strings`) with a piece of `x` (and at line 941) — and nowhere in `_collect_strings` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_collect_strings` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:937
  • `check` is public, takes a document from its caller (line 321) and hands it to `_coerce_text`, which calls itself at line 151 (`_coerce_text`) with a piece of `value` — and nowhere in `_coerce_text` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_coerce_text` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_sentinel_policy.py:151
  • `should_trigger_postexec_sentinel` is public, takes a document from its caller (line 535) and hands it to `_walk`, which calls itself at line 264 (`_walk`) with a piece of `node` (and at line 270) — and nowhere in `_walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_trigger.py:264
  • `validate_policy_rule_ir` is public, takes a document from its caller (line 211) and hands it to `_validate_predicate`, which calls itself at line 698 (`_validate_predicate`) with a piece of `raw` — and nowhere in `_validate_predicate` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_validate_predicate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:698
  • `compile_policy_rule_ir_to_unary_gate_rules` is public, takes a document from its caller (line 252) and hands it to `_compile_predicate`, which calls itself at line 751 (`_compile_predicate`) with a piece of `raw` (and at line 753) — and nowhere in `_compile_predicate` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_compile_predicate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:751
  • `validate_policy_rule_ir` is public, takes a document from its caller (line 211) and hands it to `_extract_vars`, which calls itself at line 804 (`_extract_vars`) with a piece of `raw` (and at line 807) — and nowhere in `_extract_vars` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_extract_vars` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:804

What to do

  • Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
X19 · Unrestored process-global state10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.

Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.

X2 · Cancellation propagation5.3 / 10Adequate✓ Tool-verified

Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).

Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.

  • Only 3/14 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
  • `sendBatch` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/worker/src/features/mixpanel/mixpanelClient.ts:55
  • `createUser` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — REDACTED:876
  • `uploadToPlainS3` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/web/src/features/support-chat/SupportFormSection.tsx:216
  • `sendToSlack` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/web/src/features/slack/server/slack-webhook.ts:3
  • `getChatCompletionWithTools` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/web/src/features/playground/page/context/index.tsx:701
  • `getChatCompletionWithStructuredOutput` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/web/src/features/playground/page/context/index.tsx:743
  • `getChatCompletionStream` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/web/src/features/playground/page/context/index.tsx:784
  • `getChatCompletionNonStreaming` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/web/src/features/playground/page/context/index.tsx:845
  • `syncLanguageCookie` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/web/src/features/i18n/LanguageProvider.tsx:45
  • `fetchWithSecureRedirects` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/packages/shared/src/server/webhooks/redirectHandler.ts:90
  • `request` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — langfuse/packages/shared/src/server/auth/gitHubEnterpriseProvider.ts:27

What to do

  • Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.

Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.

X23 · Unguarded diagnostic materialisation7.6 / 10Strong✓ Tool-verified

Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.

Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.

  • `debug` at line 62 is called with an argument built by `tools.map((t) => t.name)` (line 65), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch. — langfuse/web/src/features/mcp/server/mcpServer.ts:62
  • `debug` at line 526 is called with an argument built by `list(zip(abs_paths, per_path))` (line 530), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on. — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/registries/_base.py:526

What to do

  • Each finding names the diagnostic call and the expression inside its argument whose cost scales with a collection. Confirm from the two that the argument is built before the call — that is JavaScript's evaluation order, not a guess — then put the construction behind the level check the logger offers (`if (logger.isLevelEnabled('debug'))` for pino and winston, `isDebugEnabled()` for log4js, the repository's own debug flag where it has one), or hand the logger the object and a format string (`logger.debug({ payload }, 'raw request')`) so the serialising happens only when the line is written. Moving the call is not the fix: it is the join/projection/stringify in the argument that is paid, wherever the call sits. In Python, put the construction behind the logger's own check (`if logger.isEnabledFor(logging.DEBUG):`), or pass the collection itself with a `%s` placeholder (`logger.debug("Items %s", items)`) so the logging module renders it only when the record is emitted. The placeholder alone is not the fix when the argument is still built first: it defers the formatting, not a `json.dumps`, a `join` or a comprehension in the argument, and an f-string defers nothing at all.
X24 · Document value interpolated into markup unescaped3.5 / 10Weak✓ Tool-verified

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.

  • `Object.entries(THEMES).map(([theme,prefix])=>` ${prefix} [data-chart=${id}] { ${colorConfig.map(([key,itemConfig])=>{…` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup. — REDACTED:82

What to do

  • Each finding names the expression, the attribute it lands in and the line. Confirm the value's origin from the read this analyzer traced, then escape it at the sink or validate it against the shape the attribute accepts before interpolating.
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, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture 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.

X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.

Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. 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.

X3 · Exception handling5.3 / 10Adequate✓ Tool-verified

Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.

Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.

  • An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×39) — langfuse/worker/src/scripts/replayIngestionEvents/s3-ingestion-event-replay.ts:495, langfuse/worker/src/scripts/replayIngestionEvents/s3-ingestion-event-replay.ts:604, langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:398, …
  • `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included. — langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/index.tsx:116

What to do

  • Swallowed exception (empty catch)
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged

Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.

Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.

X4 · Structured logging4.2 / 10Weak✓ Tool-verified

Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.

Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `REDACTED` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.

  • `info` at line 44 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/db.ts:44
  • `warn` at line 49 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/db.ts:49
  • `error` at line 53 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/db.ts:53
  • `error` at line 41 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/evalJobConfigCache.ts:41
  • `debug` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/evalJobConfigCache.ts:62
  • `error` at line 66 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/evalJobConfigCache.ts:66
  • `debug` at line 85 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/evalJobConfigCache.ts:85
  • `error` at line 89 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/evalJobConfigCache.ts:89
  • `info` at line 18 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/traceDeletionProcessor.ts:18
  • `info` at line 38 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/traceDeletionProcessor.ts:38
  • `info` at line 81 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/traceDeletionProcessor.ts:81
  • `error` at line 129 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/traceDeletionProcessor.ts:129
  • `warn` at line 93 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:93
  • `warn` at line 106 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — REDACTED:106
  • `error` at line 48 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:48
  • `info` at line 192 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:192
  • `error` at line 194 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:194
  • `error` at line 227 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:227
  • `error` at line 246 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:246
  • `error` at line 265 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:265
  • `error` at line 296 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:296
  • `error` at line 321 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:321
  • `error` at line 350 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:350
  • `error` at line 382 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:382
  • `error` at line 415 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:415
  • `error` at line 525 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:525
  • `error` at line 545 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:545
  • `error` at line 563 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:563
  • `error` at line 578 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:578
  • `error` at line 602 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:602
  • `error` at line 625 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:625
  • `error` at line 656 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:656
  • `error` at line 765 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:765
  • `error` at line 784 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:784
  • `error` at line 805 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:805
  • `error` at line 820 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:820
  • `error` at line 842 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:842
  • `error` at line 871 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:871
  • `error` at line 904 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/StorageService.ts:904
  • `warn` at line 41 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way. — langfuse/packages/shared/src/server/services/email/cloudSpendAlert/sendCloudSpendAlertEmail.ts:41

What to do

  • Interpolated log message defeats structured logging
X5 · Nullable reference types3.8 / 10Weak✓ Tool-verified

Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.

Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.

  • 1/4 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
  • ~1.0 `!` null assertions per 1k TypeScript source lines — 362 assertion(s) across the 362318 source line(s) of the 1885 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeExpansion.clienttest.ts (39), langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeStructure.clienttest.ts (17), langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts (17). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.

What to do

  • The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).

WCAG coverage — what static analysis assessed

Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).

DimensionWCAG 2.2 A/AA criteriaCoverage
AC1 · Text alternatives1.1.1, 1.2.2, 1.2.5Partial signal
AC2 · Forms & labels1.3.1, 3.3.2, 4.1.2Partial signal
AC3 · Page structure1.4.4, 2.2.1, 2.4.1, 2.4.2, 3.1.1, 4.1.2Partial signal
AC4 · Keyboard semantics2.1.1, 2.4.3Partial signal
AC5 · ARIA correctness4.1.2Partial signal
AC6 · Visual & motion safety1.4.3, 2.4.7Partial — literal CSS only

Not statically assessed — these 40 Level A/AA criteria need runtime or manual evaluation (WCAG-EM): 1.2.1, 1.2.3, 1.2.4, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 1.4.5, 1.4.10, 1.4.11, 1.4.12, 1.4.13, 2.1.2, 2.1.4, 2.2.2, 2.3.1, 2.4.4, 2.4.5, 2.4.6, 2.4.11, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.5.7, 2.5.8, 3.1.2, 3.2.1, 3.2.2, 3.2.3, 3.2.4, 3.2.6, 3.3.1, 3.3.3, 3.3.4, 3.3.7, 3.3.8, 4.1.3.

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 Health43.4Weak — gated by D1, D2, R10, X5Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Architecture38.7Weak — gated by D26, R9, AX7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Maturity69.0Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness26.6Weak — gated by D12, R8, P5, P7Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Security57.3Adequate — gated by D28, D29, C1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Domain Modelling28.2Weak — gated by DM6Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Accessibility47.8Weak — gated by AC4Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance60.0AdequateStrongest area.
Unscored — 3 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.

  • X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X6 Hand-rolled structured-format parsing — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
  • X7 Silent fallback defaults — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 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.

  • C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. A delete/anonymise identifier was seen but did not co-occur with GDPR vocabulary or a subject-id shape, so it was not credited (e.g. a save-slot DeleteAccount()). Implement erasure, data export/portability and consent tracking over the subject's records.
  • P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 46 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.

  • 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 Python 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 — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. 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).
  • AX4 Dependency direction — not applicable to a vertical-slice architecture (the inward-dependency rule is for layered/clean styles)
  • 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 — compose up failed (exit 18 — an image could not be pulled) — clickhouse Pulling minio Pulling redis Pulling postgres Pulling minio Error Get "https://cgr.dev/v2/": Forbidden redis Error context canceled clickhouse Error context canceled postgres Error context canceled Error response from daemon: Get "https://cgr.dev/v2/": Forbidden; the earlier `compose pull` step reported: langfuse-web Skipped - No image to be pulled langfuse-worker Skipped - No image to be pulled clickhouse Pulling minio Pulling redis Pulling postgres Pulling minio Error Get "https://cgr.dev/v2/": Forbidden clickhouse Error context canceled postgres Error context canceled redis Error context canceled Error response from daemon: Get "https://cgr.dev/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped 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.
  • 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, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. 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"]`.
  • D25 ADR Conformance — no ADRs to check
  • D36 Supply-chain Provenance & Signing — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • 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: the JavaScript/TypeScript half could not be measured — the jest suite in langfuse/web/ ran and not one test passed (Error: Invalid environment variables), so the coverage would describe the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
  • DM1 Aggregate boundaries — no aggregates detected — aggregate-boundary check not applicable
  • DM10 One transaction, one aggregate — no repository writes detected — no operation to judge against the one-aggregate rule
  • DM11 Constructible invalid state — no entities detected — construction-time invariants not assessable
  • DM2 Strongly-typed ids — no id-bearing domain types detected — strongly-typed-id adoption not assessable
  • DM3 Integration-event coupling — no integration events detected — coupling check not applicable
  • DM4 Rich vs anemic model — no data-bearing entities detected — rich-vs-anemic model not assessable
  • DM5 Encapsulated state — no domain entities found — DM5 grades how entities protect their state, and this repository declares none
  • DM7 Repository granularity — no repository abstraction detected (e.g. uses a document session)
  • ED1 Event-Driven — not scored — this repository shows none of the 3 signals this lens looks for
  • ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
  • ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
  • 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'.
  • P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • 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 REDACTED, 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 scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • R5 Dependency Freshness — uses a pnpm lockfile — dependency freshness not measured here; JS/npm CVEs are scored in D30 (Dependency Vulnerabilities), which answers every ecosystem
  • SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X27 Collection changed while being enumerated — X27 reached only 7% of this repository's production lines — typescript (333,809 lines), javascript (912 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
  • 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.
  • 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 — 230 finding(s)
D30 · Dependency Vulnerabilities · High CVE · ×88
  • 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
  • + 63 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Critical CVE · ×27
  • 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
  • + 2 more in this group — see findings.md.
AC4 · Keyboard semantics · Click handler on a non-interactive <div> · ×20
  • Click handler on a non-interactive <div> langfuse/web/src/components/EnvLabel.tsx:14 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/date-picker.tsx:508 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/date-picker.tsx:525 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/layouts/breadcrumb.tsx:153 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/layouts/breadcrumb.tsx:240 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/table/ValueCell.tsx:282 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/table/data-table-controls.tsx:1524 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
  • Click handler on a non-interactive <div> langfuse/web/src/components/trace2/components/IOPreview/components/ToolCallDefinitionCard.tsx:69 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> REDACTED:418 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/trace2/components/TraceTimeline/TimelineBar.tsx:42 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/trace2/components/TraceTimeline/TimelineBar.tsx:127 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/trace2/components/_shared/VirtualizedTreeNodeWrapper.tsx:61 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/ui/AdvancedJsonViewer/components/MultiSectionJsonViewerHeader.tsx:31 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/ui/AdvancedJsonViewer/components/SimpleSectionHeader.tsx:23 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/ui/CodeJsonViewer.tsx:116 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/components/ui/timeline.tsx:40 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/features/automations/components/AutomationSidebar.tsx:77 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/features/evals/components/eval-template-detail.tsx:136 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/features/public-api/components/ApiKeyList.tsx:360 — A click handler on a plain element isn't keyboard-operable. Use a <button>, or add role + tabIndex={0} + a key handler.
  • Click handler on a non-interactive <div> langfuse/web/src/features/scores/components/multi-select-key-values.tsx:229 — A click handler on a plain element with no role and no tabindex: even where another element's key handler can reach it, assistive tech can neither focus it nor announce what it is. Use a <button>, or add role + tabIndex={0}.
D28 · Secrets (history) · High secret · ×15
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R9 · Circular Imports · Import cycle (2 files) · ×8
  • Import cycle (2 files) langfuse/packages/shared/src/server/instrumentation/index.ts:8 — langfuse/packages/shared/src/server/instrumentation/index.ts → langfuse/packages/shared/src/server/logger.ts → langfuse/packages/shared/src/server/instrumentation/index.ts
  • Import cycle (2 files) langfuse/web/src/components/session/TraceRow.tsx:1 — langfuse/web/src/components/session/TraceRow.tsx → langfuse/web/src/components/session/index.tsx → langfuse/web/src/components/session/TraceRow.tsx
  • Import cycle (2 files) langfuse/web/src/features/datasets/components/DatasetCompareRunsTable.tsx:8 — langfuse/web/src/features/datasets/components/DatasetCompareRunsTable.tsx → langfuse/web/src/features/datasets/components/DatasetRunAggregateColumnHelpers.tsx → langfuse/web/src/features/datasets/components/DatasetCompareRunsTable.tsx (one verified cycle inside a mutually-dependent group of 3 files)
  • Import cycle (2 files) langfuse/web/src/features/events/server/eventsRouter.ts:14 — langfuse/web/src/features/events/server/eventsRouter.ts → langfuse/web/src/features/events/server/eventsService.ts → langfuse/web/src/features/events/server/eventsRouter.ts
  • Import cycle (2 files) langfuse/web/src/features/scores/schema.ts:1 — langfuse/web/src/features/scores/schema.ts → langfuse/web/src/features/scores/types.ts → langfuse/web/src/features/scores/schema.ts
  • Import cycle (2 files) langfuse/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts:14 — langfuse/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts → langfuse/web/src/server/api/routers/generations/getAllQueries.ts → langfuse/web/src/server/api/routers/generations/db/getAllGenerationsSqlQuery.ts
  • Import cycle (2 files) langfuse/web/src/utils/date-range-utils.ts:803 — langfuse/web/src/utils/date-range-utils.ts → langfuse/web/src/utils/fill-time-series-gaps.ts → langfuse/web/src/utils/date-range-utils.ts
  • Import cycle (2 files) langfuse/worker/src/app.ts:19 — langfuse/worker/src/app.ts → langfuse/worker/src/utils/shutdown.ts → langfuse/worker/src/app.ts (one verified cycle inside a mutually-dependent group of 3 files)
DM6 · Domain ↔ infrastructure boundary · Domain depends on infrastructure · ×7
  • Domain depends on infrastructure: automations langfuse/packages/shared/src/domain/automations.ts:1 — `langfuse/packages/shared/src/domain/automations.ts` (domain layer) depends on `@prisma/client` (import) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: dataset-items langfuse/packages/shared/src/domain/dataset-items.ts:1 — `langfuse/packages/shared/src/domain/dataset-items.ts` (domain layer) depends on `../db` (import of `langfuse/packages/shared/src/db.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: dataset-run-items langfuse/packages/shared/src/domain/dataset-run-items.ts:2 — `langfuse/packages/shared/src/domain/dataset-run-items.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: observations langfuse/packages/shared/src/domain/observations.ts:2 — `langfuse/packages/shared/src/domain/observations.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: prompts langfuse/packages/shared/src/domain/prompts.ts:2 — `langfuse/packages/shared/src/domain/prompts.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: traces langfuse/packages/shared/src/domain/traces.ts:2 — `langfuse/packages/shared/src/domain/traces.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
  • Domain depends on infrastructure: webhooks langfuse/packages/shared/src/domain/webhooks.ts:2 — `langfuse/packages/shared/src/domain/webhooks.ts` (domain layer) depends on `../utils/zod` (import of `langfuse/packages/shared/src/utils/zod.ts`) — a persistence module; the domain should own a port and let an infrastructure adapter implement it.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D28 · Secrets (history) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC4 · Keyboard semantics · Hover-only interaction on <div> · ×4
  • Hover-only interaction on <div> langfuse/web/src/features/score-analytics/components/charts/HeatmapCell.tsx:125 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
  • Hover-only interaction on <div> langfuse/web/src/features/score-analytics/components/charts/HeatmapLegend.tsx:71 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
  • Hover-only interaction on <div> langfuse/web/src/features/score-analytics/components/charts/HeatmapLegend.tsx:101 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
  • Hover-only interaction on <div> langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx:884 — This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D30 · Dependency Vulnerabilities · Critical vulnerability · ×4
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · <button> with no accessible text · ×3
  • <button> with no accessible text langfuse/web/src/components/trace2/components/IOPreview/components/CorrectedOutputField.tsx:182 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text langfuse/web/src/components/trace2/components/TraceTimeline/TimelineRow.tsx:72 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
  • <button> with no accessible text langfuse/web/src/features/datasets/components/MappingCard.tsx:134 — A button with no text and no aria-label has no accessible name. Add visible text or an aria-label (an icon-only button still needs one).
D14 · License Compliance · Banned license · ×3
  • Banned license: psycopg — `psycopg` 3.3.9 is published on PyPI under `LGPL-3.0-only`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution 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. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
  • Banned license: psycopg-binary — `psycopg-binary` 3.3.9 is published on PyPI under `LGPL-3.0-only`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution 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. ★ The licence that makes this row is LGPL-3.0, and unmodified use is often permitted: the LGPL lets your code use an UNMODIFIED copy of the library that stays a separately installed package (its own entry in node_modules, site-packages or the gem path, which a user can replace) without your code coming under the LGPL. What it then asks is that you pass on its licence and notices and let users swap in their own build of it (LGPL-3.0 section 4). Modifying it, copying its code into yours, or merging it into one bundled or statically linked artifact is where the obligations grow, and this policy cannot see which you do — that is why it denies LGPL-3.0 by default. If you use it unmodified and separately installed, allow it in your repository's licence policy rather than replacing it: add `LGPL-3.0-only` / `LGPL-3.0-or-later` to the allow-list of the licence check your CI runs (`license-checker --onlyAllow`, the `allow-licenses` input of GitHub's dependency-review-action, `[licenses] allow` in cargo-deny's deny.toml), record why in the same change, and hide this row on the findings page with that reason. This scan's banned set is not read from that file, so the row stays until it is hidden.
  • Banned license: pcodedmp — `pcodedmp` 1.2.6 is published on PyPI under `GPL-3.0`, which this policy bans, and it is in the SHIPPED closure of this repository — so it is installed by everything that depends on this repository, not just by its test environment. A distribution 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.
D30 · Dependency Vulnerabilities · High vulnerability · ×3
  • REDACTED
  • REDACTED
  • REDACTED
AC2 · Forms & labels · Custom control with no accessible name on <div> · ×2
  • Custom control with no accessible name on <div> langfuse/web/src/components/layouts/breadcrumb.tsx:153 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
  • Custom control with no accessible name on <div> langfuse/web/src/components/layouts/breadcrumb.tsx:240 — This <div> carries a click handler, which makes it a control, but it has no text, aria-label or labelled child (the icon-only case), so assistive tech has no name to announce for it. Note that switching it to <button type="button"> — the right fix for its keyboard operability — does not give it a name either: an icon-only button still needs one. Add visible text or an aria-label.
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
R8 · Dependency Hygiene · Unlisted import '@prisma/client' · ×2
  • Unlisted import '@prisma/client' langfuse/web/src/features/error-analysis/server/errorTypeFilters.ts:1 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
  • Unlisted import '@prisma/client' langfuse/worker/src/ee/usageThresholds/thresholdProcessing.ts:1 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
AC2 · Forms & labels · <label> that labels no control · ×1
  • <label> that labels no control langfuse/web/src/features/datasets/components/DatasetItemField.tsx:58 — This <label> has no htmlFor and wraps no form control, so it names nothing: assistive tech never announces it, and clicking the caption focuses no field. Note that an id on the label is not an association — it is the TARGET of one, so a control still has to point at it. Give the label htmlFor="<the control's id>", move the control inside the label, or point the control's aria-labelledby at this label's id.
AC4 · Keyboard semantics · Focusable <div> isn't keyboard-operable · ×1
  • Focusable <div> isn't keyboard-operable langfuse/web/src/components/onboarding/DatasetItemsOnboarding.tsx:43 — This <div> carries tabIndex={0}, so it is in the tab order and a keyboard user will land on it — but its behaviour is bound to the pointer only, with no key handler. A tabindex makes an element focusable, not operable: Enter and Space fire a click on a native <button> or <a href> and nowhere else, so this can be focused and never activated. Use a <button>, or handle Enter/Space in a key handler.
AC4 · Keyboard semantics · Clickable role="button" that no keyboard user can reach · ×1
  • Clickable role="button" that no keyboard user can reach langfuse/web/src/features/prompts/components/prompt-history.tsx:109 — This <span> announces itself as a role="button" and binds a click, but nothing can put focus on it: no tabIndex={0} in any spelling, no key handler, and nothing in this file moves focus or sets aria-activedescendant. The role tells assistive tech what the control IS; it does not make the control reachable, so a keyboard user cannot operate it at all (WCAG 2.1.1). Give it tabIndex={0}="0" and an Enter/Space key handler, or make it a native <button>. If a parent widget owns the keyboard model, that parent must move focus onto the active role="button" or point aria-activedescendant at it.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
R8 · Dependency Hygiene · Unlisted import 'react-resizable' · ×1
  • Unlisted import 'react-resizable' langfuse/web/src/features/widgets/components/DashboardGrid.tsx:3 — Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
R9 · Circular Imports · Import cycle (3 files) · ×1
  • Import cycle (3 files) langfuse/packages/shared/src/db.ts:13 — langfuse/packages/shared/src/db.ts → langfuse/packages/shared/src/index.ts → langfuse/packages/shared/src/domain/dataset-items.ts → langfuse/packages/shared/src/db.ts (one verified cycle inside a mutually-dependent group of 142 files)
R9 · Circular Imports · Import cycle (4 files) · ×1
  • Import cycle (4 files) langfuse/web/src/utils/api.ts:25 — langfuse/web/src/utils/api.ts → langfuse/web/src/server/api/root.ts → langfuse/web/src/features/dashboard/server/dashboard-router.ts → langfuse/web/src/features/dashboard/lib/score-analytics-utils.ts → langfuse/web/src/utils/api.ts (one verified cycle inside a mutually-dependent group of 134 files)
R9 · Circular Imports · Import cycle (5 files) · ×1
  • Import cycle (5 files) langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/CreateEvaluatorDialog.tsx:15 — langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/CreateEvaluatorDialog.tsx → langfuse/web/src/features/evals/components/evaluator-form.tsx → langfuse/web/src/features/evals/components/inner-evaluator-form.tsx → langfuse/web/src/features/events/components/EventsTable.tsx → langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/index.tsx → langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/CreateEvaluatorDialog.tsx
Serious — 2101 finding(s)
D3 · God Classes · FunctionTooLong · ×308
  • FunctionTooLong: observations.ObservationsTable langfuse/web/src/components/table/use-cases/observations.tsx:280 — FunctionTooLong — ObservationsTable runs 1639 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1539 over it, 16.39× 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: EventsTable.ObservationsEventsTable langfuse/web/src/features/events/components/EventsTable.tsx:315 — FunctionTooLong — ObservationsEventsTable runs 1569 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1469 over it, 15.69× 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: WidgetForm.WidgetForm langfuse/web/src/features/widgets/components/WidgetForm.tsx:156 — FunctionTooLong — WidgetForm runs 1244 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 1144 over it, 12.44× 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: CreateLLMApiKeyForm.CreateLLMApiKeyForm langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:228 — FunctionTooLong — CreateLLMApiKeyForm runs 970 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 870 over it, 9.70× 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: index.ExperienceSummaryPage langfuse/web/src/pages/project/[projectId]/experience/index.tsx:113 — FunctionTooLong — ExperienceSummaryPage runs 908 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 808 over it, 9.08× 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: traces.TracesTable langfuse/web/src/components/table/use-cases/traces.tsx:134 — FunctionTooLong — TracesTable 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: buildScoreComparisonQuery.buildScoreComparisonQuery langfuse/web/src/features/score-analytics/server/buildScoreComparisonQuery.ts:50 — FunctionTooLong — buildScoreComparisonQuery runs 847 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 747 over it, 8.47× 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: useSidebarFilterState.useSidebarFilterState langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:313 — FunctionTooLong — useSidebarFilterState runs 815 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 715 over it, 8.15× 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: policy.PolicyGovernancePage langfuse/web/src/pages/project/[projectId]/policy.tsx:163 — FunctionTooLong — PolicyGovernancePage runs 806 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 706 over it, 8.06× 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: inner-evaluator-form.InnerEvaluatorForm langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:257 — FunctionTooLong — InnerEvaluatorForm runs 749 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 649 over it, 7.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: blobstorage.BlobStorageIntegrationSettingsForm langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx:179 — FunctionTooLong — BlobStorageIntegrationSettingsForm runs 725 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 625 over it, 7.25× 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: data-table-view-presets-drawer.TableViewPresetsDrawer langfuse/web/src/components/table/table-view-presets/components/data-table-view-presets-drawer.tsx:161 — FunctionTooLong — TableViewPresetsDrawer runs 683 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 583 over it, 6.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: scores.ScoresTable langfuse/web/src/components/table/use-cases/scores.tsx:97 — FunctionTooLong — ScoresTable runs 632 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 532 over it, 6.32× 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: sessions.SessionsTable langfuse/web/src/components/table/use-cases/sessions.tsx:86 — FunctionTooLong — SessionsTable runs 604 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 504 over it, 6.04× 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: CommentList.CommentList langfuse/web/src/features/comments/CommentList.tsx:82 — FunctionTooLong — CommentList runs 588 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 488 over it, 5.88× 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: ObservationDetailView.ObservationDetailView langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:82 — FunctionTooLong — ObservationDetailView runs 572 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 472 over it, 5.72× 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: filter-builder.FilterBuilderForm langfuse/web/src/features/filters/components/filter-builder.tsx:414 — FunctionTooLong — FilterBuilderForm runs 519 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 419 over it, 5.19× 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: DatasetRunsTable.DatasetRunsTable langfuse/web/src/features/datasets/components/DatasetRunsTable.tsx:181 — FunctionTooLong — DatasetRunsTable runs 515 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 415 over it, 5.15× 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: variable-mapping-card.VariableMappingCard langfuse/web/src/features/evals/components/variable-mapping-card.tsx:50 — FunctionTooLong — VariableMappingCard runs 511 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 411 over it, 5.11× 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: TraceGovernanceBanner.TraceGovernanceBanner langfuse/web/src/components/trace2/components/GovernanceBanner/TraceGovernanceBanner.tsx:20 — FunctionTooLong — TraceGovernanceBanner runs 507 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 407 over it, 5.07× 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: AnnotationForm.InnerAnnotationForm langfuse/web/src/features/scores/components/AnnotationForm.tsx:211 — FunctionTooLong — InnerAnnotationForm runs 502 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 402 over it, 5.02× 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: autoErrorAnalysisQueue.autoErrorAnalysisQueueProcessor langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:674 — FunctionTooLong — autoErrorAnalysisQueueProcessor runs 459 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 359 over it, 4.59× 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: PrettyJsonView.PrettyJsonView langfuse/web/src/components/ui/PrettyJsonView.tsx:742 — FunctionTooLong — PrettyJsonView runs 445 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 345 over it, 4.45× 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: ObservationPreview.ObservationPreview langfuse/web/src/components/trace2/ObservationPreview.tsx:44 — FunctionTooLong — ObservationPreview runs 428 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 328 over it, 4.28× 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: ObservationGovernanceAnalysisPanel.ObservationGovernanceAnalysisPanel REDACTED:45 — FunctionTooLong — ObservationGovernanceAnalysisPanel runs 428 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 328 over it, 4.28× 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.
  • + 283 more in this group — see findings.md.
D3 · God Classes · FileTooLong · ×85
  • FileTooLong: REDACTED REDACTED — FileTooLong — 5182 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 4682 over it, 10.36× 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: repositories/events.ts langfuse/packages/shared/src/server/repositories/events.ts — FileTooLong — 2118 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1618 over it, 4.24× 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: use-cases/observations.tsx langfuse/web/src/components/table/use-cases/observations.tsx — FileTooLong — 1915 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: ObservationsTable (280-2425). The bar is 500 significant lines; this is 1415 over it, 3.83× 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: REDACTED REDACTED — FileTooLong — 1863 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1363 over it, 3.73× 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: components/EventsTable.tsx langfuse/web/src/features/events/components/EventsTable.tsx — FileTooLong — 1814 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: ObservationsEventsTable (315-2384). The bar is 500 significant lines; this is 1314 over it, 3.63× 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: repositories/scores.ts langfuse/packages/shared/src/server/repositories/scores.ts — FileTooLong — 1652 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1152 over it, 3.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: otel/OtelIngestionProcessor.ts langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts — FileTooLong — 1646 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1146 over it, 3.29× 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: server/router.ts langfuse/web/src/features/error-analysis/server/router.ts — FileTooLong — 1622 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1122 over it, 3.24× 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: repositories/observations.ts langfuse/packages/shared/src/server/repositories/observations.ts — FileTooLong — 1573 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1073 over it, 3.15× 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: lib/tree-building.clienttest.ts langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts — FileTooLong — 1447 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 947 over it, 2.89× 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: server/dataset-router.ts langfuse/web/src/features/datasets/server/dataset-router.ts — FileTooLong — 1367 significant lines (blank, comment-only and punctuation-only lines excluded), about 84% of them inside a single declaration: datasetRouter (274-1969). The bar is 500 significant lines; this is 867 over it, 2.73× 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: components/WidgetForm.tsx langfuse/web/src/features/widgets/components/WidgetForm.tsx — FileTooLong — 1366 significant lines (blank, comment-only and punctuation-only lines excluded), about 91% of them inside a single declaration: WidgetForm (156-1836). The bar is 500 significant lines; this is 866 over it, 2.73× 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: IngestionService/index.ts langfuse/worker/src/services/IngestionService/index.ts — FileTooLong — 1365 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: IngestionService (252-1957). The bar is 500 significant lines; this is 865 over it, 2.73× 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: REDACTED REDACTED — FileTooLong — 1336 significant lines (blank, comment-only and punctuation-only lines excluded), about 95% of them inside a single declaration: BillingService (67-2075). The bar is 500 significant lines; this is 836 over it, 2.67× 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: arbiteros_kernel/policy_engine_bat.py ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py — FileTooLong — 1326 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 826 over it, 2.65× 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: table/data-table-controls.tsx langfuse/web/src/components/table/data-table-controls.tsx — FileTooLong — 1312 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 812 over it, 2.62× 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: query/dataModel.ts langfuse/web/src/features/query/dataModel.ts — FileTooLong — 1275 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 775 over it, 2.55× 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: repositories/traces.ts langfuse/packages/shared/src/server/repositories/traces.ts — FileTooLong — 1252 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 752 over it, 2.50× 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: trace-graph-view/buildGraphCanvasData.ts langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts — FileTooLong — 1223 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 723 over it, 2.45× 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: repositories/dataset-items.ts langfuse/packages/shared/src/server/repositories/dataset-items.ts — FileTooLong — 1188 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 688 over it, 2.38× 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: arbiteros_kernel/policy_runtime.py ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py — FileTooLong — 1163 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 663 over it, 2.33× 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: components/CreateLLMApiKeyForm.tsx langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx — FileTooLong — 1132 significant lines (blank, comment-only and punctuation-only lines excluded), about 86% of them inside a single declaration: CreateLLMApiKeyForm (228-1403). The bar is 500 significant lines; this is 632 over it, 2.26× 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: policy/relational_policy.py ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py — FileTooLong — 1101 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 601 over it, 2.20× 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: server/router.ts langfuse/web/src/features/policy-governance/server/router.ts — FileTooLong — 1077 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 577 over it, 2.15× 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: routers/promptRouter.ts langfuse/web/src/features/prompts/server/routers/promptRouter.ts — FileTooLong — 1064 significant lines (blank, comment-only and punctuation-only lines excluded), about 81% of them inside a single declaration: promptRouter (87-1364). The bar is 500 significant lines; this is 564 over it, 2.13× 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.
  • + 60 more in this group — see findings.md.
D17 · Explicit Debt · TodoComment · ×73
  • TodoComment langfuse/worker/src/services/ClickhouseWriter/index.ts:428 — // TODO - Add to a dead letter queue in Redis rather than dropping — 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 langfuse/worker/src/scripts/send-test-spend-alert-emails.ts:16 — // TODO ADD EMAILS HERE – these accounts will receive test emails — 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 langfuse/worker/src/scripts/send-test-threshold-emails.ts:20 — // TODO ADD EMAILS HERE – these accounts will receive test emails — 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 langfuse/worker/src/queues/otelIngestionQueue.ts:197 — // TODO: Do we need to add these files into the blob_storage_file_log? — 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 langfuse/worker/src/queues/webhooks.ts:49 — // TODO: Webhook outgoing API versioning — 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 langfuse/worker/src/queues/webhooks.ts:552 — // TODO: Custom templates not supported via the UI yet — 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 langfuse/worker/src/features/experiments/utils.ts:110 — // TODO: should we throw? — 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 langfuse/worker/src/features/database-read-stream/getDatabaseReadStream.ts:45 — // TODO: flip to validFrom once we write in new format — 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 langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:619 — // TODO: Remove for golive — 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 langfuse/worker/src/backgroundMigrations/backfillEventsHistoricFromParts.ts:470 — // TODO: Remove for golive — 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 langfuse/worker/src/__tests__/encryption.test.ts:2 — // TODO: move test to shared and create test setup there. — 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 langfuse/worker/src/__tests__/experimentsService.test.ts:555 — // TODO: add when we remove PG execution path — 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 langfuse/worker/src/__tests__/extractToolsBackend.test.ts:63 — // TODO: Re-enable when OTel processor maps gen_ai.tool.definitions → input.tools — 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 langfuse/worker/src/__tests__/extractToolsBackend.test.ts:87 — // TODO: Re-enable when OTel processor maps llm.tools.*.tool.json_schema → input.tools — 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 langfuse/worker/src/__tests__/extractToolsBackend.test.ts:603 — // TODO: Re-enable when OTel processor maps metadata.attributes.model_request_parameters.function_tools → input.tools — 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 langfuse/worker/src/__tests__/chatml/adapters/gemini.test.ts:179 — // TODO: remove — 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 langfuse/web/src/server/api/routers/models.ts:290 — // TODO(LFE-3229): After models table cleanup, enforce uniqueness constraint directly on (projectId, modelName)
  • TodoComment langfuse/web/src/server/api/routers/models.ts:317 — // Set fix start date for uniqueness constraint to work. TODO: drop after cleanup of models table in LFE-3229
  • TodoComment langfuse/web/src/server/api/routers/models.ts:318 — // Set fix unit for uniqueness constraint to work. TODO: drop after cleanup of models table in LFE-3229
  • TodoComment langfuse/web/src/pages/project/[projectId]/datasets/[datasetId]/compare/charts.tsx:202 — // TODO: remove when revamping the datasets api for it to directly return ms — 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 langfuse/web/src/features/datasets/components/DatasetRunsTable.tsx:645 — // TODO: remove when revamping the datasets api for it to directly return ms — 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 langfuse/web/src/hooks/useParsedObservation.ts:261 — // TODO: remove when going into prod — 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 langfuse/web/src/hooks/use-environment-filter.tsx:8 — // TODO: Add the environment selection to the query params to persist the environment filter when sharing links. — 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 langfuse/web/src/features/trace-graph-view/buildStepData.ts:235 — // TODO: move this filter to a separate function — 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 langfuse/web/src/features/trace-graph-view/components/TraceGraphView.tsx:65 — // TODO: make detection more robust based on metadata — 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.
  • + 48 more in this group — see findings.md.
D30 · Dependency Vulnerabilities · Medium CVE · ×60
  • 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
  • + 35 more in this group — see findings.md.
AX7 · Slice cohesion · Cross-slice coupling · ×40
  • Cross-slice coupling: datasets → folders langfuse/packages/shared/src/features/datasets/validation.ts:7 — `DatasetNameSchema` (slice 'datasets') depends on `withFolderPathValidation` from slice 'folders'.
  • Cross-slice coupling: prompts → folders langfuse/packages/shared/src/features/prompts/validation.ts:12 — `PromptNameSchema` (slice 'prompts') depends on `withFolderPathValidation` from slice 'folders'.
  • Cross-slice coupling: annotation-queues → rbac langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemPage.tsx:34 — `AnnotationQueueItemPage` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'.
  • Cross-slice coupling: annotation-queues → rbac langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx:53 — `QueueItemTableMultiSelectAction` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'.
  • Cross-slice coupling: annotation-queues → column-visibility langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx:411 — `AnnotationQueueItemsTable` (slice 'annotation-queues') depends on `useColumnVisibility` from slice 'column-visibility'.
  • Cross-slice coupling: annotation-queues → column-visibility langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx:416 — `AnnotationQueueItemsTable` (slice 'annotation-queues') depends on `useColumnOrder` from slice 'column-visibility'.
  • Cross-slice coupling: annotation-queues → rbac langfuse/web/src/features/annotation-queues/components/AnnotationQueuesItem.tsx:26 — `AnnotationQueuesItem` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'.
  • Cross-slice coupling: annotation-queues → rbac langfuse/web/src/features/annotation-queues/components/AnnotationQueuesTable.tsx:58 — `AnnotationQueuesTable` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'.
  • Cross-slice coupling: annotation-queues → scores langfuse/web/src/features/annotation-queues/components/AnnotationQueuesTable.tsx:135 — `AnnotationQueuesTable` (slice 'annotation-queues') depends on `getScoreDataTypeIcon` from slice 'scores'.
  • Cross-slice coupling: annotation-queues → column-visibility langfuse/web/src/features/annotation-queues/components/AnnotationQueuesTable.tsx:223 — `AnnotationQueuesTable` (slice 'annotation-queues') depends on `useColumnVisibility` from slice 'column-visibility'.
  • Cross-slice coupling: annotation-queues → column-visibility langfuse/web/src/features/annotation-queues/components/AnnotationQueuesTable.tsx:228 — `AnnotationQueuesTable` (slice 'annotation-queues') depends on `useColumnOrder` from slice 'column-visibility'.
  • Cross-slice coupling: annotation-queues → rbac langfuse/web/src/features/annotation-queues/components/CreateNewAnnotationQueueItem.tsx:35 — `CreateNewAnnotationQueueItem` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'.
  • Cross-slice coupling: annotation-queues → rbac langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:64 — `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'.
  • Cross-slice coupling: annotation-queues → entitlements langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:72 — `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `useEntitlementLimit` from slice 'entitlements'.
  • Cross-slice coupling: annotation-queues → posthog-analytics langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:74 — `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `usePostHogClientCapture` from slice 'posthog-analytics'.
  • Cross-slice coupling: annotation-queues → notifications langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:190 — `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `showErrorToast` from slice 'notifications'.
  • Cross-slice coupling: annotation-queues → scores langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:299 — `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `MultiSelectKeyValues` from slice 'scores'.
  • Cross-slice coupling: annotation-queues → scores langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:309 — `CreateOrEditAnnotationQueueButton` (slice 'annotation-queues') depends on `getScoreDataTypeIcon` from slice 'scores'.
  • Cross-slice coupling: annotation-queues → rbac langfuse/web/src/features/annotation-queues/components/DeleteAnnotationQueueButton.tsx:26 — `DeleteAnnotationQueueButton` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'.
  • Cross-slice coupling: annotation-queues → rbac langfuse/web/src/features/annotation-queues/components/UserAssignmentSection.tsx:25 — `UserAssignmentSection` (slice 'annotation-queues') depends on `useHasProjectAccess` from slice 'rbac'.
  • Cross-slice coupling: annotation-queues → notifications langfuse/web/src/features/annotation-queues/components/UserAssignmentSection.tsx:47 — `UserAssignmentSection` (slice 'annotation-queues') depends on `showSuccessToast` from slice 'notifications'.
  • Cross-slice coupling: annotation-queues → auth langfuse/web/src/features/annotation-queues/components/processors/TraceAnnotationProcessor.tsx:41 — `TraceAnnotationProcessor` (slice 'annotation-queues') depends on `useIsAuthenticatedAndProjectMember` from slice 'auth'.
  • Cross-slice coupling: annotation-queues → scores langfuse/web/src/features/annotation-queues/components/shared/AnnotationDrawerSection.tsx:19 — `AnnotationDrawerSectionProps` (slice 'annotation-queues') depends on `ScoreTarget` from slice 'scores'.
  • Cross-slice coupling: annotation-queues → scores langfuse/web/src/features/annotation-queues/components/shared/AnnotationDrawerSection.tsx:38 — `AnnotationDrawerSection` (slice 'annotation-queues') depends on `AnnotationForm` from slice 'scores'.
  • Cross-slice coupling: annotation-queues → comments langfuse/web/src/features/annotation-queues/components/shared/CommentsSection.tsx:18 — `CommentsSection` (slice 'annotation-queues') depends on `CommentList` from slice 'comments'.
  • + 15 more in this group — see findings.md.
R4 · Test Coverage · No test reaches this file · ×40
  • No test reaches this file langfuse/web/src/features/events/components/EventsTable.tsx:1 — 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 langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts:1 — 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 langfuse/web/src/features/widgets/components/WidgetForm.tsx:1 — 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 langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:1 — 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 langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:1 — 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 langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:1 — 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 langfuse/web/src/pages/project/[projectId]/experience/index.tsx:1 — 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 langfuse/web/src/pages/project/[projectId]/policy.tsx:1 — 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 langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:1 — 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 langfuse/web/src/components/session/index.tsx:1 — 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:1 — 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 langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx:1 — 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 langfuse/web/src/utils/chatml/jumptoplayground.clienttest.ts:1 — 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 langfuse/web/src/features/playground/page/context/index.tsx:1 — 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 langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:1 — 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 langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:1 — 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 langfuse/web/src/components/table/use-cases/scores.tsx:1 — 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 langfuse/web/src/features/scores/components/AnnotationForm.tsx:1 — 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 langfuse/web/src/components/trace2/components/_shared/tree-flattening.clienttest.ts:1 — 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 langfuse/worker/src/features/eventPropagation/handleExperimentBackfill.ts:1 — 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 langfuse/web/src/pages/auth/sign-in.tsx:1 — 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 langfuse/worker/src/backgroundMigrations/backfillEventsHistoricFromParts.ts:1 — 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 langfuse/packages/shared/scripts/seeder/utils/postgres-seed-constants.ts:1 — 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 langfuse/worker/src/scripts/replayIngestionEvents/s3-ingestion-event-replay.ts:1 — 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 langfuse/web/src/features/policy-governance/components/PolicyGuideCard.tsx:1 — 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.
  • + 15 more in this group — see findings.md.
X3 · Exception handling · Swallowed exception (empty catch) · ×39
  • Swallowed exception (empty catch) langfuse/worker/src/scripts/replayIngestionEvents/s3-ingestion-event-replay.ts:495 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/worker/src/scripts/replayIngestionEvents/s3-ingestion-event-replay.ts:604 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:398 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:541 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/utils/date-range-utils.ts:681 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/hooks/useClickWithoutSelection.ts:101 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/hooks/useCollapsibleSystemPrompt.ts:58 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/hooks/useFormPersistence.ts:71 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/support-chat/trpc/plainRouter.ts:278 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) REDACTED:323 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/public-api/server/RateLimitService.ts:91 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/policy-suggestions/server/router.ts:324 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/policy-governance/server/router.ts:282 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/policy-governance/server/router.ts:620 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/playground/page/components/JumpToPlaygroundButton.tsx:387 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/playground/page/components/JumpToPlaygroundButton.tsx:413 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/playground/page/components/JumpToPlaygroundButton.tsx:525 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/playground/page/components/JumpToPlaygroundButton.tsx:567 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/onboarding/hooks/useSurveyForm.ts:102 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/onboarding/components/OnboardingSurvey.tsx:77 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/natural-language-filters/server/utils.ts:42 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/i18n/LanguageProvider.tsx:54 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/i18n/LanguageProvider.tsx:75 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/governance/utils/policyMetadata.ts:84 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • Swallowed exception (empty catch) langfuse/web/src/features/governance/utils/policyMetadata.ts:109 — An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
  • + 14 more in this group — see findings.md.
D3 · God Classes · ClassTooLong · ×25
  • ClassTooLong: BillingService REDACTED:67 — ClassTooLong — 1272 significant lines (blank, comment-only and punctuation-only lines excluded), 20 methods. The bar is 400 significant lines; this is 872 over it, 3.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: WidgetForm langfuse/web/src/features/widgets/components/WidgetForm.tsx:1 — ClassTooLong — 1244 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 844 over it, 3.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: IngestionService langfuse/worker/src/services/IngestionService/index.ts:252 — ClassTooLong — 1168 significant lines (blank, comment-only and punctuation-only lines excluded), 29 methods. The bar is 400 significant lines; this is 768 over it, 2.92× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DataGenerator langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:48 — ClassTooLong — 980 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 580 over it, 2.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CreateLLMApiKeyForm langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:1 — ClassTooLong — 970 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 570 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: promptRouter langfuse/web/src/features/prompts/server/routers/promptRouter.ts:1 — ClassTooLong — 858 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 458 over it, 2.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: buildScoreComparisonQuery langfuse/web/src/features/score-analytics/server/buildScoreComparisonQuery.ts:1 — ClassTooLong — 847 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 447 over it, 2.12× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: useSidebarFilterState langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:1 — ClassTooLong — 815 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 415 over it, 2.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: QueryBuilder langfuse/web/src/features/query/server/queryBuilder.ts:42 — ClassTooLong — 744 significant lines (blank, comment-only and punctuation-only lines excluded), 34 methods. The bar is 400 significant lines; this is 344 over it, 1.86× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TraceGraphCanvas langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx:1 — ClassTooLong — 734 significant lines (blank, comment-only and punctuation-only lines excluded), 8 methods. The bar is 400 significant lines; this is 334 over it, 1.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: CommentList langfuse/web/src/features/comments/CommentList.tsx:1 — ClassTooLong — 588 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 188 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ObservationDetailView langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:1 — ClassTooLong — 572 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 172 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: DatasetRunsTable langfuse/web/src/features/datasets/components/DatasetRunsTable.tsx:1 — ClassTooLong — 515 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 115 over it, 1.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TraceGovernanceBanner langfuse/web/src/components/trace2/components/GovernanceBanner/TraceGovernanceBanner.tsx:1 — ClassTooLong — 507 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 107 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: projectsRouter langfuse/web/src/features/projects/server/projectsRouter.ts:1 — ClassTooLong — 505 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 105 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BackfillEventsHistoricFromParts langfuse/worker/src/backgroundMigrations/backfillEventsHistoricFromParts.ts:60 — ClassTooLong — 462 significant lines (blank, comment-only and punctuation-only lines excluded), 12 methods. The bar is 400 significant lines; this is 62 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: BackfillEventsHistoric langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:175 — ClassTooLong — 452 significant lines (blank, comment-only and punctuation-only lines excluded), 10 methods. The bar is 400 significant lines; this is 52 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PrettyJsonView langfuse/web/src/components/ui/PrettyJsonView.tsx:1 — ClassTooLong — 445 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 45 over it, 1.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: membersRouter langfuse/web/src/features/rbac/server/membersRouter.ts:1 — ClassTooLong — 432 significant lines (blank, comment-only and punctuation-only lines excluded), 3 methods. The bar is 400 significant lines; this is 32 over it, 1.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ObservationGovernanceAnalysisPanel REDACTED:1 — ClassTooLong — 428 significant lines (blank, comment-only and punctuation-only lines excluded), 2 methods. The bar is 400 significant lines; this is 28 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ObservationPreview langfuse/web/src/components/trace2/ObservationPreview.tsx:1 — ClassTooLong — 428 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 28 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ErrorAnalysisSettings langfuse/web/src/features/error-analysis/components/ErrorAnalysisSettings.tsx:1 — ClassTooLong — 423 significant lines (blank, comment-only and punctuation-only lines excluded), 5 methods. The bar is 400 significant lines; this is 23 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: TracePreview langfuse/web/src/components/trace2/TracePreview.tsx:1 — ClassTooLong — 423 significant lines (blank, comment-only and punctuation-only lines excluded), 1 methods. The bar is 400 significant lines; this is 23 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: ErrorAnalysisDropdown langfuse/web/src/features/error-analysis/components/ErrorAnalysisDropdown.tsx:1 — ClassTooLong — 413 significant lines (blank, comment-only and punctuation-only lines excluded), 4 methods. The bar is 400 significant lines; this is 13 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: PolicyGuideCard langfuse/web/src/features/policy-governance/components/PolicyGuideCard.tsx:1 — ClassTooLong — 409 significant lines (blank, comment-only and punctuation-only lines excluded), 7 methods. The bar is 400 significant lines; this is 9 over it, 1.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
AC2 · Forms & labels · <Select> field component without a label · ×21
  • <Select> field component without a label langfuse/web/src/components/ModelParameters/index.tsx:231 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label langfuse/web/src/components/ModelParameters/index.tsx:347 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label langfuse/web/src/components/ModelParameters/index.tsx:396 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label langfuse/web/src/components/PagedSettingsContainer.tsx:54 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/components/date-range-dropdowns.tsx:52 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/components/projectNavigation.tsx:29 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/components/table/data-table-pagination.tsx:95 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/components/table/key-value-filter-builder.tsx:285 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label langfuse/web/src/components/table/key-value-filter-builder.tsx:316 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label langfuse/web/src/components/table/key-value-filter-builder.tsx:355 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label langfuse/web/src/components/ui/time-period-select.tsx:57 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label langfuse/web/src/features/auth/components/AuthCloudRegionSwitch.tsx:84 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/components/SourceFieldSelector.tsx:22 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Select> field component without a label langfuse/web/src/features/error-analysis/components/ErrorAnalysisDropdown.tsx:634 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/features/evals/components/eval-template-detail.tsx:197 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/features/filters/components/filter-builder.tsx:727 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/features/filters/components/filter-builder.tsx:766 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/features/filters/components/filter-builder.tsx:787 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/features/filters/components/filter-builder.tsx:825 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/features/filters/components/filter-builder.tsx:954 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
  • <Select> field component without a label langfuse/web/src/features/models/components/PriceUnitSelector.tsx:45 — This select is named only by the placeholder of its value part. Nothing is typed into a select, so the placeholder does not vanish on input: it is shown as the trigger's text until a value is chosen, and then the chosen value replaces it — so at no point does the control state what the choice is for, and the trigger's role (combobox) takes its name from the author, not from that text. Name it: an aria-label on the trigger, or an id on the trigger with a <label htmlFor> pointing at it.
X17 · Uncapped recursion over a caller-supplied document · Recursive walk over a caller-supplied document has no depth cap · ×19
  • Recursive walk over a caller-supplied document has no depth cap langfuse/web/src/features/column-visibility/hooks/useColumnVisibility.ts:29 — `useColumnVisibility` is exported, takes a document from its caller (line 41) and hands it to `setVisibility`, which calls itself at line 29 (`setVisibility`) with a piece of `column` — and nowhere in `setVisibility` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `setVisibility` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap langfuse/web/src/components/ui/AdvancedJsonViewer/utils/jsonTypes.ts:229 — `countAllDescendants` is exported and takes `value: unknown` from its caller, and it calls itself at line 229 (`countAllDescendants`) with a piece of `value` — and nowhere in `countAllDescendants` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `countAllDescendants` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap langfuse/web/src/components/ui/AdvancedJsonViewer/utils/rowCount.ts:40 — `countJsonRows` is exported and takes `data: unknown` from its caller, and it calls itself at line 40 (`countJsonRows`) with a piece of `data` (and at line 52) — and nowhere in `countJsonRows` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `countJsonRows` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap langfuse/web/src/components/trace2/lib/helpers.ts:194 — `unnestObservation` is exported and takes `nestedObservation: NestedObservation` from its caller, and it calls itself at line 194 (`unnestObservation`) with a piece of `nestedObservation` — and nowhere in `unnestObservation` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `unnestObservation` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap langfuse/packages/shared/src/server/otel/utils.ts:30 — `flattenJsonToPathArrays` is exported and takes `obj: Record<string, unknown>` from its caller, and it calls itself at line 30 (`flattenJsonToPathArrays`) with a piece of `obj` — and nowhere in `flattenJsonToPathArrays` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `flattenJsonToPathArrays` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap langfuse/packages/shared/src/features/evals/utilities.ts:45 — `extractValueFromObject` is exported, takes a document from its caller (line 66) and hands it to `parseMultiEncodedJson`, which calls itself at line 45 (`parseMultiEncodedJson`) with a piece of `value` — and nowhere in `parseMultiEncodedJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `parseMultiEncodedJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap langfuse/packages/shared/src/features/batchAction/applyFieldMapping.ts:291 — `generateJsonPathSuggestions` is exported and takes `data: unknown` from its caller, and it calls itself at line 291 (`generateJsonPathSuggestions`) with a piece of `data` (and at line 302) — and nowhere in `generateJsonPathSuggestions` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `generateJsonPathSuggestions` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap REDACTED:1512 — `async_pre_call_hook` is public, takes a document from its caller (line 5926) and hands it to `_to_json`, which calls itself at line 1512 (`_to_json`) with a piece of `obj` (and at line 1514) — and nowhere in `_to_json` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_to_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:150 — `canonicalize_args` is public and takes `args: Any` from its caller, and it calls itself at line 150 (`canonicalize_args`) with a piece of `args` (and at line 153) — and nowhere in `canonicalize_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:167 — `redact_args` is public and takes `args: Any` from its caller, and it calls itself at line 167 (`redact_args`) with a piece of `args` (and at line 170) — and nowhere in `redact_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:88 — `canonicalize_args` is public and takes `args: Any` from its caller, and it calls itself at line 88 (`canonicalize_args`) with a piece of `args` (and at line 91) — and nowhere in `canonicalize_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:105 — `redact_args` is public and takes `args: Any` from its caller, and it calls itself at line 105 (`redact_args`) with a piece of `args` (and at line 108) — and nowhere in `redact_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `redact_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:610 — `canonicalize_tool_args` is public and takes `args: Any` from its caller, and it calls itself at line 610 (`self.canonicalize_tool_args`) with a piece of `args` (and at line 614) — and nowhere in `canonicalize_tool_args` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize_tool_args` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:937 — `check_taint_sink_for_tool` is public, takes a document from its caller (line 904) and hands it to `_collect_strings`, which calls itself at line 937 (`_collect_strings`) with a piece of `x` (and at line 941) — and nowhere in `_collect_strings` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_collect_strings` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_sentinel_policy.py:151 — `check` is public, takes a document from its caller (line 321) and hands it to `_coerce_text`, which calls itself at line 151 (`_coerce_text`) with a piece of `value` — and nowhere in `_coerce_text` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_coerce_text` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_trigger.py:264 — `should_trigger_postexec_sentinel` is public, takes a document from its caller (line 535) and hands it to `_walk`, which calls itself at line 264 (`_walk`) with a piece of `node` (and at line 270) — and nowhere in `_walk` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_walk` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:698 — `validate_policy_rule_ir` is public, takes a document from its caller (line 211) and hands it to `_validate_predicate`, which calls itself at line 698 (`_validate_predicate`) with a piece of `raw` — and nowhere in `_validate_predicate` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_validate_predicate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:751 — `compile_policy_rule_ir_to_unary_gate_rules` is public, takes a document from its caller (line 252) and hands it to `_compile_predicate`, which calls itself at line 751 (`_compile_predicate`) with a piece of `raw` (and at line 753) — and nowhere in `_compile_predicate` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_compile_predicate` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
  • Recursive walk over a caller-supplied document has no depth cap ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:804 — `validate_policy_rule_ir` is public, takes a document from its caller (line 211) and hands it to `_extract_vars`, which calls itself at line 804 (`_extract_vars`) with a piece of `raw` (and at line 807) — and nowhere in `_extract_vars` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_extract_vars` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
D15 · Churn × Complexity Hotspots · Hotspot · ×17
  • Hotspot: REDACTED REDACTED:6313 — REDACTED changed 18 times in last 90 days, max cyclomatic complexity 116 in MyCustomHandler.async_post_call_success_hook at line 6313. 3 of those changes were fix/bug commits, and the other 15 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-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- REDACTED`: 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.
  • Hotspot: REDACTED REDACTED:6313 — REDACTED changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 116 in MyCustomHandler.async_post_call_success_hook at line 6313. 1 of those changes was a fix/bug commit, and the other 12 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-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- REDACTED`: 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.
  • Hotspot: arbiteros_kernel/instruction_parsing/types.py arbiteros_kernel/instruction_parsing/types.py:149 — arbiteros_kernel/instruction_parsing/types.py changed 15 times in last 90 days, max cyclomatic complexity 28 in types.compute_prop_taint_for_instruction at line 149. 2 of those changes were fix/bug commits, and the other 13 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-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- arbiteros_kernel/instruction_parsing/types.py`: 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.
  • Hotspot: REDACTED REDACTED:620 — REDACTED changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in unary_gate_policy._eval_predicate at line 620. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- REDACTED`: 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.
  • Hotspot: arbiteros_kernel/policy_check.py arbiteros_kernel/policy_check.py:313 — arbiteros_kernel/policy_check.py changed 10 times in last 90 days, max cyclomatic complexity 18 in policy_check.check_response_policy at line 313. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- arbiteros_kernel/policy_check.py`: 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.
  • Hotspot: arbiteros_kernel/policy_runtime.py arbiteros_kernel/policy_runtime.py:827 — arbiteros_kernel/policy_runtime.py changed 4 times in last 90 days, max cyclomatic complexity 36 in KernelPolicyRuntime.build_taint_state at line 827. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- arbiteros_kernel/policy_runtime.py`: 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.
  • Hotspot: ArbiterOS-Kernel/arbiteros_kernel/policy_check.py ArbiterOS-Kernel/arbiteros_kernel/policy_check.py:313 — ArbiterOS-Kernel/arbiteros_kernel/policy_check.py changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in policy_check.check_response_policy at line 313. 1 of those changes was a fix/bug commit, and the other 6 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-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- ArbiterOS-Kernel/arbiteros_kernel/policy_check.py`: 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.
  • Hotspot: REDACTED REDACTED:620 — REDACTED changed 2 times in last 90 days, max cyclomatic complexity 63 in unary_gate_policy._eval_predicate at line 620. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- REDACTED`: 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.
  • Hotspot: arbiteros_kernel/policy/taint_policy.py arbiteros_kernel/policy/taint_policy.py:147 — arbiteros_kernel/policy/taint_policy.py changed 4 times in last 90 days, max cyclomatic complexity 23 in TaintPolicy.check at line 147. 1 of those changes was a fix/bug commit, and the other 3 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-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- arbiteros_kernel/policy/taint_policy.py`: 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.
  • Hotspot: arbiteros_kernel/policy/exec_composite_policy.py arbiteros_kernel/policy/exec_composite_policy.py:327 — arbiteros_kernel/policy/exec_composite_policy.py changed 2 times in last 90 days, max cyclomatic complexity 44 in ExecCompositePolicy.check at line 327. 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-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- arbiteros_kernel/policy/exec_composite_policy.py`: 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.
  • Hotspot: ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1073 — ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in RelationalPolicy.check at line 1073. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py`: 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.
  • Hotspot: arbiteros_kernel/policy/relational_policy.py arbiteros_kernel/policy/relational_policy.py:1073 — arbiteros_kernel/policy/relational_policy.py changed 2 times in last 90 days, max cyclomatic complexity 40 in RelationalPolicy.check at line 1073. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- arbiteros_kernel/policy/relational_policy.py`: 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.
  • Hotspot: arbiteros_kernel/policy/security_label_policy.py arbiteros_kernel/policy/security_label_policy.py:43 — arbiteros_kernel/policy/security_label_policy.py changed 2 times in last 90 days, max cyclomatic complexity 26 in SecurityLabelPolicy.check at line 43. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- arbiteros_kernel/policy/security_label_policy.py`: 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.
  • Hotspot: ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:659 — ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in policy_rule_ir._validate_predicate at line 659. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py`: 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.
  • Hotspot: REDACTED REDACTED:615 — REDACTED changed 2 times in last 90 days, max cyclomatic complexity 23 in run_cases.main at line 615. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- REDACTED`: 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.
  • Hotspot: arbiteros_kernel/policy/efsm_gate_policy.py arbiteros_kernel/policy/efsm_gate_policy.py:90 — arbiteros_kernel/policy/efsm_gate_policy.py changed 2 times in last 90 days, max cyclomatic complexity 22 in EfsmGatePolicy.check at line 90. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- arbiteros_kernel/policy/efsm_gate_policy.py`: 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.
  • Hotspot: arbiteros_kernel/policy/allow_deny_policy.py arbiteros_kernel/policy/allow_deny_policy.py:64 — arbiteros_kernel/policy/allow_deny_policy.py changed 2 times in last 90 days, max cyclomatic complexity 16 in AllowDenyPolicy.check at line 64. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-03-03..2026-06-01, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-03-03 11:42:31 +08:00' --until='2026-06-01 11:42:31 +08:00' --full-history --no-merges -- arbiteros_kernel/policy/allow_deny_policy.py`: 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.
D3 · God Classes · MethodTooLong · ×16
  • MethodTooLong: BillingService.changePlan REDACTED:779 — MethodTooLong — changePlan runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.62× 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.
  • MethodTooLong: DataGenerator.generateSupportChatSessionData langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:969 — MethodTooLong — generateSupportChatSessionData runs 256 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 156 over it, 2.56× 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.
  • MethodTooLong: DataGenerator.generateComprehensiveAIWorkflowTrace langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:613 — MethodTooLong — generateComprehensiveAIWorkflowTrace runs 201 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× 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.
  • MethodTooLong: BackfillEventsHistoricFromParts.run langfuse/worker/src/backgroundMigrations/backfillEventsHistoricFromParts.ts:537 — MethodTooLong — run runs 163 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× 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.
  • MethodTooLong: BillingService.getSubscriptionInfo REDACTED:312 — MethodTooLong — getSubscriptionInfo runs 157 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× 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.
  • MethodTooLong: IngestionService.processObservationEventList langfuse/worker/src/services/IngestionService/index.ts:849 — MethodTooLong — processObservationEventList 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.
  • MethodTooLong: BackfillEventsHistoric.run langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:686 — MethodTooLong — run runs 131 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 31 over it, 1.31× 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.
  • MethodTooLong: QueryBuilder.build langfuse/web/src/features/query/server/queryBuilder.ts:1100 — MethodTooLong — build runs 129 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 29 over it, 1.29× 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.
  • MethodTooLong: DataGenerator.generateSyntheticObservations langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:420 — MethodTooLong — generateSyntheticObservations runs 116 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 16 over it, 1.16× 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.
  • MethodTooLong: ApiAuthService.verifyAuthHeaderAndReturnScope langfuse/web/src/features/public-api/server/apiAuth.ts:86 — MethodTooLong — verifyAuthHeaderAndReturnScope 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.
  • MethodTooLong: IngestionService.createEventRecord langfuse/worker/src/services/IngestionService/index.ts:331 — MethodTooLong — createEventRecord 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.
  • MethodTooLong: BillingService.applyPromotionCode REDACTED:1909 — MethodTooLong — applyPromotionCode runs 112 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 12 over it, 1.12× 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.
  • MethodTooLong: AddGenerationsCostBackfill.run REDACTED:62 — MethodTooLong — run runs 111 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 11 over it, 1.11× 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.
  • MethodTooLong: FrameworkTraceLoader.adaptTrace langfuse/packages/shared/scripts/seeder/utils/framework-traces/framework-trace-loader.ts:66 — MethodTooLong — adaptTrace runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× 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.
  • MethodTooLong: MigrateDatasetRunItemsFromPostgresToClickhouseRmt.run langfuse/worker/src/backgroundMigrations/migrateDatasetRunItemsFromPostgresToClickhouseRmt.ts:63 — MethodTooLong — run runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× 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.
  • MethodTooLong: ClickhouseWriter.flush langfuse/worker/src/services/ClickhouseWriter/index.ts:271 — MethodTooLong — flush runs 102 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 2 over it, 1.02× 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 · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · Medium IaC · ×13
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X2 · Cancellation propagation · Async function without AbortSignal · ×11
  • Async function without AbortSignal: sendBatch langfuse/worker/src/features/mixpanel/mixpanelClient.ts:55 — `sendBatch` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: createUser REDACTED:876 — `createUser` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: uploadToPlainS3 langfuse/web/src/features/support-chat/SupportFormSection.tsx:216 — `uploadToPlainS3` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: sendToSlack langfuse/web/src/features/slack/server/slack-webhook.ts:3 — `sendToSlack` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getChatCompletionWithTools langfuse/web/src/features/playground/page/context/index.tsx:701 — `getChatCompletionWithTools` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getChatCompletionWithStructuredOutput langfuse/web/src/features/playground/page/context/index.tsx:743 — `getChatCompletionWithStructuredOutput` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getChatCompletionStream langfuse/web/src/features/playground/page/context/index.tsx:784 — `getChatCompletionStream` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: getChatCompletionNonStreaming langfuse/web/src/features/playground/page/context/index.tsx:845 — `getChatCompletionNonStreaming` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: syncLanguageCookie langfuse/web/src/features/i18n/LanguageProvider.tsx:45 — `syncLanguageCookie` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: fetchWithSecureRedirects langfuse/packages/shared/src/server/webhooks/redirectHandler.ts:90 — `fetchWithSecureRedirects` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
  • Async function without AbortSignal: request langfuse/packages/shared/src/server/auth/gitHubEnterpriseProvider.ts:27 — `request` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
D29 · Static Analysis (SAST) · REDACTED · ×10
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Both branches are identical · ×9
  • Both branches are identical — the condition decides nothing langfuse/web/src/components/table/data-table-pagination.tsx:161 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
  • Both branches are identical — the condition decides nothing langfuse/web/src/ee/features/billing/utils/stripeCatalogue.ts:30 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
  • Both branches are identical — the condition decides nothing langfuse/web/src/ee/features/billing/utils/stripeCatalogue.ts:50 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
  • Both branches are identical — the condition decides nothing langfuse/web/src/ee/features/billing/utils/stripeCatalogue.ts:72 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
  • Both branches are identical — the condition decides nothing langfuse/web/src/ee/features/billing/utils/stripeCatalogue.ts:92 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
  • Both branches are identical — the condition decides nothing langfuse/web/src/features/datasets/components/DatasetVersionHistoryPanel.tsx:173 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
  • Both branches are identical — the condition decides nothing langfuse/web/src/features/i18n/LanguageSwitcher.tsx:72 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
  • Both branches are identical — the condition decides nothing langfuse/web/src/features/score-analytics/components/charts/MetricCard.tsx:94 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
  • Both branches are identical — the condition decides nothing langfuse/web/src/features/score-analytics/lib/ScoreChartTooltip.tsx:106 — Both arms of this conditional expression are the same, so no input can make the condition matter. Implement the distinction that was intended, or drop the condition.
D29 · Static Analysis (SAST) · REDACTED · ×8
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
R11 · Import Boundaries · Boundary violation [package · ×8
  • Boundary violation [package:third-party-deep-import] langfuse/packages/shared/src/server/clickhouse/client.ts:3 — langfuse/packages/shared/src/server/clickhouse/client.ts:3 imports @clickhouse/client/dist/config, 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] langfuse/packages/shared/src/server/repositories/clickhouse.ts:11 — langfuse/packages/shared/src/server/repositories/clickhouse.ts:11 imports @clickhouse/client/dist/config, 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] langfuse/packages/shared/src/server/services/email/batchExportSuccess/sendBatchExportSuccessEmail.ts:2 — langfuse/packages/shared/src/server/services/email/batchExportSuccess/sendBatchExportSuccessEmail.ts:2 imports nodemailer/lib/shared/index.js, 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] langfuse/packages/shared/src/server/services/email/cloudSpendAlert/sendCloudSpendAlertEmail.ts:2 — langfuse/packages/shared/src/server/services/email/cloudSpendAlert/sendCloudSpendAlertEmail.ts:2 imports nodemailer/lib/shared/index.js, 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] langfuse/packages/shared/src/server/services/email/commentMention/sendCommentMentionEmail.ts:2 — langfuse/packages/shared/src/server/services/email/commentMention/sendCommentMentionEmail.ts:2 imports nodemailer/lib/shared/index.js, 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] REDACTED:2 — REDACTED:2 imports nodemailer/lib/shared/index.js, 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] langfuse/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts:2 — langfuse/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts:2 imports nodemailer/lib/shared/index.js, 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] langfuse/packages/shared/src/server/services/email/usageThresholdWarning/sendUsageThresholdWarningEmail.ts:2 — langfuse/packages/shared/src/server/services/email/usageThresholdWarning/sendUsageThresholdWarningEmail.ts:2 imports nodemailer/lib/shared/index.js, 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.
D29 · Static Analysis (SAST) · REDACTED · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×7
  • Duplicated block (9 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_trigger.py:318 — ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_trigger.py:318-326 | ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:279-287 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:169 — ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:169-177 | ArbiterOS-Kernel/arbiteros_kernel/policy/rate_limit_policy.py:89-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ArbiterOS-Kernel/arbiteros_kernel/policy/rate_limit_policy.py:99` calls `_prior_history` and `ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:179` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:117 — ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:117-125 | ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:167-175 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (9 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:800 — ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:800-808 | ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:759-767 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (9 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1097 — ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1097-1105 | ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:163-171 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1106` calls `set` and `ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:172` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (9 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:148 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:148-156 | REDACTED:1852-1860 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (9 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:160 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:160-168 | REDACTED:1864-1872 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×6
  • Duplicated block (12 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:133 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:133-144 | ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:36-47 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:12 — ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:12-23 | REDACTED:125-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (12 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:171 — ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:171-182 | ArbiterOS-Kernel/arbiteros_kernel/policy/schema_policy.py:90-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:167` calls `_get_delete_policy_config`, `PolicyCheckResult` and `ArbiterOS-Kernel/arbiteros_kernel/policy/schema_policy.py:89` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:47 — ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:47-59 | ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:68-79 — 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. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (12 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:160 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:160-171 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:98-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:460 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:460-471 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:304-315 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `instruction_type` to `Optional[str]` in one and `str` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×6
  • Duplicated block (10 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:467 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:467-476 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:406-415 — before extracting anything, compare `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py` and `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:467` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (10 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:672 — ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:672-681 | REDACTED:358-367 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1232 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1232-1241 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:1203-1212 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1665 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1665-1674 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:812-821 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:172 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:172-181 | REDACTED:1936-1945 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (10 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_trigger.py:240 — ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_trigger.py:240-249 | ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:125-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×6
  • Duplicated block (8 lines × 2) REDACTED:1073 — REDACTED:1073-1080 | REDACTED:1118-1125 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) REDACTED:154 — REDACTED:154-161 | REDACTED:83-90 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/apply_review_results.py:24 — ArbiterOS-Kernel/redteam/_automation/toolemu_v1/apply_review_results.py:24-31 | ArbiterOS-Kernel/redteam/_automation/toolemu_v1/build_from_trajectories.py:330-337 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/build_from_trajectories.py:34 — ArbiterOS-Kernel/redteam/_automation/toolemu_v1/build_from_trajectories.py:34-41 | REDACTED:22-29 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (8 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:189 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:189-196 | REDACTED:2491-2498 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (8 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:172 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:172-179 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:173-180 — before extracting anything, compare `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py` and `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
AC2 · Forms & labels · <TimePicker> field component without a label · ×5
  • <TimePicker> field component without a label langfuse/web/src/components/date-picker.tsx:79 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <TimePicker> field component without a label langfuse/web/src/components/date-picker.tsx:238 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <TimePicker> field component without a label langfuse/web/src/components/date-picker.tsx:251 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <TimePicker> field component without a label langfuse/web/src/components/date-picker.tsx:483 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <TimePicker> field component without a label langfuse/web/src/components/date-picker.tsx:493 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC6 · Visual & motion safety · Focus outline removed inline · ×5
  • Focus outline removed inline langfuse/web/src/components/table/peek.tsx:112 — <span> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline langfuse/web/src/components/ui/AdvancedJsonViewer/components/SearchBar.tsx:96 — <input> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline langfuse/web/src/features/dashboard/components/TabsComponent.tsx:21 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline langfuse/web/src/features/evals/components/template-selector.tsx:181 — <div> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
  • Focus outline removed inline langfuse/web/src/pages/project/[projectId]/users/[userId].tsx:133 — <select> takes keyboard focus, and its outline-none utility removes the focus ring with no focus-state ring, shadow, border or outline utility in its place. Add one (e.g. focus-visible:ring-2).
AC6 · Visual & motion safety · Animation without a prefers-reduced-motion guard · ×5
  • Animation without a prefers-reduced-motion guard langfuse/web/src/components/trace2/components/_layout/TracePanelNavigationButton.tsx:42 — <span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard langfuse/web/src/components/ui/AdvancedJsonViewer/components/ExpandButton.tsx:36 — <button> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard langfuse/web/src/features/cloud-status-notification/components/CloudStatusMenu.tsx:39 — <span> moves — its `animate-ping` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard langfuse/web/src/features/slack/components/SlackConnectionCard.tsx:95 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
  • Animation without a prefers-reduced-motion guard langfuse/web/src/features/slack/components/SlackTestMessageButton.tsx:107 — <div> moves — its `animate-spin` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D3 · God Classes · TooManyMethods · ×4
  • TooManyMethods: PolicyEngine ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:305 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: KernelPolicyRuntime ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:234 — TooManyMethods — 42 methods. The bar is 30 methods; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: OtelIngestionProcessor langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:112 — TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: QueryBuilder langfuse/web/src/features/query/server/queryBuilder.ts:42 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×4
  • Edited copy of a member (8 corresponding lines) REDACTED:240 — REDACTED:240-247 | REDACTED:71-79 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/build_from_trajectories.py:34 — ArbiterOS-Kernel/redteam/_automation/toolemu_v1/build_from_trajectories.py:34-41 | REDACTED:20-29 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:223 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:223-230 | REDACTED:2014-2025 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) REDACTED:3028 — REDACTED:3028-3037 | ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:399-406 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
AC2 · Forms & labels · <Textarea> field component without a label · ×3
  • <Textarea> field component without a label langfuse/web/src/components/table/data-table-ai-filters.tsx:117 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label langfuse/web/src/features/filters/components/filter-builder.tsx:545 — This UI-library field component is named only by a placeholder — a placeholder is not a label (it vanishes as soon as the user types, and many assistive technologies ignore it). Give it a real name whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Textarea> field component without a label langfuse/web/src/features/policy-governance/components/PolicyGuideCard.tsx:637 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
D10 · Test Quality · Skipped test · ×3
  • Skipped test: extracts tools from OTel metadata attributes langfuse/worker/src/__tests__/extractToolsBackend.test.ts:62 — Skipped — switched off by it.skip
  • Skipped test: extracts tools from OTel indexed format langfuse/worker/src/__tests__/extractToolsBackend.test.ts:86 — Skipped — switched off by it.skip
  • Skipped test: should extract tool definitions from OTel metadata structure i.e. pydantic-ai langfuse/worker/src/__tests__/extractToolsBackend.test.ts:602 — Skipped — switched off by it.skip
D29 · Static Analysis (SAST) · REDACTED · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×3
  • Edited copy of a member (9 corresponding lines) REDACTED:154 — REDACTED:154-162 | REDACTED:83-95 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) REDACTED:66 — REDACTED:66-74 | REDACTED:334-342 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_test_harness.py:31 — ArbiterOS-Kernel/arbiteros_kernel/policy_test_harness.py:31-39 | ArbiterOS-Kernel/redteam/_automation/toolemu_v1/tool_mapping.py:160-168 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×3
  • Edited copy of a member (6 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:523 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:523-529 | ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:532-537 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) REDACTED:3050 — REDACTED:3050-3055 | ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:161-169 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (6 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:561 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:561-567 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:461-466 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (2 corresponding lines) · ×3
  • Edited copy of a member (2 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:341 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:341-342 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:1021-1023 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) REDACTED:33 — REDACTED:33-34 | REDACTED:15-16 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (2 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:549 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:549-551 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:451-452 — These two members are one piece of code written twice and then edited apart: 2 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (13 lines × 2) · ×3
  • Duplicated block (13 lines × 2) REDACTED:3310 — REDACTED:3310-3322 | REDACTED:3370-3382 — 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 (13 lines × 2) REDACTED:4117 — REDACTED:4117-4129 | REDACTED:6072-6084 — 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 (13 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/nanobot_policy.py:481 — ArbiterOS-Kernel/arbiteros_kernel/policy/nanobot_policy.py:481-493 | ArbiterOS-Kernel/arbiteros_kernel/policy/nanobot_policy.py:500-512 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (11 lines × 2) · ×3
  • Duplicated block (11 lines × 2) REDACTED:6897 — REDACTED:6897-6907 | REDACTED:6973-6983 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:6897` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:6972` calls `get`, `strip` and `REDACTED:6896` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (11 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:612 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:612-622 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:505-515 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (11 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1625 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1625-1635 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:947-957 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×3
  • Duplicated block (7 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:268 — ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:268-274 | ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:402-408 — 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) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:124 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:124-130 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:62-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
  • Duplicated block (7 lines × 2) REDACTED:446 — REDACTED:446-452 | REDACTED:61-67 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
PF3 · Async & latency hygiene · Sync-over-async blocking · ×3
  • Sync-over-async blocking langfuse/packages/shared/scripts/seeder/seed-media.ts:105 — `fs.existsSync` in `uploadAndCreateMediaRecord` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking langfuse/packages/shared/scripts/seeder/seed-media.ts:112 — `fs.readFileSync` in `uploadAndCreateMediaRecord` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
  • Sync-over-async blocking langfuse/worker/src/features/mixpanel/mixpanelClient.ts:60 — `gzipSync` in `sendBatch` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
R8 · Dependency Hygiene · Unused dependency '@typescript/native-preview' · ×3
  • Unused dependency '@typescript/native-preview' REDACTED:41 — Declared in REDACTED 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.
  • Unused dependency '@typescript/native-preview' REDACTED:197 — Declared in REDACTED 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.
  • Unused dependency '@typescript/native-preview' langfuse/worker/package.json:78 — Declared in langfuse/worker/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.
R8 · Dependency Hygiene · Unused dependency 'tsc-watch' · ×3
  • Unused dependency 'tsc-watch' REDACTED:48 — Declared in REDACTED 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.
  • Unused dependency 'tsc-watch' langfuse/packages/shared/package.json:139 — Declared in langfuse/packages/shared/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.
  • Unused dependency 'tsc-watch' langfuse/worker/package.json:87 — Declared in langfuse/worker/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.
AC1 · Text alternatives · <video> without a captions track · ×2
  • <video> without a captions track langfuse/web/src/components/ui/AdvancedJsonViewer/components/MediaButtonGroup.tsx:46 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
  • <video> without a captions track langfuse/web/src/components/ui/LangfuseMediaView.tsx:161 — Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC2 · Forms & labels · <Slider> field component without a label · ×2
  • <Slider> field component without a label langfuse/web/src/components/ModelParameters/index.tsx:497 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
  • <Slider> field component without a label langfuse/web/src/components/table/data-table-controls.tsx:1002 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC6 · Visual & motion safety · Low contrast Tailwind colour pair (4.4 · ×2
  • Low contrast Tailwind colour pair (4.4:1) langfuse/web/src/components/table/data-table-ai-filters.tsx:149 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
  • Low contrast Tailwind colour pair (4.4:1) langfuse/web/src/features/filters/components/filter-builder.tsx:586 — This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
D10 · Test Quality · No assertions · ×2
  • No assertions: performance summary langfuse/web/src/__tests__/json-utils.clienttest.ts:632 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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.
  • No assertions: should log error but not throw if Redis.del fails langfuse/web/src/__tests__/promptCache.servertest.ts:298 — 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*, in the test body and in the helpers it calls in the test and test-support code (a helper there that throws when its check fails counts as an assertion) — so verification routed through a callback object whose members hold the assertions, or through a harness in production code that fails by throwing, 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.
D10 · Test Quality · Fixed-sleep synchronisation · ×2
  • Fixed-sleep synchronisation: handle no matching queue worker langfuse/worker/src/__tests__/redisConsumer.test.ts:48 — This test starts work it did not wait for (`traceUpsertQueue`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 2000))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
  • Fixed-sleep synchronisation: should reset the rate limit count after the window expires langfuse/web/src/__tests__/rate-limit.servertest.ts:123 — This test starts work it did not wait for (`rateLimitService`, still running when the sleep starts) and then orders itself against it with `new Promise((resolve) => setTimeout(resolve, 3000))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
D2 · Cognitive Complexity · router.extractFirstJsonObject (cognitive 29) · ×2
  • router.extractFirstJsonObject (cognitive 29) langfuse/web/src/features/error-analysis/server/router.ts:67 — router.extractFirstJsonObject has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 1, loops 1 (nesting depth added 16). 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.
  • router.extractFirstJsonObject (cognitive 29) langfuse/web/src/features/policy-governance/server/router.ts:222 — router.extractFirstJsonObject has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 1, loops 1 (nesting depth added 16). 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.
D32 · Data Compliance (PII/GDPR) · REDACTED
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (41 corresponding lines) · ×2
  • Edited copy of a member (41 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:498 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:498-550 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:436-491 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (41 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:416 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:416-484 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:382-422 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
  • Members sharing a duplicated core (4 members, 50+ identical tokens) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/helpers/skill_trust.py:234 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/helpers/skill_trust.py:234-250 | REDACTED:547-556 | ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_sentinel_policy.py:118-133 | REDACTED:1434-1454 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
  • Members sharing a duplicated core (4 members, 50+ identical tokens) REDACTED:964 — REDACTED:964-996 | REDACTED:1010-1042 | REDACTED:1057-1092 | REDACTED:1102-1136 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copy of a member (22 corresponding lines) · ×2
  • Edited copy of a member (22 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:259 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:259-289 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:138-159 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (22 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:588 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:588-609 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:477-502 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×2
  • Edited copy of a member (17 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:287 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:287-314 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:274-290 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) REDACTED:2568 — REDACTED:2568-2589 | REDACTED:2593-2609 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×2
  • Edited copy of a member (14 corresponding lines) REDACTED:136 — REDACTED:136-150 | REDACTED:44-57 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:267 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:267-283 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:257-270 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×2
  • Edited copy of a member (12 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:398 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:398-410 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:363-374 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) REDACTED:5133 — REDACTED:5133-5146 | REDACTED:5152-5163 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (4 corresponding lines) · ×2
  • Edited copy of a member (4 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:554 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:554-558 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:455-458 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (4 corresponding lines) REDACTED:533 — REDACTED:533-536 | REDACTED:1423-1430 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (18 lines × 2) · ×2
  • Duplicated block (18 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1129 — ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1129-1146 | ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1246-1264 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1129` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (18 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1485 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1485-1502 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:692-709 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×2
  • Duplicated block (17 lines × 2) REDACTED:2184 — REDACTED:2184-2200 | REDACTED:2203-2219 — 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 (17 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:234 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:234-250 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:113-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×2
  • Duplicated block (14 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:70 — ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:70-83 | ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:161-174 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (14 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:633 — ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:633-646 | REDACTED:287-300 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 4) · ×2
  • Duplicated block (7 lines × 4) ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:77 — ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:77-83 | ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:176-182 | ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:121-127 | ArbiterOS-Kernel/arbiteros_kernel/policy/schema_policy.py:95-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
  • Duplicated block (7 lines × 4) REDACTED:976 — REDACTED:976-982 | REDACTED:1022-1028 | REDACTED:1070-1076 | REDACTED:1115-1121 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:976` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:340 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:340-344 | REDACTED:2270-2274 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
  • Duplicated block (5 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:87 — ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:87-91 | ArbiterOS-Kernel/arbiteros_kernel/policy/exec_composite_policy.py:70-74 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×2
  • Duplicated block (6 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:390 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:390-395 | REDACTED:3019-3024 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (6 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:175 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:175-180 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:163-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D6 · Cohesion (LCOM4) · Low cohesion · ×2
  • Low cohesion: DataGenerator (LCOM4 5) langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:48 — DataGenerator's methods fall into 5 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 5 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: SlackService (LCOM4 4) langfuse/packages/shared/src/server/services/SlackService.ts:89 — SlackService'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.
IC1 · Incompleteness & stubs · Markup wires an event to an empty handler · ×2
  • Markup wires an event to an empty handler langfuse/web/src/features/datasets/components/DatasetSchemaHoverCard.tsx:80 — `onChange` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
  • Markup wires an event to an empty handler langfuse/web/src/pages/project/[projectId]/settings/models/[modelId].tsx:302 — `onChange` is wired to an arrow whose body is empty — the markup attaches a listener that does nothing. Implement the handler, or remove the attribute that wires it.
R10 · Code Duplication · Duplicated block with local edits (108 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (108 matched lines × 2 locations) langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:213 — langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:213 · langfuse/packages/shared/src/utils/chatml/adapters/openai.ts:141 — the two spans are one implementation copied and then locally edited — 677 tokens are still identical, in the same order in both files, 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.
  • Duplicated block with local edits (108 matched lines × 2 locations) langfuse/web/src/components/ui/dropdown-menu.tsx:15 — langfuse/web/src/components/ui/dropdown-menu.tsx:15 · langfuse/web/src/components/ui/select.tsx:9 — the two spans are one implementation copied and then locally edited — 613 tokens are still identical, in the same order in both files, 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 (102 lines × 2 locations) · ×2
  • Duplicated block (102 lines × 2 locations) langfuse/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx:36 — langfuse/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx:36 · langfuse/web/src/features/playground/page/components/CreateOrEditLLMToolDialog.tsx:36 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
  • Duplicated block (102 lines × 2 locations) langfuse/web/src/features/score-analytics/components/cards/DistributionBooleanCard.tsx:106 — langfuse/web/src/features/score-analytics/components/cards/DistributionBooleanCard.tsx:106 · langfuse/web/src/features/score-analytics/components/cards/DistributionNumericCard.tsx:136 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
R10 · Code Duplication · Duplicated block with local edits (98 matched lines × 2 locations) · ×2
  • Duplicated block with local edits (98 matched lines × 2 locations) langfuse/web/src/features/datasets/components/EditDatasetItem.tsx:22 — langfuse/web/src/features/datasets/components/EditDatasetItem.tsx:22 · langfuse/web/src/features/datasets/components/EditDatasetItemDialog.tsx:25 — the two spans are one implementation copied and then locally edited — 436 tokens are still identical, in the same order in both files, 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.
  • Duplicated block with local edits (98 matched lines × 2 locations) langfuse/web/src/features/organizations/components/RenameOrganization.tsx:45 — langfuse/web/src/features/organizations/components/RenameOrganization.tsx:45 · langfuse/web/src/features/projects/components/RenameProject.tsx:42 — the two spans are one implementation copied and then locally edited — 476 tokens are still identical, in the same order in both files, 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 · Wholesale file copy (92 identical lines × 2 files) · ×2
  • Wholesale file copy (92 identical lines × 2 files) langfuse/worker/src/backgroundMigrations/migrateDatasetRunItemsFromPostgresToClickhouseRmt.ts:1 — langfuse/worker/src/backgroundMigrations/migrateDatasetRunItemsFromPostgresToClickhouseRmt.ts:1 · langfuse/worker/src/backgroundMigrations/migrateTracesFromPostgresToClickhouse.ts:1 — these 2 files are line-for-line copies of one another — 92 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
  • Wholesale file copy (92 identical lines × 2 files) langfuse/worker/src/backgroundMigrations/migrateScoresFromPostgresToClickhouse.ts:1 — langfuse/worker/src/backgroundMigrations/migrateScoresFromPostgresToClickhouse.ts:1 · langfuse/worker/src/backgroundMigrations/migrateTracesFromPostgresToClickhouse.ts:1 — these 2 files are line-for-line copies of one another — 92 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication · Duplicated block (88 lines × 2 locations) · ×2
  • Duplicated block (88 lines × 2 locations) langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:362 — langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:362 · langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:607 — 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 (88 lines × 2 locations) langfuse/web/src/features/error-analysis/server/router.ts:178 — langfuse/web/src/features/error-analysis/server/router.ts:178 · langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:403 — 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.
R2 · Cyclomatic Complexity · Complex function buildMatchingEvents (cyclomatic 41, cognitive 43) · ×2
  • Complex function buildMatchingEvents (cyclomatic 41, cognitive 43) langfuse/web/src/__tests__/async/dashboard-v1-v2-consistency.servertest.ts:78 — buildMatchingEvents has cyclomatic complexity 41 and cognitive complexity 43; 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.
  • Complex function buildMatchingEvents (cyclomatic 41, cognitive 43) langfuse/web/src/__tests__/async/sessions-ui-table.servertest.ts:59 — buildMatchingEvents has cyclomatic complexity 41 and cognitive complexity 43; 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.
R7 · Dead Code · Dead file (~323 LoC) · ×2
  • Dead file (~323 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/hooks/useTreeState.ts — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/components/ui/AdvancedJsonViewer/AdvancedJsonViewer.tsx) — 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
  • Dead file (~323 LoC) langfuse/web/src/features/policy-suggestions/server/router.servertest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~269 LoC) · ×2
  • Dead file (~269 LoC) langfuse/web/src/components/trace2/components/TraceTimeline/timeline-calculations.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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
  • Dead file (~269 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeExpansion.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~253 LoC) · ×2
  • Dead file (~253 LoC) langfuse/web/src/features/batch-exports/components/BatchExportsTable.tsx — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/features/batch-exports/components/BatchExportsSettingsPage.tsx) — 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
  • Dead file (~253 LoC) langfuse/web/src/features/prompts/components/ProtectedLabelsSettings.tsx — no import path from any entry point (201 application, 23 tooling, 204 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
R8 · Dependency Hygiene · Unused dependency 'https-proxy-agent' · ×2
  • Unused dependency 'https-proxy-agent' REDACTED:31 — Declared in REDACTED 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.
  • Unused dependency 'https-proxy-agent' REDACTED:124 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency '@anthropic-ai/tokenizer' · ×2
  • Unused dependency '@anthropic-ai/tokenizer' langfuse/packages/shared/package.json:73 — Declared in langfuse/packages/shared/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.
  • Unused dependency '@anthropic-ai/tokenizer' REDACTED:29 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency 'kysely-codegen' · ×2
  • Unused dependency 'kysely-codegen' langfuse/packages/shared/package.json:134 — Declared in langfuse/packages/shared/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.
  • Unused dependency 'kysely-codegen' langfuse/worker/package.json:83 — Declared in langfuse/worker/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.
R8 · Dependency Hygiene · Unused dependency '@opentelemetry/instrumentation' · ×2
  • Unused dependency '@opentelemetry/instrumentation' REDACTED:56 — Declared in REDACTED 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.
  • Unused dependency '@opentelemetry/instrumentation' langfuse/worker/package.json:34 — Declared in langfuse/worker/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.
AC2 · Forms & labels · <fieldset> without a <legend> · ×1
  • <fieldset> without a <legend> langfuse/web/src/components/table/data-table-controls.tsx:556 — A fieldset groups related controls but has no <legend> to name the group. Add a <legend> as its first child — or, if the group already has a visible caption beside it (or the fieldset is there only to disable its subtree and carries no group box), point aria-labelledby at that caption's id instead, which names the group without rendering a second one.
AC2 · Forms & labels · <RadioGroup> field component without a label · ×1
  • <RadioGroup> field component without a label langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/components/MappingModeSelector.tsx:19 — This UI-library field component has no label / aria-label / aria-labelledby / id, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id alone, wherever it is set, names nothing until a label points at it). The text inside it does not stand in for one: these compound APIs render a trigger with role="combobox" (or role="button"), and those roles take their name from the AUTHOR, not from their content — so the words on screen never reach the accessibility tree as a name. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC2 · Forms & labels · <DatePicker> field component without a label · ×1
  • <DatePicker> field component without a label langfuse/web/src/features/filters/components/filter-builder.tsx:894 — This UI-library field component has no label / aria-label / aria-labelledby / id at this call site, and nothing written inside it here carries one either (a name prop is the form-submission key, not a label; an id, even one the component sets on what it renders, names nothing until a label points at it) — so it likely renders an unlabelled control. Name it whichever way this library supports: a label prop, an aria-label, or an id on the rendered control with a <label htmlFor> pointing at it. For a group of controls, name the group itself (aria-label, or a fieldset with a legend) — labelling each item leaves the set unnamed.
AC3 · Page structure · Page without a main landmark · ×1
  • Page without a main landmark langfuse/web/src/app/layout.tsx:12 — No <main> (or role="main") means no "skip to content" target and a weaker landmark map. Wrap the primary content in <main>.
AC3 · Page structure · Data table has no header cells · ×1
  • Data table has no header cells langfuse/web/src/features/filters/components/filter-builder.tsx:598 — A <table> with data cells but no <th> gives assistive technology no way to associate cells with their headers. Mark the header row/column cells as <th> (with a scope).
D1 · Cyclomatic Complexity · EventsTable.ObservationsEventsTable (cyclomatic 199) · ×1
  • EventsTable.ObservationsEventsTable (cyclomatic 199) langfuse/web/src/features/events/components/EventsTable.tsx:315 — EventsTable.ObservationsEventsTable has cyclomatic complexity 199 (threshold 15). Of this number, 36 points are the body's own statements and 163 belong to 64 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 · observations.ObservationsTable (cyclomatic 177) · ×1
  • observations.ObservationsTable (cyclomatic 177) langfuse/web/src/components/table/use-cases/observations.tsx:280 — observations.ObservationsTable has cyclomatic complexity 177 (threshold 15). Of this number, 48 points are the body's own statements and 129 belong to 74 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 · WidgetForm.WidgetForm (cyclomatic 173) · ×1
  • WidgetForm.WidgetForm (cyclomatic 173) langfuse/web/src/features/widgets/components/WidgetForm.tsx:156 — WidgetForm.WidgetForm has cyclomatic complexity 173 (threshold 15). Of this number, 40 points are the body's own statements and 133 belong to 43 function items 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 · buildGraphCanvasData.buildGraphFromStepData (cyclomatic 136) · ×1
  • buildGraphCanvasData.buildGraphFromStepData (cyclomatic 136) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:111 — buildGraphCanvasData.buildGraphFromStepData has cyclomatic complexity 136 (threshold 15). Of this number, 96 points are the body's own statements and 40 belong to 13 function items 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 · MyCustomHandler.async_post_call_success_hook (cyclomatic 116) · ×1
  • MyCustomHandler.async_post_call_success_hook (cyclomatic 116) REDACTED:6313 — MyCustomHandler.async_post_call_success_hook has cyclomatic complexity 116 (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 · StatisticsCard.StatisticsCard (cyclomatic 102) · ×1
  • StatisticsCard.StatisticsCard (cyclomatic 102) langfuse/web/src/features/score-analytics/components/cards/StatisticsCard.tsx:39 — StatisticsCard.StatisticsCard has cyclomatic complexity 102 (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.
D1 · Cyclomatic Complexity · useSidebarFilterState.useSidebarFilterState.filters (cyclomatic 100) · ×1
  • useSidebarFilterState.useSidebarFilterState.filters (cyclomatic 100) langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:870 — useSidebarFilterState.useSidebarFilterState.filters has cyclomatic complexity 100 (threshold 15). Most of this is not in the body itself: 1 of the 100 points is its own statement and the rest belongs to 29 function items inside it that branch (a function literal at line 923, a function literal at line 1383, a function literal at line 1525, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · litellm_callback._emit_response_nodes (cyclomatic 99) · ×1
  • litellm_callback._emit_response_nodes (cyclomatic 99) REDACTED:4023 — litellm_callback._emit_response_nodes has cyclomatic complexity 99 (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 · index.ExperienceSummaryPage (cyclomatic 98) · ×1
  • index.ExperienceSummaryPage (cyclomatic 98) langfuse/web/src/pages/project/[projectId]/experience/index.tsx:113 — index.ExperienceSummaryPage has cyclomatic complexity 98 (threshold 15). Of this number, 25 points are the body's own statements and 73 belong to 40 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 · PrettyJsonView.PrettyJsonView (cyclomatic 97) · ×1
  • PrettyJsonView.PrettyJsonView (cyclomatic 97) langfuse/web/src/components/ui/PrettyJsonView.tsx:742 — PrettyJsonView.PrettyJsonView has cyclomatic complexity 97 (threshold 15). Of this number, 31 points are the body's own statements and 66 belong to 16 function items 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 · policy.PolicyGovernancePage (cyclomatic 95) · ×1
  • policy.PolicyGovernancePage (cyclomatic 95) langfuse/web/src/pages/project/[projectId]/policy.tsx:163 — policy.PolicyGovernancePage has cyclomatic complexity 95 (threshold 15). Of this number, 33 points are the body's own statements and 62 belong to 28 function items 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 · MyCustomHandler.async_post_call_streaming_iterator_hook (cyclomatic 93) · ×1
  • MyCustomHandler.async_post_call_streaming_iterator_hook (cyclomatic 93) REDACTED:6778 — MyCustomHandler.async_post_call_streaming_iterator_hook has cyclomatic complexity 93 (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 · MyCustomHandler.async_pre_call_hook (cyclomatic 83) · ×1
  • MyCustomHandler.async_pre_call_hook (cyclomatic 83) REDACTED:5926 — MyCustomHandler.async_pre_call_hook has cyclomatic complexity 83 (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 · CommentList.CommentList (cyclomatic 78) · ×1
  • CommentList.CommentList (cyclomatic 78) langfuse/web/src/features/comments/CommentList.tsx:82 — CommentList.CommentList has cyclomatic complexity 78 (threshold 15). Of this number, 20 points are the body's own statements and 58 belong to 19 function items inside it that branch. 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 · OtelIngestionProcessor.extractInputAndOutput (cyclomatic 76) · ×1
  • OtelIngestionProcessor.extractInputAndOutput (cyclomatic 76) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1165 — OtelIngestionProcessor.extractInputAndOutput has cyclomatic complexity 76 (threshold 15). Of this number, 68 points are the body's own statements and 8 belong to 3 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 · router.inferErrorTypeKeyFromText (cyclomatic 76) · ×1
  • router.inferErrorTypeKeyFromText (cyclomatic 76) langfuse/web/src/features/error-analysis/server/router.ts:393 — router.inferErrorTypeKeyFromText has cyclomatic complexity 76 (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 · filter-builder.FilterBuilderForm (cyclomatic 75) · ×1
  • filter-builder.FilterBuilderForm (cyclomatic 75) langfuse/web/src/features/filters/components/filter-builder.tsx:414 — filter-builder.FilterBuilderForm has cyclomatic complexity 75 (threshold 15). Of this number, 31 points are the body's own statements and 44 belong to 12 function items 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 · autoErrorAnalysisQueue.inferErrorTypeKeyFromText (cyclomatic 75) · ×1
  • autoErrorAnalysisQueue.inferErrorTypeKeyFromText (cyclomatic 75) langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:182 — autoErrorAnalysisQueue.inferErrorTypeKeyFromText has cyclomatic complexity 75 (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 · traces.TracesTable (cyclomatic 72) · ×1
  • traces.TracesTable (cyclomatic 72) langfuse/web/src/components/table/use-cases/traces.tsx:134 — traces.TracesTable has cyclomatic complexity 72 (threshold 15). Of this number, 27 points are the body's own statements and 45 belong to 28 function items 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 · blobstorage.BlobStorageIntegrationSettingsForm (cyclomatic 72) · ×1
  • blobstorage.BlobStorageIntegrationSettingsForm (cyclomatic 72) langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx:179 — blobstorage.BlobStorageIntegrationSettingsForm has cyclomatic complexity 72 (threshold 15). Of this number, 25 points are the body's own statements and 47 belong to 13 function items inside it that branch. 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 · index.verifyClickhouseObservation (cyclomatic 72) · ×1
  • index.verifyClickhouseObservation (cyclomatic 72) langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:291 — index.verifyClickhouseObservation has cyclomatic complexity 72 (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 · litellm_callback._trace_state_from_dict (cyclomatic 72) · ×1
  • litellm_callback._trace_state_from_dict (cyclomatic 72) REDACTED:308 — litellm_callback._trace_state_from_dict has cyclomatic complexity 72 (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.
D1 · Cyclomatic Complexity · ScoreChartLegendContent.ScoreChartLegendContent (cyclomatic 67) · ×1
  • ScoreChartLegendContent.ScoreChartLegendContent (cyclomatic 67) langfuse/web/src/features/score-analytics/components/charts/ScoreChartLegendContent.tsx:107 — ScoreChartLegendContent.ScoreChartLegendContent has cyclomatic complexity 67 (threshold 15). Most of this is not in the body itself: 12 of the 67 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 151, getFormattedLabel, smartFormatLabel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · unary_gate_policy._eval_predicate (cyclomatic 63) · ×1
  • unary_gate_policy._eval_predicate (cyclomatic 63) REDACTED:620 — unary_gate_policy._eval_predicate has cyclomatic complexity 63 (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.
D1 · Cyclomatic Complexity · evalService.createEvalJobs (cyclomatic 62) · ×1
  • evalService.createEvalJobs (cyclomatic 62) langfuse/worker/src/features/evaluation/evalService.ts:166 — evalService.createEvalJobs has cyclomatic complexity 62 (threshold 15). Of this number, 59 points are the body's own statements and 3 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 · fetchLLMCompletion.fetchLLMCompletion (cyclomatic 59) · ×1
  • fetchLLMCompletion.fetchLLMCompletion (cyclomatic 59) langfuse/packages/shared/src/server/llm/fetchLLMCompletion.ts:118 — fetchLLMCompletion.fetchLLMCompletion has cyclomatic complexity 59 (threshold 15). Of this number, 52 points are the body's own statements and 7 belong to 2 function items 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 · inner-evaluator-form.InnerEvaluatorForm (cyclomatic 59) · ×1
  • inner-evaluator-form.InnerEvaluatorForm (cyclomatic 59) langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:257 — inner-evaluator-form.InnerEvaluatorForm has cyclomatic complexity 59 (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. This shape REPEATS in the file: one other method here (inner-evaluator-form.InnerEvaluatorForm::onSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · ObservationDetailView.ObservationDetailView (cyclomatic 58) · ×1
  • ObservationDetailView.ObservationDetailView (cyclomatic 58) langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:82 — ObservationDetailView.ObservationDetailView has cyclomatic complexity 58 (threshold 15). Of this number, 44 points are the body's own statements and 14 belong to 7 function literals inside it that branch. 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 · TraceGovernanceBanner.TraceGovernanceBanner (cyclomatic 57) · ×1
  • TraceGovernanceBanner.TraceGovernanceBanner (cyclomatic 57) langfuse/web/src/components/trace2/components/GovernanceBanner/TraceGovernanceBanner.tsx:20 — TraceGovernanceBanner.TraceGovernanceBanner has cyclomatic complexity 57 (threshold 15). Of this number, 16 points are the body's own statements and 41 belong to 24 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 · litellm_callback._format_tool_result_output_for_langfuse (cyclomatic 56) · ×1
  • litellm_callback._format_tool_result_output_for_langfuse (cyclomatic 56) REDACTED:3469 — litellm_callback._format_tool_result_output_for_langfuse has cyclomatic complexity 56 (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 · scores.ScoresTable (cyclomatic 55) · ×1
  • scores.ScoresTable (cyclomatic 55) langfuse/web/src/components/table/use-cases/scores.tsx:97 — scores.ScoresTable has cyclomatic complexity 55 (threshold 15). Of this number, 21 points are the body's own statements and 34 belong to 20 function items 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 · index.PlaygroundProvider (cyclomatic 55) · ×1
  • index.PlaygroundProvider (cyclomatic 55) langfuse/web/src/features/playground/page/context/index.tsx:90 — index.PlaygroundProvider has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 1 of the 55 points is its own statement and the rest belongs to 24 function literals inside it that branch (lines 309, 142, 236, …). 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 · buildGraphCanvasData.buildTurnMetadataSummary (cyclomatic 55) · ×1
  • buildGraphCanvasData.buildTurnMetadataSummary (cyclomatic 55) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:1222 — buildGraphCanvasData.buildTurnMetadataSummary has cyclomatic complexity 55 (threshold 15). Of this number, 52 points are the body's own statements and 3 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 · buildGraphCanvasData.buildHierarchyGraphFromStepData (cyclomatic 54) · ×1
  • buildGraphCanvasData.buildHierarchyGraphFromStepData (cyclomatic 54) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:701 — buildGraphCanvasData.buildHierarchyGraphFromStepData has cyclomatic complexity 54 (threshold 15). Of this number, 43 points are the body's own statements and 11 belong to 6 function items 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 · ErrorAnalysisDropdown.ErrorAnalysisDropdown (cyclomatic 53) · ×1
  • ErrorAnalysisDropdown.ErrorAnalysisDropdown (cyclomatic 53) langfuse/web/src/features/error-analysis/components/ErrorAnalysisDropdown.tsx:248 — ErrorAnalysisDropdown.ErrorAnalysisDropdown has cyclomatic complexity 53 (threshold 15). Of this number, 21 points are the body's own statements and 32 belong to 6 function items 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 · autoErrorAnalysisQueue.autoErrorAnalysisQueueProcessor (cyclomatic 53) · ×1
  • autoErrorAnalysisQueue.autoErrorAnalysisQueueProcessor (cyclomatic 53) langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:674 — autoErrorAnalysisQueue.autoErrorAnalysisQueueProcessor has cyclomatic complexity 53 (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 · ObservationGovernanceAnalysisPanel.ObservationGovernanceAnalysisPanel (cyclomatic 52) · ×1
  • ObservationGovernanceAnalysisPanel.ObservationGovernanceAnalysisPanel (cyclomatic 52) REDACTED:45 — ObservationGovernanceAnalysisPanel.ObservationGovernanceAnalysisPanel has cyclomatic complexity 52 (threshold 15). Of this number, 39 points are the body's own statements and 13 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 · TimelineChartCard.TimelineChartCard (cyclomatic 50) · ×1
  • TimelineChartCard.TimelineChartCard (cyclomatic 50) langfuse/web/src/features/score-analytics/components/cards/TimelineChartCard.tsx:35 — TimelineChartCard.TimelineChartCard has cyclomatic complexity 50 (threshold 15). Of this number, 16 points are the body's own statements and 34 belong to 5 function items 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 · index.SessionEventsPage (cyclomatic 49) · ×1
  • index.SessionEventsPage (cyclomatic 49) langfuse/web/src/components/session/index.tsx:553 — index.SessionEventsPage has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 14 of the 49 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 706, 763, 697, …). 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 · sessions.SessionsTable (cyclomatic 49) · ×1
  • sessions.SessionsTable (cyclomatic 49) langfuse/web/src/components/table/use-cases/sessions.tsx:86 — sessions.SessionsTable has cyclomatic complexity 49 (threshold 15). Of this number, 17 points are the body's own statements and 32 belong to 17 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 · SpanContent.SpanContent (cyclomatic 49) · ×1
  • SpanContent.SpanContent (cyclomatic 49) langfuse/web/src/components/trace2/components/SpanContent.tsx:43 — SpanContent.SpanContent has cyclomatic complexity 49 (threshold 15). Of this number, 48 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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 · ErrorAnalysisSettings.ErrorAnalysisSettings (cyclomatic 49) · ×1
  • ErrorAnalysisSettings.ErrorAnalysisSettings (cyclomatic 49) langfuse/web/src/features/error-analysis/components/ErrorAnalysisSettings.tsx:66 — ErrorAnalysisSettings.ErrorAnalysisSettings has cyclomatic complexity 49 (threshold 15). Of this number, 38 points are the body's own statements and 11 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 · DatasetForm.DatasetForm (cyclomatic 48) · ×1
  • DatasetForm.DatasetForm (cyclomatic 48) langfuse/web/src/features/datasets/components/DatasetForm.tsx:137 — DatasetForm.DatasetForm has cyclomatic complexity 48 (threshold 15). Of this number, 26 points are the body's own statements and 22 belong to 6 function items 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 · useScoreAnalyticsQuery.useScoreAnalyticsQuery.data (cyclomatic 48) · ×1
  • useScoreAnalyticsQuery.useScoreAnalyticsQuery.data (cyclomatic 48) langfuse/web/src/features/score-analytics/hooks/useScoreAnalyticsQuery.ts:246 — useScoreAnalyticsQuery.useScoreAnalyticsQuery.data has cyclomatic complexity 48 (threshold 15). Of this number, 44 points are the body's own statements and 4 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 · extractTools.extractTools (cyclomatic 48) · ×1
  • extractTools.extractTools (cyclomatic 48) langfuse/web/src/utils/chatml/extractTools.ts:29 — extractTools.extractTools has cyclomatic complexity 48 (threshold 15). Of this number, 30 points are the body's own statements and 18 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 · litellm_callback._emit_tool_result_nodes_if_needed (cyclomatic 48) · ×1
  • litellm_callback._emit_tool_result_nodes_if_needed (cyclomatic 48) REDACTED:3722 — litellm_callback._emit_tool_result_nodes_if_needed has cyclomatic complexity 48 (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 · AdvancedJsonSection.AdvancedJsonSection (cyclomatic 47) · ×1
  • AdvancedJsonSection.AdvancedJsonSection (cyclomatic 47) langfuse/web/src/components/ui/AdvancedJsonSection/AdvancedJsonSection.tsx:92 — AdvancedJsonSection.AdvancedJsonSection has cyclomatic complexity 47 (threshold 15). Of this number, 30 points are the body's own statements and 17 belong to 9 function items 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 · MultiStepExperimentForm.MultiStepExperimentForm (cyclomatic 47) · ×1
  • MultiStepExperimentForm.MultiStepExperimentForm (cyclomatic 47) langfuse/web/src/features/experiments/components/MultiStepExperimentForm.tsx:54 — MultiStepExperimentForm.MultiStepExperimentForm has cyclomatic complexity 47 (threshold 15). Of this number, 18 points are the body's own statements and 29 belong to 8 function items inside it that branch. 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 · Heatmap.Heatmap (cyclomatic 47) · ×1
  • Heatmap.Heatmap (cyclomatic 47) langfuse/web/src/features/score-analytics/components/charts/Heatmap.tsx:50 — Heatmap.Heatmap has cyclomatic complexity 47 (threshold 15). Of this number, 26 points are the body's own statements and 21 belong to 6 function literals inside it that branch. 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 · PolicyEngine.pre_instruction (cyclomatic 47) · ×1
  • PolicyEngine.pre_instruction (cyclomatic 47) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:848 — PolicyEngine.pre_instruction has cyclomatic complexity 47 (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 · observations_converters.convertObservationPartial (cyclomatic 46) · ×1
  • observations_converters.convertObservationPartial (cyclomatic 46) langfuse/packages/shared/src/server/repositories/observations_converters.ts:120 — observations_converters.convertObservationPartial has cyclomatic complexity 46 (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 · traces.buildTracesBaseQuery (cyclomatic 46) · ×1
  • traces.buildTracesBaseQuery (cyclomatic 46) langfuse/web/src/features/public-api/server/traces.ts:44 — traces.buildTracesBaseQuery has cyclomatic complexity 46 (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 · sign-in.SSOButtons (cyclomatic 46) · ×1
  • sign-in.SSOButtons (cyclomatic 46) langfuse/web/src/pages/auth/sign-in.tsx:180 — sign-in.SSOButtons has cyclomatic complexity 46 (threshold 15). Of this number, 43 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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 · unicode.decodeUnicodeEscapesOnly (cyclomatic 45) · ×1
  • unicode.decodeUnicodeEscapesOnly (cyclomatic 45) langfuse/web/src/utils/unicode.ts:26 — unicode.decodeUnicodeEscapesOnly has cyclomatic complexity 45 (threshold 15). Of this number, 30 points are the body's own statements and 15 belong to 3 function items 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 · data-table-view-presets-drawer.TableViewPresetsDrawer (cyclomatic 44) · ×1
  • data-table-view-presets-drawer.TableViewPresetsDrawer (cyclomatic 44) langfuse/web/src/components/table/table-view-presets/components/data-table-view-presets-drawer.tsx:161 — data-table-view-presets-drawer.TableViewPresetsDrawer has cyclomatic complexity 44 (threshold 15). Most of this is not in the body itself: 13 of the 44 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 569, a function literal at line 205, handleSelectView, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · LogViewToolbar.LogViewToolbar (cyclomatic 44) · ×1
  • LogViewToolbar.LogViewToolbar (cyclomatic 44) langfuse/web/src/components/trace2/components/TraceLogView/LogViewToolbar.tsx:77 — LogViewToolbar.LogViewToolbar has cyclomatic complexity 44 (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 · ExecCompositePolicy.check (cyclomatic 44) · ×1
  • ExecCompositePolicy.check (cyclomatic 44) ArbiterOS-Kernel/arbiteros_kernel/policy/exec_composite_policy.py:327 — ExecCompositePolicy.check has cyclomatic complexity 44 (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 · data-table-toolbar.DataTableToolbar (cyclomatic 43) · ×1
  • data-table-toolbar.DataTableToolbar (cyclomatic 43) langfuse/web/src/components/table/data-table-toolbar.tsx:133 — data-table-toolbar.DataTableToolbar has cyclomatic complexity 43 (threshold 15). Of this number, 39 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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 · MappingPreviewPanel.MappingPreviewPanel (cyclomatic 43) · ×1
  • MappingPreviewPanel.MappingPreviewPanel (cyclomatic 43) langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/components/MappingPreviewPanel.tsx:36 — MappingPreviewPanel.MappingPreviewPanel has cyclomatic complexity 43 (threshold 15). Of this number, 21 points are the body's own statements and 22 belong to 6 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 · build_from_trajectories.main (cyclomatic 43) · ×1
  • build_from_trajectories.main (cyclomatic 43) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/build_from_trajectories.py:353 — build_from_trajectories.main has cyclomatic complexity 43 (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 · aisdk.normalizeMessage (cyclomatic 42) · ×1
  • aisdk.normalizeMessage (cyclomatic 42) langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts:92 — aisdk.normalizeMessage has cyclomatic complexity 42 (threshold 15). Of this number, 24 points are the body's own statements and 18 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 · NewDatasetItemForm.NewDatasetItemForm (cyclomatic 42) · ×1
  • NewDatasetItemForm.NewDatasetItemForm (cyclomatic 42) langfuse/web/src/features/datasets/components/NewDatasetItemForm.tsx:105 — NewDatasetItemForm.NewDatasetItemForm has cyclomatic complexity 42 (threshold 15). Most of this is not in the body itself: 10 of the 42 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 172, a function literal at line 278, a function literal at line 374, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · DashboardWidget.DashboardWidget (cyclomatic 41) · ×1
  • DashboardWidget.DashboardWidget (cyclomatic 41) langfuse/web/src/features/widgets/components/DashboardWidget.tsx:40 — DashboardWidget.DashboardWidget has cyclomatic complexity 41 (threshold 15). Of this number, 24 points are the body's own statements and 17 belong to 6 function items 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 · UnaryGatePolicy.check (cyclomatic 41) · ×1
  • UnaryGatePolicy.check (cyclomatic 41) REDACTED:2127 — UnaryGatePolicy.check has cyclomatic complexity 41 (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 · IOPreviewJSON.IOPreviewJSONInner (cyclomatic 40) · ×1
  • IOPreviewJSON.IOPreviewJSONInner (cyclomatic 40) langfuse/web/src/components/trace2/components/IOPreview/IOPreviewJSON.tsx:74 — IOPreviewJSON.IOPreviewJSONInner has cyclomatic complexity 40 (threshold 15). Most of this is not in the body itself: 15 of the 40 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 226, 109, 197, …). 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 · AnnotationQueueItemPage.AnnotationQueueItemPage (cyclomatic 40) · ×1
  • AnnotationQueueItemPage.AnnotationQueueItemPage (cyclomatic 40) langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemPage.tsx:25 — AnnotationQueueItemPage.AnnotationQueueItemPage has cyclomatic complexity 40 (threshold 15). Of this number, 20 points are the body's own statements and 20 belong to 8 function items inside it that branch. 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 · litellm_callback._build_device_context (cyclomatic 40) · ×1
  • litellm_callback._build_device_context (cyclomatic 40) REDACTED:2138 — litellm_callback._build_device_context has cyclomatic complexity 40 (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 · RelationalPolicy.check (cyclomatic 40) · ×1
  • RelationalPolicy.check (cyclomatic 40) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1073 — RelationalPolicy.check has cyclomatic complexity 40 (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 · gemini.normalizeGeminiMessage (cyclomatic 39) · ×1
  • gemini.normalizeGeminiMessage (cyclomatic 39) langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:194 — gemini.normalizeGeminiMessage has cyclomatic complexity 39 (threshold 15). Of this number, 36 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 · litellm_callback._emit_langfuse_node (cyclomatic 39) · ×1
  • litellm_callback._emit_langfuse_node (cyclomatic 39) REDACTED:2870 — litellm_callback._emit_langfuse_node has cyclomatic complexity 39 (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.
D1 · Cyclomatic Complexity · TimelineBar.TimelineBar (cyclomatic 38) · ×1
  • TimelineBar.TimelineBar (cyclomatic 38) langfuse/web/src/components/trace2/components/TraceTimeline/TimelineBar.tsx:16 — TimelineBar.TimelineBar has cyclomatic complexity 38 (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 · errorTypeFilters.applyErrorTypeFilters (cyclomatic 38) · ×1
  • errorTypeFilters.applyErrorTypeFilters (cyclomatic 38) langfuse/web/src/features/error-analysis/server/errorTypeFilters.ts:83 — errorTypeFilters.applyErrorTypeFilters has cyclomatic complexity 38 (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 · DistributionNumericCard.DistributionNumericCard (cyclomatic 38) · ×1
  • DistributionNumericCard.DistributionNumericCard (cyclomatic 38) langfuse/web/src/features/score-analytics/components/cards/DistributionNumericCard.tsx:32 — DistributionNumericCard.DistributionNumericCard has cyclomatic complexity 38 (threshold 15). Of this number, 18 points are the body's own statements and 20 belong to 4 function items 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 · PolicyEngine._efsm_step (cyclomatic 38) · ×1
  • PolicyEngine._efsm_step (cyclomatic 38) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1205 — PolicyEngine._efsm_step has cyclomatic complexity 38 (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 · apply_review_results.main (cyclomatic 38) · ×1
  • apply_review_results.main (cyclomatic 38) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/apply_review_results.py:99 — apply_review_results.main has cyclomatic complexity 38 (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 · chart.ChartTooltipContent (cyclomatic 37) · ×1
  • chart.ChartTooltipContent (cyclomatic 37) REDACTED:119 — chart.ChartTooltipContent has cyclomatic complexity 37 (threshold 15). Most of this is not in the body itself: 5 of the 37 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 203, 151, 142, …). 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 · handleExperimentBackfill.writeEnrichedSpans (cyclomatic 37) · ×1
  • handleExperimentBackfill.writeEnrichedSpans (cyclomatic 37) langfuse/worker/src/features/eventPropagation/handleExperimentBackfill.ts:482 — handleExperimentBackfill.writeEnrichedSpans has cyclomatic complexity 37 (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 · relational_policy._flow_kind (cyclomatic 37) · ×1
  • relational_policy._flow_kind (cyclomatic 37) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:314 — relational_policy._flow_kind has cyclomatic complexity 37 (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.
D1 · Cyclomatic Complexity · traces-ui-table-service.getTracesTableGeneric (cyclomatic 36) · ×1
  • traces-ui-table-service.getTracesTableGeneric (cyclomatic 36) langfuse/packages/shared/src/server/services/traces-ui-table-service.ts:207 — traces-ui-table-service.getTracesTableGeneric has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 14 of the 36 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 375, 264, 231). 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 · openai.normalizeMessage (cyclomatic 36) · ×1
  • openai.normalizeMessage (cyclomatic 36) langfuse/packages/shared/src/utils/chatml/adapters/openai.ts:114 — openai.normalizeMessage has cyclomatic complexity 36 (threshold 15). Of this number, 32 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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 · TracePreview.TracePreview (cyclomatic 36) · ×1
  • TracePreview.TracePreview (cyclomatic 36) langfuse/web/src/components/trace2/TracePreview.tsx:67 — TracePreview.TracePreview has cyclomatic complexity 36 (threshold 15). Of this number, 29 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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 · PolicyConfirmationDetailsSheet.PolicyConfirmationDetailsSheet (cyclomatic 36) · ×1
  • PolicyConfirmationDetailsSheet.PolicyConfirmationDetailsSheet (cyclomatic 36) langfuse/web/src/features/dashboard/components/PolicyConfirmationDetailsSheet.tsx:42 — PolicyConfirmationDetailsSheet.PolicyConfirmationDetailsSheet has cyclomatic complexity 36 (threshold 15). Of this number, 17 points are the body's own statements and 19 belong to 8 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 · DatasetRunsTable.DatasetRunsTable (cyclomatic 36) · ×1
  • DatasetRunsTable.DatasetRunsTable (cyclomatic 36) langfuse/web/src/features/datasets/components/DatasetRunsTable.tsx:181 — DatasetRunsTable.DatasetRunsTable has cyclomatic complexity 36 (threshold 15). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 617, convertToTableRow, a function literal at line 346, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · template-selector.TemplateSelector (cyclomatic 36) · ×1
  • template-selector.TemplateSelector (cyclomatic 36) langfuse/web/src/features/evals/components/template-selector.tsx:56 — template-selector.TemplateSelector has cyclomatic complexity 36 (threshold 15). Of this number, 20 points are the body's own statements and 16 belong to 7 function items inside it that branch. 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 · usePreviewData.usePreviewData (cyclomatic 36) · ×1
  • usePreviewData.usePreviewData (cyclomatic 36) langfuse/web/src/features/evals/hooks/usePreviewData.ts:38 — usePreviewData.usePreviewData has cyclomatic complexity 36 (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 · index.NewPromptForm (cyclomatic 36) · ×1
  • index.NewPromptForm (cyclomatic 36) langfuse/web/src/features/prompts/components/NewPromptForm/index.tsx:59 — index.NewPromptForm has cyclomatic complexity 36 (threshold 15). Of this number, 18 points are the body's own statements and 18 belong to 6 function items 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 · DistributionCategoricalCard.DistributionCategoricalCard (cyclomatic 36) · ×1
  • DistributionCategoricalCard.DistributionCategoricalCard (cyclomatic 36) langfuse/web/src/features/score-analytics/components/cards/DistributionCategoricalCard.tsx:110 — DistributionCategoricalCard.DistributionCategoricalCard has cyclomatic complexity 36 (threshold 15). Of this number, 23 points are the body's own statements and 13 belong to 3 function items 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 · KernelPolicyRuntime.build_taint_state (cyclomatic 36) · ×1
  • KernelPolicyRuntime.build_taint_state (cyclomatic 36) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:827 — KernelPolicyRuntime.build_taint_state 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 · variable-mapping-card.VariableMappingCard (cyclomatic 35) · ×1
  • variable-mapping-card.VariableMappingCard (cyclomatic 35) langfuse/web/src/features/evals/components/variable-mapping-card.tsx:50 — variable-mapping-card.VariableMappingCard has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 9 of the 35 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 157, 504, 296, …). 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 · multi-select.MultiSelect (cyclomatic 35) · ×1
  • multi-select.MultiSelect (cyclomatic 35) langfuse/web/src/features/filters/components/multi-select.tsx:36 — multi-select.MultiSelect has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 14 of the 35 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 220, a function literal at line 88, handleDebouncedChange, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · AnnotationForm.InnerAnnotationForm (cyclomatic 35) · ×1
  • AnnotationForm.InnerAnnotationForm (cyclomatic 35) langfuse/web/src/features/scores/components/AnnotationForm.tsx:211 — AnnotationForm.InnerAnnotationForm has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 2 of the 35 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 584, handleNumericUpsert, handleCategoricalUpsert, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · index.DashboardDetail (cyclomatic 35) · ×1
  • index.DashboardDetail (cyclomatic 35) langfuse/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsx:39 — index.DashboardDetail has cyclomatic complexity 35 (threshold 15). Of this number, 20 points are the body's own statements and 15 belong to 9 function items 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 · fill-time-series-gaps.aggregateIntoMultiUnitBuckets (cyclomatic 35) · ×1
  • fill-time-series-gaps.aggregateIntoMultiUnitBuckets (cyclomatic 35) langfuse/web/src/utils/fill-time-series-gaps.ts:170 — fill-time-series-gaps.aggregateIntoMultiUnitBuckets has cyclomatic complexity 35 (threshold 15). Of this number, 23 points are the body's own statements and 12 belong to 2 function items 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 · index.verifyClickhouseTrace (cyclomatic 35) · ×1
  • index.verifyClickhouseTrace (cyclomatic 35) langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:715 — index.verifyClickhouseTrace has cyclomatic complexity 35 (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 · litellm_callback._screen_tool_results_with_alignment (cyclomatic 35) · ×1
  • litellm_callback._screen_tool_results_with_alignment (cyclomatic 35) REDACTED:965 — litellm_callback._screen_tool_results_with_alignment has cyclomatic complexity 35 (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 · json.deepParseJsonIterative (cyclomatic 34) · ×1
  • json.deepParseJsonIterative (cyclomatic 34) langfuse/packages/shared/src/utils/json.ts:165 — json.deepParseJsonIterative has cyclomatic complexity 34 (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 · sessions-ui-table-service.getSessionsTableGeneric (cyclomatic 34) · ×1
  • sessions-ui-table-service.getSessionsTableGeneric (cyclomatic 34) langfuse/packages/shared/src/server/services/sessions-ui-table-service.ts:124 — sessions-ui-table-service.getSessionsTableGeneric has cyclomatic complexity 34 (threshold 15). Of this number, 30 points are the body's own statements and 4 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 · DataGenerator.generateSyntheticObservations (cyclomatic 34) · ×1
  • DataGenerator.generateSyntheticObservations (cyclomatic 34) langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:420 — DataGenerator.generateSyntheticObservations has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 1 of the 34 points is its own statement and the rest belongs to one function literal inside it that branches (line 426). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · date-picker.TimeRangePicker (cyclomatic 34) · ×1
  • date-picker.TimeRangePicker (cyclomatic 34) langfuse/web/src/components/date-picker.tsx:276 — date-picker.TimeRangePicker has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 11 of the 34 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 317, getDisplayContent, a function literal at line 292, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · data-table.DataTable (cyclomatic 34) · ×1
  • data-table.DataTable (cyclomatic 34) langfuse/web/src/components/table/data-table.tsx:145 — data-table.DataTable has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 12 of the 34 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 303, 328, 245, …). 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 · PrettyJsonView.JsonPrettyTable (cyclomatic 34) · ×1
  • PrettyJsonView.JsonPrettyTable (cyclomatic 34) langfuse/web/src/components/ui/PrettyJsonView.tsx:417 — PrettyJsonView.JsonPrettyTable has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 2 of the 34 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 475, 453, 609, …). 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 · UpsertModelFormDialog.UpsertModelFormDialog (cyclomatic 34) · ×1
  • UpsertModelFormDialog.UpsertModelFormDialog (cyclomatic 34) langfuse/web/src/features/models/components/UpsertModelFormDialog.tsx:68 — UpsertModelFormDialog.UpsertModelFormDialog has cyclomatic complexity 34 (threshold 15). Most of this is not in the body itself: 10 of the 34 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 191, onSubmit, a function literal at line 163, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · CreateLLMApiKeyForm.CreateLLMApiKeyForm (cyclomatic 34) · ×1
  • CreateLLMApiKeyForm.CreateLLMApiKeyForm (cyclomatic 34) langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:228 — CreateLLMApiKeyForm.CreateLLMApiKeyForm has cyclomatic complexity 34 (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. This shape REPEATS in the file: one other method here (CreateLLMApiKeyForm.CreateLLMApiKeyForm::onSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · sign-in.SignIn (cyclomatic 34) · ×1
  • sign-in.SignIn (cyclomatic 34) langfuse/web/src/pages/auth/sign-in.tsx:508 — sign-in.SignIn has cyclomatic complexity 34 (threshold 15). Of this number, 22 points are the body's own statements and 12 belong to 5 function items 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 · OpenClawPolicy.check (cyclomatic 34) · ×1
  • OpenClawPolicy.check (cyclomatic 34) ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:612 — OpenClawPolicy.check has cyclomatic complexity 34 (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 · unary_gate_policy._tool_block_reason (cyclomatic 34) · ×1
  • unary_gate_policy._tool_block_reason (cyclomatic 34) REDACTED:1918 — unary_gate_policy._tool_block_reason has cyclomatic complexity 34 (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 · ObservationPreview.ObservationPreview (cyclomatic 33) · ×1
  • ObservationPreview.ObservationPreview (cyclomatic 33) langfuse/web/src/components/trace2/ObservationPreview.tsx:44 — ObservationPreview.ObservationPreview has cyclomatic complexity 33 (threshold 15). Of this number, 32 points are the body's own statements and 1 belongs 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 · BillingSwitchPlanDialog.BillingSwitchPlanDialog (cyclomatic 33) · ×1
  • BillingSwitchPlanDialog.BillingSwitchPlanDialog (cyclomatic 33) langfuse/web/src/ee/features/billing/components/BillingSwitchPlanDialog.tsx:31 — BillingSwitchPlanDialog.BillingSwitchPlanDialog has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 1 of the 33 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 90, 260, 65). 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 · automations.AutomationsPage (cyclomatic 33) · ×1
  • automations.AutomationsPage (cyclomatic 33) langfuse/web/src/features/automations/components/automations.tsx:25 — automations.AutomationsPage has cyclomatic complexity 33 (threshold 15). Most of this is not in the body itself: 4 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (renderMainContent, a function literal at line 108, handleDeleteAutomation, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · MembersTable.MembersTable (cyclomatic 33) · ×1
  • MembersTable.MembersTable (cyclomatic 33) langfuse/web/src/features/rbac/components/MembersTable.tsx:61 — MembersTable.MembersTable has cyclomatic complexity 33 (threshold 15). Of this number, 19 points are the body's own statements and 14 belong to 9 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 · buildScoreComparisonQuery.buildScoreComparisonQuery (cyclomatic 33) · ×1
  • buildScoreComparisonQuery.buildScoreComparisonQuery (cyclomatic 33) langfuse/web/src/features/score-analytics/server/buildScoreComparisonQuery.ts:50 — buildScoreComparisonQuery.buildScoreComparisonQuery has cyclomatic complexity 33 (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.
D1 · Cyclomatic Complexity · ChatMessage.ChatMessage (cyclomatic 32) · ×1
  • ChatMessage.ChatMessage (cyclomatic 32) langfuse/web/src/components/trace2/components/IOPreview/components/ChatMessage.tsx:48 — ChatMessage.ChatMessage has cyclomatic complexity 32 (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 · CreateOrEditAnnotationQueueButton.CreateOrEditAnnotationQueueButton (cyclomatic 32) · ×1
  • CreateOrEditAnnotationQueueButton.CreateOrEditAnnotationQueueButton (cyclomatic 32) langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:51 — CreateOrEditAnnotationQueueButton.CreateOrEditAnnotationQueueButton has cyclomatic complexity 32 (threshold 15). Of this number, 18 points are the body's own statements and 14 belong to 7 function items 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 · router.buildSampledTurnContext (cyclomatic 32) · ×1
  • router.buildSampledTurnContext (cyclomatic 32) langfuse/web/src/features/policy-suggestions/server/router.ts:456 — router.buildSampledTurnContext has cyclomatic complexity 32 (threshold 15). Of this number, 29 points are the body's own statements and 3 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 · ScoreDistributionBooleanChart.ScoreDistributionBooleanChart (cyclomatic 32) · ×1
  • ScoreDistributionBooleanChart.ScoreDistributionBooleanChart (cyclomatic 32) langfuse/web/src/features/score-analytics/components/charts/ScoreDistributionBooleanChart.tsx:26 — ScoreDistributionBooleanChart.ScoreDistributionBooleanChart has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 6 of the 32 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 151, 102, 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.
D1 · Cyclomatic Complexity · useFilterState.getCommaArrayParam (cyclomatic 31) · ×1
  • useFilterState.getCommaArrayParam (cyclomatic 31) langfuse/web/src/features/filters/hooks/useFilterState.ts:36 — useFilterState.getCommaArrayParam has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 1 of the 31 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 77, 40, 75). 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 · ScoreDistributionCategoricalChart.ScoreDistributionCategoricalChart (cyclomatic 31) · ×1
  • ScoreDistributionCategoricalChart.ScoreDistributionCategoricalChart (cyclomatic 31) langfuse/web/src/features/score-analytics/components/charts/ScoreDistributionCategoricalChart.tsx:32 — ScoreDistributionCategoricalChart.ScoreDistributionCategoricalChart has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 4 of the 31 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 177, a function literal at line 57, isUnmatchedKey, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · multi-select-key-values.MultiSelectKeyValues (cyclomatic 31) · ×1
  • multi-select-key-values.MultiSelectKeyValues (cyclomatic 31) langfuse/web/src/features/scores/components/multi-select-key-values.tsx:59 — multi-select-key-values.MultiSelectKeyValues has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 15 of the 31 points are its own statements and the rest belongs to 9 function items inside it that branch (formatFilterValues, renderOption, a function literal at line 108, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · sign-in.getServerSideProps (cyclomatic 31) · ×1
  • sign-in.getServerSideProps (cyclomatic 31) langfuse/web/src/pages/auth/sign-in.tsx:96 — sign-in.getServerSideProps has cyclomatic complexity 31 (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 · users.UsersTable (cyclomatic 31) · ×1
  • users.UsersTable (cyclomatic 31) langfuse/web/src/pages/project/[projectId]/users.tsx:128 — users.UsersTable has cyclomatic complexity 31 (threshold 15). Most of this is not in the body itself: 10 of the 31 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 208, 396, 415, …). 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 · handleBatchActionJob.handleBatchActionJob (cyclomatic 31) · ×1
  • handleBatchActionJob.handleBatchActionJob (cyclomatic 31) langfuse/worker/src/features/batchAction/handleBatchActionJob.ts:137 — handleBatchActionJob.handleBatchActionJob has cyclomatic complexity 31 (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 · BackfillEventsHistoricFromParts.run (cyclomatic 31) · ×1
  • BackfillEventsHistoricFromParts.run (cyclomatic 31) langfuse/worker/src/backgroundMigrations/backfillEventsHistoricFromParts.ts:537 — BackfillEventsHistoricFromParts.run has cyclomatic complexity 31 (threshold 15). Of this number, 17 points are the body's own statements and 14 belong to 3 function items 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 · openai.preprocessData (cyclomatic 30) · ×1
  • openai.preprocessData (cyclomatic 30) langfuse/packages/shared/src/utils/chatml/adapters/openai.ts:288 — openai.preprocessData has cyclomatic complexity 30 (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 · StatusStep.StatusStep (cyclomatic 30) · ×1
  • StatusStep.StatusStep (cyclomatic 30) langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/StatusStep.tsx:23 — StatusStep.StatusStep has cyclomatic complexity 30 (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 · evaluator-table.EvaluatorTable (cyclomatic 30) · ×1
  • evaluator-table.EvaluatorTable (cyclomatic 30) langfuse/web/src/features/evals/components/evaluator-table.tsx:137 — evaluator-table.EvaluatorTable has cyclomatic complexity 30 (threshold 15). Most of this is not in the body itself: 11 of the 30 points are its own statements and the rest belongs to 14 function items inside it that branch (convertToTableRow, a function literal at line 260, a function literal at line 373, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · prompt-detail.PromptDetail (cyclomatic 30) · ×1
  • prompt-detail.PromptDetail (cyclomatic 30) langfuse/web/src/features/prompts/components/prompt-detail.tsx:106 — prompt-detail.PromptDetail has cyclomatic complexity 30 (threshold 15). Of this number, 26 points are the body's own statements and 4 belong to 3 function items 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 · index.handler (cyclomatic 30) · ×1
  • index.handler (cyclomatic 30) REDACTED:45 — index.handler has cyclomatic complexity 30 (threshold 15). 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, 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 · ingestionQueue.ingestionQueueProcessorBuilder.<returned closure> (cyclomatic 30) · ×1
  • ingestionQueue.ingestionQueueProcessorBuilder.<returned closure> (cyclomatic 30) langfuse/worker/src/queues/ingestionQueue.ts:36 — ingestionQueue.ingestionQueueProcessorBuilder.<returned closure> has cyclomatic complexity 30 (threshold 15). Of this number, 29 points are the body's own statements and 1 belongs to one function item 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 · data-table-controls.CategoricalFacet (cyclomatic 29) · ×1
  • data-table-controls.CategoricalFacet (cyclomatic 29) langfuse/web/src/components/table/data-table-controls.tsx:570 — data-table-controls.CategoricalFacet has cyclomatic complexity 29 (threshold 15). Of this number, 25 points are the body's own statements and 4 belong to 4 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 · tree-building.filterAndPrepareObservations (cyclomatic 29) · ×1
  • tree-building.filterAndPrepareObservations (cyclomatic 29) langfuse/web/src/components/trace2/lib/tree-building.ts:210 — tree-building.filterAndPrepareObservations has cyclomatic complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 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 · useChatMLParser.useChatMLParser (cyclomatic 29) · ×1
  • useChatMLParser.useChatMLParser (cyclomatic 29) langfuse/web/src/components/trace2/components/IOPreview/hooks/useChatMLParser.ts:62 — useChatMLParser.useChatMLParser has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 4 of the 29 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 86, 162). 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 · JsonValue.JsonValue (cyclomatic 29) · ×1
  • JsonValue.JsonValue (cyclomatic 29) langfuse/web/src/components/ui/AdvancedJsonViewer/components/JsonValue.tsx:21 — JsonValue.JsonValue has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 11 of the 29 points are its own statements and the rest belongs to 5 function items inside it that branch (getColor, a function literal at line 126, a function literal at line 163, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · template-form.InnerEvalTemplateForm (cyclomatic 29) · ×1
  • template-form.InnerEvalTemplateForm (cyclomatic 29) langfuse/web/src/features/evals/components/template-form.tsx:151 — template-form.InnerEvalTemplateForm has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 13 of the 29 points are its own statements and the rest belongs to 5 function items inside it that branch (onSubmit, a function literal at line 231, a function literal at line 259, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PolicyGuideCard.summarizeSection (cyclomatic 29) · ×1
  • PolicyGuideCard.summarizeSection (cyclomatic 29) langfuse/web/src/features/policy-governance/components/PolicyGuideCard.tsx:139 — PolicyGuideCard.summarizeSection has cyclomatic complexity 29 (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 · OtelIngestionProcessor.extractUsageDetails (cyclomatic 28) · ×1
  • OtelIngestionProcessor.extractUsageDetails (cyclomatic 28) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1878 — OtelIngestionProcessor.extractUsageDetails has cyclomatic complexity 28 (threshold 15). Of this number, 25 points are the body's own statements and 3 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 · TracePage.TracePage (cyclomatic 28) · ×1
  • TracePage.TracePage (cyclomatic 28) langfuse/web/src/components/trace2/TracePage.tsx:26 — TracePage.TracePage has cyclomatic complexity 28 (threshold 15). Of this number, 20 points are the body's own statements and 8 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 · CorrectedOutputField.CorrectedOutputField (cyclomatic 28) · ×1
  • CorrectedOutputField.CorrectedOutputField (cyclomatic 28) langfuse/web/src/components/trace2/components/IOPreview/components/CorrectedOutputField.tsx:33 — CorrectedOutputField.CorrectedOutputField has cyclomatic complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to 2 function items 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 · CodeJsonViewer.JSONView (cyclomatic 28) · ×1
  • CodeJsonViewer.JSONView (cyclomatic 28) langfuse/web/src/components/ui/CodeJsonViewer.tsx:27 — CodeJsonViewer.JSONView has cyclomatic complexity 28 (threshold 15). Of this number, 22 points are the body's own statements and 6 belong to 4 function items 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 · stripeWebhookHandler.handleSubscriptionChanged (cyclomatic 28) · ×1
  • stripeWebhookHandler.handleSubscriptionChanged (cyclomatic 28) REDACTED:376 — stripeWebhookHandler.handleSubscriptionChanged has cyclomatic complexity 28 (threshold 15). Of this number, 26 points are the body's own statements and 2 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 · DistributionBooleanCard.DistributionBooleanCard (cyclomatic 28) · ×1
  • DistributionBooleanCard.DistributionBooleanCard (cyclomatic 28) langfuse/web/src/features/score-analytics/components/cards/DistributionBooleanCard.tsx:32 — DistributionBooleanCard.DistributionBooleanCard has cyclomatic complexity 28 (threshold 15). Of this number, 17 points are the body's own statements and 11 belong to 3 function items 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 · metrics.PromptVersionTable (cyclomatic 28) · ×1
  • metrics.PromptVersionTable (cyclomatic 28) langfuse/web/src/pages/project/[projectId]/prompts/metrics.tsx:82 — metrics.PromptVersionTable has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 9 of the 28 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 262, 196, 216, …). 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 · otelIngestionQueue.otelIngestionQueueProcessor (cyclomatic 28) · ×1
  • otelIngestionQueue.otelIngestionQueueProcessor (cyclomatic 28) langfuse/worker/src/queues/otelIngestionQueue.ts:174 — otelIngestionQueue.otelIngestionQueueProcessor has cyclomatic complexity 28 (threshold 15). Of this number, 20 points are the body's own statements and 8 belong to 3 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 · types.compute_prop_taint_for_instruction (cyclomatic 28) · ×1
  • types.compute_prop_taint_for_instruction (cyclomatic 28) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/types.py:149 — types.compute_prop_taint_for_instruction has cyclomatic complexity 28 (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 · litellm_callback._inject_taint_watermarks_into_messages (cyclomatic 28) · ×1
  • litellm_callback._inject_taint_watermarks_into_messages (cyclomatic 28) REDACTED:5842 — litellm_callback._inject_taint_watermarks_into_messages has cyclomatic complexity 28 (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 · PolicyEngine.observe_untrusted_output (cyclomatic 28) · ×1
  • PolicyEngine.observe_untrusted_output (cyclomatic 28) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:650 — PolicyEngine.observe_untrusted_output has cyclomatic complexity 28 (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 · commentFilterService.applyCommentFilters (cyclomatic 27) · ×1
  • commentFilterService.applyCommentFilters (cyclomatic 27) langfuse/packages/shared/src/server/services/commentFilterService.ts:89 — commentFilterService.applyCommentFilters has cyclomatic complexity 27 (threshold 15). Of this number, 19 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 · CommentDrawerButton.CommentDrawerButton (cyclomatic 27) · ×1
  • CommentDrawerButton.CommentDrawerButton (cyclomatic 27) langfuse/web/src/features/comments/CommentDrawerButton.tsx:20 — CommentDrawerButton.CommentDrawerButton has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 65, 130, 190, …). 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 · filter-query-encoding.decodeFiltersGeneric (cyclomatic 27) · ×1
  • filter-query-encoding.decodeFiltersGeneric (cyclomatic 27) langfuse/web/src/features/filters/lib/filter-query-encoding.ts:117 — filter-query-encoding.decodeFiltersGeneric 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 · useSidebarFilterState.useSidebarFilterState.applySelection (cyclomatic 27) · ×1
  • useSidebarFilterState.useSidebarFilterState.applySelection (cyclomatic 27) langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:518 — useSidebarFilterState.useSidebarFilterState.applySelection 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 · HeatmapCard.HeatmapCard (cyclomatic 27) · ×1
  • HeatmapCard.HeatmapCard (cyclomatic 27) langfuse/web/src/features/score-analytics/components/cards/HeatmapCard.tsx:141 — HeatmapCard.HeatmapCard 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 · analytics.ScoresAnalyticsV2Page (cyclomatic 27) · ×1
  • analytics.ScoresAnalyticsV2Page (cyclomatic 27) langfuse/web/src/pages/project/[projectId]/scores/analytics.tsx:38 — analytics.ScoresAnalyticsV2Page has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 11 of the 27 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 155, 104, 120, …). 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 · [modelId].ModelDetailPage (cyclomatic 27) · ×1
  • [modelId].ModelDetailPage (cyclomatic 27) langfuse/web/src/pages/project/[projectId]/settings/models/[modelId].tsx:42 — [modelId].ModelDetailPage has cyclomatic complexity 27 (threshold 15). Of this number, 18 points are the body's own statements and 9 belong to 3 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 · fill-time-series-gaps.fillGapsInSingleUnitData (cyclomatic 27) · ×1
  • fill-time-series-gaps.fillGapsInSingleUnitData (cyclomatic 27) langfuse/web/src/utils/fill-time-series-gaps.ts:55 — fill-time-series-gaps.fillGapsInSingleUnitData has cyclomatic complexity 27 (threshold 15). Of this number, 15 points are the body's own statements and 12 belong to 2 function items 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 · fill-time-series-gaps.aggregateCategoricalIntoMultiUnitBuckets (cyclomatic 27) · ×1
  • fill-time-series-gaps.aggregateCategoricalIntoMultiUnitBuckets (cyclomatic 27) langfuse/web/src/utils/fill-time-series-gaps.ts:471 — fill-time-series-gaps.aggregateCategoricalIntoMultiUnitBuckets has cyclomatic complexity 27 (threshold 15). Of this number, 15 points are the body's own statements and 12 belong to 2 function items inside it that branch. 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 · IngestionService.mapObservationEventsToRecords (cyclomatic 27) · ×1
  • IngestionService.mapObservationEventsToRecords (cyclomatic 27) langfuse/worker/src/services/IngestionService/index.ts:1795 — IngestionService.mapObservationEventsToRecords has cyclomatic complexity 27 (threshold 15). Most of this is not in the body itself: 1 of the 27 points is its own statement and the rest belongs to one function literal inside it that branches (line 1803). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · BackfillEventsHistoric.run (cyclomatic 27) · ×1
  • BackfillEventsHistoric.run (cyclomatic 27) langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:686 — BackfillEventsHistoric.run has cyclomatic complexity 27 (threshold 15). Of this number, 14 points are the body's own statements and 13 belong to 3 function items 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 · AlignmentSentinelPolicy.check (cyclomatic 27) · ×1
  • AlignmentSentinelPolicy.check (cyclomatic 27) ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_sentinel_policy.py:321 — AlignmentSentinelPolicy.check has cyclomatic complexity 27 (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.
D1 · Cyclomatic Complexity · filterToPrisma.tableColumnsToSqlFilter (cyclomatic 26) · ×1
  • filterToPrisma.tableColumnsToSqlFilter (cyclomatic 26) langfuse/packages/shared/src/server/filterToPrisma.ts:42 — filterToPrisma.tableColumnsToSqlFilter has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 2 of the 26 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 67, 50, 47). 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 · TraceDetailView.TraceDetailView (cyclomatic 26) · ×1
  • TraceDetailView.TraceDetailView (cyclomatic 26) langfuse/web/src/components/trace2/components/TraceDetailView/TraceDetailView.tsx:61 — TraceDetailView.TraceDetailView has cyclomatic complexity 26 (threshold 15). Of this number, 21 points are the body's own statements and 5 belong to 3 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 · JSONTableView.JSONTableView (cyclomatic 26) · ×1
  • JSONTableView.JSONTableView (cyclomatic 26) langfuse/web/src/components/trace2/components/_shared/JSONTableView/JSONTableView.tsx:26 — JSONTableView.JSONTableView has cyclomatic complexity 26 (threshold 15). Of this number, 13 points are the body's own statements and 13 belong to 8 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 · multi-select-combobox.MultiSelectCombobox (cyclomatic 26) · ×1
  • multi-select-combobox.MultiSelectCombobox (cyclomatic 26) langfuse/web/src/components/ui/multi-select-combobox.tsx:28 — multi-select-combobox.MultiSelectCombobox has cyclomatic complexity 26 (threshold 15). Of this number, 15 points are the body's own statements and 11 belong to 6 function items 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 · BillingService.getSubscriptionInfo (cyclomatic 26) · ×1
  • BillingService.getSubscriptionInfo (cyclomatic 26) REDACTED:312 — BillingService.getSubscriptionInfo has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 1 of the 26 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 315, 465, 405). 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 · index.handler (cyclomatic 26) · ×1
  • index.handler (cyclomatic 26) langfuse/web/src/pages/api/public/scim/Users/index.ts:11 — index.handler has cyclomatic complexity 26 (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 · index.verifyClickhouseScore (cyclomatic 26) · ×1
  • index.verifyClickhouseScore (cyclomatic 26) langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:879 — index.verifyClickhouseScore has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · SecurityLabelPolicy.check (cyclomatic 26) · ×1
  • SecurityLabelPolicy.check (cyclomatic 26) ArbiterOS-Kernel/arbiteros_kernel/policy/security_label_policy.py:43 — SecurityLabelPolicy.check has cyclomatic complexity 26 (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 · processEventBatch.processEventBatch (cyclomatic 25) · ×1
  • processEventBatch.processEventBatch (cyclomatic 25) langfuse/packages/shared/src/server/ingestion/processEventBatch.ts:104 — processEventBatch.processEventBatch has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 7 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 282, 156, 193, …). 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 · BillingService.getInvoices (cyclomatic 25) · ×1
  • BillingService.getInvoices (cyclomatic 25) REDACTED:1541 — BillingService.getInvoices has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 1551, 1626, 1593). 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 · ModelUsageChart.ModelUsageChart (cyclomatic 25) · ×1
  • ModelUsageChart.ModelUsageChart (cyclomatic 25) langfuse/web/src/features/dashboard/components/ModelUsageChart.tsx:32 — ModelUsageChart.ModelUsageChart has cyclomatic complexity 25 (threshold 15). Of this number, 19 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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 · DatasetItemDetailPage.DatasetItemDetailPage (cyclomatic 25) · ×1
  • DatasetItemDetailPage.DatasetItemDetailPage (cyclomatic 25) langfuse/web/src/features/datasets/components/DatasetItemDetailPage.tsx:32 — DatasetItemDetailPage.DatasetItemDetailPage has cyclomatic complexity 25 (threshold 15). Of this number, 17 points are the body's own statements and 8 belong to 2 function items 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 · remap-evaluator.RemapEvaluatorPage (cyclomatic 25) · ×1
  • remap-evaluator.RemapEvaluatorPage (cyclomatic 25) langfuse/web/src/features/evals/pages/remap-evaluator.tsx:28 — remap-evaluator.RemapEvaluatorPage has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 12 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 251, handleFormSuccess, a function literal at line 82). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · QueryBuilder.translateAggregation (cyclomatic 25) · ×1
  • QueryBuilder.translateAggregation (cyclomatic 25) langfuse/web/src/features/query/server/queryBuilder.ts:54 — QueryBuilder.translateAggregation has cyclomatic complexity 25 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
D1 · Cyclomatic Complexity · direct_metadata._coerce_generic (cyclomatic 25) · ×1
  • direct_metadata._coerce_generic (cyclomatic 25) ArbiterOS-Kernel/arbiteros_kernel/policy/direct_metadata.py:124 — direct_metadata._coerce_generic has cyclomatic complexity 25 (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 · KernelPolicyRuntime.check_path_and_budget (cyclomatic 25) · ×1
  • KernelPolicyRuntime.check_path_and_budget (cyclomatic 25) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:711 — KernelPolicyRuntime.check_path_and_budget has cyclomatic complexity 25 (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 · KernelPolicyRuntime.efsm_step (cyclomatic 25) · ×1
  • KernelPolicyRuntime.efsm_step (cyclomatic 25) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:1183 — KernelPolicyRuntime.efsm_step has cyclomatic complexity 25 (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 · public-api-filter-builder.convertApiProvidedFilterToClickhouseFilter (cyclomatic 24) · ×1
  • public-api-filter-builder.convertApiProvidedFilterToClickhouseFilter (cyclomatic 24) langfuse/packages/shared/src/server/queries/public-api-filter-builder.ts:217 — public-api-filter-builder.convertApiProvidedFilterToClickhouseFilter has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to one function literal inside it that branches (line 223). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · extractToolsBackend.extractToolCallsFromRawOutput (cyclomatic 24) · ×1
  • extractToolsBackend.extractToolCallsFromRawOutput (cyclomatic 24) langfuse/packages/shared/src/server/ingestion/extractToolsBackend.ts:180 — extractToolsBackend.extractToolCallsFromRawOutput has cyclomatic complexity 24 (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 · langgraph.normalizeMessage (cyclomatic 24) · ×1
  • langgraph.normalizeMessage (cyclomatic 24) langfuse/packages/shared/src/utils/chatml/adapters/langgraph.ts:101 — langgraph.normalizeMessage has cyclomatic complexity 24 (threshold 15). Of this number, 19 points are the body's own statements and 5 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 · generic.preprocessData (cyclomatic 24) · ×1
  • generic.preprocessData (cyclomatic 24) langfuse/packages/shared/src/utils/chatml/adapters/generic.ts:67 — generic.preprocessData has cyclomatic complexity 24 (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 · DataGenerator.generateEvaluationObservations (cyclomatic 24) · ×1
  • DataGenerator.generateEvaluationObservations (cyclomatic 24) langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:314 — DataGenerator.generateEvaluationObservations has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to one function literal inside it that branches (line 322). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · AdvancedJsonViewer.AdvancedJsonViewer (cyclomatic 24) · ×1
  • AdvancedJsonViewer.AdvancedJsonViewer (cyclomatic 24) langfuse/web/src/components/ui/AdvancedJsonViewer/AdvancedJsonViewer.tsx:32 — AdvancedJsonViewer.AdvancedJsonViewer has cyclomatic complexity 24 (threshold 15). Of this number, 14 points are the body's own statements and 10 belong to 5 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 · slider.Slider (cyclomatic 24) · ×1
  • slider.Slider (cyclomatic 24) langfuse/web/src/components/ui/slider.tsx:21 — slider.Slider has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (handleInputBlur, a function literal at line 28, handleKeyDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · eval-templates-table.EvalsTemplateTable (cyclomatic 24) · ×1
  • eval-templates-table.EvalsTemplateTable (cyclomatic 24) langfuse/web/src/features/evals/components/eval-templates-table.tsx:51 — eval-templates-table.EvalsTemplateTable has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 435, 217, 467, …). 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 · SurveyStep.SurveyStep (cyclomatic 24) · ×1
  • SurveyStep.SurveyStep (cyclomatic 24) langfuse/web/src/features/onboarding/components/SurveyStep.tsx:26 — SurveyStep.SurveyStep has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 8 of the 24 points are its own statements and the rest belongs to 3 function items inside it that branch (getLocalizedOption, handleAutoAdvanceWithTimeout, a function literal at line 173). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · JumpToPlaygroundButton.parseGeneration (cyclomatic 24) · ×1
  • JumpToPlaygroundButton.parseGeneration (cyclomatic 24) langfuse/web/src/features/playground/page/components/JumpToPlaygroundButton.tsx:277 — JumpToPlaygroundButton.parseGeneration has cyclomatic complexity 24 (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 · prompts-table.PromptTable (cyclomatic 24) · ×1
  • prompts-table.PromptTable (cyclomatic 24) langfuse/web/src/features/prompts/components/prompts-table.tsx:63 — prompts-table.PromptTable has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 7 of the 24 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 147, 309, 254, …). 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 · CreateLLMApiKeyForm.CreateLLMApiKeyForm · ×1
  • CreateLLMApiKeyForm.CreateLLMApiKeyForm::onSubmit (cyclomatic 24) langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:481 — CreateLLMApiKeyForm.CreateLLMApiKeyForm::onSubmit has cyclomatic complexity 24 (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. This shape REPEATS in the file: one other method here (CreateLLMApiKeyForm.CreateLLMApiKeyForm) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · SupportFormSection.SupportFormSection (cyclomatic 24) · ×1
  • SupportFormSection.SupportFormSection (cyclomatic 24) langfuse/web/src/features/support-chat/SupportFormSection.tsx:151 — SupportFormSection.SupportFormSection has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 6 function items inside it that branch (onSubmit, a function literal at line 469, a function literal at line 206, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · TraceGraphView.TraceGraphView (cyclomatic 24) · ×1
  • TraceGraphView.TraceGraphView (cyclomatic 24) langfuse/web/src/features/trace-graph-view/components/TraceGraphView.tsx:34 — TraceGraphView.TraceGraphView has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 7 function literals inside it that branch (lines 137, 91, 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.
D1 · Cyclomatic Complexity · BigNumber.BigNumber (cyclomatic 24) · ×1
  • BigNumber.BigNumber (cyclomatic 24) langfuse/web/src/features/widgets/chart-library/BigNumber.tsx:104 — BigNumber.BigNumber has cyclomatic complexity 24 (threshold 15). Of this number, 13 points are the body's own statements and 11 belong to 4 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 · IngestionService.getUsageUnits (cyclomatic 24) · ×1
  • IngestionService.getUsageUnits (cyclomatic 24) langfuse/worker/src/services/IngestionService/index.ts:1366 — IngestionService.getUsageUnits has cyclomatic complexity 24 (threshold 15). Of this number, 16 points are the body's own statements and 8 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 · policy_rule_ir._validate_predicate (cyclomatic 24) · ×1
  • policy_rule_ir._validate_predicate (cyclomatic 24) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:659 — policy_rule_ir._validate_predicate has cyclomatic complexity 24 (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 · PolicyEngine._check_static_allowdeny (cyclomatic 24) · ×1
  • PolicyEngine._check_static_allowdeny (cyclomatic 24) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1504 — PolicyEngine._check_static_allowdeny 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 · KernelPolicyRuntime.check_allow_deny (cyclomatic 24) · ×1
  • KernelPolicyRuntime.check_allow_deny (cyclomatic 24) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:618 — KernelPolicyRuntime.check_allow_deny 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 · validation.validatePricingTiers (cyclomatic 23) · ×1
  • validation.validatePricingTiers (cyclomatic 23) REDACTED:102 — validation.validatePricingTiers has cyclomatic complexity 23 (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 · data-table-pagination.DataTablePagination (cyclomatic 23) · ×1
  • data-table-pagination.DataTablePagination (cyclomatic 23) langfuse/web/src/components/table/data-table-pagination.tsx:32 — data-table-pagination.DataTablePagination has cyclomatic complexity 23 (threshold 15). Of this number, 16 points are the body's own statements and 7 belong to 3 function items inside it that branch. 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 · tree-building.buildTreeNodesBottomUp (cyclomatic 23) · ×1
  • tree-building.buildTreeNodesBottomUp (cyclomatic 23) langfuse/web/src/components/trace2/lib/tree-building.ts:447 — tree-building.buildTreeNodesBottomUp has cyclomatic complexity 23 (threshold 15). Of this number, 21 points are the body's own statements and 2 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 · BillingInvoiceTable.BillingInvoiceTable (cyclomatic 23) · ×1
  • BillingInvoiceTable.BillingInvoiceTable (cyclomatic 23) langfuse/web/src/ee/features/billing/components/BillingInvoiceTable.tsx:31 — BillingInvoiceTable.BillingInvoiceTable has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 4 of the 23 points are its own statements and the rest belongs to 7 function items inside it that branch (onPaginationChange, a function literal at line 133, a function literal at line 77, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · BillingService.changePlan (cyclomatic 23) · ×1
  • BillingService.changePlan (cyclomatic 23) REDACTED:779 — BillingService.changePlan has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 782, 1076, 1036). 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 · BillingService.applyPromotionCode (cyclomatic 23) · ×1
  • BillingService.applyPromotionCode (cyclomatic 23) REDACTED:1909 — BillingService.applyPromotionCode has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 1 of the 23 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 1912, 1955, 1972). 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 · EditDatasetItem.EditDatasetItem (cyclomatic 23) · ×1
  • EditDatasetItem.EditDatasetItem (cyclomatic 23) langfuse/web/src/features/datasets/components/EditDatasetItem.tsx:77 — EditDatasetItem.EditDatasetItem has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 9 of the 23 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 94, a function literal at line 199, a function literal at line 238, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · UpsertScoreConfigDialog.UpsertScoreConfigDialog (cyclomatic 23) · ×1
  • UpsertScoreConfigDialog.UpsertScoreConfigDialog (cyclomatic 23) langfuse/web/src/features/score-configs/components/UpsertScoreConfigDialog.tsx:50 — UpsertScoreConfigDialog.UpsertScoreConfigDialog has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 8 of the 23 points are its own statements and the rest belongs to 6 function items inside it that branch (onSubmit, a function literal at line 290, a function literal at line 194, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PivotTable.PivotTable (cyclomatic 23) · ×1
  • PivotTable.PivotTable (cyclomatic 23) langfuse/web/src/features/widgets/chart-library/PivotTable.tsx:237 — PivotTable.PivotTable has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 7 of the 23 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 260, 246, 308, …). 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 · auth.getAuthOptions (cyclomatic 23) · ×1
  • auth.getAuthOptions (cyclomatic 23) REDACTED:597 — auth.getAuthOptions has cyclomatic complexity 23 (threshold 15). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 741, 876, 614). 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 · litellm_callback._resolve_trace_state_from_metadata (cyclomatic 23) · ×1
  • litellm_callback._resolve_trace_state_from_metadata (cyclomatic 23) REDACTED:2340 — litellm_callback._resolve_trace_state_from_metadata has cyclomatic complexity 23 (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 · litellm_callback._infer_codex_tool_name_from_arguments (cyclomatic 23) · ×1
  • litellm_callback._infer_codex_tool_name_from_arguments (cyclomatic 23) REDACTED:5299 — litellm_callback._infer_codex_tool_name_from_arguments has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · litellm_callback._response_transform_content_only (cyclomatic 23) · ×1
  • litellm_callback._response_transform_content_only (cyclomatic 23) REDACTED:5512 — litellm_callback._response_transform_content_only has cyclomatic complexity 23 (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 · TaintPolicy.check (cyclomatic 23) · ×1
  • TaintPolicy.check (cyclomatic 23) ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:147 — TaintPolicy.check has cyclomatic complexity 23 (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 · run_cases.main (cyclomatic 23) · ×1
  • run_cases.main (cyclomatic 23) REDACTED:615 — run_cases.main has cyclomatic complexity 23 (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.
D1 · Cyclomatic Complexity · observations.getObservationsTableInternal (cyclomatic 22) · ×1
  • observations.getObservationsTableInternal (cyclomatic 22) langfuse/packages/shared/src/server/repositories/observations.ts:628 — observations.getObservationsTableInternal has cyclomatic complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to 3 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 · ChatMessageComponent.ChatMessageComponent (cyclomatic 22) · ×1
  • ChatMessageComponent.ChatMessageComponent (cyclomatic 22) langfuse/web/src/components/ChatMessages/ChatMessageComponent.tsx:76 — ChatMessageComponent.ChatMessageComponent has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 7 of the 22 points are its own statements and the rest belongs to 4 function items inside it that branch (toggleRole, a function literal at line 116, a function literal at line 171, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · VersionLabel.VersionLabel (cyclomatic 22) · ×1
  • VersionLabel.VersionLabel (cyclomatic 22) langfuse/web/src/components/VersionLabel.tsx:29 — VersionLabel.VersionLabel has cyclomatic complexity 22 (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 · MarkdownViewer.MarkdownView (cyclomatic 22) · ×1
  • MarkdownViewer.MarkdownView (cyclomatic 22) langfuse/web/src/components/ui/MarkdownViewer.tsx:315 — MarkdownViewer.MarkdownView has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 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 · automationForm.AutomationForm · ×1
  • automationForm.AutomationForm::getDefaultValues (cyclomatic 22) langfuse/web/src/features/automations/components/automationForm.tsx:152 — automationForm.AutomationForm::getDefaultValues has cyclomatic complexity 22 (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 · useExtractVariables.useExtractVariables (cyclomatic 22) · ×1
  • useExtractVariables.useExtractVariables (cyclomatic 22) langfuse/web/src/features/evals/hooks/useExtractVariables.ts:26 — useExtractVariables.useExtractVariables has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 103, 62, 56, …). 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 · PromptModelStep.PromptModelStep (cyclomatic 22) · ×1
  • PromptModelStep.PromptModelStep (cyclomatic 22) langfuse/web/src/features/experiments/components/steps/PromptModelStep.tsx:34 — PromptModelStep.PromptModelStep has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 1 of the 22 points is its own statement and the rest belongs to 7 function items inside it that branch (a function literal at line 109, a function literal at line 282, handleToggleStructuredOutput, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · PolicyGuideCard.PolicyGuideCard (cyclomatic 22) · ×1
  • PolicyGuideCard.PolicyGuideCard (cyclomatic 22) langfuse/web/src/features/policy-governance/components/PolicyGuideCard.tsx:245 — PolicyGuideCard.PolicyGuideCard has cyclomatic complexity 22 (threshold 15). Of this number, 16 points are the body's own statements and 6 belong to 3 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 · ChannelSelector.ChannelSelector (cyclomatic 22) · ×1
  • ChannelSelector.ChannelSelector (cyclomatic 22) langfuse/web/src/features/slack/components/ChannelSelector.tsx:79 — ChannelSelector.ChannelSelector has cyclomatic complexity 22 (threshold 15). Of this number, 13 points are the body's own statements and 9 belong to 4 function items 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 · buildStepData.assignGlobalTimingSteps (cyclomatic 22) · ×1
  • buildStepData.assignGlobalTimingSteps (cyclomatic 22) langfuse/web/src/features/trace-graph-view/buildStepData.ts:84 — buildStepData.assignGlobalTimingSteps has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong to 3 function items 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 · litellm_callback._append_bootstrap_scan_notice_if_needed (cyclomatic 22) · ×1
  • litellm_callback._append_bootstrap_scan_notice_if_needed (cyclomatic 22) REDACTED:1218 — litellm_callback._append_bootstrap_scan_notice_if_needed has cyclomatic complexity 22 (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.
D1 · Cyclomatic Complexity · litellm_callback._max_emitted_tool_result_index (cyclomatic 22) · ×1
  • litellm_callback._max_emitted_tool_result_index (cyclomatic 22) REDACTED:1344 — litellm_callback._max_emitted_tool_result_index has cyclomatic complexity 22 (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 · alignment_trigger.should_trigger_preexec_sentinel (cyclomatic 22) · ×1
  • alignment_trigger.should_trigger_preexec_sentinel (cyclomatic 22) ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_trigger.py:446 — alignment_trigger.should_trigger_preexec_sentinel has cyclomatic complexity 22 (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 · EfsmGatePolicy.check (cyclomatic 22) · ×1
  • EfsmGatePolicy.check (cyclomatic 22) ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:90 — EfsmGatePolicy.check has cyclomatic complexity 22 (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 · protocol_adapter.extract_all_user_messages_from_request (cyclomatic 22) · ×1
  • protocol_adapter.extract_all_user_messages_from_request (cyclomatic 22) ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:128 — protocol_adapter.extract_all_user_messages_from_request has cyclomatic complexity 22 (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 · run_cases.load_manifest (cyclomatic 22) · ×1
  • run_cases.load_manifest (cyclomatic 22) REDACTED:64 — run_cases.load_manifest has cyclomatic complexity 22 (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 · dataset-items.buildPrismaWhereFromFilterState (cyclomatic 21) · ×1
  • dataset-items.buildPrismaWhereFromFilterState (cyclomatic 21) langfuse/packages/shared/src/server/repositories/dataset-items.ts:884 — dataset-items.buildPrismaWhereFromFilterState has cyclomatic complexity 21 (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 · aisdk.preprocessData (cyclomatic 21) · ×1
  • aisdk.preprocessData (cyclomatic 21) langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts:347 — aisdk.preprocessData has cyclomatic complexity 21 (threshold 15). Of this number, 20 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 · generic.normalizeGoogleMessage (cyclomatic 21) · ×1
  • generic.normalizeGoogleMessage (cyclomatic 21) langfuse/packages/shared/src/utils/chatml/adapters/generic.ts:3 — generic.normalizeGoogleMessage has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 40, 17, 25). 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 · data-table-column-visibility-filter.ColumnVisibilityListItem (cyclomatic 21) · ×1
  • data-table-column-visibility-filter.ColumnVisibilityListItem (cyclomatic 21) langfuse/web/src/components/table/data-table-column-visibility-filter.tsx:90 — data-table-column-visibility-filter.ColumnVisibilityListItem has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · useTableViewManager.useTableViewManager (cyclomatic 21) · ×1
  • useTableViewManager.useTableViewManager (cyclomatic 21) langfuse/web/src/components/table/table-view-presets/hooks/useTableViewManager.ts:47 — useTableViewManager.useTableViewManager has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 131, 315, 281, …). 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 · VirtualizedJsonViewer.VirtualizedJsonViewer (cyclomatic 21) · ×1
  • VirtualizedJsonViewer.VirtualizedJsonViewer (cyclomatic 21) langfuse/web/src/components/ui/AdvancedJsonViewer/VirtualizedJsonViewer.tsx:39 — VirtualizedJsonViewer.VirtualizedJsonViewer has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 165, 114, 130, …). 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 · ScoreAnalytics.ScoreAnalytics (cyclomatic 21) · ×1
  • ScoreAnalytics.ScoreAnalytics (cyclomatic 21) langfuse/web/src/features/dashboard/components/score-analytics/ScoreAnalytics.tsx:25 — ScoreAnalytics.ScoreAnalytics has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 103, 76). 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 · DatasetAggregateTableCell.DatasetAggregateCellContent (cyclomatic 21) · ×1
  • DatasetAggregateTableCell.DatasetAggregateCellContent (cyclomatic 21) langfuse/web/src/features/datasets/components/DatasetAggregateTableCell.tsx:27 — DatasetAggregateTableCell.DatasetAggregateCellContent has cyclomatic complexity 21 (threshold 15). Of this number, 20 points are the body's own statements and 1 belongs to one function item inside it that branches. 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 · DatasetItemsTable.DatasetItemsTable (cyclomatic 21) · ×1
  • DatasetItemsTable.DatasetItemsTable (cyclomatic 21) langfuse/web/src/features/datasets/components/DatasetItemsTable.tsx:54 — DatasetItemsTable.DatasetItemsTable has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 268, a function literal at line 173, a function literal at line 293, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · useCsvMapping.useCsvMapping (cyclomatic 21) · ×1
  • useCsvMapping.useCsvMapping (cyclomatic 21) langfuse/web/src/features/datasets/hooks/useCsvMapping.ts:36 — useCsvMapping.useCsvMapping has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 3 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 60, 84, 49). 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 · OnboardingSurvey.OnboardingSurvey (cyclomatic 21) · ×1
  • OnboardingSurvey.OnboardingSurvey (cyclomatic 21) langfuse/web/src/features/onboarding/components/OnboardingSurvey.tsx:14 — OnboardingSurvey.OnboardingSurvey has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 39, isEmpty, a function literal at line 71, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · chatCompletionHandler.chatCompletionHandler (cyclomatic 21) · ×1
  • chatCompletionHandler.chatCompletionHandler (cyclomatic 21) REDACTED:29 — chatCompletionHandler.chatCompletionHandler has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 47, 102, 108). 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 · color-scales.buildColorMappings (cyclomatic 21) · ×1
  • color-scales.buildColorMappings (cyclomatic 21) REDACTED:562 — color-scales.buildColorMappings has cyclomatic complexity 21 (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.
D1 · Cyclomatic Complexity · playgroundConverter.convertChatMlToPlayground (cyclomatic 21) · ×1
  • playgroundConverter.convertChatMlToPlayground (cyclomatic 21) langfuse/web/src/utils/chatml/playgroundConverter.ts:52 — playgroundConverter.convertChatMlToPlayground has cyclomatic complexity 21 (threshold 15). Of this number, 13 points are the body's own statements and 8 belong to one function literal inside it that branches. 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 · fill-time-series-gaps.fillGapsInCategoricalData (cyclomatic 21) · ×1
  • fill-time-series-gaps.fillGapsInCategoricalData (cyclomatic 21) langfuse/web/src/utils/fill-time-series-gaps.ts:373 — fill-time-series-gaps.fillGapsInCategoricalData has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to 2 function items inside it that branch (toStartOfSingleUnit, addSingleUnit). 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 · index.main (cyclomatic 21) · ×1
  • index.main (cyclomatic 21) langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:47 — index.main has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 6 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 · bash._ts_iter_flat (cyclomatic 21) · ×1
  • bash._ts_iter_flat (cyclomatic 21) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:95 — bash._ts_iter_flat has cyclomatic complexity 21 (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 · powershell._ps_iter_flat (cyclomatic 21) · ×1
  • powershell._ps_iter_flat (cyclomatic 21) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:79 — powershell._ps_iter_flat has cyclomatic complexity 21 (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 · litellm_callback._wrap_reference_tool_ids_into_messages (cyclomatic 21) · ×1
  • litellm_callback._wrap_reference_tool_ids_into_messages (cyclomatic 21) REDACTED:5681 — litellm_callback._wrap_reference_tool_ids_into_messages has cyclomatic complexity 21 (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 · KernelPolicyRuntime.check_taint_sink_for_tool (cyclomatic 21) · ×1
  • KernelPolicyRuntime.check_taint_sink_for_tool (cyclomatic 21) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:904 — KernelPolicyRuntime.check_taint_sink_for_tool has cyclomatic complexity 21 (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 · protocol_adapter.to_canonical_assistant_message (cyclomatic 21) · ×1
  • protocol_adapter.to_canonical_assistant_message (cyclomatic 21) ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:259 — protocol_adapter.to_canonical_assistant_message has cyclomatic complexity 21 (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 · dataset-run-items.getDatasetRunItemsTableInternal (cyclomatic 20) · ×1
  • dataset-run-items.getDatasetRunItemsTableInternal (cyclomatic 20) langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:722 — dataset-run-items.getDatasetRunItemsTableInternal has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · gemini.preprocessData (cyclomatic 20) · ×1
  • gemini.preprocessData (cyclomatic 20) langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:346 — gemini.preprocessData 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 · FrameworkTraceLoader.adaptTrace (cyclomatic 20) · ×1
  • FrameworkTraceLoader.adaptTrace (cyclomatic 20) langfuse/packages/shared/scripts/seeder/utils/framework-traces/framework-trace-loader.ts:66 — FrameworkTraceLoader.adaptTrace 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 · data-table-ai-filters.DataTableAIFilters (cyclomatic 20) · ×1
  • data-table-ai-filters.DataTableAIFilters (cyclomatic 20) langfuse/web/src/components/table/data-table-ai-filters.tsx:21 — data-table-ai-filters.DataTableAIFilters has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (handleAiFilterSubmit, a function literal at line 127, a function literal at line 120). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · MediaButtonGroup.MediaButtonGroup (cyclomatic 20) · ×1
  • MediaButtonGroup.MediaButtonGroup (cyclomatic 20) langfuse/web/src/components/ui/AdvancedJsonViewer/components/MediaButtonGroup.tsx:126 — MediaButtonGroup.MediaButtonGroup has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 2 of the 20 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 135, 263, 142, …). 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 · time-picker-input.TimePickerInput (cyclomatic 20) · ×1
  • time-picker-input.TimePickerInput (cyclomatic 20) langfuse/web/src/components/ui/time-picker-input.tsx:27 — time-picker-input.TimePickerInput has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 4 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (handleKeyDown, calculateNewValue, a function literal at line 53). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · index.AddObservationsToDatasetDialog (cyclomatic 20) · ×1
  • index.AddObservationsToDatasetDialog (cyclomatic 20) langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/index.tsx:39 — index.AddObservationsToDatasetDialog has cyclomatic complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · useCsvImport.useCsvImport.execute (cyclomatic 20) · ×1
  • useCsvImport.useCsvImport.execute (cyclomatic 20) langfuse/web/src/features/datasets/hooks/useCsvImport.ts:82 — useCsvImport.useCsvImport.execute has cyclomatic complexity 20 (threshold 15). Of this number, 13 points are the body's own statements and 7 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 · new-evaluator.NewEvaluatorPage (cyclomatic 20) · ×1
  • new-evaluator.NewEvaluatorPage (cyclomatic 20) langfuse/web/src/features/evals/pages/new-evaluator.tsx:23 — new-evaluator.NewEvaluatorPage has cyclomatic complexity 20 (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 · GovernanceOverviewPanel.GovernanceOverviewPanel (cyclomatic 20) · ×1
  • GovernanceOverviewPanel.GovernanceOverviewPanel (cyclomatic 20) langfuse/web/src/features/governance-overview/components/GovernanceOverviewPanel.tsx:34 — GovernanceOverviewPanel.GovernanceOverviewPanel has cyclomatic complexity 20 (threshold 15). Of this number, 10 points are the body's own statements and 10 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 · CreateLLMApiKeyForm.createFormSchema (cyclomatic 20) · ×1
  • CreateLLMApiKeyForm.createFormSchema (cyclomatic 20) langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:50 — CreateLLMApiKeyForm.createFormSchema has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 5 of the 20 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 89, 191, 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 · SlackConnectButton.SlackConnectButton (cyclomatic 20) · ×1
  • SlackConnectButton.SlackConnectButton (cyclomatic 20) langfuse/web/src/features/slack/components/SlackConnectButton.tsx:38 — SlackConnectButton.SlackConnectButton has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 4 function items inside it that branch (handleConnect::handleMessage, a function literal at line 64, handleConnect, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · Chart.Chart (cyclomatic 20) · ×1
  • Chart.Chart (cyclomatic 20) langfuse/web/src/features/widgets/chart-library/Chart.tsx:18 — Chart.Chart has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 2 function items inside it that branch (renderChart, a function literal at line 55). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · sign-up.SignIn (cyclomatic 20) · ×1
  • sign-up.SignIn (cyclomatic 20) langfuse/web/src/pages/auth/sign-up.tsx:41 — sign-up.SignIn has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to 3 function items 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 · getDatabaseReadStream.getDatabaseReadStreamPaginated (cyclomatic 20) · ×1
  • getDatabaseReadStream.getDatabaseReadStreamPaginated (cyclomatic 20) langfuse/worker/src/features/database-read-stream/getDatabaseReadStream.ts:99 — getDatabaseReadStream.getDatabaseReadStreamPaginated has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 277, 352, 398, …). 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 · handleCloudUsageMeteringJob.handleCloudUsageMeteringJob (cyclomatic 20) · ×1
  • handleCloudUsageMeteringJob.handleCloudUsageMeteringJob (cyclomatic 20) langfuse/worker/src/ee/cloudUsageMetering/handleCloudUsageMeteringJob.ts:27 — handleCloudUsageMeteringJob.handleCloudUsageMeteringJob 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 · langfuse_replay._emit_response_nodes_from_pair (cyclomatic 20) · ×1
  • langfuse_replay._emit_response_nodes_from_pair (cyclomatic 20) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:543 — langfuse_replay._emit_response_nodes_from_pair 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 · litellm_callback._strip_and_record_reference_tool_ids_from_message (cyclomatic 20) · ×1
  • litellm_callback._strip_and_record_reference_tool_ids_from_message (cyclomatic 20) REDACTED:5462 — litellm_callback._strip_and_record_reference_tool_ids_from_message 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 · exec_composite_policy._humanize_review_reason (cyclomatic 20) · ×1
  • exec_composite_policy._humanize_review_reason (cyclomatic 20) ArbiterOS-Kernel/arbiteros_kernel/policy/exec_composite_policy.py:213 — exec_composite_policy._humanize_review_reason has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · openclaw_policy._get_ping_pong (cyclomatic 20) · ×1
  • openclaw_policy._get_ping_pong (cyclomatic 20) ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:394 — openclaw_policy._get_ping_pong 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 · policy_rule_ir._validate_rule (cyclomatic 20) · ×1
  • policy_rule_ir._validate_rule (cyclomatic 20) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:518 — policy_rule_ir._validate_rule has cyclomatic complexity 20 (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.
D1 · Cyclomatic Complexity · OtelIngestionProcessor.extractModelParameters (cyclomatic 19) · ×1
  • OtelIngestionProcessor.extractModelParameters (cyclomatic 19) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1747 — OtelIngestionProcessor.extractModelParameters has cyclomatic complexity 19 (threshold 15). Of this number, 18 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 · OtelIngestionProcessor.extractExperimentFields (cyclomatic 19) · ×1
  • OtelIngestionProcessor.extractExperimentFields (cyclomatic 19) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:2178 — OtelIngestionProcessor.extractExperimentFields has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · microsoft-agent.extractFromParts (cyclomatic 19) · ×1
  • microsoft-agent.extractFromParts (cyclomatic 19) langfuse/packages/shared/src/utils/chatml/adapters/microsoft-agent.ts:37 — microsoft-agent.extractFromParts has cyclomatic complexity 19 (threshold 15). Of this number, 17 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 · applyFieldMapping.applyFieldMappingConfig (cyclomatic 19) · ×1
  • applyFieldMapping.applyFieldMappingConfig (cyclomatic 19) langfuse/packages/shared/src/features/batchAction/applyFieldMapping.ts:86 — applyFieldMapping.applyFieldMappingConfig has cyclomatic complexity 19 (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 · TraceLogView.TraceLogView (cyclomatic 19) · ×1
  • TraceLogView.TraceLogView (cyclomatic 19) langfuse/web/src/components/trace2/components/TraceLogView/TraceLogView.tsx:75 — TraceLogView.TraceLogView has cyclomatic complexity 19 (threshold 15). Of this number, 12 points are the body's own statements and 7 belong to 6 function literals inside it that branch. 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 · IOPreviewPretty.IOPreviewPretty (cyclomatic 19) · ×1
  • IOPreviewPretty.IOPreviewPretty (cyclomatic 19) langfuse/web/src/components/trace2/components/IOPreview/IOPreviewPretty.tsx:118 — IOPreviewPretty.IOPreviewPretty has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 187, 220). 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 · IOPreview.IOPreview (cyclomatic 19) · ×1
  • IOPreview.IOPreview (cyclomatic 19) langfuse/web/src/components/trace2/components/IOPreview/IOPreview.tsx:120 — IOPreview.IOPreview has cyclomatic complexity 19 (threshold 15). Of this number, 14 points are the body's own statements and 5 belong to 2 function literals inside it that branch. 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 · githubDispatchHelpers.processGitHubDispatchActionConfig (cyclomatic 19) · ×1
  • githubDispatchHelpers.processGitHubDispatchActionConfig (cyclomatic 19) langfuse/web/src/features/automations/server/githubDispatchHelpers.ts:21 — githubDispatchHelpers.processGitHubDispatchActionConfig has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · DatasetActionButton.DatasetActionButton (cyclomatic 19) · ×1
  • DatasetActionButton.DatasetActionButton (cyclomatic 19) langfuse/web/src/features/datasets/components/DatasetActionButton.tsx:55 — DatasetActionButton.DatasetActionButton has cyclomatic complexity 19 (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 · DatasetVersionHistoryPanel.DatasetVersionHistoryPanel (cyclomatic 19) · ×1
  • DatasetVersionHistoryPanel.DatasetVersionHistoryPanel (cyclomatic 19) langfuse/web/src/features/datasets/components/DatasetVersionHistoryPanel.tsx:68 — DatasetVersionHistoryPanel.DatasetVersionHistoryPanel has cyclomatic complexity 19 (threshold 15). Of this number, 10 points are the body's own statements and 9 belong to 2 function items inside it that branch. 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 · NewDatasetItemFromExistingObject.NewDatasetItemFromExistingObject (cyclomatic 19) · ×1
  • NewDatasetItemFromExistingObject.NewDatasetItemFromExistingObject (cyclomatic 19) langfuse/web/src/features/datasets/components/NewDatasetItemFromExistingObject.tsx:37 — NewDatasetItemFromExistingObject.NewDatasetItemFromExistingObject has cyclomatic complexity 19 (threshold 15). Of this number, 18 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 · createDataset.upsertDataset (cyclomatic 19) · ×1
  • createDataset.upsertDataset (cyclomatic 19) langfuse/web/src/features/datasets/server/actions/createDataset.ts:33 — createDataset.upsertDataset has cyclomatic complexity 19 (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 · evaluator-selector.EvaluatorSelector (cyclomatic 19) · ×1
  • evaluator-selector.EvaluatorSelector (cyclomatic 19) langfuse/web/src/features/evals/components/evaluator-selector.tsx:41 — evaluator-selector.EvaluatorSelector has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to 4 function literals inside it that branch. 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 · ExperienceSummaryView.ExperienceSummaryView (cyclomatic 19) · ×1
  • ExperienceSummaryView.ExperienceSummaryView (cyclomatic 19) langfuse/web/src/features/experience-summary/components/ExperienceSummaryView.tsx:29 — ExperienceSummaryView.ExperienceSummaryView has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 7 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 167, 79, 56, …). 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 · ScoreAnalyticsNoticeBanner.ScoreAnalyticsNoticeBanner (cyclomatic 19) · ×1
  • ScoreAnalyticsNoticeBanner.ScoreAnalyticsNoticeBanner (cyclomatic 19) langfuse/web/src/features/score-analytics/components/ScoreAnalyticsNoticeBanner.tsx:6 — ScoreAnalyticsNoticeBanner.ScoreAnalyticsNoticeBanner has cyclomatic complexity 19 (threshold 15). Of this number, 16 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 · evalService.extractVariablesFromTracingData (cyclomatic 19) · ×1
  • evalService.extractVariablesFromTracingData (cyclomatic 19) langfuse/worker/src/features/evaluation/evalService.ts:1022 — evalService.extractVariablesFromTracingData has cyclomatic complexity 19 (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 · handleBatchExportJob.handleBatchExportJob (cyclomatic 19) · ×1
  • handleBatchExportJob.handleBatchExportJob (cyclomatic 19) langfuse/worker/src/features/batchExport/handleBatchExportJob.ts:34 — handleBatchExportJob.handleBatchExportJob has cyclomatic complexity 19 (threshold 15). Of this number, 18 points are the body's own statements and 1 belongs 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 · handleCloudSpendAlertJob.handleCloudSpendAlertJob (cyclomatic 19) · ×1
  • handleCloudSpendAlertJob.handleCloudSpendAlertJob (cyclomatic 19) langfuse/worker/src/ee/cloudSpendAlerts/handleCloudSpendAlertJob.ts:11 — handleCloudSpendAlertJob.handleCloudSpendAlertJob has cyclomatic complexity 19 (threshold 15). Of this number, 18 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 · handleBlobStorageIntegrationProjectJob.handleBlobStorageIntegrationProjectJob (cyclomatic 19) · ×1
  • handleBlobStorageIntegrationProjectJob.handleBlobStorageIntegrationProjectJob (cyclomatic 19) langfuse/worker/src/features/blobstorage/handleBlobStorageIntegrationProjectJob.ts:263 — handleBlobStorageIntegrationProjectJob.handleBlobStorageIntegrationProjectJob has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · handleExperimentBackfill.enrichSpansWithExperiment (cyclomatic 19) · ×1
  • handleExperimentBackfill.enrichSpansWithExperiment (cyclomatic 19) langfuse/worker/src/features/eventPropagation/handleExperimentBackfill.ts:409 — handleExperimentBackfill.enrichSpansWithExperiment has cyclomatic complexity 19 (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 · litellm_callback._summarize_turn_topic (cyclomatic 19) · ×1
  • litellm_callback._summarize_turn_topic (cyclomatic 19) REDACTED:2822 — litellm_callback._summarize_turn_topic has cyclomatic complexity 19 (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 · relational_policy._evaluate_flow (cyclomatic 19) · ×1
  • relational_policy._evaluate_flow (cyclomatic 19) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:841 — relational_policy._evaluate_flow has cyclomatic complexity 19 (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.
D1 · Cyclomatic Complexity · PolicyEngine._check_taint_sinks (cyclomatic 19) · ×1
  • PolicyEngine._check_taint_sinks (cyclomatic 19) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1582 — PolicyEngine._check_taint_sinks has cyclomatic complexity 19 (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 · run_cases.extract_raw_log_focus (cyclomatic 19) · ×1
  • run_cases.extract_raw_log_focus (cyclomatic 19) REDACTED:335 — run_cases.extract_raw_log_focus has cyclomatic complexity 19 (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 · factory.createFilterFromFilterState (cyclomatic 18) · ×1
  • factory.createFilterFromFilterState (cyclomatic 18) langfuse/packages/shared/src/server/queries/clickhouse-sql/factory.ts:34 — factory.createFilterFromFilterState has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to one function literal inside it that branches (line 42). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · events.getObservationsFromEventsTableInternal (cyclomatic 18) · ×1
  • events.getObservationsFromEventsTableInternal (cyclomatic 18) langfuse/packages/shared/src/server/repositories/events.ts:405 — events.getObservationsFromEventsTableInternal has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to 3 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 · breadcrumb.BreadcrumbComponent (cyclomatic 18) · ×1
  • breadcrumb.BreadcrumbComponent (cyclomatic 18) langfuse/web/src/components/layouts/breadcrumb.tsx:43 — breadcrumb.BreadcrumbComponent has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 belong to 6 function items inside it that branch. 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 · data-table-column-visibility-filter.DataTableColumnVisibilityFilter (cyclomatic 18) · ×1
  • data-table-column-visibility-filter.DataTableColumnVisibilityFilter (cyclomatic 18) langfuse/web/src/components/table/data-table-column-visibility-filter.tsx:313 — data-table-column-visibility-filter.DataTableColumnVisibilityFilter has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 6 function items inside it that branch (handleDragEnd, a function literal at line 499, a function literal at line 520, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · key-value-filter-builder.KeyValueFilterBuilder (cyclomatic 18) · ×1
  • key-value-filter-builder.KeyValueFilterBuilder (cyclomatic 18) langfuse/web/src/components/table/key-value-filter-builder.tsx:72 — key-value-filter-builder.KeyValueFilterBuilder has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 2 of the 18 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 185, handleFilterChange, handleAddFilter, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · TraceGraphDataContext.TraceGraphDataProvider (cyclomatic 18) · ×1
  • TraceGraphDataContext.TraceGraphDataProvider (cyclomatic 18) langfuse/web/src/components/trace2/contexts/TraceGraphDataContext.tsx:47 — TraceGraphDataContext.TraceGraphDataProvider has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 60, 116, 129, …). 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 · useLogViewAllObservationsIO.useLogViewAllObservationsIO.loadAllData (cyclomatic 18) · ×1
  • useLogViewAllObservationsIO.useLogViewAllObservationsIO.loadAllData (cyclomatic 18) langfuse/web/src/components/trace2/components/TraceLogView/useLogViewAllObservationsIO.ts:138 — useLogViewAllObservationsIO.useLogViewAllObservationsIO.loadAllData has cyclomatic complexity 18 (threshold 15). Of this number, 11 points are the body's own statements and 7 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 · ToolCallDefinitionCard.ToolCallDefinitionCard (cyclomatic 18) · ×1
  • ToolCallDefinitionCard.ToolCallDefinitionCard (cyclomatic 18) langfuse/web/src/components/trace2/components/IOPreview/components/ToolCallDefinitionCard.tsx:33 — ToolCallDefinitionCard.ToolCallDefinitionCard has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 51, 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 · JSONTableViewRow.JSONTableViewRowInner (cyclomatic 18) · ×1
  • JSONTableViewRow.JSONTableViewRowInner (cyclomatic 18) langfuse/web/src/components/trace2/components/_shared/JSONTableView/JSONTableViewRow.tsx:16 — JSONTableViewRow.JSONTableViewRowInner has cyclomatic complexity 18 (threshold 15). Of this number, 14 points are the body's own statements and 4 belong to 2 function literals inside it that branch. 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 · helpers.buildTraceUiData (cyclomatic 18) · ×1
  • helpers.buildTraceUiData (cyclomatic 18) langfuse/web/src/components/trace2/lib/helpers.ts:380 — helpers.buildTraceUiData has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (calculateTreeNodeTotalCost, a function literal at line 431, a function literal at line 448, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · selectionToPath.selectionToPath (cyclomatic 18) · ×1
  • selectionToPath.selectionToPath (cyclomatic 18) langfuse/web/src/features/comments/lib/selectionToPath.ts:16 — selectionToPath.selectionToPath has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · useCommentedPaths.useCommentedPaths (cyclomatic 18) · ×1
  • useCommentedPaths.useCommentedPaths (cyclomatic 18) langfuse/web/src/features/comments/hooks/useCommentedPaths.ts:19 — useCommentedPaths.useCommentedPaths has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 2 function literals inside it that branch (lines 22, 41). 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 · useSidebarFilterState.useSidebarFilterState (cyclomatic 18) · ×1
  • useSidebarFilterState.useSidebarFilterState (cyclomatic 18) langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:313 — useSidebarFilterState.useSidebarFilterState has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 442, 462, 471). 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 · NewOrganizationForm.NewOrganizationForm (cyclomatic 18) · ×1
  • NewOrganizationForm.NewOrganizationForm (cyclomatic 18) langfuse/web/src/features/organizations/components/NewOrganizationForm.tsx:31 — NewOrganizationForm.NewOrganizationForm has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 4 function items inside it that branch (getTypeLabel, a function literal at line 78, a function literal at line 122, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · JumpToPlaygroundButton.JumpToPlaygroundButton (cyclomatic 18) · ×1
  • JumpToPlaygroundButton.JumpToPlaygroundButton (cyclomatic 18) langfuse/web/src/features/playground/page/components/JumpToPlaygroundButton.tsx:73 — JumpToPlaygroundButton.JumpToPlaygroundButton has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 6 function items inside it that branch (handlePlaygroundAction, a function literal at line 85, a function literal at line 126, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · HeatmapCell.CellWithData (cyclomatic 18) · ×1
  • HeatmapCell.CellWithData (cyclomatic 18) langfuse/web/src/features/score-analytics/components/charts/HeatmapCell.tsx:54 — HeatmapCell.CellWithData has cyclomatic complexity 18 (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 · nodeNameUtils.getParserSuffixLabel (cyclomatic 18) · ×1
  • nodeNameUtils.getParserSuffixLabel (cyclomatic 18) langfuse/web/src/features/trace-graph-view/nodeNameUtils.ts:153 — nodeNameUtils.getParserSuffixLabel has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · charts.DatasetCompare (cyclomatic 18) · ×1
  • charts.DatasetCompare (cyclomatic 18) langfuse/web/src/pages/project/[projectId]/datasets/[datasetId]/compare/charts.tsx:44 — charts.DatasetCompare has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 188, 151, 145). 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 · IngestionService.processObservationEventList (cyclomatic 18) · ×1
  • IngestionService.processObservationEventList (cyclomatic 18) langfuse/worker/src/services/IngestionService/index.ts:849 — IngestionService.processObservationEventList has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs 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 · webhooks.executeHttpAction (cyclomatic 18) · ×1
  • webhooks.executeHttpAction (cyclomatic 18) langfuse/worker/src/queues/webhooks.ts:108 — webhooks.executeHttpAction has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 135, 245). 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 · langfuse_replay.replay_jsonl_to_langfuse (cyclomatic 18) · ×1
  • langfuse_replay.replay_jsonl_to_langfuse (cyclomatic 18) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:770 — langfuse_replay.replay_jsonl_to_langfuse has cyclomatic complexity 18 (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 · litellm_callback._evaluate_tool_result_postexec_once (cyclomatic 18) · ×1
  • litellm_callback._evaluate_tool_result_postexec_once (cyclomatic 18) REDACTED:831 — litellm_callback._evaluate_tool_result_postexec_once has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · litellm_callback._collect_prior_tool_call_ids_from_messages (cyclomatic 18) · ×1
  • litellm_callback._collect_prior_tool_call_ids_from_messages (cyclomatic 18) REDACTED:1705 — litellm_callback._collect_prior_tool_call_ids_from_messages has cyclomatic complexity 18 (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 · litellm_callback._enforce_topic_point_count_on_shift (cyclomatic 18) · ×1
  • litellm_callback._enforce_topic_point_count_on_shift (cyclomatic 18) REDACTED:2775 — litellm_callback._enforce_topic_point_count_on_shift has cyclomatic complexity 18 (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 · alignment_sentinel_policy._extract_user_objective (cyclomatic 18) · ×1
  • alignment_sentinel_policy._extract_user_objective (cyclomatic 18) ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_sentinel_policy.py:156 — alignment_sentinel_policy._extract_user_objective has cyclomatic complexity 18 (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 · openclaw_policy._tool_allowed (cyclomatic 18) · ×1
  • openclaw_policy._tool_allowed (cyclomatic 18) ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:183 — openclaw_policy._tool_allowed has cyclomatic complexity 18 (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 · policy_rule_ir._validate_selector_like (cyclomatic 18) · ×1
  • policy_rule_ir._validate_selector_like (cyclomatic 18) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:591 — policy_rule_ir._validate_selector_like has cyclomatic complexity 18 (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 · unary_gate_policy._render_predicate (cyclomatic 18) · ×1
  • unary_gate_policy._render_predicate (cyclomatic 18) REDACTED:503 — unary_gate_policy._render_predicate has cyclomatic complexity 18 (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 · policy_check.check_response_policy (cyclomatic 18) · ×1
  • policy_check.check_response_policy (cyclomatic 18) ArbiterOS-Kernel/arbiteros_kernel/policy_check.py:313 — policy_check.check_response_policy has cyclomatic complexity 18 (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 · PolicyEngine._check_security_policy (cyclomatic 18) · ×1
  • PolicyEngine._check_security_policy (cyclomatic 18) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1546 — PolicyEngine._check_security_policy has cyclomatic complexity 18 (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 · KernelPolicyRuntime.check_security (cyclomatic 18) · ×1
  • KernelPolicyRuntime.check_security (cyclomatic 18) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:655 — KernelPolicyRuntime.check_security has cyclomatic complexity 18 (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 · KernelPolicyRuntime.check_tool_call_budget (cyclomatic 18) · ×1
  • KernelPolicyRuntime.check_tool_call_budget (cyclomatic 18) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:1307 — KernelPolicyRuntime.check_tool_call_budget has cyclomatic complexity 18 (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 · review_cases_with_llm.main (cyclomatic 18) · ×1
  • review_cases_with_llm.main (cyclomatic 18) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/review_cases_with_llm.py:263 — review_cases_with_llm.main has cyclomatic complexity 18 (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.
D1 · Cyclomatic Complexity · openai.extractReasoningContent (cyclomatic 17) · ×1
  • openai.extractReasoningContent (cyclomatic 17) langfuse/packages/shared/src/utils/chatml/adapters/openai.ts:69 — openai.extractReasoningContent has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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 · pydantic-ai.extractFromParts (cyclomatic 17) · ×1
  • pydantic-ai.extractFromParts (cyclomatic 17) langfuse/packages/shared/src/utils/chatml/adapters/pydantic-ai.ts:42 — pydantic-ai.extractFromParts has cyclomatic complexity 17 (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 · toCompactVerbosityChatML.toCompactVerbosityChatML (cyclomatic 17) · ×1
  • toCompactVerbosityChatML.toCompactVerbosityChatML (cyclomatic 17) langfuse/packages/shared/src/utils/IORepresentation/chatML/toCompactVerbosityChatML.ts:16 — toCompactVerbosityChatML.toCompactVerbosityChatML has cyclomatic complexity 17 (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 · index.ModelParameters (cyclomatic 17) · ×1
  • index.ModelParameters (cyclomatic 17) langfuse/web/src/components/ModelParameters/index.tsx:57 — index.ModelParameters has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 3 function items 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 · useAuthGuard.useAuthGuard (cyclomatic 17) · ×1
  • useAuthGuard.useAuthGuard (cyclomatic 17) langfuse/web/src/components/layouts/app-layout/hooks/useAuthGuard.ts:33 — useAuthGuard.useAuthGuard 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 2 function literals inside it that branch (lines 39, 53). 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 · ValueCell.ValueCell (cyclomatic 17) · ×1
  • ValueCell.ValueCell (cyclomatic 17) langfuse/web/src/components/table/ValueCell.tsx:158 — ValueCell.ValueCell has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 2 function items inside it that branch (getDisplayValue, handleCopy). 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 · observations.parsePolicyNamesFromMetadata (cyclomatic 17) · ×1
  • observations.parsePolicyNamesFromMetadata (cyclomatic 17) langfuse/web/src/components/table/use-cases/observations.tsx:157 — observations.parsePolicyNamesFromMetadata has cyclomatic complexity 17 (threshold 15). Of this number, 15 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 · LogViewExpandedContent.LogViewExpandedContent (cyclomatic 17) · ×1
  • LogViewExpandedContent.LogViewExpandedContent (cyclomatic 17) langfuse/web/src/components/trace2/components/TraceLogView/LogViewExpandedContent.tsx:35 — LogViewExpandedContent.LogViewExpandedContent has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to one function literal inside it that branches. 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 · treeExpansion.applyExpansionState (cyclomatic 17) · ×1
  • treeExpansion.applyExpansionState (cyclomatic 17) langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeExpansion.ts:266 — treeExpansion.applyExpansionState has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 6 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 322, 281, 293). 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 · combobox.Combobox (cyclomatic 17) · ×1
  • combobox.Combobox (cyclomatic 17) langfuse/web/src/components/ui/combobox.tsx:83 — combobox.Combobox has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 96, 139, 175, …). 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 · AnnotationQueueItemsTable.AnnotationQueueItemsTable (cyclomatic 17) · ×1
  • AnnotationQueueItemsTable.AnnotationQueueItemsTable (cyclomatic 17) langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemsTable.tsx:160 — AnnotationQueueItemsTable.AnnotationQueueItemsTable has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 258, a function literal at line 334, convertToTableRow, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · JsonPathInput.JsonPathInput (cyclomatic 17) · ×1
  • JsonPathInput.JsonPathInput (cyclomatic 17) langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/components/JsonPathInput.tsx:69 — JsonPathInput.JsonPathInput has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 101, 85). 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 · PolicyConfirmationStatsCard.PolicyConfirmationStatsCard (cyclomatic 17) · ×1
  • PolicyConfirmationStatsCard.PolicyConfirmationStatsCard (cyclomatic 17) langfuse/web/src/features/dashboard/components/PolicyConfirmationStatsCard.tsx:209 — PolicyConfirmationStatsCard.PolicyConfirmationStatsCard has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to 3 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 · ScoresTable.ScoresTable (cyclomatic 17) · ×1
  • ScoresTable.ScoresTable (cyclomatic 17) langfuse/web/src/features/dashboard/components/ScoresTable.tsx:46 — ScoresTable.ScoresTable has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 2 function items inside it that branch. 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 · PreviewCsvImport.PreviewCsvImport (cyclomatic 17) · ×1
  • PreviewCsvImport.PreviewCsvImport (cyclomatic 17) langfuse/web/src/features/datasets/components/PreviewCsvImport.tsx:38 — PreviewCsvImport.PreviewCsvImport has cyclomatic complexity 17 (threshold 15). Of this number, 13 points are the body's own statements and 4 belong to 4 function items 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 · BulkErrorAnalysisButton.BulkErrorAnalysisButton (cyclomatic 17) · ×1
  • BulkErrorAnalysisButton.BulkErrorAnalysisButton (cyclomatic 17) langfuse/web/src/features/error-analysis/components/BulkErrorAnalysisButton.tsx:24 — BulkErrorAnalysisButton.BulkErrorAnalysisButton 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 2 function items inside it that branch (handleBulkAnalyze, a function literal at line 35). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · inner-evaluator-form.InnerEvaluatorForm · ×1
  • inner-evaluator-form.InnerEvaluatorForm::onSubmit (cyclomatic 17) langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:394 — inner-evaluator-form.InnerEvaluatorForm::onSubmit has cyclomatic complexity 17 (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. This shape REPEATS in the file: one other method here (inner-evaluator-form.InnerEvaluatorForm) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D1 · Cyclomatic Complexity · EventsTable.parsePolicyNamesFromMetadata (cyclomatic 17) · ×1
  • EventsTable.parsePolicyNamesFromMetadata (cyclomatic 17) langfuse/web/src/features/events/components/EventsTable.tsx:185 — EventsTable.parsePolicyNamesFromMetadata has cyclomatic complexity 17 (threshold 15). Of this number, 15 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 · CollapsibleSection.CollapsibleSection (cyclomatic 17) · ×1
  • CollapsibleSection.CollapsibleSection (cyclomatic 17) langfuse/web/src/features/playground/page/components/CollapsibleSection.tsx:20 — CollapsibleSection.CollapsibleSection 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 · ApiAuthService.verifyAuthHeaderAndReturnScope (cyclomatic 17) · ×1
  • ApiAuthService.verifyAuthHeaderAndReturnScope (cyclomatic 17) langfuse/web/src/features/public-api/server/apiAuth.ts:86 — ApiAuthService.verifyAuthHeaderAndReturnScope 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 one function literal inside it that branches (line 91). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · dailyMetrics.generateDailyMetrics (cyclomatic 17) · ×1
  • dailyMetrics.generateDailyMetrics (cyclomatic 17) langfuse/web/src/features/public-api/server/dailyMetrics.ts:21 — dailyMetrics.generateDailyMetrics has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 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 · scores._handleGenerateScoresForPublicApi (cyclomatic 17) · ×1
  • scores._handleGenerateScoresForPublicApi (cyclomatic 17) langfuse/web/src/features/public-api/server/scores.ts:70 — scores._handleGenerateScoresForPublicApi has cyclomatic complexity 17 (threshold 15). Of this number, 15 points are the body's own statements and 2 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 · QueryBuilder.validateAndProcessOrderBy (cyclomatic 17) · ×1
  • QueryBuilder.validateAndProcessOrderBy (cyclomatic 17) langfuse/web/src/features/query/server/queryBuilder.ts:973 — QueryBuilder.validateAndProcessOrderBy has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1004, 1029, 1012). 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 · ScoreTimeSeriesNumericChart.ScoreTimeSeriesNumericChart (cyclomatic 17) · ×1
  • ScoreTimeSeriesNumericChart.ScoreTimeSeriesNumericChart (cyclomatic 17) langfuse/web/src/features/score-analytics/components/charts/ScoreTimeSeriesNumericChart.tsx:37 — ScoreTimeSeriesNumericChart.ScoreTimeSeriesNumericChart has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to 5 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 · SetupPage.SetupPage (cyclomatic 17) · ×1
  • SetupPage.SetupPage (cyclomatic 17) langfuse/web/src/features/setup/components/SetupPage.tsx:31 — SetupPage.SetupPage 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 · pivot-table-utils.sortPivotTableRows (cyclomatic 17) · ×1
  • pivot-table-utils.sortPivotTableRows (cyclomatic 17) langfuse/web/src/features/widgets/utils/pivot-table-utils.ts:628 — pivot-table-utils.sortPivotTableRows has cyclomatic complexity 17 (threshold 15). Of this number, 10 points are the body's own statements and 7 belong to 5 function items 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 · thresholdProcessing.processThresholds (cyclomatic 17) · ×1
  • thresholdProcessing.processThresholds (cyclomatic 17) langfuse/worker/src/ee/usageThresholds/thresholdProcessing.ts:298 — thresholdProcessing.processThresholds 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.
D1 · Cyclomatic Complexity · BackfillEventsFullFromEvents.run (cyclomatic 17) · ×1
  • BackfillEventsFullFromEvents.run (cyclomatic 17) langfuse/worker/src/backgroundMigrations/backfillEventsFullFromEvents.ts:279 — BackfillEventsFullFromEvents.run has cyclomatic complexity 17 (threshold 15). 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, 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 · powershell._ps_collect_from_exec_unit (cyclomatic 17) · ×1
  • powershell._ps_collect_from_exec_unit (cyclomatic 17) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:205 — powershell._ps_collect_from_exec_unit has cyclomatic complexity 17 (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 · litellm_callback._load_trace_state_snapshot_from_disk (cyclomatic 17) · ×1
  • litellm_callback._load_trace_state_snapshot_from_disk (cyclomatic 17) REDACTED:1401 — litellm_callback._load_trace_state_snapshot_from_disk has cyclomatic complexity 17 (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 · litellm_callback._snapshot_trace_backup_state (cyclomatic 17) · ×1
  • litellm_callback._snapshot_trace_backup_state (cyclomatic 17) REDACTED:1539 — litellm_callback._snapshot_trace_backup_state 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.
D1 · Cyclomatic Complexity · litellm_callback._ensure_trace_state (cyclomatic 17) · ×1
  • litellm_callback._ensure_trace_state (cyclomatic 17) REDACTED:2277 — litellm_callback._ensure_trace_state has cyclomatic complexity 17 (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 · litellm_callback._lookup_tool_instruction_metadata_for_trace (cyclomatic 17) · ×1
  • litellm_callback._lookup_tool_instruction_metadata_for_trace (cyclomatic 17) REDACTED:4787 — litellm_callback._lookup_tool_instruction_metadata_for_trace has cyclomatic complexity 17 (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 · delete_policy._get_delete_policy_config (cyclomatic 17) · ×1
  • delete_policy._get_delete_policy_config (cyclomatic 17) ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:49 — delete_policy._get_delete_policy_config has cyclomatic complexity 17 (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 · policy_rule_ir._validate_required_metadata (cyclomatic 17) · ×1
  • policy_rule_ir._validate_required_metadata (cyclomatic 17) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:414 — policy_rule_ir._validate_required_metadata has cyclomatic complexity 17 (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 · policy_check._policy_source_location (cyclomatic 17) · ×1
  • policy_check._policy_source_location (cyclomatic 17) ArbiterOS-Kernel/arbiteros_kernel/policy_check.py:140 — policy_check._policy_source_location has cyclomatic complexity 17 (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 · PolicyEngine._check_path_and_budget (cyclomatic 17) · ×1
  • PolicyEngine._check_path_and_budget (cyclomatic 17) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1646 — PolicyEngine._check_path_and_budget has cyclomatic complexity 17 (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 · build_from_trajectories.parse_trajectory_into_steps (cyclomatic 17) · ×1
  • build_from_trajectories.parse_trajectory_into_steps (cyclomatic 17) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/build_from_trajectories.py:85 — build_from_trajectories.parse_trajectory_into_steps has cyclomatic complexity 17 (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 · PromptService.buildAndResolvePromptGraph (cyclomatic 16) · ×1
  • PromptService.buildAndResolvePromptGraph (cyclomatic 16) langfuse/packages/shared/src/server/services/PromptService/index.ts:274 — PromptService.buildAndResolvePromptGraph has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function items inside it that branch (resolve, a function literal at line 333). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · sessions-ui-table-events-service.getSessionsTableFromEventsGeneric (cyclomatic 16) · ×1
  • sessions-ui-table-events-service.getSessionsTableFromEventsGeneric (cyclomatic 16) langfuse/packages/shared/src/server/services/sessions-ui-table-events-service.ts:165 — sessions-ui-table-events-service.getSessionsTableFromEventsGeneric has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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 · OtelIngestionProcessor.extractTags (cyclomatic 16) · ×1
  • OtelIngestionProcessor.extractTags (cyclomatic 16) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:2131 — OtelIngestionProcessor.extractTags has cyclomatic complexity 16 (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 · gemini.extractFromParts (cyclomatic 16) · ×1
  • gemini.extractFromParts (cyclomatic 16) langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:82 — gemini.extractFromParts has cyclomatic complexity 16 (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 · ActionButton.ActionButton (cyclomatic 16) · ×1
  • ActionButton.ActionButton (cyclomatic 16) langfuse/web/src/components/ActionButton.tsx:38 — ActionButton.ActionButton has cyclomatic complexity 16 (threshold 15). Of this number, 8 points are the body's own statements and 8 belong to 2 function items inside it that branch. 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 · index.AppLayout (cyclomatic 16) · ×1
  • index.AppLayout (cyclomatic 16) langfuse/web/src/components/layouts/app-layout/index.tsx:42 — index.AppLayout has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 2 function items 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 · peek-evaluator-config-detail.PeekViewEvaluatorConfigDetail (cyclomatic 16) · ×1
  • peek-evaluator-config-detail.PeekViewEvaluatorConfigDetail (cyclomatic 16) langfuse/web/src/components/table/peek/peek-evaluator-config-detail.tsx:25 — peek-evaluator-config-detail.PeekViewEvaluatorConfigDetail has cyclomatic complexity 16 (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 · UserAssignmentSection.UserAssignmentSection (cyclomatic 16) · ×1
  • UserAssignmentSection.UserAssignmentSection (cyclomatic 16) langfuse/web/src/features/annotation-queues/components/UserAssignmentSection.tsx:18 — UserAssignmentSection.UserAssignmentSection has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to 4 function items inside it that branch. 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 · MappingStep.MappingStep (cyclomatic 16) · ×1
  • MappingStep.MappingStep (cyclomatic 16) langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/MappingStep.tsx:17 — MappingStep.MappingStep has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 36, getFullLabel, handleModeChange). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D1 · Cyclomatic Complexity · DatasetsTable.DatasetsTable (cyclomatic 16) · ×1
  • DatasetsTable.DatasetsTable (cyclomatic 16) langfuse/web/src/features/datasets/components/DatasetsTable.tsx:74 — DatasetsTable.DatasetsTable has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 5 of the 16 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 336, 115, 132, …). 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 · costCalculations.sumObservationCosts (cyclomatic 16) · ×1
  • costCalculations.sumObservationCosts (cyclomatic 16) langfuse/web/src/features/datasets/lib/costCalculations.ts:66 — costCalculations.sumObservationCosts has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 1 of the 16 points is its own statement and the rest belongs to one function literal inside it that branches (line 69). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D1 · Cyclomatic Complexity · CreateExperimentsForm.CreateExperimentsForm (cyclomatic 16) · ×1
  • CreateExperimentsForm.CreateExperimentsForm (cyclomatic 16) langfuse/web/src/features/experiments/components/CreateExperimentsForm.tsx:28 — CreateExperimentsForm.CreateExperimentsForm has cyclomatic complexity 16 (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 · filter-builder.PopoverFilterBuilder (cyclomatic 16) · ×1
  • filter-builder.PopoverFilterBuilder (cyclomatic 16) langfuse/web/src/features/filters/components/filter-builder.tsx:78 — filter-builder.PopoverFilterBuilder has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 4 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 · DetailPageNav.DetailPageNav (cyclomatic 16) · ×1
  • DetailPageNav.DetailPageNav (cyclomatic 16) langfuse/web/src/features/navigate-detail-pages/DetailPageNav.tsx:17 — DetailPageNav.DetailPageNav has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 37, 80, 113). 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 · MessagePlaceholderComponent.MessagePlaceholderComponent (cyclomatic 16) · ×1
  • MessagePlaceholderComponent.MessagePlaceholderComponent (cyclomatic 16) langfuse/web/src/features/playground/page/components/MessagePlaceholderComponent.tsx:13 — MessagePlaceholderComponent.MessagePlaceholderComponent has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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 · PromptSelectionDialog.PromptSelectionDialog (cyclomatic 16) · ×1
  • PromptSelectionDialog.PromptSelectionDialog (cyclomatic 16) langfuse/web/src/features/prompts/components/PromptSelectionDialog.tsx:31 — PromptSelectionDialog.PromptSelectionDialog has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 3 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 · index.SetPromptVersionLabels (cyclomatic 16) · ×1
  • index.SetPromptVersionLabels (cyclomatic 16) langfuse/web/src/features/prompts/components/SetPromptVersionLabels/index.tsx:26 — index.SetPromptVersionLabels has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to 3 function items 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 · prompt-history.PromptHistoryTraceNode (cyclomatic 16) · ×1
  • prompt-history.PromptHistoryTraceNode (cyclomatic 16) langfuse/web/src/features/prompts/components/prompt-history.tsx:11 — prompt-history.PromptHistoryTraceNode has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to 3 function literals inside it that branch. 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 · MembershipInvitesPage.MembershipInvitesPage (cyclomatic 16) · ×1
  • MembershipInvitesPage.MembershipInvitesPage (cyclomatic 16) langfuse/web/src/features/rbac/components/MembershipInvitesPage.tsx:36 — MembershipInvitesPage.MembershipInvitesPage has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 belong to 5 function items 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 · supportRequestMetadataEvent.buildPlainEventSupportRequestMetadataComponents (cyclomatic 16) · ×1
  • supportRequestMetadataEvent.buildPlainEventSupportRequestMetadataComponents (cyclomatic 16) langfuse/web/src/features/support-chat/plain/events/supportRequestMetadataEvent.ts:30 — supportRequestMetadataEvent.buildPlainEventSupportRequestMetadataComponents has cyclomatic complexity 16 (threshold 15). Of this number, 14 points are the body's own statements and 2 belong to one function item 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 · ingestion.handler (cyclomatic 16) · ×1
  • ingestion.handler (cyclomatic 16) langfuse/web/src/pages/api/public/ingestion.ts:50 — ingestion.handler has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 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 · blobstorage.BlobStorageIntegrationSettings (cyclomatic 16) · ×1
  • blobstorage.BlobStorageIntegrationSettings (cyclomatic 16) langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx:58 — blobstorage.BlobStorageIntegrationSettings has cyclomatic complexity 16 (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 · ClickhouseWriter.truncateOversizedRecord (cyclomatic 16) · ×1
  • ClickhouseWriter.truncateOversizedRecord (cyclomatic 16) langfuse/worker/src/services/ClickhouseWriter/index.ts:199 — ClickhouseWriter.truncateOversizedRecord has cyclomatic complexity 16 (threshold 15). Of this number, 13 points are the body's own statements and 3 belong to one function item 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 · commentMentionHandler.handleCommentMentionNotification (cyclomatic 16) · ×1
  • commentMentionHandler.handleCommentMentionNotification (cyclomatic 16) langfuse/worker/src/features/notifications/commentMentionHandler.ts:66 — commentMentionHandler.handleCommentMentionNotification has cyclomatic complexity 16 (threshold 15). Of this number, 15 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 · autoExperienceSummaryQueue.autoExperienceSummaryQueueProcessor (cyclomatic 16) · ×1
  • autoExperienceSummaryQueue.autoExperienceSummaryQueueProcessor (cyclomatic 16) langfuse/worker/src/queues/autoExperienceSummaryQueue.ts:490 — autoExperienceSummaryQueue.autoExperienceSummaryQueueProcessor has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs 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 · litellm_callback._normalize_topic_summary (cyclomatic 16) · ×1
  • litellm_callback._normalize_topic_summary (cyclomatic 16) REDACTED:2654 — litellm_callback._normalize_topic_summary has cyclomatic complexity 16 (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 · AllowDenyPolicy.check (cyclomatic 16) · ×1
  • AllowDenyPolicy.check (cyclomatic 16) ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:64 — AllowDenyPolicy.check has cyclomatic complexity 16 (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 · taint_policy._get_taint_policy_config (cyclomatic 16) · ×1
  • taint_policy._get_taint_policy_config (cyclomatic 16) ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:53 — taint_policy._get_taint_policy_config has cyclomatic complexity 16 (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 · unary_gate_policy._selector_matches (cyclomatic 16) · ×1
  • unary_gate_policy._selector_matches (cyclomatic 16) REDACTED:788 — unary_gate_policy._selector_matches has cyclomatic complexity 16 (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.
D17 · Explicit Debt · HackComment · ×1
  • HackComment langfuse/web/src/features/slack/server/oauth-handlers.ts:38 — // hack because nextjs dev server support for https is experimental — 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 · MyCustomHandler.async_post_call_success_hook (cognitive 245) · ×1
  • MyCustomHandler.async_post_call_success_hook (cognitive 245) REDACTED:6313 — MyCustomHandler.async_post_call_success_hook has cognitive complexity 245 (threshold 15). Drivers by points: if/else 46 (116 pts), ternaries 25 (69 pts), boolean chains 39, loops 3 (15 pts), error handling 1 (6 pts) (nesting depth added 131). 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 · index.ExperienceSummaryPage (cognitive 238) · ×1
  • index.ExperienceSummaryPage (cognitive 238) langfuse/web/src/pages/project/[projectId]/experience/index.tsx:113 — index.ExperienceSummaryPage has cognitive complexity 238 (threshold 15). Drivers by points: ternaries 31 (153 pts), if/else 47 (67 pts), boolean chains 17, error handling 1 (nesting depth added 142). Of this number, 48 points are the body's own statements and 190 belong to 40 function literals inside it that branch. 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 · buildGraphCanvasData.buildGraphFromStepData (cognitive 227) · ×1
  • buildGraphCanvasData.buildGraphFromStepData (cognitive 227) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:111 — buildGraphCanvasData.buildGraphFromStepData has cognitive complexity 227 (threshold 15). Drivers by points: if/else 69 (159 pts), loops 16 (31 pts), boolean chains 30, ternaries 6 (7 pts) (nesting depth added 106). Of this number, 182 points are the body's own statements and 45 belong to 13 function items inside it that branch. 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 · EventsTable.ObservationsEventsTable (cognitive 203) · ×1
  • EventsTable.ObservationsEventsTable (cognitive 203) langfuse/web/src/features/events/components/EventsTable.tsx:315 — EventsTable.ObservationsEventsTable has cognitive complexity 203 (threshold 15). Drivers by points: ternaries 70 (105 pts), if/else 48 (57 pts), boolean chains 39, error handling 1, match/switch 1 (nesting depth added 44). Of this number, 38 points are the body's own statements and 165 belong to 64 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 · observations.ObservationsTable (cognitive 195) · ×1
  • observations.ObservationsTable (cognitive 195) langfuse/web/src/components/table/use-cases/observations.tsx:280 — observations.ObservationsTable has cognitive complexity 195 (threshold 15). Drivers by points: ternaries 63 (92 pts), if/else 46 (55 pts), boolean chains 46, error handling 2 (nesting depth added 38). Of this number, 58 points are the body's own statements and 137 belong to 74 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 · MyCustomHandler.async_post_call_streaming_iterator_hook (cognitive 182) · ×1
  • MyCustomHandler.async_post_call_streaming_iterator_hook (cognitive 182) REDACTED:6778 — MyCustomHandler.async_post_call_streaming_iterator_hook has cognitive complexity 182 (threshold 15). Drivers by points: ternaries 29 (69 pts), if/else 25 (63 pts), boolean chains 29, loops 7 (17 pts), error handling 3 (4 pts) (nesting depth added 89). 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 · litellm_callback._emit_response_nodes (cognitive 165) · ×1
  • litellm_callback._emit_response_nodes (cognitive 165) REDACTED:4023 — litellm_callback._emit_response_nodes has cognitive complexity 165 (threshold 15). Drivers by points: if/else 41 (91 pts), boolean chains 33, ternaries 20 (32 pts), error handling 3 (7 pts), loops 1 (2 pts) (nesting depth added 67). 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 · MyCustomHandler.async_pre_call_hook (cognitive 139) · ×1
  • MyCustomHandler.async_pre_call_hook (cognitive 139) REDACTED:5926 — MyCustomHandler.async_pre_call_hook has cognitive complexity 139 (threshold 15). Drivers by points: if/else 42 (81 pts), boolean chains 27, ternaries 15 (23 pts), loops 1 (8 pts) (nesting depth added 54). 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 · useSidebarFilterState.useSidebarFilterState.filters (cognitive 131) · ×1
  • useSidebarFilterState.useSidebarFilterState.filters (cognitive 131) langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:870 — useSidebarFilterState.useSidebarFilterState.filters has cognitive complexity 131 (threshold 15). Drivers by points: if/else 34 (65 pts), boolean chains 44, ternaries 14 (20 pts), loops 1 (2 pts) (nesting depth added 38). None of this is in the body itself: all 131 points belong to 29 function items inside it that branch (a function literal at line 923, getFacetDisabledState, a function literal at line 1383, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PrettyJsonView.PrettyJsonView (cognitive 124) · ×1
  • PrettyJsonView.PrettyJsonView (cognitive 124) langfuse/web/src/components/ui/PrettyJsonView.tsx:742 — PrettyJsonView.PrettyJsonView has cognitive complexity 124 (threshold 15). Drivers by points: if/else 42 (58 pts), ternaries 17 (39 pts), boolean chains 24, loops 1 (2 pts), error handling 1 (nesting depth added 39). Of this number, 39 points are the body's own statements and 85 belong to 16 function items 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 · TraceGraphCanvas.TraceGraphCanvas (cognitive 122) · ×1
  • TraceGraphCanvas.TraceGraphCanvas (cognitive 122) langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx:65 — TraceGraphCanvas.TraceGraphCanvas has cognitive complexity 122 (threshold 15). Drivers by points: if/else 45 (49 pts), ternaries 25 (45 pts), boolean chains 20, error handling 3 (5 pts), loops 2, match/switch 1 (nesting depth added 26). Most of this is not in the body itself: 8 of the 122 points are its own statements and the rest belongs to 30 function items inside it that branch (a function literal at line 298, a function literal at line 491, a function literal at line 624, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · policy.PolicyGovernancePage (cognitive 106) · ×1
  • policy.PolicyGovernancePage (cognitive 106) langfuse/web/src/pages/project/[projectId]/policy.tsx:163 — policy.PolicyGovernancePage has cognitive complexity 106 (threshold 15). Drivers by points: if/else 36 (41 pts), ternaries 30 (40 pts), boolean chains 22, error handling 3 (nesting depth added 15). Of this number, 36 points are the body's own statements and 70 belong to 28 function items inside it that branch. 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 · json.deepParseJsonIterative (cognitive 105) · ×1
  • json.deepParseJsonIterative (cognitive 105) langfuse/packages/shared/src/utils/json.ts:165 — json.deepParseJsonIterative has cognitive complexity 105 (threshold 15). Drivers by points: if/else 27 (75 pts), loops 4 (16 pts), ternaries 2 (6 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 66). 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 · evalService.createEvalJobs (cognitive 103) · ×1
  • evalService.createEvalJobs (cognitive 103) langfuse/worker/src/features/evaluation/evalService.ts:166 — evalService.createEvalJobs has cognitive complexity 103 (threshold 15). Drivers by points: if/else 26 (50 pts), ternaries 12 (33 pts), boolean chains 15, error handling 2 (4 pts), loops 1 (nesting depth added 47). Of this number, 102 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. 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 · litellm_callback._format_tool_result_output_for_langfuse (cognitive 103) · ×1
  • litellm_callback._format_tool_result_output_for_langfuse (cognitive 103) REDACTED:3469 — litellm_callback._format_tool_result_output_for_langfuse has cognitive complexity 103 (threshold 15). Drivers by points: if/else 30 (69 pts), ternaries 6 (20 pts), boolean chains 14 (nesting depth added 53). 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 · buildGraphCanvasData.buildTurnMetadataSummary (cognitive 92) · ×1
  • buildGraphCanvasData.buildTurnMetadataSummary (cognitive 92) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:1222 — buildGraphCanvasData.buildTurnMetadataSummary has cognitive complexity 92 (threshold 15). Drivers by points: if/else 31 (69 pts), ternaries 8 (12 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 44). Of this number, 89 points are the body's own statements and 3 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 · buildGraphCanvasData.buildHierarchyGraphFromStepData (cognitive 88) · ×1
  • buildGraphCanvasData.buildHierarchyGraphFromStepData (cognitive 88) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:701 — buildGraphCanvasData.buildHierarchyGraphFromStepData has cognitive complexity 88 (threshold 15). Drivers by points: ternaries 18 (43 pts), if/else 15 (25 pts), boolean chains 11, loops 6 (9 pts) (nesting depth added 38). Of this number, 77 points are the body's own statements and 11 belong to 6 function items 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 · unicode.decodeUnicodeEscapesOnly (cognitive 88) · ×1
  • unicode.decodeUnicodeEscapesOnly (cognitive 88) langfuse/web/src/utils/unicode.ts:26 — unicode.decodeUnicodeEscapesOnly has cognitive complexity 88 (threshold 15). Drivers by points: if/else 27 (68 pts), boolean chains 11, loops 4 (8 pts), ternaries 1 (nesting depth added 45). Of this number, 73 points are the body's own statements and 15 belong to 3 function items inside it that branch. 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 · ObservationGovernanceAnalysisPanel.ObservationGovernanceAnalysisPanel (cognitive 86) · ×1
  • ObservationGovernanceAnalysisPanel.ObservationGovernanceAnalysisPanel (cognitive 86) REDACTED:45 — ObservationGovernanceAnalysisPanel.ObservationGovernanceAnalysisPanel has cognitive complexity 86 (threshold 15). Drivers by points: ternaries 27 (62 pts), boolean chains 12, if/else 10 (12 pts) (nesting depth added 37). Of this number, 71 points are the body's own statements and 15 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 · TraceGovernanceBanner.TraceGovernanceBanner (cognitive 86) · ×1
  • TraceGovernanceBanner.TraceGovernanceBanner (cognitive 86) langfuse/web/src/components/trace2/components/GovernanceBanner/TraceGovernanceBanner.tsx:20 — TraceGovernanceBanner.TraceGovernanceBanner has cognitive complexity 86 (threshold 15). Drivers by points: ternaries 23 (49 pts), if/else 24 (25 pts), boolean chains 9, error handling 2, loops 1 (nesting depth added 27). Of this number, 22 points are the body's own statements and 64 belong to 24 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 · litellm_callback._emit_tool_result_nodes_if_needed (cognitive 82) · ×1
  • litellm_callback._emit_tool_result_nodes_if_needed (cognitive 82) REDACTED:3722 — litellm_callback._emit_tool_result_nodes_if_needed has cognitive complexity 82 (threshold 15). Drivers by points: ternaries 15 (33 pts), if/else 12 (26 pts), boolean chains 18, error handling 1 (4 pts), loops 1 (nesting depth added 35). 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 · litellm_callback._trace_state_from_dict (cognitive 81) · ×1
  • litellm_callback._trace_state_from_dict (cognitive 81) REDACTED:308 — litellm_callback._trace_state_from_dict has cognitive complexity 81 (threshold 15). Drivers by points: if/else 41 (49 pts), boolean chains 27, loops 5 (nesting depth added 8). 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 · autoErrorAnalysisQueue.autoErrorAnalysisQueueProcessor (cognitive 80) · ×1
  • autoErrorAnalysisQueue.autoErrorAnalysisQueueProcessor (cognitive 80) langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:674 — autoErrorAnalysisQueue.autoErrorAnalysisQueueProcessor has cognitive complexity 80 (threshold 15). Drivers by points: if/else 21 (32 pts), ternaries 17 (31 pts), error handling 8 (13 pts), boolean chains 3, loops 1 (nesting depth added 30). 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 · PolicyEngine.pre_instruction (cognitive 80) · ×1
  • PolicyEngine.pre_instruction (cognitive 80) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:848 — PolicyEngine.pre_instruction has cognitive complexity 80 (threshold 15). Drivers by points: if/else 24 (46 pts), ternaries 10 (22 pts), boolean chains 12 (nesting depth added 34). 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 · unary_gate_policy._eval_predicate (cognitive 77) · ×1
  • unary_gate_policy._eval_predicate (cognitive 77) REDACTED:620 — unary_gate_policy._eval_predicate has cognitive complexity 77 (threshold 15). Drivers by points: if/else 46 (60 pts), boolean chains 15, error handling 1 (2 pts) (nesting depth added 15). 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 · index.verifyClickhouseObservation (cognitive 74) · ×1
  • index.verifyClickhouseObservation (cognitive 74) langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:291 — index.verifyClickhouseObservation has cognitive complexity 74 (threshold 15). Drivers by points: if/else 18 (52 pts), boolean chains 16, ternaries 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 37). 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 · build_from_trajectories.main (cognitive 73) · ×1
  • build_from_trajectories.main (cognitive 73) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/build_from_trajectories.py:353 — build_from_trajectories.main has cognitive complexity 73 (threshold 15). Drivers by points: if/else 17 (35 pts), ternaries 13 (22 pts), boolean chains 9, loops 4 (7 pts) (nesting depth added 30). 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 · traces.TracesTable (cognitive 71) · ×1
  • traces.TracesTable (cognitive 71) langfuse/web/src/components/table/use-cases/traces.tsx:134 — traces.TracesTable has cognitive complexity 71 (threshold 15). Drivers by points: ternaries 31 (36 pts), if/else 19, boolean chains 16 (nesting depth added 5). Of this number, 27 points are the body's own statements and 44 belong to 28 function items inside it that branch. 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 · OtelIngestionProcessor.extractInputAndOutput (cognitive 70) · ×1
  • OtelIngestionProcessor.extractInputAndOutput (cognitive 70) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1165 — OtelIngestionProcessor.extractInputAndOutput has cognitive complexity 70 (threshold 15). Drivers by points: boolean chains 30, if/else 24 (27 pts), ternaries 5 (10 pts), error handling 1 (3 pts) (nesting depth added 10). Of this number, 66 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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 · TimelineChartCard.TimelineChartCard (cognitive 70) · ×1
  • TimelineChartCard.TimelineChartCard (cognitive 70) langfuse/web/src/features/score-analytics/components/cards/TimelineChartCard.tsx:35 — TimelineChartCard.TimelineChartCard has cognitive complexity 70 (threshold 15). Drivers by points: ternaries 16 (33 pts), if/else 21 (26 pts), boolean chains 11 (nesting depth added 22). Of this number, 22 points are the body's own statements and 48 belong to 5 function items 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 · litellm_callback._inject_taint_watermarks_into_messages (cognitive 70) · ×1
  • litellm_callback._inject_taint_watermarks_into_messages (cognitive 70) REDACTED:5842 — litellm_callback._inject_taint_watermarks_into_messages has cognitive complexity 70 (threshold 15). Drivers by points: if/else 14 (52 pts), loops 3 (9 pts), boolean chains 8, ternaries 1 (nesting depth added 44). 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 · ExecCompositePolicy.check (cognitive 70) · ×1
  • ExecCompositePolicy.check (cognitive 70) ArbiterOS-Kernel/arbiteros_kernel/policy/exec_composite_policy.py:327 — ExecCompositePolicy.check has cognitive complexity 70 (threshold 15). Drivers by points: if/else 26 (51 pts), boolean chains 11, ternaries 5 (7 pts), loops 1 (nesting depth added 27). 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 · index.PlaygroundProvider (cognitive 69) · ×1
  • index.PlaygroundProvider (cognitive 69) langfuse/web/src/features/playground/page/context/index.tsx:90 — index.PlaygroundProvider has cognitive complexity 69 (threshold 15). Drivers by points: if/else 31 (37 pts), boolean chains 11, ternaries 9 (11 pts), loops 4 (7 pts), error handling 2 (3 pts) (nesting depth added 12). None of this is in the body itself: all 69 points belong to 24 function literals inside it that branch (lines 309, 142, 236, …). 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 · UnaryGatePolicy.check (cognitive 69) · ×1
  • UnaryGatePolicy.check (cognitive 69) REDACTED:2127 — UnaryGatePolicy.check has cognitive complexity 69 (threshold 15). Drivers by points: if/else 17 (41 pts), boolean chains 13, ternaries 7 (13 pts), error handling 1, loops 1 (nesting depth added 30). 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 · ScoreChartLegendContent.ScoreChartLegendContent (cognitive 68) · ×1
  • ScoreChartLegendContent.ScoreChartLegendContent (cognitive 68) langfuse/web/src/features/score-analytics/components/charts/ScoreChartLegendContent.tsx:107 — ScoreChartLegendContent.ScoreChartLegendContent has cognitive complexity 68 (threshold 15). Drivers by points: if/else 30 (38 pts), boolean chains 22, ternaries 4 (6 pts), loops 2 (nesting depth added 10). Most of this is not in the body itself: 10 of the 68 points are its own statements and the rest belongs to 15 function items inside it that branch (a function literal at line 151, smartFormatLabel, getFormattedLabel, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · blobstorage.BlobStorageIntegrationSettingsForm (cognitive 68) · ×1
  • blobstorage.BlobStorageIntegrationSettingsForm (cognitive 68) langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx:179 — blobstorage.BlobStorageIntegrationSettingsForm has cognitive complexity 68 (threshold 15). Drivers by points: boolean chains 41, ternaries 14 (23 pts), if/else 2, match/switch 2 (nesting depth added 9). Of this number, 23 points are the body's own statements and 45 belong to 13 function items inside it that branch. 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.
D2 · Cognitive Complexity · fetchLLMCompletion.fetchLLMCompletion (cognitive 66) · ×1
  • fetchLLMCompletion.fetchLLMCompletion (cognitive 66) langfuse/packages/shared/src/server/llm/fetchLLMCompletion.ts:118 — fetchLLMCompletion.fetchLLMCompletion has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (35 pts), boolean chains 18, ternaries 6 (11 pts), error handling 2 (nesting depth added 16). Of this number, 65 points are the body's own statements and 1 belongs to 2 function items 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 · DataGenerator.generateEvaluationObservations (cognitive 65) · ×1
  • DataGenerator.generateEvaluationObservations (cognitive 65) langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:314 — DataGenerator.generateEvaluationObservations has cognitive complexity 65 (threshold 15). Drivers by points: ternaries 17 (58 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 42). Most of this is not in the body itself: 1 of the 65 points is its own statement and the rest belongs to one function literal inside it that branches (line 322). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · traces.buildTracesBaseQuery (cognitive 64) · ×1
  • traces.buildTracesBaseQuery (cognitive 64) langfuse/web/src/features/public-api/server/traces.ts:44 — traces.buildTracesBaseQuery has cognitive complexity 64 (threshold 15). Drivers by points: ternaries 26 (46 pts), boolean chains 13, if/else 4 (5 pts) (nesting depth added 21). 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 · StatisticsCard.StatisticsCard (cognitive 64) · ×1
  • StatisticsCard.StatisticsCard (cognitive 64) langfuse/web/src/features/score-analytics/components/cards/StatisticsCard.tsx:39 — StatisticsCard.StatisticsCard has cognitive complexity 64 (threshold 15). Drivers by points: boolean chains 33, ternaries 15 (29 pts), if/else 2 (nesting depth added 14). 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.
D2 · Cognitive Complexity · ErrorAnalysisSettings.ErrorAnalysisSettings (cognitive 63) · ×1
  • ErrorAnalysisSettings.ErrorAnalysisSettings (cognitive 63) langfuse/web/src/features/error-analysis/components/ErrorAnalysisSettings.tsx:66 — ErrorAnalysisSettings.ErrorAnalysisSettings has cognitive complexity 63 (threshold 15). Drivers by points: ternaries 13 (28 pts), if/else 7 (19 pts), boolean chains 16 (nesting depth added 27). Of this number, 40 points are the body's own statements and 23 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 · CommentList.CommentList (cognitive 62) · ×1
  • CommentList.CommentList (cognitive 62) langfuse/web/src/features/comments/CommentList.tsx:82 — CommentList.CommentList has cognitive complexity 62 (threshold 15). Drivers by points: boolean chains 30, if/else 27 (28 pts), ternaries 3 (4 pts) (nesting depth added 2). Most of this is not in the body itself: 15 of the 62 points are its own statements and the rest belongs to 19 function items inside it that branch (handleKeyDown, a function literal at line 273, a function literal at line 578, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · OtelIngestionProcessor.extractUsageDetails (cognitive 61) · ×1
  • OtelIngestionProcessor.extractUsageDetails (cognitive 61) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1878 — OtelIngestionProcessor.extractUsageDetails has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (42 pts), ternaries 5 (12 pts), error handling 2 (4 pts), boolean chains 3 (nesting depth added 36). Of this number, 58 points are the body's own statements and 3 belong to 2 function literals inside it that branch. 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 · fill-time-series-gaps.aggregateIntoMultiUnitBuckets (cognitive 60) · ×1
  • fill-time-series-gaps.aggregateIntoMultiUnitBuckets (cognitive 60) langfuse/web/src/utils/fill-time-series-gaps.ts:170 — fill-time-series-gaps.aggregateIntoMultiUnitBuckets has cognitive complexity 60 (threshold 15). Drivers by points: if/else 14 (38 pts), loops 8 (17 pts), boolean chains 3, match/switch 2 (nesting depth added 33). Of this number, 58 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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 · OpenClawPolicy.check (cognitive 60) · ×1
  • OpenClawPolicy.check (cognitive 60) ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:612 — OpenClawPolicy.check has cognitive complexity 60 (threshold 15). Drivers by points: if/else 16 (27 pts), ternaries 5 (12 pts), error handling 3 (9 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 27). 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 · commentFilterService.applyCommentFilters (cognitive 59) · ×1
  • commentFilterService.applyCommentFilters (cognitive 59) langfuse/packages/shared/src/server/services/commentFilterService.ts:89 — commentFilterService.applyCommentFilters has cognitive complexity 59 (threshold 15). Drivers by points: if/else 17 (41 pts), boolean chains 11, ternaries 1 (4 pts), loops 1 (3 pts) (nesting depth added 29). Of this number, 51 points are the body's own statements and 8 belong to 4 function literals inside it that branch. 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 · inner-evaluator-form.InnerEvaluatorForm (cognitive 58) · ×1
  • inner-evaluator-form.InnerEvaluatorForm (cognitive 58) langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:257 — inner-evaluator-form.InnerEvaluatorForm has cognitive complexity 58 (threshold 15). Drivers by points: boolean chains 42, ternaries 25 (41 pts), if/else 16 (nesting depth added 16). 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. This shape REPEATS in the file: one other method here (inner-evaluator-form.InnerEvaluatorForm::onSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · apply_review_results.main (cognitive 58) · ×1
  • apply_review_results.main (cognitive 58) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/apply_review_results.py:99 — apply_review_results.main has cognitive complexity 58 (threshold 15). Drivers by points: if/else 17 (34 pts), boolean chains 17, loops 4 (7 pts) (nesting depth added 20). 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 · unary_gate_policy._tool_block_reason (cognitive 57) · ×1
  • unary_gate_policy._tool_block_reason (cognitive 57) REDACTED:1918 — unary_gate_policy._tool_block_reason has cognitive complexity 57 (threshold 15). Drivers by points: if/else 25 (41 pts), ternaries 6 (14 pts), boolean chains 2 (nesting depth added 24). 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 · PolicyEngine._efsm_step (cognitive 57) · ×1
  • PolicyEngine._efsm_step (cognitive 57) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1205 — PolicyEngine._efsm_step has cognitive complexity 57 (threshold 15). Drivers by points: if/else 16 (29 pts), boolean chains 13, error handling 2 (6 pts), ternaries 4 (6 pts), loops 2 (3 pts) (nesting depth added 20). 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 · RelationalPolicy.check (cognitive 56) · ×1
  • RelationalPolicy.check (cognitive 56) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1073 — RelationalPolicy.check has cognitive complexity 56 (threshold 15). Drivers by points: if/else 16 (31 pts), boolean chains 15, ternaries 4 (6 pts), loops 3 (4 pts) (nesting depth added 18). 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 · scores.ScoresTable (cognitive 55) · ×1
  • scores.ScoresTable (cognitive 55) langfuse/web/src/components/table/use-cases/scores.tsx:97 — scores.ScoresTable has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 28 (33 pts), boolean chains 17, if/else 5 (nesting depth added 5). Of this number, 22 points are the body's own statements and 33 belong to 20 function items inside it that branch. 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 · errorTypeFilters.applyErrorTypeFilters (cognitive 55) · ×1
  • errorTypeFilters.applyErrorTypeFilters (cognitive 55) langfuse/web/src/features/error-analysis/server/errorTypeFilters.ts:83 — errorTypeFilters.applyErrorTypeFilters has cognitive complexity 55 (threshold 15). Drivers by points: if/else 26 (40 pts), ternaries 3 (8 pts), boolean chains 6, loops 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 · KernelPolicyRuntime.build_taint_state (cognitive 55) · ×1
  • KernelPolicyRuntime.build_taint_state (cognitive 55) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:827 — KernelPolicyRuntime.build_taint_state has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (32 pts), boolean chains 15, loops 3 (6 pts), ternaries 1 (2 pts) (nesting depth added 21). 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 · protocol_adapter.extract_all_user_messages_from_request (cognitive 55) · ×1
  • protocol_adapter.extract_all_user_messages_from_request (cognitive 55) ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:128 — protocol_adapter.extract_all_user_messages_from_request has cognitive complexity 55 (threshold 15). Drivers by points: if/else 17 (48 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 34). 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 · ErrorAnalysisDropdown.ErrorAnalysisDropdown (cognitive 54) · ×1
  • ErrorAnalysisDropdown.ErrorAnalysisDropdown (cognitive 54) langfuse/web/src/features/error-analysis/components/ErrorAnalysisDropdown.tsx:248 — ErrorAnalysisDropdown.ErrorAnalysisDropdown has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 15 (24 pts), if/else 18 (19 pts), boolean chains 10, match/switch 1 (nesting depth added 10). Of this number, 23 points are the body's own statements and 31 belong to 6 function items inside it that branch. 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 · useChatMLParser.useChatMLParser (cognitive 53) · ×1
  • useChatMLParser.useChatMLParser (cognitive 53) langfuse/web/src/components/trace2/components/IOPreview/hooks/useChatMLParser.ts:62 — useChatMLParser.useChatMLParser has cognitive complexity 53 (threshold 15). Drivers by points: if/else 8 (22 pts), ternaries 6 (13 pts), boolean chains 10, loops 4 (8 pts) (nesting depth added 25). Most of this is not in the body itself: 3 of the 53 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 86, 162). 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.handler (cognitive 53) · ×1
  • index.handler (cognitive 53) REDACTED:45 — index.handler has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (35 pts), loops 4 (10 pts), boolean chains 5, error handling 2 (3 pts) (nesting depth added 21). Of this number, 46 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 · litellm_callback._screen_tool_results_with_alignment (cognitive 53) · ×1
  • litellm_callback._screen_tool_results_with_alignment (cognitive 53) REDACTED:965 — litellm_callback._screen_tool_results_with_alignment has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 15, ternaries 3 (6 pts), error handling 1 (2 pts), loops 1 (nesting depth added 19). 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 · DatasetRunsTable.DatasetRunsTable (cognitive 52) · ×1
  • DatasetRunsTable.DatasetRunsTable (cognitive 52) langfuse/web/src/features/datasets/components/DatasetRunsTable.tsx:181 — DatasetRunsTable.DatasetRunsTable has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 23 (38 pts), if/else 8 (10 pts), boolean chains 4 (nesting depth added 17). Of this number, 18 points are the body's own statements and 34 belong to 12 function items 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 · useScoreAnalyticsQuery.useScoreAnalyticsQuery.data (cognitive 52) · ×1
  • useScoreAnalyticsQuery.useScoreAnalyticsQuery.data (cognitive 52) langfuse/web/src/features/score-analytics/hooks/useScoreAnalyticsQuery.ts:246 — useScoreAnalyticsQuery.useScoreAnalyticsQuery.data has cognitive complexity 52 (threshold 15). Drivers by points: ternaries 20 (23 pts), if/else 10 (15 pts), boolean chains 14 (nesting depth added 8). Of this number, 46 points are the body's own statements and 6 belong to 2 function literals inside it that branch. 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 · extractTools.extractTools (cognitive 51) · ×1
  • extractTools.extractTools (cognitive 51) langfuse/web/src/utils/chatml/extractTools.ts:29 — extractTools.extractTools has cognitive complexity 51 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 14 (nesting depth added 19). Of this number, 44 points are the body's own statements and 7 belong to 5 function literals inside it that branch. 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 · litellm_callback._build_device_context (cognitive 51) · ×1
  • litellm_callback._build_device_context (cognitive 51) REDACTED:2138 — litellm_callback._build_device_context has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 16, ternaries 5, loops 1 (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 · sessions.SessionsTable (cognitive 50) · ×1
  • sessions.SessionsTable (cognitive 50) langfuse/web/src/components/table/use-cases/sessions.tsx:86 — sessions.SessionsTable has cognitive complexity 50 (threshold 15). Drivers by points: ternaries 26 (28 pts), if/else 12, boolean chains 10 (nesting depth added 2). Of this number, 18 points are the body's own statements and 32 belong to 17 function literals inside it that branch. 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 · handleBatchActionJob.handleBatchActionJob (cognitive 50) · ×1
  • handleBatchActionJob.handleBatchActionJob (cognitive 50) langfuse/worker/src/features/batchAction/handleBatchActionJob.ts:137 — handleBatchActionJob.handleBatchActionJob has cognitive complexity 50 (threshold 15). Drivers by points: if/else 14 (24 pts), ternaries 5 (12 pts), loops 4 (8 pts), boolean chains 4, error handling 1 (2 pts) (nesting depth added 22). 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 · experienceSummaryHintMarkdown.buildExperienceSummaryHintSectionContent (cognitive 49) · ×1
  • experienceSummaryHintMarkdown.buildExperienceSummaryHintSectionContent (cognitive 49) REDACTED:32 — experienceSummaryHintMarkdown.buildExperienceSummaryHintSectionContent has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (21 pts), loops 5 (20 pts), ternaries 2 (8 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 · PolicyConfirmationDetailsSheet.PolicyConfirmationDetailsSheet (cognitive 49) · ×1
  • PolicyConfirmationDetailsSheet.PolicyConfirmationDetailsSheet (cognitive 49) langfuse/web/src/features/dashboard/components/PolicyConfirmationDetailsSheet.tsx:42 — PolicyConfirmationDetailsSheet.PolicyConfirmationDetailsSheet has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 13 (23 pts), if/else 12 (17 pts), boolean chains 7, loops 2 (nesting depth added 15). Of this number, 21 points are the body's own statements and 28 belong to 8 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 · DatasetForm.DatasetForm (cognitive 49) · ×1
  • DatasetForm.DatasetForm (cognitive 49) langfuse/web/src/features/datasets/components/DatasetForm.tsx:137 — DatasetForm.DatasetForm has cognitive complexity 49 (threshold 15). Drivers by points: boolean chains 17, if/else 12 (17 pts), ternaries 13 (15 pts) (nesting depth added 7). Of this number, 22 points are the body's own statements and 27 belong to 6 function items inside it that branch. 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 · aisdk.normalizeMessage (cognitive 48) · ×1
  • aisdk.normalizeMessage (cognitive 48) langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts:92 — aisdk.normalizeMessage has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (36 pts), boolean chains 12 (nesting depth added 20). Of this number, 44 points are the body's own statements and 4 belong to 5 function literals inside it that branch. 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 · data-table-view-presets-drawer.TableViewPresetsDrawer (cognitive 48) · ×1
  • data-table-view-presets-drawer.TableViewPresetsDrawer (cognitive 48) langfuse/web/src/components/table/table-view-presets/components/data-table-view-presets-drawer.tsx:161 — data-table-view-presets-drawer.TableViewPresetsDrawer has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 16, ternaries 11 (12 pts), error handling 1 (nesting depth added 2). Most of this is not in the body itself: 11 of the 48 points are its own statements and the rest belongs to 13 function items inside it that branch (a function literal at line 569, a function literal at line 205, handleSelectView, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · tree-building.buildTreeNodesBottomUp (cognitive 48) · ×1
  • tree-building.buildTreeNodesBottomUp (cognitive 48) langfuse/web/src/components/trace2/lib/tree-building.ts:447 — tree-building.buildTreeNodesBottomUp has cognitive complexity 48 (threshold 15). Drivers by points: if/else 12 (29 pts), ternaries 5 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 25). Of this number, 44 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 · unary_gate_policy._render_predicate (cognitive 47) · ×1
  • unary_gate_policy._render_predicate (cognitive 47) REDACTED:503 — unary_gate_policy._render_predicate has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (47 pts) (nesting depth added 30). 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 · ObservationDetailView.ObservationDetailView (cognitive 46) · ×1
  • ObservationDetailView.ObservationDetailView (cognitive 46) langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:82 — ObservationDetailView.ObservationDetailView has cognitive complexity 46 (threshold 15). Drivers by points: boolean chains 30, ternaries 7 (10 pts), if/else 6 (nesting depth added 3). Of this number, 34 points are the body's own statements and 12 belong to 7 function literals inside it that branch. 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.
D2 · Cognitive Complexity · router.buildSampledTurnContext (cognitive 46) · ×1
  • router.buildSampledTurnContext (cognitive 46) langfuse/web/src/features/policy-suggestions/server/router.ts:456 — router.buildSampledTurnContext has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (32 pts), boolean chains 5, ternaries 4 (5 pts), loops 3 (4 pts) (nesting depth added 18). Of this number, 43 points are the body's own statements and 3 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 · sign-in.SSOButtons (cognitive 46) · ×1
  • sign-in.SSOButtons (cognitive 46) langfuse/web/src/pages/auth/sign-in.tsx:180 — sign-in.SSOButtons has cognitive complexity 46 (threshold 15). Drivers by points: boolean chains 36, ternaries 4 (10 pts) (nesting depth added 6). Of this number, 45 points are the body's own statements and 1 belongs to 3 function literals inside it that branch. 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.
D2 · Cognitive Complexity · gemini.normalizeGeminiMessage (cognitive 45) · ×1
  • gemini.normalizeGeminiMessage (cognitive 45) langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:194 — gemini.normalizeGeminiMessage has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (31 pts), boolean chains 12, ternaries 1 (2 pts) (nesting depth added 14). 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 · data-table.DataTable (cognitive 45) · ×1
  • data-table.DataTable (cognitive 45) langfuse/web/src/components/table/data-table.tsx:145 — data-table.DataTable has cognitive complexity 45 (threshold 15). Drivers by points: ternaries 12 (18 pts), boolean chains 13, if/else 9 (13 pts), loops 1 (nesting depth added 10). Most of this is not in the body itself: 13 of the 45 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 303, 328, 245, …). 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 · JumpToPlaygroundButton.parseGeneration (cognitive 45) · ×1
  • JumpToPlaygroundButton.parseGeneration (cognitive 45) langfuse/web/src/features/playground/page/components/JumpToPlaygroundButton.tsx:277 — JumpToPlaygroundButton.parseGeneration has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (17 pts), error handling 4 (12 pts), ternaries 5 (12 pts), boolean chains 4 (nesting depth added 22). 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 · evalService.extractVariablesFromTracingData (cognitive 45) · ×1
  • evalService.extractVariablesFromTracingData (cognitive 45) langfuse/worker/src/features/evaluation/evalService.ts:1022 — evalService.extractVariablesFromTracingData has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (42 pts), boolean chains 2, loops 1 (nesting depth added 26). 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 · powershell._ps_iter_flat (cognitive 45) · ×1
  • powershell._ps_iter_flat (cognitive 45) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:79 — powershell._ps_iter_flat has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (33 pts), loops 5 (12 pts) (nesting depth added 28). 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 · litellm_callback._resolve_trace_state_from_metadata (cognitive 45) · ×1
  • litellm_callback._resolve_trace_state_from_metadata (cognitive 45) REDACTED:2340 — litellm_callback._resolve_trace_state_from_metadata has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (36 pts), boolean chains 5, ternaries 2 (4 pts) (nesting depth added 21). 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 · litellm_callback._emit_langfuse_node (cognitive 45) · ×1
  • litellm_callback._emit_langfuse_node (cognitive 45) REDACTED:2870 — litellm_callback._emit_langfuse_node has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (24 pts), boolean chains 13, error handling 3 (4 pts), loops 1 (2 pts), ternaries 2 (nesting depth added 7). 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 · relational_policy._flow_kind (cognitive 45) · ×1
  • relational_policy._flow_kind (cognitive 45) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:314 — relational_policy._flow_kind has cognitive complexity 45 (threshold 15). Drivers by points: if/else 27 (35 pts), boolean chains 8, ternaries 1 (2 pts) (nesting depth added 9). 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 · DistributionCategoricalCard.DistributionCategoricalCard (cognitive 43) · ×1
  • DistributionCategoricalCard.DistributionCategoricalCard (cognitive 43) langfuse/web/src/features/score-analytics/components/cards/DistributionCategoricalCard.tsx:110 — DistributionCategoricalCard.DistributionCategoricalCard has cognitive complexity 43 (threshold 15). Drivers by points: ternaries 10 (19 pts), if/else 10 (12 pts), boolean chains 11, match/switch 1 (nesting depth added 11). Of this number, 30 points are the body's own statements and 13 belong to 3 function items 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 · WidgetForm.WidgetForm (cognitive 43) · ×1
  • WidgetForm.WidgetForm (cognitive 43) langfuse/web/src/features/widgets/components/WidgetForm.tsx:156 — WidgetForm.WidgetForm has cognitive complexity 43 (threshold 15). Drivers by points: boolean chains 67, if/else 49 (62 pts), ternaries 39 (61 pts) (nesting depth added 35). 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. This shape REPEATS in the file: one other method here (WidgetForm.WidgetForm::handleSaveWidget) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · direct_metadata._coerce_generic (cognitive 43) · ×1
  • direct_metadata._coerce_generic (cognitive 43) ArbiterOS-Kernel/arbiteros_kernel/policy/direct_metadata.py:124 — direct_metadata._coerce_generic has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (29 pts), loops 6 (12 pts), boolean chains 2 (nesting depth added 20). 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 · applyFieldMapping.applyFieldMappingConfig (cognitive 42) · ×1
  • applyFieldMapping.applyFieldMappingConfig (cognitive 42) langfuse/packages/shared/src/features/batchAction/applyFieldMapping.ts:86 — applyFieldMapping.applyFieldMappingConfig has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (34 pts), boolean chains 4, loops 1 (3 pts), match/switch 1 (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D2 · Cognitive Complexity · NewDatasetItemForm.NewDatasetItemForm (cognitive 42) · ×1
  • NewDatasetItemForm.NewDatasetItemForm (cognitive 42) langfuse/web/src/features/datasets/components/NewDatasetItemForm.tsx:105 — NewDatasetItemForm.NewDatasetItemForm has cognitive complexity 42 (threshold 15). Drivers by points: boolean chains 17, if/else 13 (15 pts), ternaries 8 (10 pts) (nesting depth added 4). Most of this is not in the body itself: 8 of the 42 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 172, a function literal at line 278, onSubmit, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · BackfillEventsHistoricFromParts.run (cognitive 42) · ×1
  • BackfillEventsHistoricFromParts.run (cognitive 42) langfuse/worker/src/backgroundMigrations/backfillEventsHistoricFromParts.ts:537 — BackfillEventsHistoricFromParts.run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 21 (30 pts), loops 4 (6 pts), boolean chains 5, error handling 1 (nesting depth added 11). Of this number, 24 points are the body's own statements and 18 belong to 3 function items 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 · SecurityLabelPolicy.check (cognitive 42) · ×1
  • SecurityLabelPolicy.check (cognitive 42) ArbiterOS-Kernel/arbiteros_kernel/policy/security_label_policy.py:43 — SecurityLabelPolicy.check has cognitive complexity 42 (threshold 15). Drivers by points: if/else 13 (27 pts), boolean chains 9, loops 3 (4 pts), ternaries 1 (2 pts) (nesting depth added 16). 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 · DataGenerator.generateSyntheticObservations (cognitive 41) · ×1
  • DataGenerator.generateSyntheticObservations (cognitive 41) langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:420 — DataGenerator.generateSyntheticObservations has cognitive complexity 41 (threshold 15). Drivers by points: ternaries 13 (29 pts), boolean chains 8, match/switch 1 (2 pts), if/else 1, loops 1 (nesting depth added 17). None of this is in the body itself: all 41 points belong to one function literal inside it that branches (line 426). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · buildStepData.assignGlobalTimingSteps (cognitive 41) · ×1
  • buildStepData.assignGlobalTimingSteps (cognitive 41) langfuse/web/src/features/trace-graph-view/buildStepData.ts:84 — buildStepData.assignGlobalTimingSteps has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 5 (10 pts), boolean chains 7, ternaries 1 (2 pts) (nesting depth added 21). Of this number, 38 points are the body's own statements and 3 belong to 3 function items 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 · extractToolsBackend.extractToolCallsFromRawOutput (cognitive 40) · ×1
  • extractToolsBackend.extractToolCallsFromRawOutput (cognitive 40) langfuse/packages/shared/src/server/ingestion/extractToolsBackend.ts:180 — extractToolsBackend.extractToolCallsFromRawOutput has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 6 (15 pts), boolean chains 5 (nesting depth added 18). 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 · IOPreviewJSON.IOPreviewJSONInner (cognitive 40) · ×1
  • IOPreviewJSON.IOPreviewJSONInner (cognitive 40) langfuse/web/src/components/trace2/components/IOPreview/IOPreviewJSON.tsx:74 — IOPreviewJSON.IOPreviewJSONInner has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (19 pts), boolean chains 12, ternaries 8 (9 pts) (nesting depth added 2). Most of this is not in the body itself: 12 of the 40 points are its own statements and the rest belongs to 12 function literals inside it that branch (lines 350, 226, 109, …). 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 · CodeJsonViewer.JSONView (cognitive 40) · ×1
  • CodeJsonViewer.JSONView (cognitive 40) langfuse/web/src/components/ui/CodeJsonViewer.tsx:27 — CodeJsonViewer.JSONView has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 16 (27 pts), if/else 5 (7 pts), boolean chains 6 (nesting depth added 13). Of this number, 29 points are the body's own statements and 11 belong to 4 function items 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 · CreateLLMApiKeyForm.CreateLLMApiKeyForm · ×1
  • CreateLLMApiKeyForm.CreateLLMApiKeyForm::onSubmit (cognitive 40) langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:481 — CreateLLMApiKeyForm.CreateLLMApiKeyForm::onSubmit has cognitive complexity 40 (threshold 15). Drivers by points: if/else 18 (29 pts), ternaries 5 (6 pts), boolean chains 4, error handling 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. This shape REPEATS in the file: one other method here (CreateLLMApiKeyForm.CreateLLMApiKeyForm) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · MembersTable.MembersTable (cognitive 40) · ×1
  • MembersTable.MembersTable (cognitive 40) langfuse/web/src/features/rbac/components/MembersTable.tsx:61 — MembersTable.MembersTable has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 17 (25 pts), boolean chains 8, if/else 5 (7 pts) (nesting depth added 10). Of this number, 25 points are the body's own statements and 15 belong to 9 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 · DistributionNumericCard.DistributionNumericCard (cognitive 40) · ×1
  • DistributionNumericCard.DistributionNumericCard (cognitive 40) langfuse/web/src/features/score-analytics/components/cards/DistributionNumericCard.tsx:32 — DistributionNumericCard.DistributionNumericCard has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 11 (20 pts), boolean chains 9, if/else 9, match/switch 2 (nesting depth added 9). Of this number, 23 points are the body's own statements and 17 belong to 4 function items 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 · DashboardWidget.DashboardWidget (cognitive 40) · ×1
  • DashboardWidget.DashboardWidget (cognitive 40) langfuse/web/src/features/widgets/components/DashboardWidget.tsx:40 — DashboardWidget.DashboardWidget has cognitive complexity 40 (threshold 15). Drivers by points: ternaries 14 (15 pts), boolean chains 13, if/else 9 (12 pts) (nesting depth added 4). Of this number, 20 points are the body's own statements and 20 belong to 6 function items inside it that branch. 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 · date-picker.TimeRangePicker (cognitive 39) · ×1
  • date-picker.TimeRangePicker (cognitive 39) langfuse/web/src/components/date-picker.tsx:276 — date-picker.TimeRangePicker has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 12 (17 pts), if/else 13 (14 pts), boolean chains 8 (nesting depth added 6). Most of this is not in the body itself: 10 of the 39 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 317, getDisplayContent, onCalendarSelection, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · MappingPreviewPanel.MappingPreviewPanel (cognitive 39) · ×1
  • MappingPreviewPanel.MappingPreviewPanel (cognitive 39) langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/components/MappingPreviewPanel.tsx:36 — MappingPreviewPanel.MappingPreviewPanel has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 15, ternaries 3 (4 pts), error handling 1 (nesting depth added 6). Most of this is not in the body itself: 14 of the 39 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 158, 48, 98, …). 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 · AnnotationForm.InnerAnnotationForm (cognitive 39) · ×1
  • AnnotationForm.InnerAnnotationForm (cognitive 39) langfuse/web/src/features/scores/components/AnnotationForm.tsx:211 — AnnotationForm.InnerAnnotationForm has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 12 (13 pts), boolean chains 12 (nesting depth added 6). Most of this is not in the body itself: 1 of the 39 points is its own statement and the rest belongs to 10 function items inside it that branch (a function literal at line 584, handleNumericUpsert, handleUpsert, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · litellm_callback._collect_prior_tool_call_ids_from_messages (cognitive 39) · ×1
  • litellm_callback._collect_prior_tool_call_ids_from_messages (cognitive 39) REDACTED:1705 — litellm_callback._collect_prior_tool_call_ids_from_messages has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (25 pts), boolean chains 5, ternaries 1 (5 pts), loops 2 (4 pts) (nesting depth added 23). 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 · TaintPolicy.check (cognitive 39) · ×1
  • TaintPolicy.check (cognitive 39) ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:147 — TaintPolicy.check has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (21 pts), ternaries 4 (10 pts), boolean chains 6, loops 2 (nesting depth added 15). 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 · observations_converters.convertObservationPartial (cognitive 38) · ×1
  • observations_converters.convertObservationPartial (cognitive 38) langfuse/packages/shared/src/server/repositories/observations_converters.ts:120 — observations_converters.convertObservationPartial has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 34, if/else 2, ternaries 2. 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.
D2 · Cognitive Complexity · index.SessionEventsPage (cognitive 38) · ×1
  • index.SessionEventsPage (cognitive 38) langfuse/web/src/components/session/index.tsx:553 — index.SessionEventsPage has cognitive complexity 38 (threshold 15). Drivers by points: boolean chains 17, if/else 14, ternaries 5 (7 pts) (nesting depth added 2). Most of this is not in the body itself: 13 of the 38 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 706, 809, 632, …). 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 · filter-builder.InlineFilterState (cognitive 38) · ×1
  • filter-builder.InlineFilterState (cognitive 38) langfuse/web/src/features/filters/components/filter-builder.tsx:265 — filter-builder.InlineFilterState has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 11 (35 pts), boolean chains 3 (nesting depth added 24). None of this is in the body itself: all 38 points belong to 2 function literals inside it that branch (lines 273, 288). 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 · HeatmapCard.HeatmapCard (cognitive 38) · ×1
  • HeatmapCard.HeatmapCard (cognitive 38) langfuse/web/src/features/score-analytics/components/cards/HeatmapCard.tsx:141 — HeatmapCard.HeatmapCard has cognitive complexity 38 (threshold 15). Drivers by points: ternaries 15 (28 pts), boolean chains 7, if/else 3 (nesting depth added 13). 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 · index.handler (cognitive 38) · ×1
  • index.handler (cognitive 38) langfuse/web/src/pages/api/public/scim/Users/index.ts:11 — index.handler has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (21 pts), boolean chains 8, error handling 3 (7 pts), ternaries 1 (2 pts) (nesting depth added 14). 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 · policy_check._policy_source_location (cognitive 38) · ×1
  • policy_check._policy_source_location (cognitive 38) ArbiterOS-Kernel/arbiteros_kernel/policy_check.py:140 — policy_check._policy_source_location has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 2 (6 pts), boolean chains 4, error handling 2 (3 pts) (nesting depth added 22). 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 · schemaValidation.validateAllDatasetItems (cognitive 37) · ×1
  • schemaValidation.validateAllDatasetItems (cognitive 37) langfuse/packages/shared/src/server/datasets/schemaValidation.ts:39 — schemaValidation.validateAllDatasetItems has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (33 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 24). 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 · variable-mapping-card.VariableMappingCard (cognitive 37) · ×1
  • variable-mapping-card.VariableMappingCard (cognitive 37) langfuse/web/src/features/evals/components/variable-mapping-card.tsx:50 — variable-mapping-card.VariableMappingCard has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 8 (17 pts), boolean chains 14, if/else 3 (6 pts) (nesting depth added 12). Most of this is not in the body itself: 3 of the 37 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 157, 296, 84, …). 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 · filter-builder.FilterBuilderForm (cognitive 37) · ×1
  • filter-builder.FilterBuilderForm (cognitive 37) langfuse/web/src/features/filters/components/filter-builder.tsx:414 — filter-builder.FilterBuilderForm has cognitive complexity 37 (threshold 15). Drivers by points: boolean chains 25, if/else 4 (7 pts), ternaries 1 (3 pts), error handling 1 (2 pts) (nesting depth added 6). Of this number, 23 points are the body's own statements and 14 belong to 12 function items inside it that branch. 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.
D2 · Cognitive Complexity · useSidebarFilterState.useSidebarFilterState.applySelection (cognitive 37) · ×1
  • useSidebarFilterState.useSidebarFilterState.applySelection (cognitive 37) langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:518 — useSidebarFilterState.useSidebarFilterState.applySelection has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (21 pts), ternaries 5 (9 pts), boolean chains 7 (nesting depth added 9). Of this number, 35 points are the body's own statements and 2 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 · BackfillEventsHistoric.run (cognitive 37) · ×1
  • BackfillEventsHistoric.run (cognitive 37) langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:686 — BackfillEventsHistoric.run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (25 pts), loops 4 (6 pts), boolean chains 5, error handling 1 (nesting depth added 9). Of this number, 21 points are the body's own statements and 16 belong to 3 function items 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 · EfsmGatePolicy.check (cognitive 37) · ×1
  • EfsmGatePolicy.check (cognitive 37) ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:90 — EfsmGatePolicy.check has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (24 pts), ternaries 3 (7 pts), boolean chains 4, loops 2 (nesting depth added 16). 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 · validation.validatePricingTiers (cognitive 36) · ×1
  • validation.validatePricingTiers (cognitive 36) REDACTED:102 — validation.validatePricingTiers has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 5 (7 pts), ternaries 1 (4 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 14). 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 · createDataset.upsertDataset (cognitive 36) · ×1
  • createDataset.upsertDataset (cognitive 36) langfuse/web/src/features/datasets/server/actions/createDataset.ts:33 — createDataset.upsertDataset has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 11 (23 pts), if/else 5 (11 pts), boolean chains 2 (nesting depth added 18). 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 · MultiStepExperimentForm.MultiStepExperimentForm (cognitive 36) · ×1
  • MultiStepExperimentForm.MultiStepExperimentForm (cognitive 36) langfuse/web/src/features/experiments/components/MultiStepExperimentForm.tsx:54 — MultiStepExperimentForm.MultiStepExperimentForm has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 24, if/else 8 (9 pts), ternaries 2, match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 15 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (isStepValid, a function literal at line 448, a function literal at line 274, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · buildScoreComparisonQuery.buildScoreComparisonQuery (cognitive 36) · ×1
  • buildScoreComparisonQuery.buildScoreComparisonQuery (cognitive 36) langfuse/web/src/features/score-analytics/server/buildScoreComparisonQuery.ts:50 — buildScoreComparisonQuery.buildScoreComparisonQuery has cognitive complexity 36 (threshold 15). Drivers by points: ternaries 32 (36 pts) (nesting depth added 4). 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 · IngestionService.getUsageUnits (cognitive 36) · ×1
  • IngestionService.getUsageUnits (cognitive 36) langfuse/worker/src/services/IngestionService/index.ts:1366 — IngestionService.getUsageUnits has cognitive complexity 36 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 6 (12 pts), boolean chains 6, error handling 2 (4 pts), loops 1 (nesting depth added 14). Of this number, 22 points are the body's own statements and 14 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 · ingestionQueue.ingestionQueueProcessorBuilder.<returned closure> (cognitive 36) · ×1
  • ingestionQueue.ingestionQueueProcessorBuilder.<returned closure> (cognitive 36) langfuse/worker/src/queues/ingestionQueue.ts:36 — ingestionQueue.ingestionQueueProcessorBuilder.<returned closure> has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 7, ternaries 4 (7 pts), error handling 2 (3 pts), loops 1 (2 pts) (nesting depth added 8). Of this number, 34 points are the body's own statements and 2 belong to one function item 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 · handleExperimentBackfill.writeEnrichedSpans (cognitive 36) · ×1
  • handleExperimentBackfill.writeEnrichedSpans (cognitive 36) langfuse/worker/src/features/eventPropagation/handleExperimentBackfill.ts:482 — handleExperimentBackfill.writeEnrichedSpans has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 32, if/else 3, loops 1. 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.
D2 · Cognitive Complexity · index.main (cognitive 36) · ×1
  • index.main (cognitive 36) langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:47 — index.main has cognitive complexity 36 (threshold 15). Drivers by points: if/else 19 (29 pts), error handling 3 (6 pts), loops 1 (nesting depth added 13). Of this number, 24 points are the body's own statements and 12 belong to 6 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 · types.compute_prop_taint_for_instruction (cognitive 36) · ×1
  • types.compute_prop_taint_for_instruction (cognitive 36) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/types.py:149 — types.compute_prop_taint_for_instruction has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 10, ternaries 5 (7 pts), loops 2 (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 · litellm_callback._response_transform_content_only (cognitive 36) · ×1
  • litellm_callback._response_transform_content_only (cognitive 36) REDACTED:5512 — litellm_callback._response_transform_content_only has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (17 pts), ternaries 4 (9 pts), boolean chains 5, error handling 2 (5 pts) (nesting depth added 13). 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 · KernelPolicyRuntime.check_path_and_budget (cognitive 36) · ×1
  • KernelPolicyRuntime.check_path_and_budget (cognitive 36) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:711 — KernelPolicyRuntime.check_path_and_budget has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (13 pts), ternaries 4 (9 pts), boolean chains 8, loops 3 (4 pts), error handling 1 (2 pts) (nesting depth added 14). 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 · tree-building.filterAndPrepareObservations (cognitive 35) · ×1
  • tree-building.filterAndPrepareObservations (cognitive 35) langfuse/web/src/components/trace2/lib/tree-building.ts:210 — tree-building.filterAndPrepareObservations has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 8, loops 4 (5 pts), ternaries 1 (nesting depth added 11). Of this number, 28 points are the body's own statements and 7 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 · BillingService.getSubscriptionInfo (cognitive 35) · ×1
  • BillingService.getSubscriptionInfo (cognitive 35) REDACTED:312 — BillingService.getSubscriptionInfo has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), ternaries 5 (6 pts), boolean chains 4, error handling 1 (nesting depth added 12). None of this is in the body itself: all 35 points belong to 3 function literals inside it that branch (lines 315, 465, 405). 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 · BillingService.getInvoices (cognitive 35) · ×1
  • BillingService.getInvoices (cognitive 35) REDACTED:1541 — BillingService.getInvoices has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (16 pts), ternaries 10 (14 pts), boolean chains 4, loops 1 (nesting depth added 11). None of this is in the body itself: all 35 points belong to 3 function literals inside it that branch (lines 1626, 1551, 1593). 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 · automations.AutomationsPage (cognitive 35) · ×1
  • automations.AutomationsPage (cognitive 35) langfuse/web/src/features/automations/components/automations.tsx:25 — automations.AutomationsPage has cognitive complexity 35 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 10, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 6 function items inside it that branch (renderMainContent, handleDeleteAutomation, a function literal at line 76, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · remap-evaluator.RemapEvaluatorPage (cognitive 35) · ×1
  • remap-evaluator.RemapEvaluatorPage (cognitive 35) langfuse/web/src/features/evals/pages/remap-evaluator.tsx:28 — remap-evaluator.RemapEvaluatorPage has cognitive complexity 35 (threshold 15). Drivers by points: ternaries 10 (23 pts), boolean chains 8, if/else 2, error handling 1, match/switch 1 (nesting depth added 13). Of this number, 17 points are the body's own statements and 18 belong to 3 function items inside it that branch. 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 · ScoreDistributionCategoricalChart.ScoreDistributionCategoricalChart (cognitive 35) · ×1
  • ScoreDistributionCategoricalChart.ScoreDistributionCategoricalChart (cognitive 35) langfuse/web/src/features/score-analytics/components/charts/ScoreDistributionCategoricalChart.tsx:32 — ScoreDistributionCategoricalChart.ScoreDistributionCategoricalChart has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 8, ternaries 5 (7 pts) (nesting depth added 9). Most of this is not in the body itself: 3 of the 35 points are its own statements and the rest belongs to 12 function items inside it that branch (a function literal at line 177, a function literal at line 57, a function literal at line 173, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PatchLLMToolAndLLMSchemaAuditLogs.run (cognitive 35) · ×1
  • PatchLLMToolAndLLMSchemaAuditLogs.run (cognitive 35) langfuse/worker/src/backgroundMigrations/patchLLMToolAndLLLMSchemaAuditLogs.ts:31 — PatchLLMToolAndLLMSchemaAuditLogs.run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 7 (19 pts), error handling 2 (6 pts), ternaries 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 21). 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 · litellm_callback._wrap_reference_tool_ids_into_messages (cognitive 35) · ×1
  • litellm_callback._wrap_reference_tool_ids_into_messages (cognitive 35) REDACTED:5681 — litellm_callback._wrap_reference_tool_ids_into_messages has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (nesting depth added 15). 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 · policy_rule_ir._validate_predicate (cognitive 35) · ×1
  • policy_rule_ir._validate_predicate (cognitive 35) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:659 — policy_rule_ir._validate_predicate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 5, loops 2 (4 pts) (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 · traces-ui-table-service.getTracesTableGeneric (cognitive 34) · ×1
  • traces-ui-table-service.getTracesTableGeneric (cognitive 34) langfuse/packages/shared/src/server/services/traces-ui-table-service.ts:207 — traces-ui-table-service.getTracesTableGeneric has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 17 (19 pts), boolean chains 14, match/switch 1 (nesting depth added 2). Most of this is not in the body itself: 15 of the 34 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 375, 264, 231). 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 · pydantic-ai.extractFromParts (cognitive 34) · ×1
  • pydantic-ai.extractFromParts (cognitive 34) langfuse/packages/shared/src/utils/chatml/adapters/pydantic-ai.ts:42 — pydantic-ai.extractFromParts has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 5 (17 pts), if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 18). 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 · generic.normalizeGoogleMessage (cognitive 34) · ×1
  • generic.normalizeGoogleMessage (cognitive 34) langfuse/packages/shared/src/utils/chatml/adapters/generic.ts:3 — generic.normalizeGoogleMessage has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 10 (nesting depth added 13). Most of this is not in the body itself: 9 of the 34 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 40, 17, 25). 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 · JsonValue.JsonValue (cognitive 34) · ×1
  • JsonValue.JsonValue (cognitive 34) langfuse/web/src/components/ui/AdvancedJsonViewer/components/JsonValue.tsx:21 — JsonValue.JsonValue has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 9 (18 pts), if/else 6 (10 pts), boolean chains 4, match/switch 2 (nesting depth added 13). Of this number, 18 points are the body's own statements and 16 belong to 5 function items 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 · evaluator-table.EvaluatorTable (cognitive 34) · ×1
  • evaluator-table.EvaluatorTable (cognitive 34) langfuse/web/src/features/evals/components/evaluator-table.tsx:137 — evaluator-table.EvaluatorTable has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 13 (18 pts), if/else 9 (10 pts), boolean chains 6 (nesting depth added 6). Most of this is not in the body itself: 11 of the 34 points are its own statements and the rest belongs to 14 function items inside it that branch (convertToTableRow, a function literal at line 260, a function literal at line 373, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · index.DashboardDetail (cognitive 34) · ×1
  • index.DashboardDetail (cognitive 34) langfuse/web/src/pages/project/[projectId]/dashboards/[dashboardId]/index.tsx:39 — index.DashboardDetail has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 16, if/else 10 (11 pts), ternaries 4 (7 pts) (nesting depth added 4). Of this number, 19 points are the body's own statements and 15 belong to 9 function items inside it that branch. 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 · alignment_trigger.should_trigger_preexec_sentinel (cognitive 34) · ×1
  • alignment_trigger.should_trigger_preexec_sentinel (cognitive 34) ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_trigger.py:446 — alignment_trigger.should_trigger_preexec_sentinel has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 7, ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 13). 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 · PolicyEngine.observe_untrusted_output (cognitive 34) · ×1
  • PolicyEngine.observe_untrusted_output (cognitive 34) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:650 — PolicyEngine.observe_untrusted_output has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 13, loops 5 (6 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 · public-api-filter-builder.convertApiProvidedFilterToClickhouseFilter (cognitive 33) · ×1
  • public-api-filter-builder.convertApiProvidedFilterToClickhouseFilter (cognitive 33) langfuse/packages/shared/src/server/queries/public-api-filter-builder.ts:217 — public-api-filter-builder.convertApiProvidedFilterToClickhouseFilter has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (20 pts), ternaries 2 (6 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 18). None of this is in the body itself: all 33 points belong to one function literal inside it that branches (line 223). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · OtelIngestionProcessor.extractModelParameters (cognitive 33) · ×1
  • OtelIngestionProcessor.extractModelParameters (cognitive 33) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1747 — OtelIngestionProcessor.extractModelParameters has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 10 (22 pts), error handling 3 (6 pts), if/else 5 (nesting depth added 15). Of this number, 32 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 · AdvancedJsonSection.AdvancedJsonSection (cognitive 33) · ×1
  • AdvancedJsonSection.AdvancedJsonSection (cognitive 33) langfuse/web/src/components/ui/AdvancedJsonSection/AdvancedJsonSection.tsx:92 — AdvancedJsonSection.AdvancedJsonSection has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 14, if/else 11, ternaries 7 (8 pts) (nesting depth added 1). Of this number, 19 points are the body's own statements and 14 belong to 9 function items 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 · MarkdownViewer.MarkdownView (cognitive 33) · ×1
  • MarkdownViewer.MarkdownView (cognitive 33) langfuse/web/src/components/ui/MarkdownViewer.tsx:315 — MarkdownViewer.MarkdownView has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 13 (28 pts), boolean chains 5 (nesting depth added 15). Most of this is not in the body itself: 15 of the 33 points are its own statements and the rest belongs to one function literal inside it that branches (line 417). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · AnnotationQueueItemPage.AnnotationQueueItemPage (cognitive 33) · ×1
  • AnnotationQueueItemPage.AnnotationQueueItemPage (cognitive 33) langfuse/web/src/features/annotation-queues/components/AnnotationQueueItemPage.tsx:25 — AnnotationQueueItemPage.AnnotationQueueItemPage has cognitive complexity 33 (threshold 15). Drivers by points: boolean chains 15, if/else 14, ternaries 2 (3 pts), match/switch 1 (nesting depth added 1). Most of this is not in the body itself: 14 of the 33 points are its own statements and the rest belongs to 8 function items inside it that branch (a function literal at line 103, renderContent, a function literal at line 78, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · UpsertModelFormDialog.UpsertModelFormDialog (cognitive 33) · ×1
  • UpsertModelFormDialog.UpsertModelFormDialog (cognitive 33) langfuse/web/src/features/models/components/UpsertModelFormDialog.tsx:68 — UpsertModelFormDialog.UpsertModelFormDialog has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 12 (14 pts), if/else 11, boolean chains 8 (nesting depth added 2). Most of this is not in the body itself: 9 of the 33 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 80, onSubmit, a function literal at line 169, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · index.NewPromptForm (cognitive 33) · ×1
  • index.NewPromptForm (cognitive 33) langfuse/web/src/features/prompts/components/NewPromptForm/index.tsx:59 — index.NewPromptForm has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 10 (13 pts), boolean chains 10, if/else 9, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 15 of the 33 points are its own statements and the rest belongs to 6 function items inside it that branch (onSubmit, a function literal at line 184, a function literal at line 211, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · prompt-detail.PromptDetail (cognitive 33) · ×1
  • prompt-detail.PromptDetail (cognitive 33) langfuse/web/src/features/prompts/components/prompt-detail.tsx:106 — prompt-detail.PromptDetail has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 9 (14 pts), boolean chains 11, if/else 6 (7 pts), error handling 1 (nesting depth added 6). Of this number, 29 points are the body's own statements and 4 belong to 3 function items 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 · litellm_callback._summarize_turn_topic (cognitive 33) · ×1
  • litellm_callback._summarize_turn_topic (cognitive 33) REDACTED:2822 — litellm_callback._summarize_turn_topic has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 7, loops 2 (5 pts) (nesting depth added 15). 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 · SpanContent.SpanContent (cognitive 32) · ×1
  • SpanContent.SpanContent (cognitive 32) langfuse/web/src/components/trace2/components/SpanContent.tsx:43 — SpanContent.SpanContent has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 26, ternaries 4 (6 pts) (nesting depth added 2). Of this number, 31 points are the body's own statements and 1 belongs to one function literal inside it that branches. 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.
D2 · Cognitive Complexity · CorrectedOutputField.CorrectedOutputField (cognitive 32) · ×1
  • CorrectedOutputField.CorrectedOutputField (cognitive 32) langfuse/web/src/components/trace2/components/IOPreview/components/CorrectedOutputField.tsx:33 — CorrectedOutputField.CorrectedOutputField has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 7 (12 pts), boolean chains 7, if/else 6 (7 pts), error handling 3 (6 pts) (nesting depth added 9). Of this number, 18 points are the body's own statements and 14 belong to 2 function items 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 · ChatMessage.ChatMessage (cognitive 32) · ×1
  • ChatMessage.ChatMessage (cognitive 32) langfuse/web/src/components/trace2/components/IOPreview/components/ChatMessage.tsx:48 — ChatMessage.ChatMessage has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 13, ternaries 7 (13 pts), if/else 6 (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 · treeStructure.buildTreeStructureIterative (cognitive 32) · ×1
  • treeStructure.buildTreeStructureIterative (cognitive 32) langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeStructure.ts:119 — treeStructure.buildTreeStructureIterative has cognitive complexity 32 (threshold 15). Drivers by points: loops 5 (15 pts), ternaries 2 (9 pts), if/else 3 (7 pts), boolean chains 1 (nesting depth added 21). 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 · chart.ChartTooltipContent (cognitive 32) · ×1
  • chart.ChartTooltipContent (cognitive 32) REDACTED:119 — chart.ChartTooltipContent has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 15, ternaries 8 (12 pts), if/else 5 (nesting depth added 4). Most of this is not in the body itself: 4 of the 32 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 203, 151, 142, …). 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 · template-form.InnerEvalTemplateForm (cognitive 32) · ×1
  • template-form.InnerEvalTemplateForm (cognitive 32) langfuse/web/src/features/evals/components/template-form.tsx:151 — template-form.InnerEvalTemplateForm has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 13 (14 pts), if/else 10 (12 pts), boolean chains 6 (nesting depth added 3). Most of this is not in the body itself: 11 of the 32 points are its own statements and the rest belongs to 5 function items inside it that branch (onSubmit, a function literal at line 259, a function literal at line 339, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CreateLLMApiKeyForm.CreateLLMApiKeyForm (cognitive 32) · ×1
  • CreateLLMApiKeyForm.CreateLLMApiKeyForm (cognitive 32) langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:228 — CreateLLMApiKeyForm.CreateLLMApiKeyForm has cognitive complexity 32 (threshold 15). Drivers by points: ternaries 25 (47 pts), boolean chains 32, if/else 19 (30 pts), error handling 1, match/switch 1 (nesting depth added 33). 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. This shape REPEATS in the file: one other method here (CreateLLMApiKeyForm.CreateLLMApiKeyForm::onSubmit) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · fill-time-series-gaps.fillGapsInSingleUnitData (cognitive 32) · ×1
  • fill-time-series-gaps.fillGapsInSingleUnitData (cognitive 32) langfuse/web/src/utils/fill-time-series-gaps.ts:55 — fill-time-series-gaps.fillGapsInSingleUnitData has cognitive complexity 32 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (7 pts), boolean chains 3, match/switch 2, ternaries 2 (nesting depth added 15). Of this number, 30 points are the body's own statements and 2 belong to 2 function items inside it that branch. 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 · bash._ts_iter_flat (cognitive 32) · ×1
  • bash._ts_iter_flat (cognitive 32) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:95 — bash._ts_iter_flat has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 18). 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 · powershell._ps_collect_from_exec_unit (cognitive 32) · ×1
  • powershell._ps_collect_from_exec_unit (cognitive 32) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:205 — powershell._ps_collect_from_exec_unit has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 18). 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 · langfuse_replay.replay_jsonl_to_langfuse (cognitive 32) · ×1
  • langfuse_replay.replay_jsonl_to_langfuse (cognitive 32) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:770 — langfuse_replay.replay_jsonl_to_langfuse has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (25 pts), ternaries 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 15). 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 · litellm_callback._max_emitted_tool_result_index (cognitive 32) · ×1
  • litellm_callback._max_emitted_tool_result_index (cognitive 32) REDACTED:1344 — litellm_callback._max_emitted_tool_result_index has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (24 pts), error handling 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 11). 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 · KernelPolicyRuntime.check_taint_sink_for_tool (cognitive 32) · ×1
  • KernelPolicyRuntime.check_taint_sink_for_tool (cognitive 32) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:904 — KernelPolicyRuntime.check_taint_sink_for_tool has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (2 pts) (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 · KernelPolicyRuntime.efsm_step (cognitive 32) · ×1
  • KernelPolicyRuntime.efsm_step (cognitive 32) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:1183 — KernelPolicyRuntime.efsm_step has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 9, ternaries 5 (7 pts), loops 1 (nesting depth added 8). 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 · sessions-ui-table-service.getSessionsTableGeneric (cognitive 31) · ×1
  • sessions-ui-table-service.getSessionsTableGeneric (cognitive 31) langfuse/packages/shared/src/server/services/sessions-ui-table-service.ts:124 — sessions-ui-table-service.getSessionsTableGeneric has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 15 (16 pts), boolean chains 13, if/else 1, match/switch 1 (nesting depth added 1). Of this number, 28 points are the body's own statements and 3 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 · aisdk.preprocessData (cognitive 31) · ×1
  • aisdk.preprocessData (cognitive 31) langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts:347 — aisdk.preprocessData has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 6, ternaries 1 (3 pts) (nesting depth added 12). Of this number, 28 points are the body's own statements and 3 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 · FrameworkTraceLoader.adaptTrace (cognitive 31) · ×1
  • FrameworkTraceLoader.adaptTrace (cognitive 31) langfuse/packages/shared/scripts/seeder/utils/framework-traces/framework-trace-loader.ts:66 — FrameworkTraceLoader.adaptTrace has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (20 pts), boolean chains 6, if/else 2 (3 pts), loops 2 (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 · seed-postgres.createDatasets (cognitive 31) · ×1
  • seed-postgres.createDatasets (cognitive 31) REDACTED:492 — seed-postgres.createDatasets has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 3 (12 pts), if/else 3 (10 pts), loops 4 (9 pts) (nesting depth added 21). 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 · NewDatasetItemFromExistingObject.NewDatasetItemFromExistingObject (cognitive 31) · ×1
  • NewDatasetItemFromExistingObject.NewDatasetItemFromExistingObject (cognitive 31) langfuse/web/src/features/datasets/components/NewDatasetItemFromExistingObject.tsx:37 — NewDatasetItemFromExistingObject.NewDatasetItemFromExistingObject has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 10 (23 pts), boolean chains 8 (nesting depth added 13). Of this number, 28 points are the body's own statements and 3 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 · ScoreDistributionBooleanChart.ScoreDistributionBooleanChart (cognitive 31) · ×1
  • ScoreDistributionBooleanChart.ScoreDistributionBooleanChart (cognitive 31) langfuse/web/src/features/score-analytics/components/charts/ScoreDistributionBooleanChart.tsx:26 — ScoreDistributionBooleanChart.ScoreDistributionBooleanChart has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 13, ternaries 2 (nesting depth added 3). Most of this is not in the body itself: 3 of the 31 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 151, 64, 102, …). 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 · DistributionBooleanCard.DistributionBooleanCard (cognitive 31) · ×1
  • DistributionBooleanCard.DistributionBooleanCard (cognitive 31) langfuse/web/src/features/score-analytics/components/cards/DistributionBooleanCard.tsx:32 — DistributionBooleanCard.DistributionBooleanCard has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (16 pts), if/else 8, boolean chains 6, match/switch 1 (nesting depth added 7). Of this number, 22 points are the body's own statements and 9 belong to 3 function items 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 · charts.DatasetCompare (cognitive 31) · ×1
  • charts.DatasetCompare (cognitive 31) langfuse/web/src/pages/project/[projectId]/datasets/[datasetId]/compare/charts.tsx:44 — charts.DatasetCompare has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 9 (19 pts), if/else 6 (9 pts), boolean chains 3 (nesting depth added 13). Most of this is not in the body itself: 8 of the 31 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 188, 151, 145). 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 · handleCloudUsageMeteringJob.handleCloudUsageMeteringJob (cognitive 31) · ×1
  • handleCloudUsageMeteringJob.handleCloudUsageMeteringJob (cognitive 31) langfuse/worker/src/ee/cloudUsageMetering/handleCloudUsageMeteringJob.ts:27 — handleCloudUsageMeteringJob.handleCloudUsageMeteringJob has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (22 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 11). 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 · otelIngestionQueue.otelIngestionQueueProcessor (cognitive 31) · ×1
  • otelIngestionQueue.otelIngestionQueueProcessor (cognitive 31) langfuse/worker/src/queues/otelIngestionQueue.ts:174 — otelIngestionQueue.otelIngestionQueueProcessor has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (14 pts), error handling 4 (6 pts), ternaries 4 (6 pts), boolean chains 5 (nesting depth added 6). Of this number, 21 points are the body's own statements and 10 belong to 3 function literals inside it that branch. 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 · json.deepParseJsonRecursive (cognitive 30) · ×1
  • json.deepParseJsonRecursive (cognitive 30) langfuse/packages/shared/src/utils/json.ts:84 — json.deepParseJsonRecursive has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (6 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 16). 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 · openai.normalizeMessage (cognitive 30) · ×1
  • openai.normalizeMessage (cognitive 30) langfuse/packages/shared/src/utils/chatml/adapters/openai.ts:114 — openai.normalizeMessage has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 13, if/else 11 (13 pts), ternaries 2 (4 pts) (nesting depth added 4). Of this number, 29 points are the body's own statements and 1 belongs to 2 function literals inside it that branch. 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 · gemini.preprocessData (cognitive 30) · ×1
  • gemini.preprocessData (cognitive 30) langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:346 — gemini.preprocessData has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 11). 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 · generic.preprocessData (cognitive 30) · ×1
  • generic.preprocessData (cognitive 30) langfuse/packages/shared/src/utils/chatml/adapters/generic.ts:67 — generic.preprocessData has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 6, ternaries 2 (4 pts), error handling 1 (3 pts) (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 · TracePreview.TracePreview (cognitive 30) · ×1
  • TracePreview.TracePreview (cognitive 30) langfuse/web/src/components/trace2/TracePreview.tsx:67 — TracePreview.TracePreview has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 20, ternaries 8, if/else 2. Of this number, 24 points are the body's own statements and 6 belong to 3 function literals inside it that branch. 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.
D2 · Cognitive Complexity · TraceGraphView.TraceGraphView (cognitive 30) · ×1
  • TraceGraphView.TraceGraphView (cognitive 30) langfuse/web/src/features/trace-graph-view/components/TraceGraphView.tsx:34 — TraceGraphView.TraceGraphView has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (21 pts), boolean chains 7, loops 1, ternaries 1 (nesting depth added 6). None of this is in the body itself: all 30 points belong to 7 function literals inside it that branch (lines 137, 91, 53, …). 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 · sign-in.SignIn (cognitive 30) · ×1
  • sign-in.SignIn (cognitive 30) langfuse/web/src/pages/auth/sign-in.tsx:508 — sign-in.SignIn has cognitive complexity 30 (threshold 15). Drivers by points: boolean chains 10, ternaries 8 (10 pts), if/else 7 (8 pts), error handling 2 (nesting depth added 3). Of this number, 18 points are the body's own statements and 12 belong to 5 function items inside it that branch. 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 · usageAggregation.processUsageAggregationForAllOrgs (cognitive 30) · ×1
  • usageAggregation.processUsageAggregationForAllOrgs (cognitive 30) langfuse/worker/src/ee/usageThresholds/usageAggregation.ts:172 — usageAggregation.processUsageAggregationForAllOrgs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (7 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 15). 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 · index.verifyClickhouseTrace (cognitive 30) · ×1
  • index.verifyClickhouseTrace (cognitive 30) langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:715 — index.verifyClickhouseTrace has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 5, ternaries 1 (3 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). 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 · PolicyEngine._check_taint_sinks (cognitive 30) · ×1
  • PolicyEngine._check_taint_sinks (cognitive 30) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1582 — PolicyEngine._check_taint_sinks has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 6, loops 2 (3 pts), ternaries 1 (2 pts) (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 · protocol_adapter.to_canonical_assistant_message (cognitive 30) · ×1
  • protocol_adapter.to_canonical_assistant_message (cognitive 30) ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:259 — protocol_adapter.to_canonical_assistant_message has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (11 pts), ternaries 6 (10 pts), error handling 2 (4 pts), boolean chains 3, loops 1 (2 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 · run_cases.load_manifest (cognitive 30) · ×1
  • run_cases.load_manifest (cognitive 30) REDACTED:64 — run_cases.load_manifest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 8, ternaries 1 (2 pts), 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 · seed-dataset-versions.seedDatasetVersions (cognitive 29) · ×1
  • seed-dataset-versions.seedDatasetVersions (cognitive 29) langfuse/packages/shared/scripts/seeder/seed-dataset-versions.ts:26 — seed-dataset-versions.seedDatasetVersions has cognitive complexity 29 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 6 (13 pts) (nesting depth added 16). Of this number, 25 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · useLogViewAllObservationsIO.useLogViewAllObservationsIO.loadAllData (cognitive 29) · ×1
  • useLogViewAllObservationsIO.useLogViewAllObservationsIO.loadAllData (cognitive 29) langfuse/web/src/components/trace2/components/TraceLogView/useLogViewAllObservationsIO.ts:138 — useLogViewAllObservationsIO.useLogViewAllObservationsIO.loadAllData has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 6, error handling 2 (3 pts), loops 2 (nesting depth added 11). Of this number, 18 points are the body's own statements and 11 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 · useLogViewDownload.useLogViewDownload.handleCopyJson (cognitive 29) · ×1
  • useLogViewDownload.useLogViewDownload.handleCopyJson (cognitive 29) langfuse/web/src/components/trace2/components/TraceLogView/useLogViewDownload.ts:73 — useLogViewDownload.useLogViewDownload.handleCopyJson has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 4 (16 pts), if/else 8 (13 pts) (nesting depth added 17). 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. This shape REPEATS in the file: one other method here (useLogViewDownload.useLogViewDownload.handleDownloadJson) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · useLogViewDownload.useLogViewDownload.handleDownloadJson (cognitive 29) · ×1
  • useLogViewDownload.useLogViewDownload.handleDownloadJson (cognitive 29) langfuse/web/src/components/trace2/components/TraceLogView/useLogViewDownload.ts:122 — useLogViewDownload.useLogViewDownload.handleDownloadJson has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 4 (16 pts), if/else 8 (13 pts) (nesting depth added 17). 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. This shape REPEATS in the file: one other method here (useLogViewDownload.useLogViewDownload.handleCopyJson) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · PrettyJsonView.JsonPrettyTable (cognitive 29) · ×1
  • PrettyJsonView.JsonPrettyTable (cognitive 29) langfuse/web/src/components/ui/PrettyJsonView.tsx:417 — PrettyJsonView.JsonPrettyTable has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 9, ternaries 7 (nesting depth added 3). Most of this is not in the body itself: 1 of the 29 points is its own statement and the rest belongs to 10 function literals inside it that branch (lines 475, 609, 453, …). 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 · router.inferErrorTypeKeyFromText (cognitive 29) · ×1
  • router.inferErrorTypeKeyFromText (cognitive 29) langfuse/web/src/features/error-analysis/server/router.ts:393 — router.inferErrorTypeKeyFromText has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 17, if/else 12. 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.
D2 · Cognitive Complexity · chatCompletionHandler.chatCompletionHandler (cognitive 29) · ×1
  • chatCompletionHandler.chatCompletionHandler (cognitive 29) REDACTED:29 — chatCompletionHandler.chatCompletionHandler has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 8, loops 1 (3 pts), error handling 1 (nesting depth added 8). Most of this is not in the body itself: 8 of the 29 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 102, 47, 108). 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 · ApiAuthService.verifyAuthHeaderAndReturnScope (cognitive 29) · ×1
  • ApiAuthService.verifyAuthHeaderAndReturnScope (cognitive 29) langfuse/web/src/features/public-api/server/apiAuth.ts:86 — ApiAuthService.verifyAuthHeaderAndReturnScope has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1 (nesting depth added 14). None of this is in the body itself: all 29 points belong to one function literal inside it that branches (line 91). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · UpsertScoreConfigDialog.UpsertScoreConfigDialog (cognitive 29) · ×1
  • UpsertScoreConfigDialog.UpsertScoreConfigDialog (cognitive 29) langfuse/web/src/features/score-configs/components/UpsertScoreConfigDialog.tsx:50 — UpsertScoreConfigDialog.UpsertScoreConfigDialog has cognitive complexity 29 (threshold 15). Drivers by points: ternaries 9 (13 pts), if/else 8 (9 pts), boolean chains 7 (nesting depth added 5). Most of this is not in the body itself: 7 of the 29 points are its own statements and the rest belongs to 6 function items inside it that branch (onSubmit, a function literal at line 194, a function literal at line 290, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · handleCloudSpendAlertJob.handleCloudSpendAlertJob (cognitive 29) · ×1
  • handleCloudSpendAlertJob.handleCloudSpendAlertJob (cognitive 29) langfuse/worker/src/ee/cloudSpendAlerts/handleCloudSpendAlertJob.ts:11 — handleCloudSpendAlertJob.handleCloudSpendAlertJob has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (19 pts), error handling 2 (6 pts), boolean chains 2, loops 1, ternaries 1 (nesting depth added 11). Of this number, 28 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 · autoErrorAnalysisQueue.inferErrorTypeKeyFromText (cognitive 29) · ×1
  • autoErrorAnalysisQueue.inferErrorTypeKeyFromText (cognitive 29) langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:182 — autoErrorAnalysisQueue.inferErrorTypeKeyFromText has cognitive complexity 29 (threshold 15). Drivers by points: boolean chains 17, if/else 12. 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.
D2 · Cognitive Complexity · litellm_callback._strip_and_record_reference_tool_ids_from_message (cognitive 29) · ×1
  • litellm_callback._strip_and_record_reference_tool_ids_from_message (cognitive 29) REDACTED:5462 — litellm_callback._strip_and_record_reference_tool_ids_from_message has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 3, ternaries 1 (2 pts), loops 1 (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 · events.getObservationsFromEventsTableInternal (cognitive 28) · ×1
  • events.getObservationsFromEventsTableInternal (cognitive 28) langfuse/packages/shared/src/server/repositories/events.ts:405 — events.getObservationsFromEventsTableInternal has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 4 (9 pts), boolean chains 5 (nesting depth added 10). Of this number, 24 points are the body's own statements and 4 belong to 3 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 · dataset-items.buildPrismaWhereFromFilterState (cognitive 28) · ×1
  • dataset-items.buildPrismaWhereFromFilterState (cognitive 28) langfuse/packages/shared/src/server/repositories/dataset-items.ts:884 — dataset-items.buildPrismaWhereFromFilterState has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 13). 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 · redirectHandler.fetchWithSecureRedirects (cognitive 28) · ×1
  • redirectHandler.fetchWithSecureRedirects (cognitive 28) langfuse/packages/shared/src/server/webhooks/redirectHandler.ts:90 — redirectHandler.fetchWithSecureRedirects has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 3 (11 pts), if/else 5 (10 pts), error handling 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 16). 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 · openai.preprocessData (cognitive 28) · ×1
  • openai.preprocessData (cognitive 28) langfuse/packages/shared/src/utils/chatml/adapters/openai.ts:288 — openai.preprocessData has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 10, ternaries 1 (2 pts) (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 · AdvancedJsonViewer.AdvancedJsonViewer (cognitive 28) · ×1
  • AdvancedJsonViewer.AdvancedJsonViewer (cognitive 28) langfuse/web/src/components/ui/AdvancedJsonViewer/AdvancedJsonViewer.tsx:32 — AdvancedJsonViewer.AdvancedJsonViewer has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 7, ternaries 6 (7 pts) (nesting depth added 2). Of this number, 14 points are the body's own statements and 14 belong to 5 function literals inside it that branch. 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 · slider.Slider (cognitive 28) · ×1
  • slider.Slider (cognitive 28) langfuse/web/src/components/ui/slider.tsx:21 — slider.Slider has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 6, ternaries 3 (nesting depth added 7). Most of this is not in the body itself: 4 of the 28 points are its own statements and the rest belongs to 4 function items inside it that branch (handleInputBlur, a function literal at line 28, handleKeyDown, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · EvaluatorSelectionStep.EvaluatorSelectionStep (cognitive 28) · ×1
  • EvaluatorSelectionStep.EvaluatorSelectionStep (cognitive 28) langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/EvaluatorSelectionStep.tsx:31 — EvaluatorSelectionStep.EvaluatorSelectionStep has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 8 (24 pts), if/else 3, boolean chains 1 (nesting depth added 16). Of this number, 18 points are the body's own statements and 10 belong to 4 function items inside it that branch. 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 · CommentDrawerButton.CommentDrawerButton (cognitive 28) · ×1
  • CommentDrawerButton.CommentDrawerButton (cognitive 28) langfuse/web/src/features/comments/CommentDrawerButton.tsx:20 — CommentDrawerButton.CommentDrawerButton has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (12 pts), ternaries 5 (9 pts), boolean chains 7 (nesting depth added 7). Most of this is not in the body itself: 12 of the 28 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 65, 130, 190, …). 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 · DatasetActionButton.DatasetActionButton (cognitive 28) · ×1
  • DatasetActionButton.DatasetActionButton (cognitive 28) langfuse/web/src/features/datasets/components/DatasetActionButton.tsx:55 — DatasetActionButton.DatasetActionButton has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 10 (20 pts), boolean chains 8 (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 · useCsvMapping.useCsvMapping (cognitive 28) · ×1
  • useCsvMapping.useCsvMapping (cognitive 28) langfuse/web/src/features/datasets/hooks/useCsvMapping.ts:36 — useCsvMapping.useCsvMapping has cognitive complexity 28 (threshold 15). Drivers by points: ternaries 10 (20 pts), boolean chains 6, if/else 2 (nesting depth added 10). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 60, 84, 49). 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 · template-selector.TemplateSelector (cognitive 28) · ×1
  • template-selector.TemplateSelector (cognitive 28) langfuse/web/src/features/evals/components/template-selector.tsx:56 — template-selector.TemplateSelector has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 20, if/else 6, ternaries 2. Of this number, 19 points are the body's own statements and 9 belong to 7 function items inside it that branch. 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.
D2 · Cognitive Complexity · useExtractVariables.useExtractVariables (cognitive 28) · ×1
  • useExtractVariables.useExtractVariables (cognitive 28) langfuse/web/src/features/evals/hooks/useExtractVariables.ts:26 — useExtractVariables.useExtractVariables has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (17 pts), error handling 1 (4 pts), ternaries 3 (4 pts), boolean chains 3 (nesting depth added 7). Most of this is not in the body itself: 2 of the 28 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 103, 62, 56, …). 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 · filter-query-encoding.decodeFiltersGeneric (cognitive 28) · ×1
  • filter-query-encoding.decodeFiltersGeneric (cognitive 28) langfuse/web/src/features/filters/lib/filter-query-encoding.ts:117 — filter-query-encoding.decodeFiltersGeneric has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 8). 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 · [modelId].ModelDetailPage (cognitive 28) · ×1
  • [modelId].ModelDetailPage (cognitive 28) langfuse/web/src/pages/project/[projectId]/settings/models/[modelId].tsx:42 — [modelId].ModelDetailPage has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 13, if/else 7 (8 pts), ternaries 4 (7 pts) (nesting depth added 4). Of this number, 18 points are the body's own statements and 10 belong to 3 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 · autoErrorAnalysisQueue.extractFirstJsonObject (cognitive 28) · ×1
  • autoErrorAnalysisQueue.extractFirstJsonObject (cognitive 28) langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:340 — autoErrorAnalysisQueue.extractFirstJsonObject has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (26 pts), boolean chains 1, loops 1 (nesting depth added 16). 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 · AlignmentSentinelPolicy.check (cognitive 28) · ×1
  • AlignmentSentinelPolicy.check (cognitive 28) ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_sentinel_policy.py:321 — AlignmentSentinelPolicy.check has cognitive complexity 28 (threshold 15). Drivers by points: boolean chains 9, if/else 7 (8 pts), error handling 4 (5 pts), ternaries 5, loops 1 (nesting depth added 2). 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 · alignment_sentinel_policy._extract_user_objective (cognitive 28) · ×1
  • alignment_sentinel_policy._extract_user_objective (cognitive 28) ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_sentinel_policy.py:156 — alignment_sentinel_policy._extract_user_objective has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 11). 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 · policy_rule_ir._validate_required_metadata (cognitive 28) · ×1
  • policy_rule_ir._validate_required_metadata (cognitive 28) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:414 — policy_rule_ir._validate_required_metadata has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 3, loops 1 (nesting depth added 11). 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 · run_cases.main (cognitive 28) · ×1
  • run_cases.main (cognitive 28) REDACTED:615 — run_cases.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 6, loops 2, ternaries 2 (nesting depth added 4). 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 · processEventBatch.processEventBatch (cognitive 27) · ×1
  • processEventBatch.processEventBatch (cognitive 27) langfuse/packages/shared/src/server/ingestion/processEventBatch.ts:104 — processEventBatch.processEventBatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (16 pts), ternaries 3 (6 pts), boolean chains 5 (nesting depth added 4). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 156, 282, 243, …). 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 · extractToolsBackend.extractToolsFromRawInput (cognitive 27) · ×1
  • extractToolsBackend.extractToolsFromRawInput (cognitive 27) langfuse/packages/shared/src/server/ingestion/extractToolsBackend.ts:135 — extractToolsBackend.extractToolsFromRawInput has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (9 pts), boolean chains 3, ternaries 1 (nesting depth added 14). 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 · gemini.extractFromParts (cognitive 27) · ×1
  • gemini.extractFromParts (cognitive 27) langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:82 — gemini.extractFromParts has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 6, ternaries 2 (6 pts), loops 1 (nesting depth added 11). 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 · TimelineBar.TimelineBar (cognitive 27) · ×1
  • TimelineBar.TimelineBar (cognitive 27) langfuse/web/src/components/trace2/components/TraceTimeline/TimelineBar.tsx:16 — TimelineBar.TimelineBar has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 13, ternaries 9 (13 pts), if/else 1 (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 · TracePage.TracePage (cognitive 27) · ×1
  • TracePage.TracePage (cognitive 27) langfuse/web/src/components/trace2/TracePage.tsx:26 — TracePage.TracePage has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 8, if/else 7 (nesting depth added 1). Of this number, 19 points are the body's own statements and 8 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 · stripeWebhookHandler.handleSubscriptionChanged (cognitive 27) · ×1
  • stripeWebhookHandler.handleSubscriptionChanged (cognitive 27) REDACTED:376 — stripeWebhookHandler.handleSubscriptionChanged has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 10, ternaries 3 (nesting depth added 1). 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, 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 · WebhookActionHandler.validateFormData (cognitive 27) · ×1
  • WebhookActionHandler.validateFormData (cognitive 27) langfuse/web/src/features/automations/components/actions/WebhookActionHandler.tsx:103 — WebhookActionHandler.validateFormData has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (18 pts), ternaries 2 (5 pts), boolean chains 4 (nesting depth added 13). Most of this is not in the body itself: 5 of the 27 points are its own statements and the rest belongs to one function literal inside it that branches (line 117). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · multi-select.MultiSelect (cognitive 27) · ×1
  • multi-select.MultiSelect (cognitive 27) langfuse/web/src/features/filters/components/multi-select.tsx:36 — multi-select.MultiSelect has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 12, ternaries 7 (8 pts), if/else 7 (nesting depth added 1). Most of this is not in the body itself: 9 of the 27 points are its own statements and the rest belongs to 10 function items inside it that branch (a function literal at line 220, a function literal at line 88, handleDebouncedChange, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · useSidebarFilterState.useSidebarFilterState (cognitive 27) · ×1
  • useSidebarFilterState.useSidebarFilterState (cognitive 27) langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:313 — useSidebarFilterState.useSidebarFilterState has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 3 (6 pts), boolean chains 4 (nesting depth added 10). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 442, 462, 471). 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 · PolicyGuideCard.summarizeSection (cognitive 27) · ×1
  • PolicyGuideCard.summarizeSection (cognitive 27) langfuse/web/src/features/policy-governance/components/PolicyGuideCard.tsx:139 — PolicyGuideCard.summarizeSection has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (22 pts), boolean chains 3, if/else 1, match/switch 1 (nesting depth added 11). 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 · QueryBuilder.validateFilters (cognitive 27) · ×1
  • QueryBuilder.validateFilters (cognitive 27) langfuse/web/src/features/query/server/queryBuilder.ts:139 — QueryBuilder.validateFilters has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), boolean chains 3, loops 1 (nesting depth added 15). 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 · metrics.PromptVersionTable (cognitive 27) · ×1
  • metrics.PromptVersionTable (cognitive 27) langfuse/web/src/pages/project/[projectId]/prompts/metrics.tsx:82 — metrics.PromptVersionTable has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (15 pts), if/else 7, boolean chains 5 (nesting depth added 1). Most of this is not in the body itself: 8 of the 27 points are its own statements and the rest belongs to 11 function literals inside it that branch (lines 262, 196, 216, …). 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 · analytics.ScoresAnalyticsV2Page (cognitive 27) · ×1
  • analytics.ScoresAnalyticsV2Page (cognitive 27) langfuse/web/src/pages/project/[projectId]/scores/analytics.tsx:38 — analytics.ScoresAnalyticsV2Page has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12, ternaries 4 (10 pts), boolean chains 5 (nesting depth added 6). Most of this is not in the body itself: 13 of the 27 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 104, 120, 131, …). 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 · users.UsersTable (cognitive 27) · ×1
  • users.UsersTable (cognitive 27) langfuse/web/src/pages/project/[projectId]/users.tsx:128 — users.UsersTable has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 14 (17 pts), if/else 6, boolean chains 3, match/switch 1 (nesting depth added 3). Most of this is not in the body itself: 10 of the 27 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 396, 415, 435, …). 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.getAuthOptions (cognitive 27) · ×1
  • auth.getAuthOptions (cognitive 27) REDACTED:597 — auth.getAuthOptions has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (18 pts), boolean chains 4, ternaries 3 (4 pts), error handling 1 (nesting depth added 6). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 741, 614, 876). 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 · langfuse_replay._emit_response_nodes_from_pair (cognitive 27) · ×1
  • langfuse_replay._emit_response_nodes_from_pair (cognitive 27) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:543 — langfuse_replay._emit_response_nodes_from_pair has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 6, if/else 5, loops 1 (2 pts) (nesting depth added 8). 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 · litellm_callback._extract_tool_call_details_by_call_id (cognitive 27) · ×1
  • litellm_callback._extract_tool_call_details_by_call_id (cognitive 27) REDACTED:3360 — litellm_callback._extract_tool_call_details_by_call_id has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 4 (12 pts), if/else 4 (10 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 15). 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 · AllowDenyPolicy.check (cognitive 27) · ×1
  • AllowDenyPolicy.check (cognitive 27) ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:64 — AllowDenyPolicy.check has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 3 (7 pts), boolean chains 4, loops 1 (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 · rate_limit_policy._policy_enabled (cognitive 27) · ×1
  • rate_limit_policy._policy_enabled (cognitive 27) ArbiterOS-Kernel/arbiteros_kernel/policy/rate_limit_policy.py:23 — rate_limit_policy._policy_enabled has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (11 pts), error handling 2 (7 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 14). 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 · unary_gate_policy._load_rule_bundle (cognitive 27) · ×1
  • unary_gate_policy._load_rule_bundle (cognitive 27) REDACTED:1370 — unary_gate_policy._load_rule_bundle has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 17). 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 · protocol_adapter.extract_text_from_responses_input (cognitive 27) · ×1
  • protocol_adapter.extract_text_from_responses_input (cognitive 27) ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:60 — protocol_adapter.extract_text_from_responses_input has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 14). 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 · protocol_adapter.inject_system_hint_into_request (cognitive 27) · ×1
  • protocol_adapter.inject_system_hint_into_request (cognitive 27) ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py:89 — protocol_adapter.inject_system_hint_into_request has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 2 (4 pts) (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 · warm_skill_trust.main (cognitive 27) · ×1
  • warm_skill_trust.main (cognitive 27) ArbiterOS-Kernel/arbiteros_kernel/warm_skill_trust.py:13 — warm_skill_trust.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (16 pts), ternaries 2 (6 pts), loops 2 (4 pts), error handling 1 (nesting depth added 11). 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 · OtelIngestionProcessor.processToEvent (cognitive 26) · ×1
  • OtelIngestionProcessor.processToEvent (cognitive 26) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:192 — OtelIngestionProcessor.processToEvent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (11 pts), ternaries 3 (9 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (nesting depth added 13). None of this is in the body itself: all 26 points belong to 2 function literals inside it that branch (lines 211, 193). 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 · microsoft-agent.extractFromParts (cognitive 26) · ×1
  • microsoft-agent.extractFromParts (cognitive 26) langfuse/packages/shared/src/utils/chatml/adapters/microsoft-agent.ts:37 — microsoft-agent.extractFromParts has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 6, ternaries 1 (3 pts), loops 1 (nesting depth added 10). Of this number, 24 points are the body's own statements and 2 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 · BillingService.changePlan (cognitive 26) · ×1
  • BillingService.changePlan (cognitive 26) REDACTED:779 — BillingService.changePlan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13, ternaries 7 (11 pts), boolean chains 2 (nesting depth added 4). None of this is in the body itself: all 26 points belong to 3 function literals inside it that branch (lines 782, 1076, 1036). 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 · useCsvImport.useCsvImport.execute (cognitive 26) · ×1
  • useCsvImport.useCsvImport.execute (cognitive 26) langfuse/web/src/features/datasets/hooks/useCsvImport.ts:82 — useCsvImport.useCsvImport.execute has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 5 (6 pts), boolean chains 3, error handling 2, loops 1 (nesting depth added 4). Of this number, 16 points are the body's own statements and 10 belong to 2 function literals inside it that branch. 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 · PolicyGuideCard.PolicyGuideCard (cognitive 26) · ×1
  • PolicyGuideCard.PolicyGuideCard (cognitive 26) langfuse/web/src/features/policy-governance/components/PolicyGuideCard.tsx:245 — PolicyGuideCard.PolicyGuideCard has cognitive complexity 26 (threshold 15). Drivers by points: ternaries 16 (22 pts), boolean chains 4 (nesting depth added 6). Of this number, 15 points are the body's own statements and 11 belong to 3 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 · prompt-content-utils.renderRichPromptContent (cognitive 26) · ×1
  • prompt-content-utils.renderRichPromptContent (cognitive 26) langfuse/web/src/features/prompts/components/prompt-content-utils.tsx:75 — prompt-content-utils.renderRichPromptContent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 1 (4 pts), boolean chains 2, loops 1 (nesting depth added 12). Of this number, 22 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 · Heatmap.Heatmap (cognitive 26) · ×1
  • Heatmap.Heatmap (cognitive 26) langfuse/web/src/features/score-analytics/components/charts/Heatmap.tsx:50 — Heatmap.Heatmap has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 17, if/else 7, ternaries 2. Of this number, 14 points are the body's own statements and 12 belong to 6 function literals inside it that branch. 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.
D2 · Cognitive Complexity · multi-select-key-values.MultiSelectKeyValues (cognitive 26) · ×1
  • multi-select-key-values.MultiSelectKeyValues (cognitive 26) langfuse/web/src/features/scores/components/multi-select-key-values.tsx:59 — multi-select-key-values.MultiSelectKeyValues has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 16, if/else 6, ternaries 4. Most of this is not in the body itself: 9 of the 26 points are its own statements and the rest belongs to 9 function items inside it that branch (formatFilterValues, a function literal at line 122, renderOption, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · litellm_callback._append_bootstrap_scan_notice_if_needed (cognitive 26) · ×1
  • litellm_callback._append_bootstrap_scan_notice_if_needed (cognitive 26) REDACTED:1218 — litellm_callback._append_bootstrap_scan_notice_if_needed has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (nesting depth added 5). 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 · litellm_callback._load_trace_state_snapshot_from_disk (cognitive 26) · ×1
  • litellm_callback._load_trace_state_snapshot_from_disk (cognitive 26) REDACTED:1401 — litellm_callback._load_trace_state_snapshot_from_disk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), boolean chains 3, error handling 3, ternaries 2 (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 · litellm_callback._get_instruction_builder_for_trace (cognitive 26) · ×1
  • litellm_callback._get_instruction_builder_for_trace (cognitive 26) REDACTED:4728 — litellm_callback._get_instruction_builder_for_trace has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (3 pts) (nesting depth added 14). 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 · openclaw_policy._get_ping_pong (cognitive 26) · ×1
  • openclaw_policy._get_ping_pong (cognitive 26) ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:394 — openclaw_policy._get_ping_pong has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3, boolean chains 2, ternaries 1 (2 pts) (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 · taint_policy._get_taint_policy_config (cognitive 26) · ×1
  • taint_policy._get_taint_policy_config (cognitive 26) ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:53 — taint_policy._get_taint_policy_config has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (12 pts), ternaries 2 (8 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 11). 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 · policy_check.check_response_policy (cognitive 26) · ×1
  • policy_check.check_response_policy (cognitive 26) ArbiterOS-Kernel/arbiteros_kernel/policy_check.py:313 — policy_check.check_response_policy has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (18 pts), ternaries 3 (4 pts), boolean chains 3, loops 1 (nesting depth added 8). 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 · key-value-filter-builder.KeyValueFilterBuilder (cognitive 25) · ×1
  • key-value-filter-builder.KeyValueFilterBuilder (cognitive 25) langfuse/web/src/components/table/key-value-filter-builder.tsx:72 — key-value-filter-builder.KeyValueFilterBuilder has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 9, boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 8 function items inside it that branch (a function literal at line 185, handleFilterChange, handleAddFilter, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · treeExpansion.applyExpansionState (cognitive 25) · ×1
  • treeExpansion.applyExpansionState (cognitive 25) langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeExpansion.ts:266 — treeExpansion.applyExpansionState has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (20 pts), loops 3 (5 pts) (nesting depth added 5). Most of this is not in the body itself: 11 of the 25 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 322, 281, 293). 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 · combobox.Combobox (cognitive 25) · ×1
  • combobox.Combobox (cognitive 25) langfuse/web/src/components/ui/combobox.tsx:83 — combobox.Combobox has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 4 (8 pts), boolean chains 5, loops 1 (2 pts) (nesting depth added 9). Most of this is not in the body itself: 3 of the 25 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 96, 139, 175, …). 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 · BillingService.applyPromotionCode (cognitive 25) · ×1
  • BillingService.applyPromotionCode (cognitive 25) REDACTED:1909 — BillingService.applyPromotionCode has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 9, ternaries 2 (4 pts), error handling 1 (nesting depth added 3). None of this is in the body itself: all 25 points belong to 3 function literals inside it that branch (lines 1912, 1972, 1955). 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 · eval-templates-table.EvalsTemplateTable (cognitive 25) · ×1
  • eval-templates-table.EvalsTemplateTable (cognitive 25) langfuse/web/src/features/evals/components/eval-templates-table.tsx:51 — eval-templates-table.EvalsTemplateTable has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (12 pts), ternaries 8 (9 pts), boolean chains 4 (nesting depth added 3). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 14 function literals inside it that branch (lines 217, 435, 467, …). 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 · OnboardingSurvey.OnboardingSurvey (cognitive 25) · ×1
  • OnboardingSurvey.OnboardingSurvey (cognitive 25) langfuse/web/src/features/onboarding/components/OnboardingSurvey.tsx:14 — OnboardingSurvey.OnboardingSurvey has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 7, ternaries 5 (6 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 39, isEmpty, handleSkipButton, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · SupportFormSection.SupportFormSection (cognitive 25) · ×1
  • SupportFormSection.SupportFormSection (cognitive 25) langfuse/web/src/features/support-chat/SupportFormSection.tsx:151 — SupportFormSection.SupportFormSection has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 9, ternaries 7 (9 pts), if/else 5 (6 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 6 function items inside it that branch (onSubmit, a function literal at line 469, a function literal at line 206, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · fill-time-series-gaps.aggregateCategoricalIntoMultiUnitBuckets (cognitive 25) · ×1
  • fill-time-series-gaps.aggregateCategoricalIntoMultiUnitBuckets (cognitive 25) langfuse/web/src/utils/fill-time-series-gaps.ts:471 — fill-time-series-gaps.aggregateCategoricalIntoMultiUnitBuckets has cognitive complexity 25 (threshold 15). Drivers by points: loops 9 (15 pts), if/else 3 (6 pts), boolean chains 2, match/switch 2 (nesting depth added 9). Of this number, 23 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · getDatabaseReadStream.getDatabaseReadStreamPaginated (cognitive 25) · ×1
  • getDatabaseReadStream.getDatabaseReadStreamPaginated (cognitive 25) langfuse/worker/src/features/database-read-stream/getDatabaseReadStream.ts:99 — getDatabaseReadStream.getDatabaseReadStreamPaginated has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 11 (23 pts), boolean chains 1, match/switch 1 (nesting depth added 12). Most of this is not in the body itself: 1 of the 25 points is its own statement and the rest belongs to 8 function literals inside it that branch (lines 536, 277, 352, …). 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 · webhooks.executeHttpAction (cognitive 25) · ×1
  • webhooks.executeHttpAction (cognitive 25) langfuse/worker/src/queues/webhooks.ts:108 — webhooks.executeHttpAction has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 5, ternaries 2 (4 pts), error handling 2 (nesting depth added 8). Most of this is not in the body itself: 8 of the 25 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 135, 245). 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 · skill_trust._load_cache_from_disk (cognitive 25) · ×1
  • skill_trust._load_cache_from_disk (cognitive 25) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/helpers/skill_trust.py:69 — skill_trust._load_cache_from_disk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), error handling 2 (4 pts), loops 1 (3 pts), boolean chains 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 · litellm_callback._resolve_upstream_compat_flags (cognitive 25) · ×1
  • litellm_callback._resolve_upstream_compat_flags (cognitive 25) REDACTED:591 — litellm_callback._resolve_upstream_compat_flags has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 3 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 11). 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 · openclaw_policy._build_history (cognitive 25) · ×1
  • openclaw_policy._build_history (cognitive 25) ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:310 — openclaw_policy._build_history has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, ternaries 1 (3 pts), loops 1 (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 · policy_rule_ir._validate_required_metadata_rule_refs (cognitive 25) · ×1
  • policy_rule_ir._validate_required_metadata_rule_refs (cognitive 25) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:477 — policy_rule_ir._validate_required_metadata_rule_refs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (5 pts), ternaries 1 (3 pts), boolean chains 1 (nesting depth added 13). 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 · policy_rule_ir._validate_selector_like (cognitive 25) · ×1
  • policy_rule_ir._validate_selector_like (cognitive 25) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:591 — policy_rule_ir._validate_selector_like has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 5, loops 1 (nesting depth added 8). 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 · PolicyEngine._check_static_allowdeny (cognitive 25) · ×1
  • PolicyEngine._check_static_allowdeny (cognitive 25) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1504 — PolicyEngine._check_static_allowdeny has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (9 pts), ternaries 2 (nesting depth added 2). 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.
D2 · Cognitive Complexity · PolicyEngine._check_path_and_budget (cognitive 25) · ×1
  • PolicyEngine._check_path_and_budget (cognitive 25) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1646 — PolicyEngine._check_path_and_budget has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 8, loops 3 (5 pts) (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 · KernelPolicyRuntime.check_allow_deny (cognitive 25) · ×1
  • KernelPolicyRuntime.check_allow_deny (cognitive 25) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:618 — KernelPolicyRuntime.check_allow_deny has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 14, if/else 7 (9 pts), ternaries 2 (nesting depth added 2). 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.
D2 · Cognitive Complexity · KernelPolicyRuntime.check_tool_call_budget (cognitive 25) · ×1
  • KernelPolicyRuntime.check_tool_call_budget (cognitive 25) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:1307 — KernelPolicyRuntime.check_tool_call_budget has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 6, error handling 1 (3 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 8). 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 · run_cases.extract_raw_log_focus (cognitive 25) · ×1
  • run_cases.extract_raw_log_focus (cognitive 25) REDACTED:335 — run_cases.extract_raw_log_focus has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 6 (7 pts), boolean chains 4, ternaries 1 (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 · JSONTableView.JSONTableView (cognitive 24) · ×1
  • JSONTableView.JSONTableView (cognitive 24) langfuse/web/src/components/trace2/components/_shared/JSONTableView/JSONTableView.tsx:26 — JSONTableView.JSONTableView has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, ternaries 5, loops 1 (nesting depth added 1). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 119, 144, 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 · BillingInvoiceTable.BillingInvoiceTable (cognitive 24) · ×1
  • BillingInvoiceTable.BillingInvoiceTable (cognitive 24) langfuse/web/src/ee/features/billing/components/BillingInvoiceTable.tsx:31 — BillingInvoiceTable.BillingInvoiceTable has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, ternaries 5 (6 pts), boolean chains 5 (nesting depth added 1). Most of this is not in the body itself: 3 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (onPaginationChange, a function literal at line 133, a function literal at line 77, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · CreateOrEditAnnotationQueueButton.CreateOrEditAnnotationQueueButton (cognitive 24) · ×1
  • CreateOrEditAnnotationQueueButton.CreateOrEditAnnotationQueueButton (cognitive 24) langfuse/web/src/features/annotation-queues/components/CreateOrEditAnnotationQueueButton.tsx:51 — CreateOrEditAnnotationQueueButton.CreateOrEditAnnotationQueueButton has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 7, ternaries 3, error handling 1. Most of this is not in the body itself: 10 of the 24 points are its own statements and the rest belongs to 7 function items inside it that branch (onSubmit, a function literal at line 85, a function literal at line 131, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · PivotTable.PivotTable (cognitive 24) · ×1
  • PivotTable.PivotTable (cognitive 24) langfuse/web/src/features/widgets/chart-library/PivotTable.tsx:237 — PivotTable.PivotTable has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 8, error handling 2, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 24 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 260, 346, 246, …). 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 · sign-in.getServerSideProps (cognitive 24) · ×1
  • sign-in.getServerSideProps (cognitive 24) langfuse/web/src/pages/auth/sign-in.tsx:96 — sign-in.getServerSideProps has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 14, ternaries 6 (10 pts) (nesting depth added 4). 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.
D2 · Cognitive Complexity · playgroundConverter.convertChatMlToPlayground (cognitive 24) · ×1
  • playgroundConverter.convertChatMlToPlayground (cognitive 24) langfuse/web/src/utils/chatml/playgroundConverter.ts:52 — playgroundConverter.convertChatMlToPlayground has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 10, error handling 2 (6 pts), if/else 5 (6 pts), ternaries 1 (2 pts) (nesting depth added 6). Of this number, 12 points are the body's own statements and 12 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 · handleBatchExportJob.handleBatchExportJob (cognitive 24) · ×1
  • handleBatchExportJob.handleBatchExportJob (cognitive 24) langfuse/worker/src/features/batchExport/handleBatchExportJob.ts:34 — handleBatchExportJob.handleBatchExportJob has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (17 pts), ternaries 3 (6 pts), boolean chains 1 (nesting depth added 4). Of this number, 22 points are the body's own statements and 2 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 · IngestionService.mapObservationEventsToRecords (cognitive 24) · ×1
  • IngestionService.mapObservationEventsToRecords (cognitive 24) langfuse/worker/src/services/IngestionService/index.ts:1795 — IngestionService.mapObservationEventsToRecords has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 9 (10 pts), boolean chains 4 (nesting depth added 4). None of this is in the body itself: all 24 points belong to one function literal inside it that branches (line 1803). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · litellm_callback._ensure_trace_state (cognitive 24) · ×1
  • litellm_callback._ensure_trace_state (cognitive 24) REDACTED:2277 — litellm_callback._ensure_trace_state has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, ternaries 1 (2 pts) (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 · litellm_callback._normalize_topic_summary (cognitive 24) · ×1
  • litellm_callback._normalize_topic_summary (cognitive 24) REDACTED:2654 — litellm_callback._normalize_topic_summary has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (4 pts), boolean chains 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 · delete_policy._get_delete_policy_config (cognitive 24) · ×1
  • delete_policy._get_delete_policy_config (cognitive 24) ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:49 — delete_policy._get_delete_policy_config has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 7, loops 1 (2 pts) (nesting depth added 8). 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 · direct_metadata._path_values (cognitive 24) · ×1
  • direct_metadata._path_values (cognitive 24) ArbiterOS-Kernel/arbiteros_kernel/policy/direct_metadata.py:53 — direct_metadata._path_values has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 11). 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 · exec_composite_policy._humanize_review_reason (cognitive 24) · ×1
  • exec_composite_policy._humanize_review_reason (cognitive 24) ArbiterOS-Kernel/arbiteros_kernel/policy/exec_composite_policy.py:213 — exec_composite_policy._humanize_review_reason has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13, ternaries 5 (10 pts), boolean chains 1 (nesting depth added 5). 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 · user_approval.apply_user_approval_preprocessing (cognitive 24) · ×1
  • user_approval.apply_user_approval_preprocessing (cognitive 24) ArbiterOS-Kernel/arbiteros_kernel/user_approval.py:79 — user_approval.apply_user_approval_preprocessing has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 11). 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 · dataset-items.createManyDatasetItems (cognitive 23) · ×1
  • dataset-items.createManyDatasetItems (cognitive 23) langfuse/packages/shared/src/server/repositories/dataset-items.ts:508 — dataset-items.createManyDatasetItems has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). Of this number, 22 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 · langgraph.normalizeMessage (cognitive 23) · ×1
  • langgraph.normalizeMessage (cognitive 23) langfuse/packages/shared/src/utils/chatml/adapters/langgraph.ts:101 — langgraph.normalizeMessage has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 8 (nesting depth added 5). Of this number, 22 points are the body's own statements and 1 belongs 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 · VersionLabel.VersionLabel (cognitive 23) · ×1
  • VersionLabel.VersionLabel (cognitive 23) langfuse/web/src/components/VersionLabel.tsx:29 — VersionLabel.VersionLabel has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (13 pts), boolean chains 10 (nesting depth added 5). 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 · data-table-ai-filters.DataTableAIFilters (cognitive 23) · ×1
  • data-table-ai-filters.DataTableAIFilters (cognitive 23) langfuse/web/src/components/table/data-table-ai-filters.tsx:21 — data-table-ai-filters.DataTableAIFilters has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, ternaries 2 (4 pts), error handling 1 (2 pts) (nesting depth added 6). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (handleAiFilterSubmit, a function literal at line 127, a function literal at line 120). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · data-table-toolbar.DataTableToolbar (cognitive 23) · ×1
  • data-table-toolbar.DataTableToolbar (cognitive 23) langfuse/web/src/components/table/data-table-toolbar.tsx:133 — data-table-toolbar.DataTableToolbar has cognitive complexity 23 (threshold 15). Drivers by points: boolean chains 17, ternaries 3 (6 pts) (nesting depth added 3). 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.
D2 · Cognitive Complexity · helpers.buildTraceUiData (cognitive 23) · ×1
  • helpers.buildTraceUiData (cognitive 23) langfuse/web/src/components/trace2/lib/helpers.ts:380 — helpers.buildTraceUiData has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 7 (10 pts), boolean chains 3 (nesting depth added 6). Most of this is not in the body itself: 2 of the 23 points are its own statements and the rest belongs to 4 function items inside it that branch (calculateTreeNodeTotalCost, a function literal at line 431, a function literal at line 448, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · time-picker-input.TimePickerInput (cognitive 23) · ×1
  • time-picker-input.TimePickerInput (cognitive 23) langfuse/web/src/components/ui/time-picker-input.tsx:27 — time-picker-input.TimePickerInput has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, ternaries 2 (3 pts) (nesting depth added 5). Most of this is not in the body itself: 3 of the 23 points are its own statements and the rest belongs to 3 function items inside it that branch (handleKeyDown, calculateNewValue, a function literal at line 53). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · githubDispatchHelpers.processGitHubDispatchActionConfig (cognitive 23) · ×1
  • githubDispatchHelpers.processGitHubDispatchActionConfig (cognitive 23) langfuse/web/src/features/automations/server/githubDispatchHelpers.ts:21 — githubDispatchHelpers.processGitHubDispatchActionConfig has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4, ternaries 3 (4 pts), error handling 1 (nesting depth added 2). 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 · usePreviewData.usePreviewData (cognitive 23) · ×1
  • usePreviewData.usePreviewData (cognitive 23) langfuse/web/src/features/evals/hooks/usePreviewData.ts:38 — usePreviewData.usePreviewData has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (14 pts), boolean chains 9 (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 · prompts-table.PromptTable (cognitive 23) · ×1
  • prompts-table.PromptTable (cognitive 23) langfuse/web/src/features/prompts/components/prompts-table.tsx:63 — prompts-table.PromptTable has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 7 (10 pts), if/else 9, boolean chains 3, loops 1 (nesting depth added 3). Most of this is not in the body itself: 6 of the 23 points are its own statements and the rest belongs to 10 function literals inside it that branch (lines 147, 309, 254, …). 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 · handleBlobStorageIntegrationProjectJob.handleBlobStorageIntegrationProjectJob (cognitive 23) · ×1
  • handleBlobStorageIntegrationProjectJob.handleBlobStorageIntegrationProjectJob (cognitive 23) langfuse/worker/src/features/blobstorage/handleBlobStorageIntegrationProjectJob.ts:263 — handleBlobStorageIntegrationProjectJob.handleBlobStorageIntegrationProjectJob has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 6, error handling 1, ternaries 1 (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 · bash._ts_collect_from_exec_unit (cognitive 23) · ×1
  • bash._ts_collect_from_exec_unit (cognitive 23) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:216 — bash._ts_collect_from_exec_unit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 11). 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 · litellm_callback._wrap_messages_with_categories (cognitive 23) · ×1
  • litellm_callback._wrap_messages_with_categories (cognitive 23) REDACTED:5792 — litellm_callback._wrap_messages_with_categories has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, ternaries 1 (2 pts), loops 1 (nesting depth added 8). 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 · RateLimitPolicy.check (cognitive 23) · ×1
  • RateLimitPolicy.check (cognitive 23) ArbiterOS-Kernel/arbiteros_kernel/policy/rate_limit_policy.py:79 — RateLimitPolicy.check has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 4 (9 pts), boolean chains 2, 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 · run_cases.analysis_summary (cognitive 23) · ×1
  • run_cases.analysis_summary (cognitive 23) REDACTED:287 — run_cases.analysis_summary has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), boolean chains 5 (nesting depth added 10). 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 · PromptService.buildAndResolvePromptGraph · ×1
  • PromptService.buildAndResolvePromptGraph::resolve (cognitive 22) langfuse/packages/shared/src/server/services/PromptService/index.ts:292 — PromptService.buildAndResolvePromptGraph::resolve has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (6 pts), boolean chains 3, loops 1 (2 pts) (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 · ValueCell.renderArrayValue (cognitive 22) · ×1
  • ValueCell.renderArrayValue (cognitive 22) langfuse/web/src/components/table/ValueCell.tsx:62 — ValueCell.renderArrayValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2 (nesting depth added 9). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 70, 93). 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 · multi-select-combobox.MultiSelectCombobox (cognitive 22) · ×1
  • multi-select-combobox.MultiSelectCombobox (cognitive 22) langfuse/web/src/components/ui/multi-select-combobox.tsx:28 — multi-select-combobox.MultiSelectCombobox has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 11, if/else 7, ternaries 3 (4 pts) (nesting depth added 1). Of this number, 12 points are the body's own statements and 10 belong to 6 function items inside it that branch. 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.
D2 · Cognitive Complexity · BillingSwitchPlanDialog.BillingSwitchPlanDialog (cognitive 22) · ×1
  • BillingSwitchPlanDialog.BillingSwitchPlanDialog (cognitive 22) langfuse/web/src/ee/features/billing/components/BillingSwitchPlanDialog.tsx:31 — BillingSwitchPlanDialog.BillingSwitchPlanDialog has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 12, if/else 3 (6 pts), ternaries 3 (4 pts) (nesting depth added 4). None of this is in the body itself: all 22 points belong to 3 function literals inside it that branch (lines 90, 260, 65). 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 · automationForm.AutomationForm · ×1
  • automationForm.AutomationForm::getDefaultValues (cognitive 22) langfuse/web/src/features/automations/components/automationForm.tsx:152 — automationForm.AutomationForm::getDefaultValues has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 13, ternaries 5, if/else 4. 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.
D2 · Cognitive Complexity · ChannelSelector.ChannelSelector (cognitive 22) · ×1
  • ChannelSelector.ChannelSelector (cognitive 22) langfuse/web/src/features/slack/components/ChannelSelector.tsx:79 — ChannelSelector.ChannelSelector has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8, boolean chains 7, ternaries 5 (7 pts) (nesting depth added 2). Of this number, 12 points are the body's own statements and 10 belong to 4 function items inside it that branch. 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 · buildGraphCanvasData.getFirstBooleanValue (cognitive 22) · ×1
  • buildGraphCanvasData.getFirstBooleanValue (cognitive 22) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:1666 — buildGraphCanvasData.getFirstBooleanValue has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (19 pts), boolean chains 2, loops 1 (nesting depth added 11). 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 · litellm_callback._enforce_topic_point_count_on_shift (cognitive 22) · ×1
  • litellm_callback._enforce_topic_point_count_on_shift (cognitive 22) REDACTED:2775 — litellm_callback._enforce_topic_point_count_on_shift has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 7, loops 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 5). 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 · litellm_callback._infer_codex_tool_name_from_arguments (cognitive 22) · ×1
  • litellm_callback._infer_codex_tool_name_from_arguments (cognitive 22) REDACTED:5299 — litellm_callback._infer_codex_tool_name_from_arguments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13, boolean chains 9. 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 · PathBudgetPolicy.check (cognitive 22) · ×1
  • PathBudgetPolicy.check (cognitive 22) ArbiterOS-Kernel/arbiteros_kernel/policy/path_budget_policy.py:182 — PathBudgetPolicy.check has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (16 pts), ternaries 2 (4 pts), boolean chains 1, loops 1 (nesting depth added 8). 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 · policy_rule_ir._validate_rule (cognitive 22) · ×1
  • policy_rule_ir._validate_rule (cognitive 22) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:518 — policy_rule_ir._validate_rule has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 3, loops 1 (nesting depth added 4). 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 · relational_policy._evaluate_flow (cognitive 22) · ×1
  • relational_policy._evaluate_flow (cognitive 22) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:841 — relational_policy._evaluate_flow has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 3 (nesting depth added 4). 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 · build_from_trajectories.parse_trajectory_into_steps (cognitive 22) · ×1
  • build_from_trajectories.parse_trajectory_into_steps (cognitive 22) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/build_from_trajectories.py:85 — build_from_trajectories.parse_trajectory_into_steps has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 7, ternaries 2 (3 pts), 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 · factory.createFilterFromFilterState (cognitive 21) · ×1
  • factory.createFilterFromFilterState (cognitive 21) langfuse/packages/shared/src/server/queries/clickhouse-sql/factory.ts:34 — factory.createFilterFromFilterState has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 5 (17 pts), if/else 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 13). None of this is in the body itself: all 21 points belong to one function literal inside it that branches (line 42). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · OtelIngestionProcessor.convertKeyPathToNestedObject (cognitive 21) · ×1
  • OtelIngestionProcessor.convertKeyPathToNestedObject (cognitive 21) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1105 — OtelIngestionProcessor.convertKeyPathToNestedObject has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (5 pts) (nesting depth added 9). Of this number, 18 points are the body's own statements and 3 belong to one function item 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 · gemini.extractToolDeclarations (cognitive 21) · ×1
  • gemini.extractToolDeclarations (cognitive 21) langfuse/packages/shared/src/utils/chatml/adapters/gemini.ts:151 — gemini.extractToolDeclarations has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 5, loops 2 (4 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 · index.ModelParameters (cognitive 21) · ×1
  • index.ModelParameters (cognitive 21) langfuse/web/src/components/ModelParameters/index.tsx:57 — index.ModelParameters has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (10 pts), if/else 6 (7 pts), boolean chains 4 (nesting depth added 5). Of this number, 16 points are the body's own statements and 5 belong to 3 function items 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 · data-table-column-visibility-filter.DataTableColumnVisibilityFilter (cognitive 21) · ×1
  • data-table-column-visibility-filter.DataTableColumnVisibilityFilter (cognitive 21) langfuse/web/src/components/table/data-table-column-visibility-filter.tsx:313 — data-table-column-visibility-filter.DataTableColumnVisibilityFilter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 6, ternaries 2 (nesting depth added 3). Most of this is not in the body itself: 2 of the 21 points are its own statements and the rest belongs to 6 function items inside it that branch (handleDragEnd, a function literal at line 499, a function literal at line 361, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · useTableViewManager.useTableViewManager (cognitive 21) · ×1
  • useTableViewManager.useTableViewManager (cognitive 21) langfuse/web/src/components/table/table-view-presets/hooks/useTableViewManager.ts:47 — useTableViewManager.useTableViewManager has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7 (nesting depth added 2). Most of this is not in the body itself: 1 of the 21 points is its own statement and the rest belongs to 4 function literals inside it that branch (lines 131, 315, 281, …). 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 · selectionToPath.selectionToPath (cognitive 21) · ×1
  • selectionToPath.selectionToPath (cognitive 21) langfuse/web/src/features/comments/lib/selectionToPath.ts:16 — selectionToPath.selectionToPath has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, ternaries 2, loops 1 (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 · DatasetItemsTable.DatasetItemsTable (cognitive 21) · ×1
  • DatasetItemsTable.DatasetItemsTable (cognitive 21) langfuse/web/src/features/datasets/components/DatasetItemsTable.tsx:54 — DatasetItemsTable.DatasetItemsTable has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 12 (13 pts), boolean chains 4, if/else 4 (nesting depth added 1). Most of this is not in the body itself: 5 of the 21 points are its own statements and the rest belongs to 11 function items inside it that branch (a function literal at line 268, a function literal at line 173, a function literal at line 293, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · ExperienceSummaryView.ExperienceSummaryView (cognitive 21) · ×1
  • ExperienceSummaryView.ExperienceSummaryView (cognitive 21) langfuse/web/src/features/experience-summary/components/ExperienceSummaryView.tsx:29 — ExperienceSummaryView.ExperienceSummaryView has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 14 (16 pts), boolean chains 2, if/else 2, error handling 1 (nesting depth added 2). Most of this is not in the body itself: 6 of the 21 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 167, 79, 56, …). 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 · GovernanceOverviewPanel.GovernanceOverviewPanel (cognitive 21) · ×1
  • GovernanceOverviewPanel.GovernanceOverviewPanel (cognitive 21) langfuse/web/src/features/governance-overview/components/GovernanceOverviewPanel.tsx:34 — GovernanceOverviewPanel.GovernanceOverviewPanel has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 8 (9 pts), if/else 4 (8 pts), boolean chains 2, loops 2 (nesting depth added 5). Most of this is not in the body itself: 8 of the 21 points are its own statements and the rest belongs to one function literal inside it that branches (line 113). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · ScoreAnalyticsNoticeBanner.ScoreAnalyticsNoticeBanner (cognitive 21) · ×1
  • ScoreAnalyticsNoticeBanner.ScoreAnalyticsNoticeBanner (cognitive 21) langfuse/web/src/features/score-analytics/components/ScoreAnalyticsNoticeBanner.tsx:6 — ScoreAnalyticsNoticeBanner.ScoreAnalyticsNoticeBanner has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 10, if/else 6 (7 pts), ternaries 2 (4 pts) (nesting depth added 3). Of this number, 17 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 · BackfillExperimentsHistoric.run (cognitive 21) · ×1
  • BackfillExperimentsHistoric.run (cognitive 21) langfuse/worker/src/backgroundMigrations/backfillExperimentsHistoric.ts:401 — BackfillExperimentsHistoric.run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (8 pts), boolean chains 1, ternaries 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 · litellm_callback._evaluate_tool_result_postexec_once (cognitive 21) · ×1
  • litellm_callback._evaluate_tool_result_postexec_once (cognitive 21) REDACTED:831 — litellm_callback._evaluate_tool_result_postexec_once has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6, ternaries 4 (6 pts), error handling 4 (5 pts), boolean chains 4 (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 · litellm_callback._lookup_tool_instruction_metadata_for_trace (cognitive 21) · ×1
  • litellm_callback._lookup_tool_instruction_metadata_for_trace (cognitive 21) REDACTED:4787 — litellm_callback._lookup_tool_instruction_metadata_for_trace has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 7, if/else 4 (7 pts), ternaries 4 (6 pts), loops 1 (nesting depth added 5). 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 · unary_gate_policy._extract_instruction_tags (cognitive 21) · ×1
  • unary_gate_policy._extract_instruction_tags (cognitive 21) REDACTED:159 — unary_gate_policy._extract_instruction_tags has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 11). 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 · PolicyEngine._check_security_policy (cognitive 21) · ×1
  • PolicyEngine._check_security_policy (cognitive 21) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1546 — PolicyEngine._check_security_policy has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, error handling 1 (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 · KernelPolicyRuntime.check_security (cognitive 21) · ×1
  • KernelPolicyRuntime.check_security (cognitive 21) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:655 — KernelPolicyRuntime.check_security has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 7, error handling 1 (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 · observations.getObservationsTableInternal (cognitive 20) · ×1
  • observations.getObservationsTableInternal (cognitive 20) langfuse/packages/shared/src/server/repositories/observations.ts:628 — observations.getObservationsTableInternal has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 11, boolean chains 9. Of this number, 16 points are the body's own statements and 4 belong to 3 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 · OtelIngestionProcessor.extractExperimentFields (cognitive 20) · ×1
  • OtelIngestionProcessor.extractExperimentFields (cognitive 20) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:2178 — OtelIngestionProcessor.extractExperimentFields has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 12, error handling 2 (4 pts), boolean chains 2, if/else 2 (nesting depth added 2). 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 · observations.parsePolicyNamesFromMetadata (cognitive 20) · ×1
  • observations.parsePolicyNamesFromMetadata (cognitive 20) langfuse/web/src/components/table/use-cases/observations.tsx:157 — observations.parsePolicyNamesFromMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 5). Of this number, 18 points are the body's own statements and 2 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 · useCorrectionEditor.useCorrectionEditor.handleEdit (cognitive 20) · ×1
  • useCorrectionEditor.useCorrectionEditor.handleEdit (cognitive 20) langfuse/web/src/components/trace2/components/IOPreview/components/hooks/useCorrectionEditor.ts:54 — useCorrectionEditor.useCorrectionEditor.handleEdit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), error handling 2 (5 pts), ternaries 1 (2 pts), boolean chains 1 (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 · treeNavigation.getNodeByIndex (cognitive 20) · ×1
  • treeNavigation.getNodeByIndex (cognitive 20) langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeNavigation.ts:32 — treeNavigation.getNodeByIndex has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), ternaries 1 (2 pts), boolean chains 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 · webhookHelpers.processWebhookHeaders (cognitive 20) · ×1
  • webhookHelpers.processWebhookHeaders (cognitive 20) langfuse/web/src/features/automations/server/webhookHelpers.ts:95 — webhookHelpers.processWebhookHeaders has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 8). 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 · JsonPathInput.JsonPathInput (cognitive 20) · ×1
  • JsonPathInput.JsonPathInput (cognitive 20) langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/components/JsonPathInput.tsx:69 — JsonPathInput.JsonPathInput has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 8, error handling 2 (4 pts), if/else 4, ternaries 2 (4 pts) (nesting depth added 4). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 101, 85). 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 · StatusStep.StatusStep (cognitive 20) · ×1
  • StatusStep.StatusStep (cognitive 20) langfuse/web/src/features/batch-actions/components/AddObservationsToDatasetDialog/StatusStep.tsx:23 — StatusStep.StatusStep has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 18, ternaries 2. 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.
D2 · Cognitive Complexity · DatasetAggregateTableCell.DatasetAggregateCellContent (cognitive 20) · ×1
  • DatasetAggregateTableCell.DatasetAggregateCellContent (cognitive 20) langfuse/web/src/features/datasets/components/DatasetAggregateTableCell.tsx:27 — DatasetAggregateTableCell.DatasetAggregateCellContent has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 11, ternaries 6 (7 pts), if/else 2 (nesting depth added 1). Of this number, 18 points are the body's own statements and 2 belong to one function item inside it that branches. 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.
D2 · Cognitive Complexity · EditDatasetItem.EditDatasetItem (cognitive 20) · ×1
  • EditDatasetItem.EditDatasetItem (cognitive 20) langfuse/web/src/features/datasets/components/EditDatasetItem.tsx:77 — EditDatasetItem.EditDatasetItem has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 8, if/else 3 (nesting depth added 3). Most of this is not in the body itself: 7 of the 20 points are its own statements and the rest belongs to 5 function items inside it that branch (a function literal at line 94, a function literal at line 199, a function literal at line 238, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · inner-evaluator-form.InnerEvaluatorForm · ×1
  • inner-evaluator-form.InnerEvaluatorForm::onSubmit (cognitive 20) langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:394 — inner-evaluator-form.InnerEvaluatorForm::onSubmit has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 8 (13 pts), if/else 5, boolean chains 2 (nesting depth added 5). 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. This shape REPEATS in the file: one other method here (inner-evaluator-form.InnerEvaluatorForm) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · EventsTable.parsePolicyNamesFromMetadata (cognitive 20) · ×1
  • EventsTable.parsePolicyNamesFromMetadata (cognitive 20) langfuse/web/src/features/events/components/EventsTable.tsx:185 — EventsTable.parsePolicyNamesFromMetadata has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, error handling 2 (4 pts), ternaries 1 (2 pts) (nesting depth added 5). Of this number, 18 points are the body's own statements and 2 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 · JumpToPlaygroundButton.JumpToPlaygroundButton (cognitive 20) · ×1
  • JumpToPlaygroundButton.JumpToPlaygroundButton (cognitive 20) langfuse/web/src/features/playground/page/components/JumpToPlaygroundButton.tsx:73 — JumpToPlaygroundButton.JumpToPlaygroundButton has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (12 pts), ternaries 6, boolean chains 1, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 20 points are its own statements and the rest belongs to 6 function items inside it that branch (handlePlaygroundAction, a function literal at line 85, a function literal at line 126, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · withMiddlewares.withMiddlewares.<returned closure> (cognitive 20) · ×1
  • withMiddlewares.withMiddlewares.<returned closure> (cognitive 20) REDACTED:40 — withMiddlewares.withMiddlewares.<returned closure> has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 8). None of this is in the body itself: all 20 points belong to one function literal inside it that branches (line 45). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · color-scales.buildColorMappings (cognitive 20) · ×1
  • color-scales.buildColorMappings (cognitive 20) REDACTED:562 — color-scales.buildColorMappings has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, ternaries 2 (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.
D2 · Cognitive Complexity · ingestion.handler (cognitive 20) · ×1
  • ingestion.handler (cognitive 20) langfuse/web/src/pages/api/public/ingestion.ts:50 — ingestion.handler has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), error handling 2, ternaries 1 (2 pts), boolean chains 1 (nesting depth added 5). Of this number, 15 points are the body's own statements and 5 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 · prompts.handler (cognitive 20) · ×1
  • prompts.handler (cognitive 20) langfuse/web/src/pages/api/public/prompts.ts:23 — prompts.handler has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), ternaries 2 (4 pts), boolean chains 1, error handling 1 (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 · IngestionService.processObservationEventList (cognitive 20) · ×1
  • IngestionService.processObservationEventList (cognitive 20) langfuse/worker/src/services/IngestionService/index.ts:849 — IngestionService.processObservationEventList has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, ternaries 3, error handling 1 (nesting depth added 3). Of this number, 19 points are the body's own statements and 1 belongs 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 · handleExperimentBackfill.processExperimentBackfill (cognitive 20) · ×1
  • handleExperimentBackfill.processExperimentBackfill (cognitive 20) langfuse/worker/src/features/eventPropagation/handleExperimentBackfill.ts:768 — handleExperimentBackfill.processExperimentBackfill has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 4 (9 pts), boolean chains 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · commentMentionHandler.handleCommentMentionNotification (cognitive 20) · ×1
  • commentMentionHandler.handleCommentMentionNotification (cognitive 20) langfuse/worker/src/features/notifications/commentMentionHandler.ts:66 — commentMentionHandler.handleCommentMentionNotification has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 4, error handling 2 (3 pts), ternaries 2, loops 1 (nesting depth added 5). Of this number, 19 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 · engine._get_path (cognitive 20) · ×1
  • engine._get_path (cognitive 20) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/tool_parsers/engine.py:60 — engine._get_path has cognitive complexity 20 (threshold 15). Drivers by points: ternaries 3 (10 pts), if/else 5 (9 pts), loops 1 (nesting depth added 11). 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 · openclaw_policy._tool_allowed (cognitive 20) · ×1
  • openclaw_policy._tool_allowed (cognitive 20) ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:183 — openclaw_policy._tool_allowed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 8 (nesting depth added 3). 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 · review_cases_with_llm.main (cognitive 20) · ×1
  • review_cases_with_llm.main (cognitive 20) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/review_cases_with_llm.py:263 — review_cases_with_llm.main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 6 (7 pts), boolean chains 4, loops 1 (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.
D2 · Cognitive Complexity · dataset-run-items.getDatasetRunItemsTableInternal (cognitive 19) · ×1
  • dataset-run-items.getDatasetRunItemsTableInternal (cognitive 19) langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:722 — dataset-run-items.getDatasetRunItemsTableInternal has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 8 (11 pts), if/else 4 (5 pts), boolean chains 2, match/switch 1 (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 · data-table-column-visibility-filter.ColumnVisibilityListItem (cognitive 19) · ×1
  • data-table-column-visibility-filter.ColumnVisibilityListItem (cognitive 19) langfuse/web/src/components/table/data-table-column-visibility-filter.tsx:90 — data-table-column-visibility-filter.ColumnVisibilityListItem has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, ternaries 7 (8 pts), if/else 1 (nesting depth added 1). Of this number, 17 points are the body's own statements and 2 belong to one function literal inside it that branches. 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.
D2 · Cognitive Complexity · data-table.TableBodyComponent (cognitive 19) · ×1
  • data-table.TableBodyComponent (cognitive 19) langfuse/web/src/components/table/data-table.tsx:522 — data-table.TableBodyComponent has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (13 pts), boolean chains 6 (nesting depth added 8). Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to one function literal inside it that branches (line 555). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · TraceDetailView.TraceDetailView (cognitive 19) · ×1
  • TraceDetailView.TraceDetailView (cognitive 19) langfuse/web/src/components/trace2/components/TraceDetailView/TraceDetailView.tsx:61 — TraceDetailView.TraceDetailView has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 11, ternaries 5 (6 pts), if/else 2 (nesting depth added 1). Of this number, 14 points are the body's own statements and 5 belong to 3 function literals inside it that branch. 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.
D2 · Cognitive Complexity · IOPreviewPretty.IOPreviewPretty (cognitive 19) · ×1
  • IOPreviewPretty.IOPreviewPretty (cognitive 19) langfuse/web/src/components/trace2/components/IOPreview/IOPreviewPretty.tsx:118 — IOPreviewPretty.IOPreviewPretty has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7, boolean chains 6, ternaries 5 (6 pts) (nesting depth added 1). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 187, 220). 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 · trace-aggregation.aggregateTraceMetrics (cognitive 19) · ×1
  • trace-aggregation.aggregateTraceMetrics (cognitive 19) langfuse/web/src/components/trace2/lib/trace-aggregation.ts:30 — trace-aggregation.aggregateTraceMetrics has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (8 pts), ternaries 2 (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 · VirtualizedJsonViewer.VirtualizedJsonViewer (cognitive 19) · ×1
  • VirtualizedJsonViewer.VirtualizedJsonViewer (cognitive 19) langfuse/web/src/components/ui/AdvancedJsonViewer/VirtualizedJsonViewer.tsx:39 — VirtualizedJsonViewer.VirtualizedJsonViewer has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 9, if/else 7, boolean chains 3. Most of this is not in the body itself: 5 of the 19 points are its own statements and the rest belongs to 5 function literals inside it that branch (lines 165, 130, 103, …). 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 · MediaButtonGroup.MediaButtonGroup (cognitive 19) · ×1
  • MediaButtonGroup.MediaButtonGroup (cognitive 19) langfuse/web/src/components/ui/AdvancedJsonViewer/components/MediaButtonGroup.tsx:126 — MediaButtonGroup.MediaButtonGroup has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14, boolean chains 3, ternaries 2. Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 9 function literals inside it that branch (lines 135, 263, 193, …). 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 · DatasetVersionHistoryPanel.DatasetVersionHistoryPanel (cognitive 19) · ×1
  • DatasetVersionHistoryPanel.DatasetVersionHistoryPanel (cognitive 19) langfuse/web/src/features/datasets/components/DatasetVersionHistoryPanel.tsx:68 — DatasetVersionHistoryPanel.DatasetVersionHistoryPanel has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 13, if/else 4, ternaries 2. Most of this is not in the body itself: 9 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (renderVersionItem, a function literal at line 139). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · BulkErrorAnalysisButton.BulkErrorAnalysisButton · ×1
  • BulkErrorAnalysisButton.BulkErrorAnalysisButton::handleBulkAnalyze (cognitive 19) langfuse/web/src/features/error-analysis/components/BulkErrorAnalysisButton.tsx:48 — BulkErrorAnalysisButton.BulkErrorAnalysisButton::handleBulkAnalyze has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 5 (7 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (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 · PromptModelStep.PromptModelStep (cognitive 19) · ×1
  • PromptModelStep.PromptModelStep (cognitive 19) langfuse/web/src/features/experiments/components/steps/PromptModelStep.tsx:34 — PromptModelStep.PromptModelStep has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, ternaries 4 (5 pts), if/else 3 (4 pts) (nesting depth added 2). None of this is in the body itself: all 19 points belong to 7 function items inside it that branch (handleToggleStructuredOutput, a function literal at line 109, a function literal at line 282, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · router.countValidDatasetItems (cognitive 19) · ×1
  • router.countValidDatasetItems (cognitive 19) langfuse/web/src/features/experiments/server/router.ts:46 — router.countValidDatasetItems has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 8). 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 · useFilterState.getCommaArrayParam (cognitive 19) · ×1
  • useFilterState.getCommaArrayParam (cognitive 19) langfuse/web/src/features/filters/hooks/useFilterState.ts:36 — useFilterState.getCommaArrayParam has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (11 pts), boolean chains 6, if/else 2 (nesting depth added 6). None of this is in the body itself: all 19 points belong to 3 function literals inside it that branch (lines 40, 75, 77). 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 · SlackConnectButton.SlackConnectButton (cognitive 19) · ×1
  • SlackConnectButton.SlackConnectButton (cognitive 19) langfuse/web/src/features/slack/components/SlackConnectButton.tsx:38 — SlackConnectButton.SlackConnectButton has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, ternaries 1 (2 pts), error handling 1 (nesting depth added 3). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 4 function items inside it that branch (handleConnect::handleMessage, handleConnect, a function literal at line 64, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · supportRequestMetadataEvent.buildPlainEventSupportRequestMetadataComponents (cognitive 19) · ×1
  • supportRequestMetadataEvent.buildPlainEventSupportRequestMetadataComponents (cognitive 19) langfuse/web/src/features/support-chat/plain/events/supportRequestMetadataEvent.ts:30 — supportRequestMetadataEvent.buildPlainEventSupportRequestMetadataComponents has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), ternaries 3 (4 pts), boolean chains 2 (nesting depth added 4). Of this number, 17 points are the body's own statements and 2 belong to one function item 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 · nodeNameUtils.getParserSuffixLabel (cognitive 19) · ×1
  • nodeNameUtils.getParserSuffixLabel (cognitive 19) langfuse/web/src/features/trace-graph-view/nodeNameUtils.ts:153 — nodeNameUtils.getParserSuffixLabel has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 2 (nesting depth added 4). 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 · pivot-table-utils.sortPivotTableRows (cognitive 19) · ×1
  • pivot-table-utils.sortPivotTableRows (cognitive 19) langfuse/web/src/features/widgets/utils/pivot-table-utils.ts:628 — pivot-table-utils.sortPivotTableRows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 3, ternaries 1 (2 pts) (nesting depth added 3). Of this number, 10 points are the body's own statements and 9 belong to 5 function items 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 · upsertDefaultModelPrices.upsertDefaultModelPrices (cognitive 19) · ×1
  • upsertDefaultModelPrices.upsertDefaultModelPrices (cognitive 19) langfuse/worker/src/scripts/upsertDefaultModelPrices.ts:84 — upsertDefaultModelPrices.upsertDefaultModelPrices has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), ternaries 1 (2 pts), boolean chains 1, error handling 1 (nesting depth added 8). 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 · trace-stream.getTraceStream (cognitive 19) · ×1
  • trace-stream.getTraceStream (cognitive 19) langfuse/worker/src/features/database-read-stream/trace-stream.ts:29 — trace-stream.getTraceStream has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), ternaries 2, boolean chains 1 (nesting depth added 9). Most of this is not in the body itself: 1 of the 19 points is its own statement and the rest belongs to 3 function items inside it that branch (a function literal at line 283, a function literal at line 61, processTraceRow). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · event-stream.getEventsStream (cognitive 19) · ×1
  • event-stream.getEventsStream (cognitive 19) langfuse/worker/src/features/database-read-stream/event-stream.ts:46 — event-stream.getEventsStream has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 9). None of this is in the body itself: all 19 points belong to 4 function literals inside it that branch (lines 283, 77, 75, …). 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 · thresholdProcessing.processThresholds (cognitive 19) · ×1
  • thresholdProcessing.processThresholds (cognitive 19) langfuse/worker/src/ee/usageThresholds/thresholdProcessing.ts:298 — thresholdProcessing.processThresholds has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 6, ternaries 2 (3 pts) (nesting depth added 2). 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 · processBatchedObservationEval.processBatchedObservationEval (cognitive 19) · ×1
  • processBatchedObservationEval.processBatchedObservationEval (cognitive 19) langfuse/worker/src/features/batchAction/processBatchedObservationEval.ts:15 — processBatchedObservationEval.processBatchedObservationEval has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), ternaries 4 (8 pts), loops 2 (nesting depth added 8). Most of this is not in the body itself: 8 of the 19 points are its own statements and the rest belongs to one function item inside it that branches (processBatch). 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 · BackfillEventsFullFromEvents.run (cognitive 19) · ×1
  • BackfillEventsFullFromEvents.run (cognitive 19) langfuse/worker/src/backgroundMigrations/backfillEventsFullFromEvents.ts:279 — BackfillEventsFullFromEvents.run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, error handling 1 (2 pts), loops 1, ternaries 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 · bash._collect_exec_path_tokens (cognitive 19) · ×1
  • bash._collect_exec_path_tokens (cognitive 19) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:413 — bash._collect_exec_path_tokens has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (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 · powershell._collect_exec_path_tokens (cognitive 19) · ×1
  • powershell._collect_exec_path_tokens (cognitive 19) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:377 — powershell._collect_exec_path_tokens has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (5 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts) (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 · litellm_callback._snapshot_trace_backup_state (cognitive 19) · ×1
  • litellm_callback._snapshot_trace_backup_state (cognitive 19) REDACTED:1539 — litellm_callback._snapshot_trace_backup_state has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 5, loops 1 (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.
D2 · Cognitive Complexity · litellm_callback._inject_reference_tool_id_into_tools (cognitive 19) · ×1
  • litellm_callback._inject_reference_tool_id_into_tools (cognitive 19) REDACTED:1741 — litellm_callback._inject_reference_tool_id_into_tools has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), ternaries 1 (2 pts), boolean chains 1, loops 1 (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 · litellm_callback._truncate_messages_after_last_reset (cognitive 19) · ×1
  • litellm_callback._truncate_messages_after_last_reset (cognitive 19) REDACTED:1891 — litellm_callback._truncate_messages_after_last_reset has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 2 (nesting depth added 5). 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 · litellm_callback._extract_tool_call_details_from_response (cognitive 19) · ×1
  • litellm_callback._extract_tool_call_details_from_response (cognitive 19) REDACTED:3300 — litellm_callback._extract_tool_call_details_from_response has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 5 (9 pts), if/else 3 (5 pts), boolean chains 4, 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 · litellm_callback._resolve_codex_tool_name_for_request (cognitive 19) · ×1
  • litellm_callback._resolve_codex_tool_name_for_request (cognitive 19) REDACTED:5355 — litellm_callback._resolve_codex_tool_name_for_request has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 2 (4 pts), boolean chains 2, ternaries 1 (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 · openclaw_policy._repair_tool_calls (cognitive 19) · ×1
  • openclaw_policy._repair_tool_calls (cognitive 19) ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:240 — openclaw_policy._repair_tool_calls has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 5, loops 1 (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 · filterToPrisma.tableColumnsToSqlFilter (cognitive 18) · ×1
  • filterToPrisma.tableColumnsToSqlFilter (cognitive 18) langfuse/packages/shared/src/server/filterToPrisma.ts:42 — filterToPrisma.tableColumnsToSqlFilter has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (11 pts), boolean chains 4, if/else 2, match/switch 1 (nesting depth added 3). Most of this is not in the body itself: 1 of the 18 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 67, 50, 47). 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 · toCompactVerbosityChatML.toCompactVerbosityChatML (cognitive 18) · ×1
  • toCompactVerbosityChatML.toCompactVerbosityChatML (cognitive 18) langfuse/packages/shared/src/utils/IORepresentation/chatML/toCompactVerbosityChatML.ts:16 — toCompactVerbosityChatML.toCompactVerbosityChatML has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 5, error handling 1 (nesting depth added 5). 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 · SeederOrchestrator.createDatasetExperimentData (cognitive 18) · ×1
  • SeederOrchestrator.createDatasetExperimentData (cognitive 18) langfuse/packages/shared/scripts/seeder/utils/seeder-orchestrator.ts:94 — SeederOrchestrator.createDatasetExperimentData has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (4 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · ActionButton.ButtonContent (cognitive 18) · ×1
  • ActionButton.ButtonContent (cognitive 18) langfuse/web/src/components/ActionButton.tsx:145 — ActionButton.ButtonContent has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (16 pts), boolean chains 2 (nesting depth added 8). 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 · DiffViewer.DiffViewer (cognitive 18) · ×1
  • DiffViewer.DiffViewer (cognitive 18) langfuse/web/src/components/DiffViewer.tsx:92 — DiffViewer.DiffViewer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, ternaries 2 (3 pts), loops 1 (nesting depth added 4). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 3 function items inside it that branch (a function literal at line 106, DiffRow::renderContent, a function literal at line 162). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · useLocalStorage.useLocalStorage (cognitive 18) · ×1
  • useLocalStorage.useLocalStorage (cognitive 18) langfuse/web/src/components/useLocalStorage.tsx:28 — useLocalStorage.useLocalStorage has cognitive complexity 18 (threshold 15). Drivers by points: error handling 5 (7 pts), ternaries 4 (6 pts), if/else 5 (nesting depth added 4). None of this is in the body itself: all 18 points belong to 7 function literals inside it that branch (lines 91, 102, 34, …). 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 · observationIoSource.buildKernelObservationIoSourceMap (cognitive 18) · ×1
  • observationIoSource.buildKernelObservationIoSourceMap (cognitive 18) langfuse/web/src/components/trace2/lib/observationIoSource.ts:46 — observationIoSource.buildKernelObservationIoSourceMap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, loops 2 (3 pts), ternaries 1 (nesting depth added 6). Of this number, 16 points are the body's own statements and 2 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 · TruncatedString.TruncatedString (cognitive 18) · ×1
  • TruncatedString.TruncatedString (cognitive 18) langfuse/web/src/components/ui/AdvancedJsonViewer/components/TruncatedString.tsx:35 — TruncatedString.TruncatedString has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 8 (12 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 5). Most of this is not in the body itself: 5 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 77, 132, 53). 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 · useCommentedPaths.useCommentedPaths (cognitive 18) · ×1
  • useCommentedPaths.useCommentedPaths (cognitive 18) langfuse/web/src/features/comments/hooks/useCommentedPaths.ts:19 — useCommentedPaths.useCommentedPaths has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 4 (6 pts), boolean chains 2, loops 1 (nesting depth added 5). None of this is in the body itself: all 18 points belong to 2 function literals inside it that branch (lines 22, 41). 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 · ModelUsageChart.ModelUsageChart (cognitive 18) · ×1
  • ModelUsageChart.ModelUsageChart (cognitive 18) langfuse/web/src/features/dashboard/components/ModelUsageChart.tsx:32 — ModelUsageChart.ModelUsageChart has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, ternaries 7. Of this number, 15 points are the body's own statements and 3 belong to 3 function literals inside it that branch. 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.
D2 · Cognitive Complexity · PolicyConfirmationStatsCard.PolicyConfirmationStatsCard (cognitive 18) · ×1
  • PolicyConfirmationStatsCard.PolicyConfirmationStatsCard (cognitive 18) langfuse/web/src/features/dashboard/components/PolicyConfirmationStatsCard.tsx:209 — PolicyConfirmationStatsCard.PolicyConfirmationStatsCard has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 10 (12 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 3). Of this number, 14 points are the body's own statements and 4 belong to 3 function literals inside it that branch. 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 · ScoreAnalytics.ScoreAnalytics (cognitive 18) · ×1
  • ScoreAnalytics.ScoreAnalytics (cognitive 18) langfuse/web/src/features/dashboard/components/score-analytics/ScoreAnalytics.tsx:25 — ScoreAnalytics.ScoreAnalytics has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, ternaries 3 (5 pts), if/else 1 (2 pts) (nesting depth added 3). Most of this is not in the body itself: 6 of the 18 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 103, 76). 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 · dashboard-router.getPolicyConfirmationDetailsByState (cognitive 18) · ×1
  • dashboard-router.getPolicyConfirmationDetailsByState (cognitive 18) langfuse/web/src/features/dashboard/server/dashboard-router.ts:352 — dashboard-router.getPolicyConfirmationDetailsByState has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 7). Of this number, 17 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 · getPlan.getOrganizationPlanServerSide (cognitive 18) · ×1
  • getPlan.getOrganizationPlanServerSide (cognitive 18) langfuse/web/src/features/entitlements/server/getPlan.ts:9 — getPlan.getOrganizationPlanServerSide has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (4 pts) (nesting depth added 11). 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 · filter-builder.PopoverFilterBuilder (cognitive 18) · ×1
  • filter-builder.PopoverFilterBuilder (cognitive 18) langfuse/web/src/features/filters/components/filter-builder.tsx:78 — filter-builder.PopoverFilterBuilder has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (10 pts), boolean chains 4, if/else 4 (nesting depth added 3). Of this number, 11 points are the body's own statements and 7 belong to 4 function literals inside it that branch. 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 · SurveyStep.SurveyStep (cognitive 18) · ×1
  • SurveyStep.SurveyStep (cognitive 18) langfuse/web/src/features/onboarding/components/SurveyStep.tsx:26 — SurveyStep.SurveyStep has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 6 (11 pts), if/else 4 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 6). Of this number, 11 points are the body's own statements and 7 belong to 3 function items 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 · GenerationOutput.GenerationOutput (cognitive 18) · ×1
  • GenerationOutput.GenerationOutput (cognitive 18) langfuse/web/src/features/playground/page/components/GenerationOutput.tsx:9 — GenerationOutput.GenerationOutput has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9 (14 pts), if/else 3, boolean chains 1 (nesting depth added 5). Of this number, 14 points are the body's own statements and 4 belong to 3 function items 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 · QueryBuilder.validateAndProcessOrderBy (cognitive 18) · ×1
  • QueryBuilder.validateAndProcessOrderBy (cognitive 18) langfuse/web/src/features/query/server/queryBuilder.ts:973 — QueryBuilder.validateAndProcessOrderBy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 8 (nesting depth added 2). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1004, 1029, 1012). 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 · QueryBuilder.build (cognitive 18) · ×1
  • QueryBuilder.build (cognitive 18) langfuse/web/src/features/query/server/queryBuilder.ts:1100 — QueryBuilder.build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 4, loops 1 (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 · BigNumber.BigNumber (cognitive 18) · ×1
  • BigNumber.BigNumber (cognitive 18) langfuse/web/src/features/widgets/chart-library/BigNumber.tsx:104 — BigNumber.BigNumber has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 4 (6 pts), boolean chains 4, loops 1 (nesting depth added 3). Most of this is not in the body itself: 4 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 135, 116, 124, …). 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 · WidgetForm.WidgetForm · ×1
  • WidgetForm.WidgetForm::handleSaveWidget (cognitive 18) langfuse/web/src/features/widgets/components/WidgetForm.tsx:944 — WidgetForm.WidgetForm::handleSaveWidget has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 7 (14 pts), boolean chains 2, if/else 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. This shape REPEATS in the file: one other method here (WidgetForm.WidgetForm) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D2 · Cognitive Complexity · sign-up.SignIn (cognitive 18) · ×1
  • sign-up.SignIn (cognitive 18) langfuse/web/src/pages/auth/sign-up.tsx:41 — sign-up.SignIn has cognitive complexity 18 (threshold 15). Drivers by points: ternaries 9, if/else 4, boolean chains 3, error handling 2. Of this number, 11 points are the body's own statements and 7 belong to 3 function items 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 · utils.replaceVariablesInPrompt (cognitive 18) · ×1
  • utils.replaceVariablesInPrompt (cognitive 18) langfuse/worker/src/features/experiments/utils.ts:73 — utils.replaceVariablesInPrompt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, error handling 1 (3 pts), loops 1 (nesting depth added 6). Of this number, 14 points are the body's own statements and 4 belong to 4 function items 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 · EncryptBlobStorageSecrets.run (cognitive 18) · ×1
  • EncryptBlobStorageSecrets.run (cognitive 18) langfuse/worker/src/backgroundMigrations/encryptBlobStorageSecrets.ts:32 — EncryptBlobStorageSecrets.run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), error handling 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 8). 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 · RegistrySet.classify_confidentiality (cognitive 18) · ×1
  • RegistrySet.classify_confidentiality (cognitive 18) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/registries/_base.py:423 — RegistrySet.classify_confidentiality has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 4 (8 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
D2 · Cognitive Complexity · bash._classify_segment_risk (cognitive 18) · ×1
  • bash._classify_segment_risk (cognitive 18) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:317 — bash._classify_segment_risk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), error handling 1 (2 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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 · powershell._ps_find_exec_units (cognitive 18) · ×1
  • powershell._ps_find_exec_units (cognitive 18) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:183 — powershell._ps_find_exec_units has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (8 pts) (nesting depth added 11). 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 · litellm_callback._build_policy_runtime_context (cognitive 18) · ×1
  • litellm_callback._build_policy_runtime_context (cognitive 18) REDACTED:1638 — litellm_callback._build_policy_runtime_context has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), error handling 2 (5 pts), boolean chains 3, loops 1 (2 pts), ternaries 1 (nesting depth added 8). 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 · DeletePolicy.check (cognitive 18) · ×1
  • DeletePolicy.check (cognitive 18) ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:158 — DeletePolicy.check has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (4 pts), boolean chains 2, 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 · unary_gate_policy._selector_matches (cognitive 18) · ×1
  • unary_gate_policy._selector_matches (cognitive 18) REDACTED:788 — unary_gate_policy._selector_matches has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 8 (nesting depth added 3). 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 · observations.getObservationsForTrace (cognitive 17) · ×1
  • observations.getObservationsForTrace (cognitive 17) langfuse/packages/shared/src/server/repositories/observations.ts:134 — observations.getObservationsForTrace has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 5, loops 2 (3 pts), boolean chains 2 (nesting depth added 5). Of this number, 14 points are the body's own statements and 3 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 · getInternalTracingHandler.getInternalTracingHandler.processTracedEvents (cognitive 17) · ×1
  • getInternalTracingHandler.getInternalTracingHandler.processTracedEvents (cognitive 17) langfuse/packages/shared/src/server/llm/getInternalTracingHandler.ts:88 — getInternalTracingHandler.getInternalTracingHandler.processTracedEvents has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (2 pts), loops 1 (nesting depth added 5). Of this number, 14 points are the body's own statements and 3 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 · OtelIngestionProcessor.filterRedundantShallowTraces (cognitive 17) · ×1
  • OtelIngestionProcessor.filterRedundantShallowTraces (cognitive 17) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:542 — OtelIngestionProcessor.filterRedundantShallowTraces has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2, boolean chains 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 · OtelIngestionProcessor.extractMetadata (cognitive 17) · ×1
  • OtelIngestionProcessor.extractMetadata (cognitive 17) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1637 — OtelIngestionProcessor.extractMetadata has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 2 (3 pts), boolean chains 2, error handling 1 (2 pts), ternaries 2 (nesting depth added 5). 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 · microsoft-agent.extractToolDefinitions (cognitive 17) · ×1
  • microsoft-agent.extractToolDefinitions (cognitive 17) langfuse/packages/shared/src/utils/chatml/adapters/microsoft-agent.ts:108 — microsoft-agent.extractToolDefinitions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 5, 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 · semantic-kernel.normalizeMessage (cognitive 17) · ×1
  • semantic-kernel.normalizeMessage (cognitive 17) langfuse/packages/shared/src/utils/chatml/adapters/semantic-kernel.ts:54 — semantic-kernel.normalizeMessage has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 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 · ObservationPreview.ObservationPreview (cognitive 17) · ×1
  • ObservationPreview.ObservationPreview (cognitive 17) langfuse/web/src/components/trace2/ObservationPreview.tsx:44 — ObservationPreview.ObservationPreview has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 13, ternaries 3, if/else 1. 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.
D2 · Cognitive Complexity · LogViewToolbar.LogViewToolbar (cognitive 17) · ×1
  • LogViewToolbar.LogViewToolbar (cognitive 17) langfuse/web/src/components/trace2/components/TraceLogView/LogViewToolbar.tsx:77 — LogViewToolbar.LogViewToolbar has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 16, ternaries 1. 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.
D2 · Cognitive Complexity · ToolCallDefinitionCard.ToolCallDefinitionCard (cognitive 17) · ×1
  • ToolCallDefinitionCard.ToolCallDefinitionCard (cognitive 17) langfuse/web/src/components/trace2/components/IOPreview/components/ToolCallDefinitionCard.tsx:33 — ToolCallDefinitionCard.ToolCallDefinitionCard has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 10, ternaries 5 (6 pts), if/else 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 51, 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.
D2 · Cognitive Complexity · JSONTableViewRow.JSONTableViewRowInner (cognitive 17) · ×1
  • JSONTableViewRow.JSONTableViewRowInner (cognitive 17) langfuse/web/src/components/trace2/components/_shared/JSONTableView/JSONTableViewRow.tsx:16 — JSONTableViewRow.JSONTableViewRowInner has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 8, ternaries 7, if/else 1 (2 pts) (nesting depth added 1). Of this number, 12 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 · SearchBar.SearchBar (cognitive 17) · ×1
  • SearchBar.SearchBar (cognitive 17) langfuse/web/src/components/ui/AdvancedJsonViewer/components/SearchBar.tsx:26 — SearchBar.SearchBar has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (handleKeyDown, handleClear, handleChange, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
D2 · Cognitive Complexity · index.handleCreateApiKey (cognitive 17) · ×1
  • index.handleCreateApiKey (cognitive 17) langfuse/web/src/ee/features/admin-api/server/projects/projectById/apiKeys/index.ts:46 — index.handleCreateApiKey has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1, ternaries 1 (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 · index.handleUpdateProject (cognitive 17) · ×1
  • index.handleUpdateProject (cognitive 17) REDACTED:17 — index.handleUpdateProject has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), error handling 4 (6 pts), ternaries 3, boolean chains 1 (nesting depth added 5). 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 · DatasetsTable.DatasetsTable (cognitive 17) · ×1
  • DatasetsTable.DatasetsTable (cognitive 17) langfuse/web/src/features/datasets/components/DatasetsTable.tsx:74 — DatasetsTable.DatasetsTable has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 6 (8 pts), if/else 6, boolean chains 2, loops 1 (nesting depth added 2). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 336, 115, 132, …). 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 · costCalculations.sumObservationCosts (cognitive 17) · ×1
  • costCalculations.sumObservationCosts (cognitive 17) langfuse/web/src/features/datasets/lib/costCalculations.ts:66 — costCalculations.sumObservationCosts has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 5 (7 pts), boolean chains 5, if/else 4 (5 pts) (nesting depth added 3). None of this is in the body itself: all 17 points belong to one function literal inside it that branches (line 69). The decisions are inside the literal, 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 literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
D2 · Cognitive Complexity · evaluation-prompt-preview.ColoredVariable (cognitive 17) · ×1
  • evaluation-prompt-preview.ColoredVariable (cognitive 17) langfuse/web/src/features/evals/components/evaluation-prompt-preview.tsx:25 — evaluation-prompt-preview.ColoredVariable has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 3, error handling 1 (3 pts), ternaries 2 (3 pts) (nesting depth added 6). Most of this is not in the body itself: 2 of the 17 points are its own statements and the rest belongs to one function item inside it that branches (renderValue). 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 · router.testLLMConnection (cognitive 17) · ×1
  • router.testLLMConnection (cognitive 17) langfuse/web/src/features/llm-api-key/server/router.ts:57 — router.testLLMConnection has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, ternaries 2 (3 pts), error handling 1 (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 · DetailPageNav.DetailPageNav (cognitive 17) · ×1
  • DetailPageNav.DetailPageNav (cognitive 17) langfuse/web/src/features/navigate-detail-pages/DetailPageNav.tsx:17 — DetailPageNav.DetailPageNav has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 5, ternaries 2 (nesting depth added 2). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 37, 80, 113). 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.SetPromptVersionLabels (cognitive 17) · ×1
  • index.SetPromptVersionLabels (cognitive 17) langfuse/web/src/features/prompts/components/SetPromptVersionLabels/index.tsx:26 — index.SetPromptVersionLabels has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 7, ternaries 4 (5 pts), if/else 4, error handling 1 (nesting depth added 1). Of this number, 12 points are the body's own statements and 5 belong to 3 function items 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 · auto-complete.AutoComplete (cognitive 17) · ×1
  • auto-complete.AutoComplete (cognitive 17) langfuse/web/src/features/prompts/components/auto-complete.tsx:29 — auto-complete.AutoComplete has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 4 (9 pts), if/else 5 (6 pts), boolean chains 2 (nesting depth added 6). Most of this is not in the body itself: 4 of the 17 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 43, 112). 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 · CreateLLMApiKeyForm.createFormSchema (cognitive 17) · ×1
  • CreateLLMApiKeyForm.createFormSchema (cognitive 17) langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:50 — CreateLLMApiKeyForm.createFormSchema has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, ternaries 4 (5 pts), boolean chains 4 (nesting depth added 1). Most of this is not in the body itself: 5 of the 17 points are its own statements and the rest belongs to 6 function literals inside it that branch (lines 89, 149, 166, …). 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 · evals.handler (cognitive 17) · ×1
  • evals.handler (cognitive 17) REDACTED:21 — evals.handler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 3, loops 1 (3 pts), ternaries 1 (2 pts), error handling 1 (nesting depth added 5). 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 · index.handler (cognitive 17) · ×1
  • index.handler (cognitive 17) langfuse/web/src/pages/api/public/projects/index.ts:9 — index.handler has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 5). Of this number, 15 points are the body's own statements and 2 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 · [id].handlePut (cognitive 17) · ×1
  • [id].handlePut (cognitive 17) langfuse/web/src/pages/api/public/scim/Users/[id].ts:256 — [id].handlePut has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 1 (2 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 · traces.getPolicyConfirmationTurnIndexesForTrace (cognitive 17) · ×1
  • traces.getPolicyConfirmationTurnIndexesForTrace (cognitive 17) langfuse/web/src/server/api/routers/traces.ts:78 — traces.getPolicyConfirmationTurnIndexesForTrace has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 3 (7 pts), if/else 2 (6 pts), loops 2 (3 pts), boolean chains 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 · ClickhouseWriter.truncateOversizedRecord (cognitive 17) · ×1
  • ClickhouseWriter.truncateOversizedRecord (cognitive 17) langfuse/worker/src/services/ClickhouseWriter/index.ts:199 — ClickhouseWriter.truncateOversizedRecord has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 3). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. 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 · autoExperienceSummaryQueue.autoExperienceSummaryQueueProcessor (cognitive 17) · ×1
  • autoExperienceSummaryQueue.autoExperienceSummaryQueueProcessor (cognitive 17) langfuse/worker/src/queues/autoExperienceSummaryQueue.ts:490 — autoExperienceSummaryQueue.autoExperienceSummaryQueueProcessor has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 7 (9 pts), if/else 5, error handling 1 (2 pts), boolean chains 1 (nesting depth added 3). 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: 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 · BackfillBillingCycleAnchors.run (cognitive 17) · ×1
  • BackfillBillingCycleAnchors.run (cognitive 17) langfuse/worker/src/backgroundMigrations/backfillBillingCycleAnchors.ts:80 — BackfillBillingCycleAnchors.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 2 (3 pts), loops 2 (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 · powershell._ps_command_words (cognitive 17) · ×1
  • powershell._ps_command_words (cognitive 17) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:144 — powershell._ps_command_words has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 2 (4 pts), boolean chains 2 (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 · litellm_callback._add_non_strict_content_instructions (cognitive 17) · ×1
  • litellm_callback._add_non_strict_content_instructions (cognitive 17) REDACTED:5392 — litellm_callback._add_non_strict_content_instructions has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 5 (6 pts), boolean chains 2, loops 1 (nesting depth added 5). 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 · direct_metadata._external_domains_from_values (cognitive 17) · ×1
  • direct_metadata._external_domains_from_values (cognitive 17) ArbiterOS-Kernel/arbiteros_kernel/policy/direct_metadata.py:220 — direct_metadata._external_domains_from_values has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 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 · unary_gate_policy._merge_rule_bundles (cognitive 17) · ×1
  • unary_gate_policy._merge_rule_bundles (cognitive 17) REDACTED:370 — unary_gate_policy._merge_rule_bundles has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), boolean chains 1 (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 · unary_gate_policy._resolve_value (cognitive 17) · ×1
  • unary_gate_policy._resolve_value (cognitive 17) REDACTED:580 — unary_gate_policy._resolve_value has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (17 pts) (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 · KernelPolicyRuntime.efsm_replay_history (cognitive 17) · ×1
  • KernelPolicyRuntime.efsm_replay_history (cognitive 17) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:1127 — KernelPolicyRuntime.efsm_replay_history has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 1 (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 · ClickHouseClientManager.getClient (cognitive 16) · ×1
  • ClickHouseClientManager.getClient (cognitive 16) langfuse/packages/shared/src/server/clickhouse/client.ts:93 — ClickHouseClientManager.getClient has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 3 (5 pts), boolean chains 1 (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 · scores.getScoresUiGenericFromEvents (cognitive 16) · ×1
  • scores.getScoresUiGenericFromEvents (cognitive 16) langfuse/packages/shared/src/server/repositories/scores.ts:1061 — scores.getScoresUiGenericFromEvents has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 8 (10 pts), boolean chains 3, if/else 2 (3 pts) (nesting depth added 3). Of this number, 14 points are the body's own statements and 2 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 · headerPropagation.contextWithLangfuseProps (cognitive 16) · ×1
  • headerPropagation.contextWithLangfuseProps (cognitive 16) langfuse/packages/shared/src/server/headerPropagation.ts:16 — headerPropagation.contextWithLangfuseProps has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (5 pts), boolean chains 1 (nesting depth added 7). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 35, 25). 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 · microsoft-agent.normalizeMicrosoftAgentMessage (cognitive 16) · ×1
  • microsoft-agent.normalizeMicrosoftAgentMessage (cognitive 16) langfuse/packages/shared/src/utils/chatml/adapters/microsoft-agent.ts:152 — microsoft-agent.normalizeMicrosoftAgentMessage has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4 (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 · applyFieldMapping.applyFullMapping (cognitive 16) · ×1
  • applyFieldMapping.applyFullMapping (cognitive 16) langfuse/packages/shared/src/features/batchAction/applyFieldMapping.ts:183 — applyFieldMapping.applyFullMapping has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (11 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 8). Of this number, 14 points are the body's own statements and 2 belong to one function item 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 · ChatMessageComponent.ChatMessageComponent · ×1
  • ChatMessageComponent.ChatMessageComponent::toggleRole (cognitive 16) langfuse/web/src/components/ChatMessages/ChatMessageComponent.tsx:96 — ChatMessageComponent.ChatMessageComponent::toggleRole has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (13 pts), ternaries 1 (2 pts), boolean chains 1 (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 · CodeMirrorEditor.CodeMirrorEditor (cognitive 16) · ×1
  • CodeMirrorEditor.CodeMirrorEditor (cognitive 16) langfuse/web/src/components/editor/CodeMirrorEditor.tsx:162 — CodeMirrorEditor.CodeMirrorEditor has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11 (13 pts), boolean chains 2, if/else 1 (nesting depth added 2). Of this number, 15 points are the body's own statements and 1 belongs 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 · data-table-pagination.DataTablePagination (cognitive 16) · ×1
  • data-table-pagination.DataTablePagination (cognitive 16) langfuse/web/src/components/table/data-table-pagination.tsx:32 — data-table-pagination.DataTablePagination has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 11, if/else 4, ternaries 1. Of this number, 10 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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.
D2 · Cognitive Complexity · tree-building.buildDependencyGraph (cognitive 16) · ×1
  • tree-building.buildDependencyGraph (cognitive 16) langfuse/web/src/components/trace2/lib/tree-building.ts:372 — tree-building.buildDependencyGraph has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 6 (7 pts) (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 · TraceGraphDataContext.TraceGraphDataProvider (cognitive 16) · ×1
  • TraceGraphDataContext.TraceGraphDataProvider (cognitive 16) langfuse/web/src/components/trace2/contexts/TraceGraphDataContext.tsx:47 — TraceGraphDataContext.TraceGraphDataProvider has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 7, if/else 5 (7 pts), loops 1, ternaries 1 (nesting depth added 2). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 60, 116, 129, …). 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 · TraceLogView.TraceLogView (cognitive 16) · ×1
  • TraceLogView.TraceLogView (cognitive 16) langfuse/web/src/components/trace2/components/TraceLogView/TraceLogView.tsx:75 — TraceLogView.TraceLogView has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 8, if/else 5, ternaries 3. Of this number, 8 points are the body's own statements and 8 belong to 6 function literals inside it that branch. 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.
D2 · Cognitive Complexity · helpers.calculateDisplayTotalCost.totalCost (cognitive 16) · ×1
  • helpers.calculateDisplayTotalCost.totalCost (cognitive 16) langfuse/web/src/components/trace2/lib/helpers.ts:110 — helpers.calculateDisplayTotalCost.totalCost has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (10 pts), boolean chains 3, if/else 3 (nesting depth added 5). 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 · helpers.enrichTreeNodeWithCosts (cognitive 16) · ×1
  • helpers.enrichTreeNodeWithCosts (cognitive 16) langfuse/web/src/components/trace2/lib/helpers.ts:203 — helpers.enrichTreeNodeWithCosts has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (7 pts), ternaries 4 (6 pts), boolean chains 3 (nesting depth added 4). Of this number, 14 points are the body's own statements and 2 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 · useJsonViewerLayout.useJsonViewerLayout.estimateSize (cognitive 16) · ×1
  • useJsonViewerLayout.useJsonViewerLayout.estimateSize (cognitive 16) langfuse/web/src/components/ui/AdvancedJsonViewer/hooks/useJsonViewerLayout.ts:117 — useJsonViewerLayout.useJsonViewerLayout.estimateSize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (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 · SimpleJsonViewer.SimpleJsonViewer (cognitive 16) · ×1
  • SimpleJsonViewer.SimpleJsonViewer (cognitive 16) langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleJsonViewer.tsx:38 — SimpleJsonViewer.SimpleJsonViewer has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 5, boolean chains 2 (nesting depth added 3). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 93, 127, 137, …). 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 · PrettyJsonView.isMarkdownContent (cognitive 16) · ×1
  • PrettyJsonView.isMarkdownContent (cognitive 16) langfuse/web/src/components/ui/PrettyJsonView.tsx:164 — PrettyJsonView.isMarkdownContent has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 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 · time-picker-utils.getValidNumber (cognitive 16) · ×1
  • time-picker-utils.getValidNumber (cognitive 16) langfuse/web/src/components/ui/time-picker-utils.tsx:24 — time-picker-utils.getValidNumber has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (16 pts) (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 · createProject.handleCreateProject (cognitive 16) · ×1
  • createProject.handleCreateProject (cognitive 16) REDACTED:9 — createProject.handleCreateProject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), error handling 4 (6 pts), boolean chains 1, ternaries 1 (nesting depth added 5). 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 · createProjectMembershipsOnSignup.createProjectMembershipsOnSignup (cognitive 16) · ×1
  • createProjectMembershipsOnSignup.createProjectMembershipsOnSignup (cognitive 16) langfuse/web/src/features/auth/lib/createProjectMembershipsOnSignup.ts:6 — createProjectMembershipsOnSignup.createProjectMembershipsOnSignup has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), error handling 2 (3 pts), ternaries 3, boolean chains 2, loops 2 (nesting depth added 2). 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 · validateCommentReferenceObject.validateCommentReferenceObject (cognitive 16) · ×1
  • validateCommentReferenceObject.validateCommentReferenceObject (cognitive 16) langfuse/web/src/features/comments/validateCommentReferenceObject.ts:12 — validateCommentReferenceObject.validateCommentReferenceObject has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), ternaries 3 (7 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 · UserChart.UserChart (cognitive 16) · ×1
  • UserChart.UserChart (cognitive 16) langfuse/web/src/features/dashboard/components/UserChart.tsx:26 — UserChart.UserChart has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (12 pts), boolean chains 4 (nesting depth added 2). Of this number, 8 points are the body's own statements and 8 belong to 5 function literals inside it that branch. 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 · PreviewCsvImport.PreviewCsvImport (cognitive 16) · ×1
  • PreviewCsvImport.PreviewCsvImport (cognitive 16) langfuse/web/src/features/datasets/components/PreviewCsvImport.tsx:38 — PreviewCsvImport.PreviewCsvImport has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, ternaries 5 (6 pts), if/else 4 (nesting depth added 1). Of this number, 12 points are the body's own statements and 4 belong to 4 function items 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 · costCalculations.findObservationDescendants (cognitive 16) · ×1
  • costCalculations.findObservationDescendants (cognitive 16) langfuse/web/src/features/datasets/lib/costCalculations.ts:18 — costCalculations.findObservationDescendants has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 3 (4 pts) (nesting depth added 8). 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 · ErrorAnalysisDropdown.FormattedAnalysisView (cognitive 16) · ×1
  • ErrorAnalysisDropdown.FormattedAnalysisView (cognitive 16) langfuse/web/src/features/error-analysis/components/ErrorAnalysisDropdown.tsx:35 — ErrorAnalysisDropdown.FormattedAnalysisView has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 10 (16 pts) (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 · evaluator-selector.EvaluatorSelector (cognitive 16) · ×1
  • evaluator-selector.EvaluatorSelector (cognitive 16) langfuse/web/src/features/evals/components/evaluator-selector.tsx:41 — evaluator-selector.EvaluatorSelector has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 12, if/else 3, ternaries 1. Of this number, 10 points are the body's own statements and 6 belong to 4 function literals inside it that branch. 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.
D2 · Cognitive Complexity · variable-mapping-validation.validateAndTransformVariableMapping (cognitive 16) · ×1
  • variable-mapping-validation.validateAndTransformVariableMapping (cognitive 16) langfuse/web/src/features/evals/utils/variable-mapping-validation.ts:36 — variable-mapping-validation.validateAndTransformVariableMapping has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 4, ternaries 1 (nesting depth added 4). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 61, 91, 45, …). 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 · router.getRejectedTurnDetails (cognitive 16) · ×1
  • router.getRejectedTurnDetails (cognitive 16) langfuse/web/src/features/policy-suggestions/server/router.ts:386 — router.getRejectedTurnDetails has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (8 pts), if/else 3 (6 pts), boolean chains 1, loops 1 (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 · deletePrompt.deletePrompt (cognitive 16) · ×1
  • deletePrompt.deletePrompt (cognitive 16) langfuse/web/src/features/prompts/server/actions/deletePrompt.ts:13 — deletePrompt.deletePrompt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6, ternaries 3 (6 pts), boolean chains 3, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 57, 80, 113). 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 · scores._handleGenerateScoresForPublicApi (cognitive 16) · ×1
  • scores._handleGenerateScoresForPublicApi (cognitive 16) langfuse/web/src/features/public-api/server/scores.ts:70 — scores._handleGenerateScoresForPublicApi has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 14, boolean chains 2. Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. 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 · MembershipInvitesPage.MembershipInvitesPage (cognitive 16) · ×1
  • MembershipInvitesPage.MembershipInvitesPage (cognitive 16) langfuse/web/src/features/rbac/components/MembershipInvitesPage.tsx:36 — MembershipInvitesPage.MembershipInvitesPage has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 9 (10 pts), if/else 3 (4 pts), boolean chains 2 (nesting depth added 2). Of this number, 9 points are the body's own statements and 7 belong to 5 function items inside it that branch. 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 · SetupPage.SetupPage (cognitive 16) · ×1
  • SetupPage.SetupPage (cognitive 16) langfuse/web/src/features/setup/components/SetupPage.tsx:31 — SetupPage.SetupPage has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 7 (nesting depth added 3). 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 · SlackDisconnectButton.SlackDisconnectButton (cognitive 16) · ×1
  • SlackDisconnectButton.SlackDisconnectButton (cognitive 16) langfuse/web/src/features/slack/components/SlackDisconnectButton.tsx:74 — SlackDisconnectButton.SlackDisconnectButton has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (7 pts), boolean chains 4, if/else 4, error handling 1 (nesting depth added 3). Of this number, 11 points are the body's own statements and 5 belong to 3 function items 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 · index.handler (cognitive 16) · ×1
  • index.handler (cognitive 16) langfuse/web/src/pages/api/public/mcp/index.ts:60 — index.handler has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, ternaries 1 (2 pts), error handling 1 (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 · [id].handlePatch (cognitive 16) · ×1
  • [id].handlePatch (cognitive 16) langfuse/web/src/pages/api/public/scim/Users/[id].ts:152 — [id].handlePatch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 1 (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 · ClickhouseWriter.flush (cognitive 16) · ×1
  • ClickhouseWriter.flush (cognitive 16) langfuse/worker/src/services/ClickhouseWriter/index.ts:271 — ClickhouseWriter.flush has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 1, error handling 1, ternaries 1 (nesting depth added 3). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 309, 421). 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 · BackgroundMigrationManager.run (cognitive 16) · ×1
  • BackgroundMigrationManager.run (cognitive 16) langfuse/worker/src/backgroundMigrations/backgroundMigrationManager.ts:38 — BackgroundMigrationManager.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), ternaries 1 (3 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (nesting depth added 7). None of this is in the body itself: all 16 points belong to 2 function literals inside it that branch (lines 39, 44). 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 · usageAggregation.aggregateByOrg (cognitive 16) · ×1
  • usageAggregation.aggregateByOrg (cognitive 16) langfuse/worker/src/ee/usageThresholds/usageAggregation.ts:81 — usageAggregation.aggregateByOrg has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (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 · handleExperimentBackfill.enrichSpansWithExperiment (cognitive 16) · ×1
  • handleExperimentBackfill.enrichSpansWithExperiment (cognitive 16) langfuse/worker/src/features/eventPropagation/handleExperimentBackfill.ts:409 — handleExperimentBackfill.enrichSpansWithExperiment has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 15, loops 1. 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.
D2 · Cognitive Complexity · litellm_callback._record_policy_protected_tool_calls (cognitive 16) · ×1
  • litellm_callback._record_policy_protected_tool_calls (cognitive 16) REDACTED:3169 — litellm_callback._record_policy_protected_tool_calls has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, loops 2 (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 · litellm_callback._build_policy_metadata (cognitive 16) · ×1
  • litellm_callback._build_policy_metadata (cognitive 16) REDACTED:4889 — litellm_callback._build_policy_metadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 2, error handling 1 (2 pts), loops 1 (2 pts), ternaries 1 (nesting depth added 4). 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 · litellm_callback._extract_codex_suffix_json_objects (cognitive 16) · ×1
  • litellm_callback._extract_codex_suffix_json_objects (cognitive 16) REDACTED:5244 — litellm_callback._extract_codex_suffix_json_objects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3, error handling 1 (2 pts), boolean chains 1 (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 · litellm_callback._extract_text_to_wrap (cognitive 16) · ×1
  • litellm_callback._extract_text_to_wrap (cognitive 16) REDACTED:5596 — litellm_callback._extract_text_to_wrap has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). 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 · openclaw_policy._sanitize_user_facing_text (cognitive 16) · ×1
  • openclaw_policy._sanitize_user_facing_text (cognitive 16) ArbiterOS-Kernel/arbiteros_kernel/policy/openclaw_policy.py:516 — openclaw_policy._sanitize_user_facing_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2 (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 · SchemaValidationPolicy.check (cognitive 16) · ×1
  • SchemaValidationPolicy.check (cognitive 16) ArbiterOS-Kernel/arbiteros_kernel/policy/schema_policy.py:81 — SchemaValidationPolicy.check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (4 pts), boolean chains 1, 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 · taint_policy._classify_tool (cognitive 16) · ×1
  • taint_policy._classify_tool (cognitive 16) ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:89 — taint_policy._classify_tool has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 4 (nesting depth added 5). 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 · policy_engine_bat._extract_snippet_variants (cognitive 16) · ×1
  • policy_engine_bat._extract_snippet_variants (cognitive 16) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:183 — policy_engine_bat._extract_snippet_variants has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, loops 1 (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 · KernelPolicyRuntime.approval_granted (cognitive 16) · ×1
  • KernelPolicyRuntime.approval_granted (cognitive 16) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:476 — KernelPolicyRuntime.approval_granted has cognitive complexity 16 (threshold 15). Drivers by points: error handling 3 (7 pts), if/else 3 (5 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 · user_approval._get_last_n_valid_instructions (cognitive 16) · ×1
  • user_approval._get_last_n_valid_instructions (cognitive 16) ArbiterOS-Kernel/arbiteros_kernel/user_approval.py:42 — user_approval._get_last_n_valid_instructions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 1 (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 · review_cases_with_llm.deterministic_review (cognitive 16) · ×1
  • review_cases_with_llm.deterministic_review (cognitive 16) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/review_cases_with_llm.py:128 — review_cases_with_llm.deterministic_review has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 5 (8 pts), if/else 5, boolean chains 3 (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.
D2 · Cognitive Complexity · review_cases_with_llm.review_one_item (cognitive 16) · ×1
  • review_cases_with_llm.review_one_item (cognitive 16) ArbiterOS-Kernel/redteam/_automation/toolemu_v1/review_cases_with_llm.py:199 — review_cases_with_llm.review_one_item has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (6 pts), boolean chains 5, ternaries 3 (4 pts), loops 1 (nesting depth added 2). 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.
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Edited copy of a member (30 corresponding lines) · ×1
  • Edited copy of a member (30 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:184 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:184-230 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:172-205 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (10 members, 50+ identical tokens) ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:73 — ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:73-129 | ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:167-211 | ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:99-199 | ArbiterOS-Kernel/arbiteros_kernel/policy/path_budget_policy.py:191-247 | ArbiterOS-Kernel/arbiteros_kernel/policy/rate_limit_policy.py:88-152 | ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1083-1451 | ArbiterOS-Kernel/arbiteros_kernel/policy/schema_policy.py:90-125 | ArbiterOS-Kernel/arbiteros_kernel/policy/security_label_policy.py:53-116 | ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:156-237 | REDACTED:2135-2366 — These 10 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 10 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 10 times.
D4 · Code Duplication · Edited copy of a member (58 corresponding lines) · ×1
  • Edited copy of a member (58 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1585 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1585-1644 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:907-964 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (37 corresponding lines) · ×1
  • Edited copy of a member (37 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:222 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:222-258 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:211-248 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (40 corresponding lines) · ×1
  • Edited copy of a member (40 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:318 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:318-380 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:294-333 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (34 corresponding lines) · ×1
  • Edited copy of a member (34 corresponding lines) REDACTED:3212 — REDACTED:3212-3245 | REDACTED:3253-3297 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (31 corresponding lines) · ×1
  • Edited copy of a member (31 corresponding lines) REDACTED:3303 — REDACTED:3303-3333 | REDACTED:3363-3394 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×1
  • Edited copy of a member (15 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:273 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:273-287 | REDACTED:1951-1971 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×1
  • Edited copy of a member (7 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:504 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:504-511 | ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:514-520 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×1
  • Edited copy of a member (10 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1359 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1359-1372 | ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1375-1384 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 10+ corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:798 — ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py:798-808 | ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:757-767 | REDACTED:491-500 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (46 corresponding lines) · ×1
  • Edited copy of a member (46 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:361 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:361-435 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:1026-1071 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (5 corresponding lines) · ×1
  • Edited copy of a member (5 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy/direct_metadata.py:247 — ArbiterOS-Kernel/arbiteros_kernel/policy/direct_metadata.py:247-252 | ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:650-654 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×1
  • Edited copy of a member (11 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:200 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:200-210 | REDACTED:1876-1888 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (18 corresponding lines) · ×1
  • Edited copy of a member (18 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:365 — ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:365-389 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/builder.py:46-63 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:544 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:544-546 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:446-448 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (21–48 lines × 2) · ×1
  • Duplicated block (21–48 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:416 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:416-463 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:382-402 — before extracting anything, compare `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py` and `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (41–43 lines × 2) · ×1
  • Duplicated block (41–43 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:510 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:510-550 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:449-491 — before extracting anything, compare `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py` and `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:510` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (39–40 lines × 2) · ×1
  • Duplicated block (39–40 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1307 — ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1307-1345 | ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1405-1444 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (34–37 lines × 2) · ×1
  • Duplicated block (34–37 lines × 2) REDACTED:4347 — REDACTED:4347-4380 | REDACTED:4529-4565 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:4347` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:4528` calls `max` and `REDACTED:4347` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (29–35 lines × 2) · ×1
  • Duplicated block (29–35 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:189 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:189-223 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:172-200 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (33–35 lines × 2) · ×1
  • Duplicated block (33–35 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1510 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1510-1544 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:621-653 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (34 lines × 2) · ×1
  • Duplicated block (34 lines × 2) REDACTED:7074 — REDACTED:7074-7111 | REDACTED:7207-7240 — 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.
D4 · Code Duplication · Duplicated block (32 lines × 2) · ×1
  • Duplicated block (32 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1549 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1549-1580 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:658-689 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (22–27 lines × 2) · ×1
  • Duplicated block (22–27 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:263 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:263-289 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:138-159 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (25–26 lines × 2) · ×1
  • Duplicated block (25–26 lines × 2) REDACTED:3219 — REDACTED:3219-3243 | REDACTED:3272-3297 — 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.
D4 · Code Duplication · Duplicated block (16–24 lines × 2) · ×1
  • Duplicated block (16–24 lines × 2) REDACTED:875 — REDACTED:875-898 | REDACTED:1181-1196 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1181` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:248 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:248-269 | REDACTED:2531-2552 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (20–21 lines × 2) · ×1
  • Duplicated block (20–21 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1266 — ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1266-1285 | REDACTED:2276-2296 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1266` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1754 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1754-1774 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:425-443 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (19–20 lines × 2) · ×1
  • Duplicated block (19–20 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:229 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py:229-248 | ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py:218-236 — before extracting anything, compare `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py` and `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/powershell.py` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (15–20 lines × 2) · ×1
  • Duplicated block (15–20 lines × 2) REDACTED:335 — REDACTED:335-354 | REDACTED:359-373 — 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.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:134 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:134-154 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:72-92 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12–17 lines × 2) · ×1
  • Duplicated block (12–17 lines × 2) REDACTED:514 — REDACTED:514-525 | REDACTED:104-120 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:514` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:436 — ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:436-449 | REDACTED:2023-2037 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×1
  • Duplicated block (15 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:593 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:593-609 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:488-502 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (14 lines × 3) · ×1
  • Duplicated block (14 lines × 3) ArbiterOS-Kernel/arbiteros_kernel/policy/path_budget_policy.py:222 — ArbiterOS-Kernel/arbiteros_kernel/policy/path_budget_policy.py:222-235 | ArbiterOS-Kernel/arbiteros_kernel/policy/schema_policy.py:108-121 | ArbiterOS-Kernel/arbiteros_kernel/policy/security_label_policy.py:83-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (11–14 lines × 2) · ×1
  • Duplicated block (11–14 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:273 — ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:273-283 | REDACTED:1954-1967 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (13–14 lines × 2) · ×1
  • Duplicated block (13–14 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:442 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:442-455 | ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:289-301 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (9–11 lines × 2) · ×1
  • Duplicated block (9–11 lines × 2) REDACTED:5215 — REDACTED:5215-5223 | REDACTED:5541-5551 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:5215` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9–10 lines × 2) · ×1
  • Duplicated block (9–10 lines × 2) REDACTED:6330 — REDACTED:6330-6338 | REDACTED:6384-6393 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:6330` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6–9 lines × 10) · ×1
  • Duplicated block (6–9 lines × 10) ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:110 — ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:110-117 | ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:199-205 | ArbiterOS-Kernel/arbiteros_kernel/policy/efsm_gate_policy.py:191-196 | ArbiterOS-Kernel/arbiteros_kernel/policy/path_budget_policy.py:229-237 | ArbiterOS-Kernel/arbiteros_kernel/policy/rate_limit_policy.py:142-149 | ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1269-1275 | ArbiterOS-Kernel/arbiteros_kernel/policy/schema_policy.py:115-122 | ArbiterOS-Kernel/arbiteros_kernel/policy/security_label_policy.py:90-97 | ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:225-233 | REDACTED:2280-2286 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 10 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:110` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:197` calls `write_back_tool_args` and `ArbiterOS-Kernel/arbiteros_kernel/policy/path_budget_policy.py:229` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–9 lines × 4) · ×1
  • Duplicated block (7–9 lines × 4) REDACTED:5216 — REDACTED:5216-5222 | REDACTED:5542-5550 | REDACTED:6333-6339 | REDACTED:6388-6394 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:6340` calls `_accumulate_trace_total_tokens`, `isinstance`, `strip` and `REDACTED:6395` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (7–8 lines × 2) · ×1
  • Duplicated block (7–8 lines × 2) ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1359 — ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1359-1366 | ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:1375-1381 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (7 lines × 5) · ×1
  • Duplicated block (7 lines × 5) ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:15 — ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:15-21 | ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1096-1102 | ArbiterOS-Kernel/arbiteros_kernel/policy/security_label_policy.py:61-67 | ArbiterOS-Kernel/arbiteros_kernel/policy/taint_policy.py:162-168 | REDACTED:128-134 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `ArbiterOS-Kernel/arbiteros_kernel/policy/security_label_policy.py:68` calls `get`, `isinstance` and `ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py:1103` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (4–6 lines × 3) · ×1
  • Duplicated block (4–6 lines × 3) REDACTED:984 — REDACTED:984-989 | REDACTED:1030-1035 | REDACTED:1082-1085 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:984` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (4–5 lines × 4) · ×1
  • Duplicated block (4–5 lines × 4) ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/helpers/skill_trust.py:241 — ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/helpers/skill_trust.py:241-244 | REDACTED:552-556 | ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_sentinel_policy.py:128-131 | REDACTED:1450-1454 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `REDACTED:1449` calls `get`, `strip` and `ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/helpers/skill_trust.py:241` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (9 lines × 5) · ×1
  • Duplicated block (9 lines × 5) ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:47 — ArbiterOS-Kernel/arbiteros_kernel/policy/allow_deny_policy.py:47-55 | ArbiterOS-Kernel/arbiteros_kernel/policy/delete_policy.py:140-148 | ArbiterOS-Kernel/arbiteros_kernel/policy/rate_limit_policy.py:12-20 | ArbiterOS-Kernel/arbiteros_kernel/policy/security_label_policy.py:12-21 | ArbiterOS-Kernel/arbiteros_kernel/policy/security_label_policy.py:25-33 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
D8 · Code Coverage · Coverage not measured · ×1
  • Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — the jest suite in langfuse/web/ ran and not one test passed (Error: Invalid environment variables), so the coverage would describe the failed run, not the code. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
IC1 · Incompleteness & stubs · Fake-async · ×1
  • Fake-async — async method never awaits langfuse/worker/src/scripts/convertDefaultModelPricesToTiers.ts:116 — `convertFile` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
P5 · DR & Backup · No DR/backup evidence · ×1
  • No DR/backup evidence — A persistence guard (data volume / purge-protection) was found, but no backup, geo-recovery or RTO/RPO controls were evidenced — a volume that survives a container recreate is not a tested restore from catastrophic loss.
P7 · Outbound HTTP resilience · Outbound HTTP without resilience · ×1
  • Outbound HTTP without resilience langfuse/worker/src/features/mixpanel/mixpanelClient.ts:66 — `fetch(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
R10 · Code Duplication · Duplication concentrated across 47 sibling directories (150 clone groups) · ×1
  • Duplication concentrated across 47 sibling directories (150 clone groups) langfuse/web/src/features/organizations/components/RenameOrganization.tsx:45 — 150 duplicated blocks under langfuse/web/src/features/ have copies in at least two of the sibling directories annotation-queues, automations, background-migrations, batch-actions, batch-exports, blobstorage-integration (+41 more sibling(s) not listed) — 84 of them are reported below, and 66 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 150 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 150 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 150 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 7 sibling directories (149 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (149 clone groups) langfuse/web/src/components/table/use-cases/observations.tsx:757 — 149 duplicated blocks under langfuse/web/src/ have copies in at least two of the sibling directories components, ee, features, hooks, pages, server (+1 more sibling(s) not listed) — 87 of them are reported below, and 62 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 149 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 149 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 149 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 3 sibling directories (81 clone groups) · ×1
  • Duplication concentrated across 3 sibling directories (81 clone groups) langfuse/web/src/features/error-analysis/server/router.ts:178 — 81 duplicated blocks under langfuse/ have copies in at least two of the sibling directories packages, web, worker — 46 of them are reported below, and 35 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 81 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 81 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 81 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 13 sibling directories (16 clone groups) · ×1
  • Duplication concentrated across 13 sibling directories (16 clone groups) langfuse/web/src/pages/api/public/projects/[projectId]/memberships/index.ts:14 — 16 duplicated blocks under langfuse/web/src/pages/api/public/ have copies in at least two of the sibling directories annotation-queues, comments, datasets, metrics, models, observations (+7 more sibling(s) not listed) — 12 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 16 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 16 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 16 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 6 sibling directories (13 clone groups) · ×1
  • Duplication concentrated across 6 sibling directories (13 clone groups) langfuse/packages/shared/src/features/evals/observationForEval.ts:18 — 13 duplicated blocks under langfuse/packages/shared/src/ have copies in at least two of the sibling directories domain, features, interfaces, server, tableDefinitions, utils — 5 of them are reported below, and 8 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 4 sibling directories (9 clone groups) · ×1
  • Duplication concentrated across 4 sibling directories (9 clone groups) langfuse/web/src/components/table/utils/jsonExpansionUtils.ts:49 — 9 of the duplicated blocks reported below have copies in at least two of the sibling directories session, table, trace2, ui under langfuse/web/src/components/. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (9 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (9 clone groups) langfuse/worker/src/backgroundMigrations/backfillExperimentsHistoric.ts:443 — 9 duplicated blocks under langfuse/worker/src/ have copies in at least two of the sibling directories backgroundMigrations, ee, features, queues, utils — 4 of them are reported below, and 5 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 7 sibling directories (8 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (8 clone groups) langfuse/packages/shared/src/server/services/email/usageThresholdSuspension/sendUsageThresholdSuspensionEmail.ts:9 — 8 duplicated blocks under langfuse/packages/shared/src/server/services/email/ have copies in at least two of the sibling directories batchExportSuccess, cloudSpendAlert, commentMention, organizationInvitation, passwordReset, usageThresholdSuspension (+1 more sibling(s) not listed) — 7 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 8 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 8 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 8 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (6 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (6 clone groups) langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailViewHeader.tsx:136 — 6 of the duplicated blocks reported below have copies in at least two of the sibling directories ObservationDetailView, TraceDetailView, TraceLogView, TraceTimeline, _shared under langfuse/web/src/components/trace2/components/. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 7 sibling directories (6 clone groups) · ×1
  • Duplication concentrated across 7 sibling directories (6 clone groups) langfuse/worker/src/features/mixpanel/handleMixpanelIntegrationProjectJob.ts:214 — 6 of the duplicated blocks reported below have copies in at least two of the sibling directories batch-data-retention-cleaner, batch-project-cleaner, batch-trace-deletion-cleaner, blobstorage, media-retention-cleaner, mixpanel (+1 more sibling(s) not listed) under langfuse/worker/src/features/. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplication concentrated across 5 sibling directories (5 clone groups) · ×1
  • Duplication concentrated across 5 sibling directories (5 clone groups) langfuse/packages/shared/src/server/repositories/traces.ts:910 — 5 duplicated blocks under langfuse/packages/shared/src/server/ have copies in at least two of the sibling directories llm, otel, queries, repositories, services — 1 of them are reported below, and 4 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 5 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication · Duplicated block with local edits (569 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (569 matched lines × 2 locations) langfuse/web/src/components/table/use-cases/observations.tsx:757 — langfuse/web/src/components/table/use-cases/observations.tsx:757 · langfuse/web/src/features/events/components/EventsTable.tsx:653 — the two spans are one implementation copied and then locally edited — 2630 tokens are still identical, in the same order in both files, 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 with local edits (253 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (253 matched lines × 2 locations) langfuse/web/src/components/table/use-cases/observations.tsx:2025 — langfuse/web/src/components/table/use-cases/observations.tsx:2025 · langfuse/web/src/features/events/components/EventsTable.tsx:1995 — the two spans are one implementation copied and then locally edited — 1183 tokens are still identical, in the same order in both files, 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 with local edits (201 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (201 matched lines × 2 locations) langfuse/web/src/components/trace2/ObservationPreview.tsx:68 — langfuse/web/src/components/trace2/ObservationPreview.tsx:68 · langfuse/web/src/components/trace2/TracePreview.tsx:90 — the two spans are one implementation copied and then locally edited — 844 tokens are still identical, in the same order in both files, 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 with local edits (190 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (190 matched lines × 2 locations) langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleMultiSectionViewer.tsx:34 — langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleMultiSectionViewer.tsx:34 · langfuse/web/src/components/ui/AdvancedJsonViewer/VirtualizedMultiSectionViewer.tsx:41 — the two spans are one implementation copied and then locally edited — 882 tokens are still identical, in the same order in both files, 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 with local edits (157 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (157 matched lines × 2 locations) langfuse/web/src/features/playground/page/components/PlaygroundTools/index.tsx:144 — langfuse/web/src/features/playground/page/components/PlaygroundTools/index.tsx:144 · langfuse/web/src/features/playground/page/components/StructuredOutputSchemaSection.tsx:154 — the two spans are one implementation copied and then locally edited — 692 tokens are still identical, in the same order in both files, 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 with local edits (149 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (149 matched lines × 2 locations) langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleJsonViewer.tsx:19 — langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleJsonViewer.tsx:19 · langfuse/web/src/components/ui/AdvancedJsonViewer/VirtualizedJsonViewer.tsx:20 — the two spans are one implementation copied and then locally edited — 625 tokens are still identical, in the same order in both files, 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 with local edits (144 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (144 matched lines × 2 locations) langfuse/web/src/components/session/TraceEventsRow.tsx:17 — langfuse/web/src/components/session/TraceEventsRow.tsx:17 · langfuse/web/src/components/session/TraceRow.tsx:23 — the two spans are one implementation copied and then locally edited — 807 tokens are still identical, in the same order in both files, 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 with local edits (143 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (143 matched lines × 2 locations) langfuse/web/src/features/evals/components/eval-templates-table.tsx:56 — langfuse/web/src/features/evals/components/eval-templates-table.tsx:56 · langfuse/web/src/features/evals/components/evaluator-table.tsx:139 — the two spans are one implementation copied and then locally edited — 675 tokens are still identical, in the same order in both files, 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 (141 lines × 2 locations) · ×1
  • Duplicated block (141 lines × 2 locations) langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:607 — langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:607 · langfuse/worker/src/backgroundMigrations/backfillEventsHistoricFromParts.ts:458 — 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 (132 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (132 matched lines × 2 locations) langfuse/web/src/components/session/index.tsx:227 — langfuse/web/src/components/session/index.tsx:227 · langfuse/web/src/components/session/index.tsx:544 — the two spans are one implementation copied and then locally edited — 626 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 with local edits (126 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (126 matched lines × 2 locations) langfuse/web/src/components/ui/command.tsx:18 — langfuse/web/src/components/ui/command.tsx:18 · langfuse/web/src/components/ui/input-command.tsx:16 — the two spans are one implementation copied and then locally edited — 644 tokens are still identical, in the same order in both files, 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 · Wholesale file copy (119 identical lines × 2 files) · ×1
  • Wholesale file copy (119 identical lines × 2 files) langfuse/web/src/features/score-analytics/components/charts/ScoreTimeSeriesBooleanChart.tsx:1 — langfuse/web/src/features/score-analytics/components/charts/ScoreTimeSeriesBooleanChart.tsx:1 · langfuse/web/src/features/score-analytics/components/charts/ScoreTimeSeriesCategoricalChart.tsx:1 — these 2 files are line-for-line copies of one another — 119 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication · Duplicated block with local edits (116 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (116 matched lines × 2 locations) langfuse/web/src/features/datasets/components/DatasetRunItemsByItemTable.tsx:43 — langfuse/web/src/features/datasets/components/DatasetRunItemsByItemTable.tsx:43 · langfuse/web/src/features/datasets/components/DatasetRunItemsByRunTable.tsx:63 — the two spans are one implementation copied and then locally edited — 594 tokens are still identical, in the same order in both files, 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 with local edits (114 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (114 matched lines × 2 locations) langfuse/web/src/pages/auth/sign-in.tsx:548 — langfuse/web/src/pages/auth/sign-in.tsx:548 · langfuse/web/src/pages/auth/sign-up.tsx:60 — the two spans are one implementation copied and then locally edited — 523 tokens are still identical, in the same order in both files, 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 with local edits (111 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (111 matched lines × 2 locations) langfuse/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx:183 — langfuse/web/src/pages/project/[projectId]/settings/integrations/mixpanel.tsx:183 · langfuse/web/src/pages/project/[projectId]/settings/integrations/posthog.tsx:156 — the two spans are one implementation copied and then locally edited — 440 tokens are still identical, in the same order in both files, 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 with local edits (105 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (105 matched lines × 2 locations) langfuse/worker/src/features/database-read-stream/event-stream.ts:37 — langfuse/worker/src/features/database-read-stream/event-stream.ts:37 · langfuse/worker/src/features/database-read-stream/trace-stream.ts:27 — the two spans are one implementation copied and then locally edited — 543 tokens are still identical, in the same order in both files, 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 (97 lines × 2 locations) · ×1
  • Duplicated block (97 lines × 2 locations) langfuse/packages/shared/src/server/repositories/dashboards.ts:104 — langfuse/packages/shared/src/server/repositories/dashboards.ts:104 · langfuse/packages/shared/src/server/repositories/dashboards.ts:202 — 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 with local edits (96 matched lines × 2 locations) · ×1
  • Duplicated block with local edits (96 matched lines × 2 locations) langfuse/packages/shared/src/server/queries/clickhouse-sql/clickhouse-filter.ts:44 — langfuse/packages/shared/src/server/queries/clickhouse-sql/clickhouse-filter.ts:44 · langfuse/packages/shared/src/server/queries/clickhouse-sql/clickhouse-filter.ts:271 — the two spans are one implementation copied and then locally edited — 559 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 (92 lines × 2 locations) · ×1
  • Duplicated block (92 lines × 2 locations) langfuse/web/src/features/score-analytics/components/cards/DistributionCategoricalCard.tsx:209 — langfuse/web/src/features/score-analytics/components/cards/DistributionCategoricalCard.tsx:209 · langfuse/web/src/features/score-analytics/components/cards/DistributionNumericCard.tsx:148 — 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.
R2 · Cyclomatic Complexity · Complex function StatisticsCard (cyclomatic 107, cognitive 93) · ×1
  • Complex function StatisticsCard (cyclomatic 107, cognitive 93) langfuse/web/src/features/score-analytics/components/cards/StatisticsCard.tsx:39 — StatisticsCard has cyclomatic complexity 107 and cognitive complexity 93; 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 buildGraphFromStepData (cyclomatic 103, cognitive 193) · ×1
  • Complex function buildGraphFromStepData (cyclomatic 103, cognitive 193) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:111 — buildGraphFromStepData has cyclomatic complexity 103 and cognitive complexity 193; 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 convertObservationPartial (cyclomatic 94, cognitive 93) · ×1
  • Complex function convertObservationPartial (cyclomatic 94, cognitive 93) langfuse/packages/shared/src/server/repositories/observations_converters.ts:120 — convertObservationPartial has cyclomatic complexity 94 and cognitive complexity 93; 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 buildTurnMetadataSummary (cyclomatic 81, cognitive 116) · ×1
  • Complex function buildTurnMetadataSummary (cyclomatic 81, cognitive 116) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:1222 — buildTurnMetadataSummary has cyclomatic complexity 81 and cognitive complexity 116; 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 inferErrorTypeKeyFromText (cyclomatic 76, cognitive 28) · ×1
  • Complex function inferErrorTypeKeyFromText (cyclomatic 76, cognitive 28) langfuse/web/src/features/error-analysis/server/router.ts:393 — inferErrorTypeKeyFromText has cyclomatic complexity 76 and cognitive complexity 28; 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 inferErrorTypeKeyFromText (cyclomatic 75, cognitive 29) · ×1
  • Complex function inferErrorTypeKeyFromText (cyclomatic 75, cognitive 29) langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:182 — inferErrorTypeKeyFromText has cyclomatic complexity 75 and cognitive complexity 29; 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 verifyClickhouseObservation (cyclomatic 72, cognitive 78) · ×1
  • Complex function verifyClickhouseObservation (cyclomatic 72, cognitive 78) langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts:291 — verifyClickhouseObservation has cyclomatic complexity 72 and cognitive complexity 78; 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 extractInputAndOutput (cyclomatic 70, cognitive 97) · ×1
  • Complex function extractInputAndOutput (cyclomatic 70, cognitive 97) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1165 — extractInputAndOutput has cyclomatic complexity 70 and cognitive complexity 97; 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 65, cognitive 105) · ×1
  • Complex function (anonymous) (cyclomatic 65, cognitive 105) langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:923 — (anonymous) has cyclomatic complexity 65 and cognitive complexity 105; 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 autoErrorAnalysisQueueProcessor (cyclomatic 65, cognitive 99) · ×1
  • Complex function autoErrorAnalysisQueueProcessor (cyclomatic 65, cognitive 99) langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:674 — autoErrorAnalysisQueueProcessor has cyclomatic complexity 65 and cognitive complexity 99; 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 createEvalJobs (cyclomatic 61, cognitive 125) · ×1
  • Complex function createEvalJobs (cyclomatic 61, cognitive 125) langfuse/worker/src/features/evaluation/evalService.ts:166 — createEvalJobs has cyclomatic complexity 61 and cognitive complexity 125; 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 57, cognitive 57) · ×1
  • Complex function (anonymous) (cyclomatic 57, cognitive 57) langfuse/web/src/features/score-analytics/hooks/useScoreAnalyticsQuery.ts:246 — (anonymous) has cyclomatic complexity 57 and cognitive complexity 57; 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 buildHierarchyGraphFromStepData (cyclomatic 56, cognitive 89) · ×1
  • Complex function buildHierarchyGraphFromStepData (cyclomatic 56, cognitive 89) langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:701 — buildHierarchyGraphFromStepData has cyclomatic complexity 56 and cognitive complexity 89; 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 fetchLLMCompletion (cyclomatic 56, cognitive 71) · ×1
  • Complex function fetchLLMCompletion (cyclomatic 56, cognitive 71) langfuse/packages/shared/src/server/llm/fetchLLMCompletion.ts:118 — fetchLLMCompletion has cyclomatic complexity 56 and cognitive complexity 71; 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 PolicyGovernancePage (cyclomatic 52, cognitive 48) · ×1
  • Complex function PolicyGovernancePage (cyclomatic 52, cognitive 48) langfuse/web/src/pages/project/[projectId]/policy.tsx:163 — PolicyGovernancePage has cyclomatic complexity 52 and cognitive complexity 48; 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 ObservationDetailView (cyclomatic 51, cognitive 43) · ×1
  • Complex function ObservationDetailView (cyclomatic 51, cognitive 43) langfuse/web/src/components/trace2/components/ObservationDetailView/ObservationDetailView.tsx:82 — ObservationDetailView has cyclomatic complexity 51 and cognitive complexity 43; 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 InnerEvaluatorForm (cyclomatic 51, cognitive 43) · ×1
  • Complex function InnerEvaluatorForm (cyclomatic 51, cognitive 43) langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:257 — InnerEvaluatorForm has cyclomatic complexity 51 and cognitive complexity 43; 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 50, cognitive 99) · ×1
  • Complex function (anonymous) (cyclomatic 50, cognitive 99) langfuse/web/src/features/error-analysis/server/router.ts:1068 — (anonymous) has cyclomatic complexity 50 and cognitive complexity 99; 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 handleBatchActionJob (cyclomatic 50, cognitive 68) · ×1
  • Complex function handleBatchActionJob (cyclomatic 50, cognitive 68) langfuse/worker/src/features/batchAction/handleBatchActionJob.ts:137 — handleBatchActionJob has cyclomatic complexity 50 and cognitive complexity 68; 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 DataTableToolbar (cyclomatic 50, cognitive 39) · ×1
  • Complex function DataTableToolbar (cyclomatic 50, cognitive 39) langfuse/web/src/components/table/data-table-toolbar.tsx:133 — DataTableToolbar has cyclomatic complexity 50 and cognitive complexity 39; 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 SpanContent (cyclomatic 49, cognitive 38) · ×1
  • Complex function SpanContent (cyclomatic 49, cognitive 38) langfuse/web/src/components/trace2/components/SpanContent.tsx:43 — SpanContent has cyclomatic complexity 49 and cognitive complexity 38; 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 buildTracesBaseQuery (cyclomatic 46, cognitive 59) · ×1
  • Complex function buildTracesBaseQuery (cyclomatic 46, cognitive 59) langfuse/web/src/features/public-api/server/traces.ts:44 — buildTracesBaseQuery has cyclomatic complexity 46 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 LogViewToolbar (cyclomatic 46, cognitive 38) · ×1
  • Complex function LogViewToolbar (cyclomatic 46, cognitive 38) langfuse/web/src/components/trace2/components/TraceLogView/LogViewToolbar.tsx:77 — LogViewToolbar has cyclomatic complexity 46 and cognitive complexity 38; 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 44, cognitive 43) · ×1
  • Complex function (anonymous) (cyclomatic 44, cognitive 43) langfuse/web/src/features/filters/components/filter-builder.tsx:600 — (anonymous) has cyclomatic complexity 44 and cognitive complexity 43; 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 ObservationsEventsTable (cyclomatic 42, cognitive 41) · ×1
  • Complex function ObservationsEventsTable (cyclomatic 42, cognitive 41) langfuse/web/src/features/events/components/EventsTable.tsx:315 — ObservationsEventsTable has cyclomatic complexity 42 and cognitive complexity 41; 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 SSOButtons (cyclomatic 42, cognitive 41) · ×1
  • Complex function SSOButtons (cyclomatic 42, cognitive 41) langfuse/web/src/pages/auth/sign-in.tsx:180 — SSOButtons has cyclomatic complexity 42 and cognitive complexity 41; 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 ObservationGovernanceAnalysisPanel (cyclomatic 41, cognitive 38) · ×1
  • Complex function ObservationGovernanceAnalysisPanel (cyclomatic 41, cognitive 38) REDACTED:45 — ObservationGovernanceAnalysisPanel has cyclomatic complexity 41 and cognitive complexity 38; 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 WidgetForm (cyclomatic 40, cognitive 37) · ×1
  • Complex function WidgetForm (cyclomatic 40, cognitive 37) langfuse/web/src/features/widgets/components/WidgetForm.tsx:156 — WidgetForm has cyclomatic complexity 40 and cognitive complexity 37; 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 applyErrorTypeFilters (cyclomatic 39, cognitive 58) · ×1
  • Complex function applyErrorTypeFilters (cyclomatic 39, cognitive 58) langfuse/web/src/features/error-analysis/server/errorTypeFilters.ts:83 — applyErrorTypeFilters has cyclomatic complexity 39 and cognitive complexity 58; 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 detect (cyclomatic 39, cognitive 55) · ×1
  • Complex function detect (cyclomatic 39, cognitive 55) langfuse/packages/shared/src/utils/chatml/adapters/langgraph.ts:272 — detect has cyclomatic complexity 39 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 ErrorAnalysisSettings (cyclomatic 39, cognitive 30) · ×1
  • Complex function ErrorAnalysisSettings (cyclomatic 39, cognitive 30) langfuse/web/src/features/error-analysis/components/ErrorAnalysisSettings.tsx:66 — ErrorAnalysisSettings has cyclomatic complexity 39 and cognitive complexity 30; 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 usePreviewData (cyclomatic 39, cognitive 22) · ×1
  • Complex function usePreviewData (cyclomatic 39, cognitive 22) langfuse/web/src/features/evals/hooks/usePreviewData.ts:38 — usePreviewData has cyclomatic complexity 39 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 extractUsageDetails (cyclomatic 38, cognitive 73) · ×1
  • Complex function extractUsageDetails (cyclomatic 38, cognitive 73) langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1878 — extractUsageDetails has cyclomatic complexity 38 and cognitive complexity 73; 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 ObservationsTable (cyclomatic 38, cognitive 37) · ×1
  • Complex function ObservationsTable (cyclomatic 38, cognitive 37) langfuse/web/src/components/table/use-cases/observations.tsx:280 — ObservationsTable has cyclomatic complexity 38 and cognitive complexity 37; 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 TimelineBar (cyclomatic 38, cognitive 27) · ×1
  • Complex function TimelineBar (cyclomatic 38, cognitive 27) langfuse/web/src/components/trace2/components/TraceTimeline/TimelineBar.tsx:16 — TimelineBar has cyclomatic complexity 38 and cognitive complexity 27; 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 (top-level) (cyclomatic 37, cognitive 59) · ×1
  • Complex function (top-level) (cyclomatic 37, cognitive 59) langfuse/web/src/initialize.ts:1 — (top-level) has cyclomatic complexity 37 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 detect (cyclomatic 37, cognitive 46) · ×1
  • Complex function detect (cyclomatic 37, cognitive 46) langfuse/packages/shared/src/utils/chatml/adapters/openai.ts:369 — detect has cyclomatic complexity 37 and cognitive complexity 46; 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 37, cognitive 39) · ×1
  • Complex function (anonymous) (cyclomatic 37, cognitive 39) langfuse/worker/src/services/IngestionService/index.ts:1803 — (anonymous) has cyclomatic complexity 37 and cognitive complexity 39; 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.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 16409 lines of code REDACTED:1 — REDACTED has 16409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/packages/shared/src/server/repositories/events.ts · ×1
  • langfuse/packages/shared/src/server/repositories/events.ts: 2843 lines of code langfuse/packages/shared/src/server/repositories/events.ts:1 — langfuse/packages/shared/src/server/repositories/events.ts has 2843 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/components/table/use-cases/observations.tsx · ×1
  • langfuse/web/src/components/table/use-cases/observations.tsx: 2352 lines of code langfuse/web/src/components/table/use-cases/observations.tsx:1 — langfuse/web/src/components/table/use-cases/observations.tsx has 2352 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/events/components/EventsTable.tsx · ×1
  • langfuse/web/src/features/events/components/EventsTable.tsx: 2262 lines of code langfuse/web/src/features/events/components/EventsTable.tsx:1 — langfuse/web/src/features/events/components/EventsTable.tsx has 2262 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts · ×1
  • langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts: 2174 lines of code langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:1 — langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts has 2174 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/error-analysis/server/router.ts · ×1
  • langfuse/web/src/features/error-analysis/server/router.ts: 2069 lines of code langfuse/web/src/features/error-analysis/server/router.ts:1 — langfuse/web/src/features/error-analysis/server/router.ts has 2069 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/packages/shared/src/server/repositories/scores.ts · ×1
  • langfuse/packages/shared/src/server/repositories/scores.ts: 1960 lines of code langfuse/packages/shared/src/server/repositories/scores.ts:1 — langfuse/packages/shared/src/server/repositories/scores.ts has 1960 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts · ×1
  • langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts: 1920 lines of code langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts:1 — langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts has 1920 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/packages/shared/src/server/repositories/observations.ts · ×1
  • langfuse/packages/shared/src/server/repositories/observations.ts: 1892 lines of code langfuse/packages/shared/src/server/repositories/observations.ts:1 — langfuse/packages/shared/src/server/repositories/observations.ts has 1892 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · REDACTED · ×1
  • REDACTED: 1847 lines of code REDACTED:1 — REDACTED has 1847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/datasets/server/dataset-router.ts · ×1
  • langfuse/web/src/features/datasets/server/dataset-router.ts: 1825 lines of code langfuse/web/src/features/datasets/server/dataset-router.ts:1 — langfuse/web/src/features/datasets/server/dataset-router.ts has 1825 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/worker/src/services/IngestionService/index.ts · ×1
  • langfuse/worker/src/services/IngestionService/index.ts: 1757 lines of code langfuse/worker/src/services/IngestionService/index.ts:1 — langfuse/worker/src/services/IngestionService/index.ts has 1757 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/widgets/components/WidgetForm.tsx · ×1
  • langfuse/web/src/features/widgets/components/WidgetForm.tsx: 1733 lines of code langfuse/web/src/features/widgets/components/WidgetForm.tsx:1 — langfuse/web/src/features/widgets/components/WidgetForm.tsx has 1733 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/packages/shared/src/server/repositories/dataset-items.ts · ×1
  • langfuse/packages/shared/src/server/repositories/dataset-items.ts: 1694 lines of code langfuse/packages/shared/src/server/repositories/dataset-items.ts:1 — langfuse/packages/shared/src/server/repositories/dataset-items.ts has 1694 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts · ×1
  • langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts: 1559 lines of code langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts:1 — langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts has 1559 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/packages/shared/src/server/repositories/traces.ts · ×1
  • langfuse/packages/shared/src/server/repositories/traces.ts: 1556 lines of code langfuse/packages/shared/src/server/repositories/traces.ts:1 — langfuse/packages/shared/src/server/repositories/traces.ts has 1556 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/query/dataModel.ts · ×1
  • langfuse/web/src/features/query/dataModel.ts: 1531 lines of code langfuse/web/src/features/query/dataModel.ts:1 — langfuse/web/src/features/query/dataModel.ts has 1531 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/components/table/data-table-controls.tsx · ×1
  • langfuse/web/src/components/table/data-table-controls.tsx: 1483 lines of code langfuse/web/src/components/table/data-table-controls.tsx:1 — langfuse/web/src/components/table/data-table-controls.tsx has 1483 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx · ×1
  • langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx: 1429 lines of code langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx:1 — langfuse/web/src/features/filters/hooks/useSidebarFilterState.tsx has 1429 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.ts · ×1
  • langfuse/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.ts: 1422 lines of code langfuse/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.ts:1 — langfuse/packages/shared/src/server/queries/clickhouse-sql/event-query-builder.ts has 1422 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/evals/server/router.ts · ×1
  • langfuse/web/src/features/evals/server/router.ts: 1394 lines of code langfuse/web/src/features/evals/server/router.ts:1 — langfuse/web/src/features/evals/server/router.ts has 1394 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/prompts/server/routers/promptRouter.ts · ×1
  • langfuse/web/src/features/prompts/server/routers/promptRouter.ts: 1393 lines of code langfuse/web/src/features/prompts/server/routers/promptRouter.ts:1 — langfuse/web/src/features/prompts/server/routers/promptRouter.ts has 1393 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/policy-governance/server/router.ts · ×1
  • langfuse/web/src/features/policy-governance/server/router.ts: 1362 lines of code langfuse/web/src/features/policy-governance/server/router.ts:1 — langfuse/web/src/features/policy-governance/server/router.ts has 1362 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx · ×1
  • langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx: 1344 lines of code langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx:1 — langfuse/web/src/features/public-api/components/CreateLLMApiKeyForm.tsx has 1344 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/components/ui/PrettyJsonView.tsx · ×1
  • langfuse/web/src/components/ui/PrettyJsonView.tsx: 1271 lines of code langfuse/web/src/components/ui/PrettyJsonView.tsx:1 — langfuse/web/src/components/ui/PrettyJsonView.tsx has 1271 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/packages/shared/scripts/seeder/utils/data-generators.ts · ×1
  • langfuse/packages/shared/scripts/seeder/utils/data-generators.ts: 1237 lines of code langfuse/packages/shared/scripts/seeder/utils/data-generators.ts:1 — langfuse/packages/shared/scripts/seeder/utils/data-generators.ts has 1237 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/components/table/use-cases/traces.tsx · ×1
  • langfuse/web/src/components/table/use-cases/traces.tsx: 1228 lines of code langfuse/web/src/components/table/use-cases/traces.tsx:1 — langfuse/web/src/components/table/use-cases/traces.tsx has 1228 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/worker/src/queues/autoErrorAnalysisQueue.ts · ×1
  • langfuse/worker/src/queues/autoErrorAnalysisQueue.ts: 1209 lines of code langfuse/worker/src/queues/autoErrorAnalysisQueue.ts:1 — langfuse/worker/src/queues/autoErrorAnalysisQueue.ts has 1209 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/pages/project/[projectId]/experience/index.tsx · ×1
  • langfuse/web/src/pages/project/[projectId]/experience/index.tsx: 1192 lines of code langfuse/web/src/pages/project/[projectId]/experience/index.tsx:1 — langfuse/web/src/pages/project/[projectId]/experience/index.tsx has 1192 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/query/server/queryBuilder.ts · ×1
  • langfuse/web/src/features/query/server/queryBuilder.ts: 1184 lines of code langfuse/web/src/features/query/server/queryBuilder.ts:1 — langfuse/web/src/features/query/server/queryBuilder.ts has 1184 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/worker/src/features/evaluation/evalService.ts · ×1
  • langfuse/worker/src/features/evaluation/evalService.ts: 1177 lines of code langfuse/worker/src/features/evaluation/evalService.ts:1 — langfuse/worker/src/features/evaluation/evalService.ts has 1177 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/pages/project/[projectId]/policy.tsx · ×1
  • langfuse/web/src/pages/project/[projectId]/policy.tsx: 1121 lines of code langfuse/web/src/pages/project/[projectId]/policy.tsx:1 — langfuse/web/src/pages/project/[projectId]/policy.tsx has 1121 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/packages/shared/src/server/repositories/dataset-run-items.ts · ×1
  • langfuse/packages/shared/src/server/repositories/dataset-run-items.ts: 1116 lines of code langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:1 — langfuse/packages/shared/src/server/repositories/dataset-run-items.ts has 1116 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/evals/components/inner-evaluator-form.tsx · ×1
  • langfuse/web/src/features/evals/components/inner-evaluator-form.tsx: 1116 lines of code langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:1 — langfuse/web/src/features/evals/components/inner-evaluator-form.tsx has 1116 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/components/session/index.tsx · ×1
  • langfuse/web/src/components/session/index.tsx: 1048 lines of code langfuse/web/src/components/session/index.tsx:1 — langfuse/web/src/components/session/index.tsx has 1048 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/dashboard/server/dashboard-router.ts · ×1
  • langfuse/web/src/features/dashboard/server/dashboard-router.ts: 1041 lines of code langfuse/web/src/features/dashboard/server/dashboard-router.ts:1 — langfuse/web/src/features/dashboard/server/dashboard-router.ts has 1041 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx · ×1
  • langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx: 1021 lines of code langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx:1 — langfuse/web/src/features/trace-graph-view/components/TraceGraphCanvas.tsx has 1021 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/features/filters/components/filter-builder.tsx · ×1
  • langfuse/web/src/features/filters/components/filter-builder.tsx: 1010 lines of code langfuse/web/src/features/filters/components/filter-builder.tsx:1 — langfuse/web/src/features/filters/components/filter-builder.tsx has 1010 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx · ×1
  • langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx: 1005 lines of code langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx:1 — langfuse/web/src/pages/project/[projectId]/settings/integrations/blobstorage.tsx has 1005 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files · langfuse/web/src/server/api/routers/scores.ts · ×1
  • langfuse/web/src/server/api/routers/scores.ts: 1003 lines of code langfuse/web/src/server/api/routers/scores.ts:1 — langfuse/web/src/server/api/routers/scores.ts has 1003 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R7 · Dead Code · Dead file (~2185 LoC) · ×1
  • Dead file (~2185 LoC) langfuse/web/src/components/trace2/lib/tree-building.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~1057 LoC) · ×1
  • Dead file (~1057 LoC) REDACTED — no import path from any entry point (201 application, 23 tooling, 204 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 (~1010 LoC) · ×1
  • Dead file (~1010 LoC) langfuse/web/src/utils/chatml/jumptoplayground.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~967 LoC) · ×1
  • Dead file (~967 LoC) langfuse/worker/src/scripts/verifyClickhouseRecords/index.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~901 LoC) · ×1
  • Dead file (~901 LoC) langfuse/web/src/components/trace2/components/_shared/tree-flattening.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~630 LoC) · ×1
  • Dead file (~630 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeStructure.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~568 LoC) · ×1
  • Dead file (~568 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeNavigation.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~567 LoC) · ×1
  • Dead file (~567 LoC) langfuse/web/src/features/filters/filter-integration.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~547 LoC) · ×1
  • Dead file (~547 LoC) langfuse/web/src/features/filters/lib/filter-query-encoding-decoding.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~531 LoC) · ×1
  • Dead file (~531 LoC) langfuse/web/src/features/comments/lib/mentionParser.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~500 LoC) · ×1
  • Dead file (~500 LoC) langfuse/web/src/components/trace2/contexts/json-expansion-utils.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~456 LoC) · ×1
  • Dead file (~456 LoC) langfuse/web/src/components/ui/AdvancedJsonSection/AdvancedJsonSection.tsx — no import path from any entry point (201 application, 23 tooling, 204 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 (~450 LoC) · ×1
  • Dead file (~450 LoC) langfuse/web/src/components/trace2/components/TraceLogView/log-view-flattening.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~441 LoC) · ×1
  • Dead file (~441 LoC) langfuse/web/src/features/score-configs/components/UpsertScoreConfigDialog.tsx — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/components/table/use-cases/score-configs.tsx) — 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
R7 · Dead Code · Dead file (~319 LoC) · ×1
  • Dead file (~319 LoC) langfuse/web/src/components/table/use-cases/score-configs.tsx — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/features/score-configs/components/ScoreConfigSettings.tsx) — 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
R7 · Dead Code · Dead file (~316 LoC) · ×1
  • Dead file (~316 LoC) langfuse/web/src/components/trace2/components/IOPreview/components/chat-message-utils.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~304 LoC) · ×1
  • Dead file (~304 LoC) langfuse/web/src/features/datasets/components/EditDatasetItem.tsx — no import path from any entry point (201 application, 23 tooling, 204 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 (~297 LoC) · ×1
  • Dead file (~297 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/AdvancedJsonViewer.tsx — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/components/ui/AdvancedJsonSection/AdvancedJsonSection.tsx) — 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
R7 · Dead Code · Dead file (~289 LoC) · ×1
  • Dead file (~289 LoC) langfuse/web/src/server/api/services/tableDefinitions.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~262 LoC) · ×1
  • Dead file (~262 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/VirtualizedJsonViewer.tsx — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/components/ui/AdvancedJsonViewer/AdvancedJsonViewer.tsx) — 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
R7 · Dead Code · Dead file (~256 LoC) · ×1
  • Dead file (~256 LoC) langfuse/web/src/features/dashboard/components/ScoresTable.tsx — no import path from any entry point (201 application, 23 tooling, 204 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 (~222 LoC) · ×1
  • Dead file (~222 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/utils/searchJson.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~217 LoC) · ×1
  • Dead file (~217 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/SimpleJsonViewer.tsx — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/components/ui/AdvancedJsonViewer/AdvancedJsonViewer.tsx) — 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
R7 · Dead Code · Dead file (~213 LoC) · ×1
  • Dead file (~213 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/utils/jsonTypes.clienttest.ts — no import path from any entry point (201 application, 23 tooling, 204 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 (~211 LoC) · ×1
  • Dead file (~211 LoC) langfuse/web/src/features/batch-actions/components/BatchActionsTable.tsx — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/features/batch-actions/components/BatchActionsSettingsPage.tsx) — 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
R7 · Dead Code · Dead file (~210 LoC) · ×1
  • Dead file (~210 LoC) langfuse/packages/shared/scripts/seeder/seed-dataset-versions.ts — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (REDACTED) — 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
R7 · Dead Code · Dead file (~206 LoC) · ×1
  • Dead file (~206 LoC) langfuse/web/src/features/dashboard/components/score-analytics/ScoreAnalytics.tsx — no import path from any entry point (201 application, 23 tooling, 204 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 (~189 LoC) · ×1
  • Dead file (~189 LoC) langfuse/web/src/features/prompts/components/auto-complete.tsx — no import path from any entry point (201 application, 23 tooling, 204 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 (~182 LoC) · ×1
  • Dead file (~182 LoC) langfuse/packages/shared/src/server/services/email/usageThresholdSuspension/UsageThresholdUpcomingEnforcementEmailTemplate.tsx — no import path from any entry point (201 application, 23 tooling, 204 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 (~176 LoC) · ×1
  • Dead file (~176 LoC) langfuse/web/src/features/dashboard/components/TracesBarListChart.tsx — no import path from any entry point (201 application, 23 tooling, 204 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 (~157 LoC) · ×1
  • Dead file (~157 LoC) langfuse/web/src/components/ui/AdvancedJsonViewer/components/SearchBar.tsx — no import path from any entry point (201 application, 23 tooling, 204 test roots considered), but 1 in-repo import(s) from 1 other file(s) do name it (langfuse/web/src/components/ui/AdvancedJsonViewer/AdvancedJsonViewer.tsx) — 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
R7 · Dead Code · Dead file (~156 LoC) · ×1
  • Dead file (~156 LoC) langfuse/web/src/features/datasets/components/ImportCard.tsx — no import path from any entry point (201 application, 23 tooling, 204 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
R8 · Dependency Hygiene · Unused dependency '@release-it/bumper' · ×1
  • Unused dependency '@release-it/bumper' langfuse/package.json:40 — Declared in langfuse/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.
R8 · Dependency Hygiene · Unused dependency 'braces' · ×1
  • Unused dependency 'braces' langfuse/package.json:41 — Declared in langfuse/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.
R8 · Dependency Hygiene · Unused dependency '@eslint/compat' · ×1
  • Unused dependency '@eslint/compat' langfuse/packages/config-eslint/package.json:18 — Declared in langfuse/packages/config-eslint/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.
R8 · Dependency Hygiene · Unused dependency 'prisma-kysely' · ×1
  • Unused dependency 'prisma-kysely' langfuse/packages/shared/package.json:137 — Declared in langfuse/packages/shared/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.
R8 · Dependency Hygiene · Unused dependency 'zod-to-json-schema' · ×1
  • Unused dependency 'zod-to-json-schema' langfuse/packages/shared/package.json:118 — Declared in langfuse/packages/shared/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.
R8 · Dependency Hygiene · Unused dependency '@heroicons/react' · ×1
  • Unused dependency '@heroicons/react' REDACTED:43 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency '@langfuse/ee' · ×1
  • Unused dependency '@langfuse/ee' REDACTED:46 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency '@mui/x-tree-view' · ×1
  • Unused dependency '@mui/x-tree-view' REDACTED:51 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency '@opentelemetry/sdk-trace-node' · ×1
  • Unused dependency '@opentelemetry/sdk-trace-node' REDACTED:66 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency '@paralleldrive/cuid2' · ×1
  • Unused dependency '@paralleldrive/cuid2' REDACTED:67 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency '@radix-ui/react-icons' · ×1
  • Unused dependency '@radix-ui/react-icons' REDACTED:77 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency '@remixicon/react' · ×1
  • Unused dependency '@remixicon/react' REDACTED:92 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency '@xyflow/react' · ×1
  • Unused dependency '@xyflow/react' REDACTED:106 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency 'graphql' · ×1
  • Unused dependency 'graphql' REDACTED:123 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency 'langchain' · ×1
  • Unused dependency 'langchain' REDACTED:129 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency 'remark-math' · ×1
  • Unused dependency 'remark-math' REDACTED:158 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency 'remark-parse' · ×1
  • Unused dependency 'remark-parse' REDACTED:159 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency 'remark-rehype' · ×1
  • Unused dependency 'remark-rehype' REDACTED:160 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency 'remark-stringify' · ×1
  • Unused dependency 'remark-stringify' REDACTED:161 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency 'tsconfig-paths' · ×1
  • Unused dependency 'tsconfig-paths' REDACTED:210 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency 'unified' · ×1
  • Unused dependency 'unified' REDACTED:167 — Declared in REDACTED 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.
R8 · Dependency Hygiene · Unused dependency '@aws-sdk/client-s3' · ×1
  • Unused dependency '@aws-sdk/client-s3' langfuse/worker/package.json:30 — Declared in langfuse/worker/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.
R8 · Dependency Hygiene · Unused dependency 'backoff' · ×1
  • Unused dependency 'backoff' langfuse/worker/package.json:45 — Declared in langfuse/worker/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.
S1 · Web-Security Posture · Weak hash algorithm · ×1
  • Weak hash algorithm langfuse/worker/src/features/batch-data-retention-cleaner/index.ts:56 — MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`createHash("sha256")`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
X24 · Document value interpolated into markup unescaped · Untrusted text written into markup unescaped · ×1
  • Untrusted text written into markup unescaped REDACTED:82 — `Object.entries(THEMES).map(([theme,prefix])=>` ${prefix} [data-chart=${id}] { ${colorConfig.map(([key,itemConfig])=>{…` is text this program did not author, and it is written into the text of an element through `dangerouslySetInnerHTML` with nothing encoding it for that place. Whoever controls the value controls the markup: it can close the element or attribute it sits in and open a script of its own. Encode it for HTML at this site, render it through the framework's escaping output, or sanitise it if it must stay markup.
X3 · Exception handling · Swallowed exception (caught, then discarded) · ×1
  • Swallowed exception (caught, then discarded) langfuse/web/src/features/batch-actions/components/RunEvaluationDialog/index.tsx:116 — `catch` takes every exception and records none of it — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch and only the substituted value survives. Log it through whatever this codebase already uses to report problems, or keep only the failure you expect and rethrow the rest (`catch (e) { if (!(e instanceof SyntaxError)) throw e; … }`, or test `e.name`), because a JavaScript catch takes every exception, programming errors included.
Minor — 614 finding(s)
D24 · Comment Value · redundant comment · ×384
  • redundant comment langfuse/packages/shared/scripts/seeder/seed-media.ts:104 — "Check if file exists" repeats the code it sits on: 3 of its 3 words (check, file, exists) are already in `if (!fs.existsSync(mediaFile.filePath))`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/scripts/seeder/seed-media.ts:242 — "Trace 2: All media types" repeats the code it sits on: 3 of its 3 words (trace, media, types) are already in `const trace2Id = MEDIA_TEST_TRACE_IDS.allTypes;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/scripts/seeder/utils/framework-traces/framework-trace-loader.ts:126 — "Map parent observation ID" repeats the code it sits on: 4 of its 4 words (map, parent, observation, id) are already in `const parentObservationId = obs.parentObservationId`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/scripts/seeder/utils/seeder-orchestrator.ts:122 — 11 comments in this file only repeat the code they sit on (lines 122, 134, 145, 157, 215, 221, 328, 331, 334, 337, 343), for example "Generate dataset run item data". Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/domain/score-configs.ts:10 — "Numeric config fields" repeats the code it sits on: 3 of its 3 words (numeric, config, fields) are already in `export const NumericConfigFields = z.object({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/domain/score-configs.ts:18 — "Boolean config fields" repeats the code it sits on: 3 of its 3 words (boolean, config, fields) are already in `export const BooleanConfigFields = z.object({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/encryption/signature.ts:3 — "Generate a webhook secret key" repeats the code it sits on: 4 of its 4 words (generate, webhook, secret, key) are already in `export function generateWebhookSecret(): {`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/features/batchAction/addToDatasetTypes.ts:26 — "Custom mapping config - either root or key-value map type" repeats the code it sits on: 7 of its 8 words (custom, mapping, config, root, key, value, map) are already in `export const CustomMappingConfigSchema = z.object({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/features/scores/interfaces/api/shared.ts:22 — "GET /scores/{scoreId}" repeats the code it sits on: 4 of its 4 words (get, scores, score, id) are already in `export const GetScoreQuery = z.object({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/data-deletion/ingestionFileDeletion.ts:76 — "soft delete the blob storage references in clickhouse" repeats the code it sits on: 5 of its 6 words (soft, delete, blob, storage, clickhouse) are already in `await softDeleteInClickhouse(blobStorageRefs);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/index.ts:119 — "dataset run items" repeats the code it sits on: 3 of its 3 words (dataset, run, items) are already in `export * from "./dataset-run-items/addToDeleteQueue";`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/ingestion/sampling.ts:51 — "Return true if normalized hash is less than sample rate" repeats the code it sits on: 5 of its 6 words (return, normalized, hash, sample, rate) are already in `return normalizedHash < sampleRate;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:498 — "Filter out redundant shallow trace events" repeats the code it sits on: 5 of its 5 words (filter, redundant, shallow, trace, events) are already in `const finalEvents = this.filterRedundantShallowTraces(allEvents);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/otel/OtelIngestionProcessor.ts:745 — "Create observation event" repeats the code it sits on: 3 of its 3 words (create, observation, event) are already in `const observationEvent = this.createObservationEvent({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/queries/clickhouse-sql/orderby-factory.ts:57 — "Join all order by clauses with a comma and return" repeats the code it sits on: 4 of its 5 words (join, order, clauses, return) are already in `return `ORDER BY ${orderByClauses.join(", ")}`;`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/queries/clickhouse-sql/query-fragments.ts:74 — "Observation level: trace_id + observation_id Trace level: project_id + trace_id" repeats the code it sits on: 5 of its 5 words (observation, level, trace, id, project) are already in `const primaryKey = isTraceLevel ? "project_id" : "observation_id";`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:573 — "Create run ID condition" repeats the code it sits on: 4 of its 4 words (create, run, id, condition) are already in `const runConditionFilter = new StringFilter({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:581 — "Create user filters for this run" repeats the code it sits on: 4 of its 4 words (create, user, filters, run) are already in `const userFilters = createFilterFromFilterState(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:597 — "Create run ID condition" repeats the code it sits on: 4 of its 4 words (create, run, id, condition) are already in `const runConditionFilter = new FilterList([`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/repositories/events.ts:950 — "Extract time filter and apply filters" repeats the code it sits on: 4 of its 5 words (extract, time, filter, filters) are already in `const startTimeFrom = extractTimeFilter(observationsFilter);`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/repositories/events.ts:1086 — "Select count field set" repeats the code it sits on: 4 of its 4 words (select, count, field, set) are already in `queryBuilder.selectFieldSet("count");`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/repositories/events.ts:1292 — "Check if any filters reference the scores table" repeats the code it sits on: 4 of its 5 words (check, filters, scores, table) are already in `const filtersNeedScores = tracesFilter.some(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/repositories/scores.ts:621 — "Only join dataset run items and traces if there is a dataset run items filter" repeats the code it sits on: 6 of its 7 words (join, dataset, run, items, traces, filter) are already in `const performDatasetRunItemsAndTracesJoin = scoresFilter.some(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/repositories/scores.ts:1094 — "Separate trace filters (events_core) from score filters" repeats the code it sits on: 5 of its 6 words (trace, filters, events, core, score) are already in `const traceFilters = scoresFilter.filter(`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • redundant comment langfuse/packages/shared/src/server/services/DashboardService/types.ts:134 — "Define create widget input schema" repeats the code it sits on: 4 of its 5 words (create, widget, input, schema) are already in `export const CreateWidgetInputSchema = z.object({`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
  • + 359 more in this group — see findings.md.
X10 · Duplicated predicate · Duplicated predicate · ×40
  • Duplicated predicate langfuse/web/src/components/table/use-cases/observations.tsx:839 — `!clearTypeFilter && normalizedForcedLevels.length === 0 && !replaceLevelWithErrorType && !replaceLevelWithPolicyType` appears character-identically in 2 files — langfuse/web/src/components/table/use-cases/observations.tsx, langfuse/web/src/features/events/components/EventsTable.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/table/use-cases/observations.tsx:1882 — `!columnKey || !omittedColumnSet.has(columnKey)` appears character-identically in 2 files — langfuse/web/src/components/table/use-cases/observations.tsx, langfuse/web/src/features/events/components/EventsTable.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts:634 — `!env.CLICKHOUSE_URL || !env.CLICKHOUSE_USER || !env.CLICKHOUSE_PASSWORD` appears character-identically in 8 files — langfuse/worker/src/backgroundMigrations/backfillEventsHistoric.ts, langfuse/worker/src/backgroundMigrations/backfillEventsHistoricFromParts.ts, langfuse/worker/src/backgroundMigrations/backfillExperimentsHistoric.ts, langfuse/worker/src/backgroundMigrations/migrateDatasetRunItemsFromPostgresToClickhouse.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/packages/shared/src/server/services/email/batchExportSuccess/sendBatchExportSuccessEmail.ts:25 — `!env.EMAIL_FROM_ADDRESS || !env.SMTP_CONNECTION_URL` appears character-identically in 6 files — langfuse/packages/shared/src/server/services/email/batchExportSuccess/sendBatchExportSuccessEmail.ts, langfuse/packages/shared/src/server/services/email/cloudSpendAlert/sendCloudSpendAlertEmail.ts, langfuse/packages/shared/src/server/services/email/commentMention/sendCommentMentionEmail.ts, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/features/dashboard/components/LatencyChart.tsx:106 — `!isLoading && selectedModels.length > 0 && allModels.length > 0` appears character-identically in 2 files — langfuse/web/src/features/dashboard/components/LatencyChart.tsx, langfuse/web/src/features/dashboard/components/ModelUsageChart.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/features/dashboard/server/dashboard-router.ts:167 — `!metadata || typeof metadata !== "object" || Array.isArray(metadata)` appears character-identically in 4 files — langfuse/web/src/features/dashboard/server/dashboard-router.ts, langfuse/web/src/features/experience-summary/server/router.ts, langfuse/web/src/features/projects/server/projectsRouter.ts, langfuse/worker/src/services/IngestionService/index.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/ui/AdvancedJsonViewer/utils/multiSectionTree.ts:58 — `!node.isExpanded || node.children.length === 0` appears character-identically in 2 files — langfuse/web/src/components/ui/AdvancedJsonViewer/utils/multiSectionTree.ts, langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeExpansion.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/ui/AdvancedJsonViewer/hooks/useMultiSectionTreeState.ts:133 — `!searchQuery || searchQuery.trim() === ""` appears character-identically in 2 files — langfuse/web/src/components/ui/AdvancedJsonViewer/hooks/useMultiSectionTreeState.ts, langfuse/web/src/features/datasets/server/dataset-router.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/worker/src/backgroundMigrations/migrateDatasetRunItemsFromPostgresToClickhouseRmt.ts:89 — `!this.isAborted && !this.isFinished && processedRows < maxRowsToProcess` appears character-identically in 4 files — langfuse/worker/src/backgroundMigrations/migrateDatasetRunItemsFromPostgresToClickhouseRmt.ts, langfuse/worker/src/backgroundMigrations/migrateEventLogToBlobStorageRefTable.ts, langfuse/worker/src/backgroundMigrations/migrateScoresFromPostgresToClickhouse.ts, langfuse/worker/src/backgroundMigrations/migrateTracesFromPostgresToClickhouse.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/table/use-cases/observations.tsx:1332 — `!value || (value !== "ERROR" && value !== "WARNING")` appears character-identically in 2 files — langfuse/web/src/components/table/use-cases/observations.tsx, langfuse/web/src/features/events/components/EventsTable.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/table/use-cases/observations.tsx:234 — `!value || isUnclassifiedErrorTypeValue(value)` appears character-identically in 2 files — langfuse/web/src/components/table/use-cases/observations.tsx, langfuse/web/src/features/events/components/EventsTable.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts:461 — `"attributes" in meta && typeof meta.attributes === "object"` appears character-identically in 2 files — langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts, langfuse/packages/shared/src/utils/chatml/adapters/langgraph.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/features/evals/components/inner-evaluator-form.tsx:502 — `"message" in error && typeof error.message === "string"` appears character-identically in 2 files — langfuse/web/src/features/evals/components/inner-evaluator-form.tsx, langfuse/web/src/features/evals/components/template-form.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/features/rbac/server/allInvitesRoutes.ts:33 — `"projectId" in query && !showAllOrgMembers` appears character-identically in 2 files — langfuse/web/src/features/rbac/server/allInvitesRoutes.ts, langfuse/web/src/features/rbac/server/allMembersRoutes.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts:456 — `"scope" in meta && typeof meta.scope === "object"` appears character-identically in 3 files — langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts, langfuse/packages/shared/src/utils/chatml/adapters/langgraph.ts, langfuse/packages/shared/src/utils/chatml/adapters/openai.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/packages/shared/src/server/llm/compileChatMessages.ts:18 — `"type" in message && message.type === ChatMessageType.Placeholder` appears character-identically in 2 files — langfuse/packages/shared/src/server/llm/compileChatMessages.ts, langfuse/web/src/features/prompts/components/NewPromptForm/PromptChatMessages.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/features/organizations/components/NewOrganizationForm.tsx:123 — `(e.metaKey || e.ctrlKey) && e.key === "Enter"` appears character-identically in 2 files — langfuse/web/src/features/organizations/components/NewOrganizationForm.tsx, langfuse/web/src/features/projects/components/NewProjectForm.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/packages/shared/src/server/repositories/clickhouse.ts:346 — `(error as Error).message?.toLowerCase() || ""` appears character-identically in 2 files — langfuse/packages/shared/src/server/repositories/clickhouse.ts, langfuse/worker/src/services/ClickhouseWriter/index.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/session/index.tsx:656 — `(f.column === "Start Time" || f.column === "startTime") && f.type === "datetime"` appears character-identically in 3 files — langfuse/web/src/components/session/index.tsx, langfuse/web/src/components/table/use-cases/observations.tsx, langfuse/web/src/features/events/hooks/useEventsFilterOptions.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/table/use-cases/observations.tsx:1993 — `(row.level === "ERROR" || row.level === "WARNING") && !!row.traceId` appears character-identically in 2 files — langfuse/web/src/components/table/use-cases/observations.tsx, langfuse/web/src/features/events/components/EventsTable.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/table/utils/jsonExpansionUtils.ts:61 — `(valueType === "object" && Object.keys(value as Record<string, unknown>).length > 0) || (valueType === "array" && Array.isArray(value) && va…` appears character-identically in 2 files — langfuse/web/src/components/table/utils/jsonExpansionUtils.ts, langfuse/web/src/components/ui/PrettyJsonView.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/features/score-analytics/components/cards/DistributionBooleanCard.tsx:231 — `activeTab === "score1" || activeTab === "score2"` appears character-identically in 4 files — langfuse/web/src/features/score-analytics/components/cards/DistributionBooleanCard.tsx, langfuse/web/src/features/score-analytics/components/cards/DistributionCategoricalCard.tsx, langfuse/web/src/features/score-analytics/components/cards/DistributionNumericCard.tsx, langfuse/web/src/features/score-analytics/components/cards/TimelineChartCard.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/trace2/lib/observationIoSource.ts:78 — `activeTurnIndex < sessionTurns.length && obs.startTime.getTime() >= sessionTurnEndBounds[activeTurnIndex]!` appears character-identically in 2 files — langfuse/web/src/components/trace2/lib/observationIoSource.ts, langfuse/web/src/components/trace2/lib/tree-building.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/web/src/components/table/data-table-ai-filters.tsx:38 — `aiPrompt.trim() && !createFilterMutation.isPending && projectId` appears character-identically in 2 files — langfuse/web/src/components/table/data-table-ai-filters.tsx, langfuse/web/src/features/filters/components/filter-builder.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • Duplicated predicate langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts:464 — `attrs && typeof attrs["operation.name"] === "string" && attrs["operation.name"].startsWith("ai.")` appears character-identically in 2 files — langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts, langfuse/packages/shared/src/utils/chatml/adapters/langgraph.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
  • + 15 more in this group — see findings.md.
X4 · Structured logging · Interpolated log message defeats structured logging · ×40
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/db.ts:44 — `info` at line 44 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/db.ts:49 — `warn` at line 49 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/db.ts:53 — `error` at line 53 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/evalJobConfigCache.ts:41 — `error` at line 41 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/evalJobConfigCache.ts:62 — `debug` at line 62 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/evalJobConfigCache.ts:66 — `error` at line 66 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/evalJobConfigCache.ts:85 — `debug` at line 85 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.debug({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.debug('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/evalJobConfigCache.ts:89 — `error` at line 89 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/traceDeletionProcessor.ts:18 — `info` at line 18 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/traceDeletionProcessor.ts:38 — `info` at line 38 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/traceDeletionProcessor.ts:81 — `info` at line 81 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/traceDeletionProcessor.ts:129 — `error` at line 129 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:93 — `warn` at line 93 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging REDACTED:106 — `warn` at line 106 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.warn({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.warn('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:48 — `error` at line 48 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:192 — `info` at line 192 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.info({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.info('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:194 — `error` at line 194 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:227 — `error` at line 227 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:246 — `error` at line 246 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:265 — `error` at line 265 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:296 — `error` at line 296 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:321 — `error` at line 321 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:350 — `error` at line 350 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:382 — `error` at line 382 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • Interpolated log message defeats structured logging langfuse/packages/shared/src/server/services/StorageService.ts:415 — `error` at line 415 is handed a template literal with `${…}` substitutions as its message, so the logger receives one finished string — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Pass the values beside a constant message instead: `logger.error({ orderId, status }, 'order status updated')` for pino and bunyan, `logger.error('order status updated', { orderId, status })` for winston. If these calls go through a NestJS `Logger` routed into pino, nestjs-pino forwards an object first argument as fields in the same way.
  • + 15 more in this group — see findings.md.
P2 · Observability · Console output used as the logging channel · ×39
  • Console output used as the logging channel langfuse/packages/shared/src/server/webhooks/redirectHandler.ts:86 — `langfuse/packages/shared/src/server/webhooks/redirectHandler.ts` reports through `console.*` at line 86 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/packages/shared/src/server/webhooks/redirectHandler.ts:87 — `langfuse/packages/shared/src/server/webhooks/redirectHandler.ts` reports through `console.*` at line 87 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/packages/shared/src/server/utils/headerUtils.ts:77 — `langfuse/packages/shared/src/server/utils/headerUtils.ts` reports through `console.*` at line 77 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/packages/shared/src/server/ingestion/extractToolsBackend.ts:334 — `langfuse/packages/shared/src/server/ingestion/extractToolsBackend.ts` reports through `console.*` at line 334 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/packages/shared/src/features/scores/interfaces/application/validation.ts:69 — `langfuse/packages/shared/src/features/scores/interfaces/application/validation.ts` reports through `console.*` at line 69 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/packages/shared/src/features/scores/interfaces/application/validation.ts:111 — `langfuse/packages/shared/src/features/scores/interfaces/application/validation.ts` reports through `console.*` at line 111 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/packages/shared/src/features/scores/interfaces/api/v2/validation.ts:21 — `langfuse/packages/shared/src/features/scores/interfaces/api/v2/validation.ts` reports through `console.*` at line 21 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/packages/shared/src/features/scores/interfaces/api/v1/validation.ts:23 — `langfuse/packages/shared/src/features/scores/interfaces/api/v1/validation.ts` reports through `console.*` at line 23 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/instrumentation.ts:11 — `langfuse/web/src/instrumentation.ts` reports through `console.*` at line 11 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/workers/json-parser.worker.ts:59 — `langfuse/web/src/workers/json-parser.worker.ts` reports through `console.*` at line 59 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/utils/shutdown.ts:24 — `langfuse/web/src/utils/shutdown.ts` reports through `console.*` at line 24 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/utils/shutdown.ts:33 — `langfuse/web/src/utils/shutdown.ts` reports through `console.*` at line 33 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/pages/_app.tsx:241 — `langfuse/web/src/pages/_app.tsx` reports through `console.*` at line 241 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/pages/project/[projectId]/traces/setup.tsx:36 — `langfuse/web/src/pages/project/[projectId]/traces/setup.tsx` reports through `console.*` at line 36 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/pages/auth/sso-initiate.tsx:33 — `langfuse/web/src/pages/auth/sso-initiate.tsx` reports through `console.*` at line 33 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/pages/account/settings/index.tsx:158 — `langfuse/web/src/pages/account/settings/index.tsx` reports through `console.*` at line 158 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/hooks/useParsedObservation.ts:78 — `langfuse/web/src/hooks/useParsedObservation.ts` reports through `console.*` at line 78 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/hooks/useParsedObservation.ts:81 — `langfuse/web/src/hooks/useParsedObservation.ts` reports through `console.*` at line 81 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/hooks/useParsedObservation.ts:168 — `langfuse/web/src/hooks/useParsedObservation.ts` reports through `console.*` at line 168 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/hooks/useParsedObservation.ts:265 — `langfuse/web/src/hooks/useParsedObservation.ts` reports through `console.*` at line 265 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/hooks/useParsedTrace.ts:75 — `langfuse/web/src/hooks/useParsedTrace.ts` reports through `console.*` at line 75 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/hooks/useParsedTrace.ts:78 — `langfuse/web/src/hooks/useParsedTrace.ts` reports through `console.*` at line 78 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/hooks/useParsedTrace.ts:161 — `langfuse/web/src/hooks/useParsedTrace.ts` reports through `console.*` at line 161 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/features/widgets/components/WidgetTable.tsx:92 — `langfuse/web/src/features/widgets/components/WidgetTable.tsx` reports through `console.*` at line 92 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • Console output used as the logging channel langfuse/web/src/features/widgets/chart-library/PivotTable.tsx:302 — `langfuse/web/src/features/widgets/chart-library/PivotTable.tsx` reports through `console.*` at line 302 although other files in its module log through a logger. Console lines carry no level, fields or correlation and never reach the log pipeline.
  • + 14 more in this group — see findings.md.
X7 · Silent fallback defaults · Silent fallback default in catch · ×26
  • Silent fallback default in catch REDACTED:513 — `_read_litellm_config_yaml` 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.
  • Silent fallback default in catch REDACTED:1360 — `_max_emitted_tool_result_index` swallows every exception into `return 0` — 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.
  • Silent fallback default in catch ArbiterOS-Kernel/arbiteros_kernel/policy/alignment_sentinel_policy.py:148 — `_coerce_text` 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.
  • Silent fallback default in catch ArbiterOS-Kernel/arbiteros_kernel/policy/exec_composite_policy.py:101 — `_extract_exec_parse` 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.
  • Silent fallback default in catch ArbiterOS-Kernel/arbiteros_kernel/policy/nanobot_policy.py:157 — `_parse_arguments` 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.
  • Silent fallback default in catch ArbiterOS-Kernel/arbiteros_kernel/policy_check.py:241 — `_load_role_policy_sets` 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.
  • Silent fallback default in catch ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:349 — `_efsm_hist_max` swallows every exception into `return 128` — 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.
  • Silent fallback default in catch ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:357 — `_efsm_event_dedupe_max` swallows every exception into `return 1024` — 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.
  • Silent fallback default in catch ArbiterOS-Kernel/arbiteros_kernel/policy_engine_bat.py:566 — `_approval_ttl` swallows every exception into `return 120` — 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.
  • Silent fallback default in catch ArbiterOS-Kernel/arbiteros_kernel/policy_runtime.py:465 — `_approval_ttl` swallows every exception into `return 120` — 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.
  • Silent fallback default in catch langfuse/packages/shared/src/utils/chatml/adapters/aisdk.ts:278 — `flattenToolDefinition` 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.
  • Silent fallback default in catch langfuse/web/src/components/table/use-cases/observations.tsx:166 — `parsePolicyNamesFromMetadata` 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.
  • Silent fallback default in catch langfuse/web/src/components/trace2/contexts/JsonExpansionContext.tsx:86 — `readFormattedExpansion` 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.
  • Silent fallback default in catch langfuse/web/src/features/datasets/components/DatasetForm.tsx:104 — `jsonSchemaStringValidator` swallows every exception into `return false` — 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.
  • Silent fallback default in catch langfuse/web/src/features/error-analysis/server/errorTypeFilters.ts:346 — `getErrorTypeFilterOptions` 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.
  • Silent fallback default in catch langfuse/web/src/features/error-analysis/server/router.ts:203 — `coerceToString` swallows every exception into `return "[Unserializable value]"` — 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.
  • Silent fallback default in catch langfuse/web/src/features/error-analysis/server/router.ts:373 — `safeStringify` swallows every exception into `return "[Unserializable value]"` — 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.
  • Silent fallback default in catch langfuse/web/src/features/events/components/EventsTable.tsx:194 — `parsePolicyNamesFromMetadata` 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.
  • Silent fallback default in catch langfuse/web/src/features/experience-summary/server/router.ts:40 — `safeStringify` swallows every exception into `return "[Unserializable value]"` — 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.
  • Silent fallback default in catch langfuse/web/src/features/governance/utils/policyMetadata.ts:132 — `parseStringRecord` 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.
  • Silent fallback default in catch langfuse/web/src/features/playground/page/components/JumpToPlaygroundButton.tsx:507 — `parseTools` 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.
  • Silent fallback default in catch langfuse/web/src/features/policy-governance/server/router.ts:646 — `safeStringify` swallows every exception into `return "[Unserializable value]"` — 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.
  • Silent fallback default in catch langfuse/web/src/features/policy-suggestions/server/router.ts:136 — `safeStringify` swallows every exception into `return "[Unserializable value]"` — 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.
  • Silent fallback default in catch langfuse/web/src/hooks/useCollapsibleSystemPrompt.ts:42 — `useCollapsibleSystemPrompt` swallows every exception into `return true` — 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.
  • Silent fallback default in catch langfuse/web/src/hooks/useParsedObservation.ts:45 — `estimateSize` swallows every exception into `return 0` — 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.
  • + 1 more in this group — see findings.md.
X7 · Silent fallback defaults · Pending state with no failure state · ×12
  • Pending state with no failure state langfuse/web/src/features/score-analytics/components/cards/DistributionBooleanCard.tsx:125 — The view draws `Distribution Loading chart...` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/features/score-analytics/components/cards/DistributionCategoricalCard.tsx:214 — The view draws `Distribution Loading chart...` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/features/score-analytics/components/cards/DistributionNumericCard.tsx:153 — The view draws `Distribution Loading chart...` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/features/score-analytics/components/cards/HeatmapCard.tsx:163 — The view draws `Score Comparison Loading heatmap...` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/features/score-analytics/components/cards/TimelineChartCard.tsx:209 — The view draws `Trend Over Time Loading chart...` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/features/playground/page/index.tsx:89 — The view draws `<Page withPadding= headerProps= >` under `! isLoaded`, but `isLoaded` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/features/playground/page/index.tsx:164 — The view draws `<Loader2 class="h-3 w-3 animate-spin"/>` under `globalIsExecutingAll`, but `globalIsExecutingAll` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/features/dashboard/components/score-analytics/CategoricalScoreChart.tsx:102 — The view draws `<NoDataOrLoading isLoading= class="min-h-[9rem] flex-1"/>` under `isEmptyChart ( { data : chartData } )`, but `chartData` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/components/ui/AdvancedJsonViewer/MultiSectionJsonViewer.tsx:234 — The view draws `Building tree...` under `! tree`, but `tree` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/components/trace2/components/TraceGraphView/TraceGraphView.tsx:43 — The view draws `Loading graph...` under `isLoading`, but `isLoading` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/components/trace2/components/IOPreview/components/CorrectedOutputField.tsx:224 — The view draws `<div class="mr-2 flex items-center gap-1">` under `isValidJson && saveStatus === "saving"`, but `isValidJson` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
  • Pending state with no failure state langfuse/web/src/components/layouts/app-layout/index.tsx:127 — The view draws `<LoadingLayout message="Loading"/>` under `! session . data`, but `session` is settled by a load that can fail and the component draws no failure state, so a failed load is shown as "not yet" for ever, or as the loaded state over its initial value. Give the component a failure state and draw it.
D10 · Test Quality · Mock-dominated test · ×11
  • Mock-dominated test: should report wait time and processing time metrics correctly langfuse/worker/src/services/ClickhouseWriter/ClickhouseWriter.unit.test.ts:262 — This test sets up 4 test doubles (for example `vi.spyOn`) against 0 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should schedule retry and set DELAYED status for retryable LLM errors langfuse/worker/src/queues/__tests__/llmAsJudgeExecutionQueueProcessor.test.ts:138 — This test sets up 4 test doubles (for example `vi.mock/jest.mock of an imported module`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should set ERROR status for non-retryable LLM errors langfuse/worker/src/queues/__tests__/llmAsJudgeExecutionQueueProcessor.test.ts:186 — This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 1 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should set ERROR status with user-facing message for UnrecoverableError langfuse/worker/src/queues/__tests__/llmAsJudgeExecutionQueueProcessor.test.ts:225 — This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should not call traceException for UnrecoverableError langfuse/worker/src/queues/__tests__/llmAsJudgeExecutionQueueProcessor.test.ts:262 — This test sets up 3 test doubles (for example `vi.mock/jest.mock of an imported module`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should complete evaluation successfully langfuse/worker/src/features/evaluation/executeLLMAsJudgeEvaluation.test.ts:152 — This test sets up 3 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 5 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should pass model config to LLM langfuse/worker/src/features/evaluation/executeLLMAsJudgeEvaluation.test.ts:461 — This test sets up 4 test doubles (for example `vi.fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should have persisted score before job update fails langfuse/worker/src/features/evaluation/executeLLMAsJudgeEvaluation.test.ts:747 — This test sets up 3 test doubles (for example `vi.fn`) against 1 real object(s) of its own, and its only verification is 2 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should call executeLLMAsJudgeEvaluation with correct parameters langfuse/worker/src/features/evaluation/observationEval/__tests__/observationEvalProcessor.test.ts:219 — This test sets up 3 test doubles (for example `vi .fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should use default environment when observation environment is null langfuse/worker/src/features/evaluation/observationEval/__tests__/observationEvalProcessor.test.ts:279 — This test sets up 3 test doubles (for example `vi .fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
  • Mock-dominated test: should extract multiple variables from observation langfuse/worker/src/features/evaluation/observationEval/__tests__/observationEvalProcessor.test.ts:314 — This test sets up 3 test doubles (for example `vi .fn`) against 0 real object(s) of its own, and its only verification is 1 check(s) that the doubles were called. It pins how the code is wired, not what it does: it passes with a wrong result and fails when a call is harmlessly reordered or merged. Assert the outcome instead (the value returned, the state left behind), build collaborators and value objects for real or with a small hand-written fake, and keep doubles for the boundaries the test cannot own — the network, the clock, the file system.
D30 · Dependency Vulnerabilities · Low CVE · ×9
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
IC1 · Incompleteness & stubs · Disabled test · ×8
  • Disabled test langfuse/web/src/__tests__/async/otel-api.servertest.ts:221 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test langfuse/web/src/__tests__/async/score-comparison-analytics.servertest.ts:461 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test langfuse/web/src/__tests__/async/score-comparison-analytics.servertest.ts:3162 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test langfuse/web/src/__tests__/async/traces-api.servertest.ts:2131 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test langfuse/web/src/__tests__/server/api/otel/otelMapping.servertest.ts:4909 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test langfuse/worker/src/__tests__/extractToolsBackend.test.ts:62 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test langfuse/worker/src/__tests__/extractToolsBackend.test.ts:86 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
  • Disabled test langfuse/worker/src/__tests__/extractToolsBackend.test.ts:602 — A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
D31 · IaC & Container Security · Low IaC · ×7
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D29 · Static Analysis (SAST) · REDACTED · ×5
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
X6 · Hand-rolled structured-format parsing · Hand-rolled JSON/XML parsing via regex · ×4
  • Hand-rolled JSON/XML parsing via regex ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:75 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex ArbiterOS-Kernel/arbiteros_kernel/langfuse_replay.py:76 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:235 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
  • Hand-rolled JSON/XML parsing via regex REDACTED:236 — A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This Python code already uses a real parser in the same package; use it here too.
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×3
  • Projects may be oversized for their cohesion REDACTED:1 — `langfuse/web` (251692 LoC, 1468 module-visible types across 326 directories) overshoots its size bounds. 3 of 4 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
  • Projects may be oversized for their cohesion langfuse/packages/shared/package.json:1 — `langfuse/packages/shared` (52821 LoC, 343 module-visible types across 66 directories) overshoots its size bounds. 3 of 4 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
  • Projects may be oversized for their cohesion langfuse/worker/package.json:1 — `langfuse/worker` (29296 LoC, 179 module-visible types across 44 directories) overshoots its size bounds. 3 of 4 build unit(s) (Python, npm) overshoot their size bounds, lowering Project Cohesion to 0.0/10. 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.
D29 · Static Analysis (SAST) · REDACTED · ×2
  • REDACTED
  • REDACTED
X23 · Unguarded diagnostic materialisation · Diagnostic log message is built whether or not it is wanted · ×2
  • Diagnostic log message is built whether or not it is wanted langfuse/web/src/features/mcp/server/mcpServer.ts:62 — `debug` at line 62 is called with an argument built by `tools.map((t) => t.name)` (line 65), whose cost grows with the collection it walks. JavaScript evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isLevelEnabled`/`isDebugEnabled` test, no debug flag, no `NODE_ENV` build switch.
  • Diagnostic log message is built whether or not it is wanted ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/registries/_base.py:526 — `debug` at line 526 is called with an argument built by `list(zip(abs_paths, per_path))` (line 530), whose cost grows with the collection it walks. Python evaluates a call's arguments BEFORE entering the method, so that join/projection runs in full every time this line is reached — and then the level check inside the logger discards the string it produced, because debug is a level a shipped configuration normally leaves off. Nothing here decides beforehand whether the message is wanted: no `isEnabledFor(logging.DEBUG)` test, no debug flag, no `lambda` the logger calls only when the level is on.
X7 · Silent fallback defaults · Silent fallback default on parse failure · ×2
  • Silent fallback default on parse failure ArbiterOS-Kernel/arbiteros_kernel/policy/path_protection_policy.py:69 — `_parse_tool_arguments` returns `{}` when `(json.JSONDecodeError, TypeError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
  • Silent fallback default on parse failure ArbiterOS-Kernel/redteam/_automation/toolemu_v1/tool_mapping.py:165 — `safe_json_loads` returns `{}` when `json.JSONDecodeError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. 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.
C2 · Access Controls · No named authorization policies · ×1
  • No named authorization policies langfuse/packages/shared/src/server/ingestion/processEventBatch.ts:148 — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
C3 · Audit Trail · Partial audit-trail evidence · ×1
  • Partial audit-trail evidence — An audit mechanism is present, but the trail is not yet complete — missing: an ORM write hook every change flows through (a TypeORM/MikroORM subscriber, a Sequelize or Mongoose hook, Prisma middleware or a query extension, or an event-store append), per-model coverage (@Audited, or a change-history plugin such as mongoose-history or sequelize-paper-trail applied to each model).
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 8 significant file(s) lose their only recent owner: REDACTED, ArbiterOS-Kernel/arbiteros_kernel/policy_check.py, ArbiterOS-Kernel/arbiteros_kernel/protocol_adapter.py, ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/builder.py, ArbiterOS-Kernel/arbiteros_kernel/policy/resource_guard_policy.py, ArbiterOS-Kernel/arbiteros_kernel/warm_skill_trust.py, ArbiterOS-Kernel/arbiteros_kernel/taint_ablation.py, ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/tool_parsers/__init__.py. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 2 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 (12 single-owned of 1052 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1052 of the 1924 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (2 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: ArbiterOS-Kernel/arbiteros_kernel/policy/relational_policy.py, ArbiterOS-Kernel/arbiteros_kernel/policy/policy_rule_ir.py, ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/shell_parsers/bash.py, ArbiterOS-Kernel/arbiteros_kernel/instruction_parsing/tool_parsers/engine.py.
D21 · Naming Consistency · `parseMetadataCHRecordToDomain` spells `CH` where 14 names in the project spell it `Ch` · ×1
  • `parseMetadataCHRecordToDomain` spells `CH` where 14 names in the project spell it `Ch` langfuse/packages/shared/src/server/utils/metadata_conversion.ts:4 — 14 of 15 names in project repository spell the token `Ch` (14 of 15; unit: names in project repository containing `Ch`). Peers: dataset-run-items.getDatasetRunsTableMetricsCh (langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:500); dataset-run-items.getDatasetRunsTableRowsCh (langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:513); dataset-run-items.getDatasetRunsTableCountCh (langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:525); dataset-run-items.getDatasetRunItemsCh (langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:903); dataset-run-items.getDatasetRunItemsByDatasetIdCh (langfuse/packages/shared/src/server/repositories/dataset-run-items.ts:915). Rename to `parseMetadataChRecordToDomain`. [rule N6]
D21 · Naming Consistency · `PutLlmConnectionV1Body` spells `Llm` where 22 names in the project spell it `LLM` · ×1
  • `PutLlmConnectionV1Body` spells `Llm` where 22 names in the project spell it `LLM` langfuse/web/src/features/public-api/types/llm-connections.ts:56 — 22 of 24 names in project repository spell the token `LLM` (22 of 24; unit: names in project repository containing `LLM`). Peers: errors.isLLMCompletionError (langfuse/packages/shared/src/server/llm/errors.ts:24); fetchLLMCompletion.fetchLLMCompletion (langfuse/packages/shared/src/server/llm/fetchLLMCompletion.ts:118); router.mapLLMCompletionErrorToTRPCError (langfuse/web/src/features/error-analysis/server/router.ts:332); router.testLLMConnection (langfuse/web/src/features/llm-api-key/server/router.ts:57); CreateOrEditLLMSchemaDialog.CreateOrEditLLMSchemaDialog (langfuse/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx:59). Rename to `PutLLMConnectionV1Body`. [rule N6]
D21 · Naming Consistency · `transformDbLlmConnectionToAPI` spells `Llm` where 22 names in the project spell it `LLM` · ×1
  • `transformDbLlmConnectionToAPI` spells `Llm` where 22 names in the project spell it `LLM` langfuse/web/src/features/public-api/types/llm-connections.ts:107 — 22 of 24 names in project repository spell the token `LLM` (22 of 24; unit: names in project repository containing `LLM`). Peers: errors.isLLMCompletionError (langfuse/packages/shared/src/server/llm/errors.ts:24); fetchLLMCompletion.fetchLLMCompletion (langfuse/packages/shared/src/server/llm/fetchLLMCompletion.ts:118); router.mapLLMCompletionErrorToTRPCError (langfuse/web/src/features/error-analysis/server/router.ts:332); router.testLLMConnection (langfuse/web/src/features/llm-api-key/server/router.ts:57); CreateOrEditLLMSchemaDialog.CreateOrEditLLMSchemaDialog (langfuse/web/src/features/playground/page/components/CreateOrEditLLMSchemaDialog.tsx:59). Rename to `transformDbLLMConnectionToAPI`. [rule N6]
D21 · Naming Consistency · `bulkUpdateOrganizationsRawSQL` spells `SQL` where 16 names in the project spell it `Sql` · ×1
  • `bulkUpdateOrganizationsRawSQL` spells `SQL` where 16 names in the project spell it `Sql` REDACTED:146 — 16 of 17 names in project repository spell the token `Sql` (16 of 17; unit: names in project repository containing `Sql`). Peers: filterToPrisma.tableColumnsToSqlFilterAndPrefix (langfuse/packages/shared/src/server/filterToPrisma.ts:26); filterToPrisma.tableColumnsToSqlFilter (langfuse/packages/shared/src/server/filterToPrisma.ts:42); filterToPrisma.datetimeFilterToPrismaSql (langfuse/packages/shared/src/server/filterToPrisma.ts:177); orderByToPrisma.orderByToPrismaSql (langfuse/packages/shared/src/server/orderByToPrisma.ts:15); orderby-factory.orderByToClickhouseSql (langfuse/packages/shared/src/server/queries/clickhouse-sql/orderby-factory.ts:9). Rename to `bulkUpdateOrganizationsRawSql`. [rule N6]
D28 · Secrets (history) · Rotate the exposed credentials · ×1
  • REDACTED
DM9 · Scattered domain decisions · Rule about [kind, raw_message_index] decided in 2 places · ×1
  • Rule about [kind, raw_message_index] decided in 2 places — ArbiterOS-Kernel.redteam._automation.toolemu_v1.build_from_trajectories.ConvertedStep's [kind, raw_message_index] are judged in ArbiterOS-Kernel.redteam._automation.toolemu_v1.apply_review_results, ArbiterOS-Kernel.redteam._automation.toolemu_v1.build_from_trajectories — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
DM9 · Scattered domain decisions · Rule about [field, operator] decided in 6 places · ×1
  • Rule about [field, operator] decided in 6 places — langfuse.packages.shared.src.server.queries.clickhouse-sql.clickhouse-filter.Filter's [field, operator] are judged in langfuse.packages.shared.src.server.queries.clickhouse-sql.event-query-builder.EventsQueryBuilder, langfuse.packages.shared.src.server.repositories.dashboards, langfuse.packages.shared.src.server.repositories.traces, langfuse.packages.shared.src.server.services.sessions-ui-table-events-service, langfuse.packages.shared.src.server.services.sessions-ui-table-service, langfuse.packages.shared.src.server.services.traces-ui-table-service — the same decision, restated. Every copy is a chance to drift, and copies drift silently because each one looks correct on its own. Move the judgement onto the type that owns the members and let the call sites ask it.
GD1 · Unfinished & placeholder code · Placeholder literal left in code · ×1
  • Placeholder literal left in code langfuse/web/src/features/comments/lib/mentionParser.clienttest.ts:287 — A placeholder string ("Lorem ipsum") is still in shipped code — typical of generated boilerplate that was never filled in.
IC1 · Incompleteness & stubs · Blanket warning suppression · ×1
  • Blanket warning suppression REDACTED:1 — A bare `eslint-disable` or `@ts-nocheck` with no rule list switches every lint rule or the whole type checker off for the rest of the file — hidden debt. Disable the specific rule on the specific line, with a justification, instead.
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.
M2 · Architecture documentation · Architecture diagram out of date · ×1
  • Architecture diagram out of date langfuse/CONTRIBUTING.md:65 — `langfuse/CONTRIBUTING.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `@langfuse/ee`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 4/5 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `langfuse/ee`.
P3 · Security & performance tooling · Dependabot does not watch uv · ×1
  • Dependabot does not watch uv REDACTED:7 — `REDACTED` schedules updates, but no `package-ecosystem` entry covers `uv`, which this tree depends on — so those dependencies get no update pull requests and no advisory pressure, however complete the dep-scan credit looks. Add the missing entry to the `updates:` list.
X2 · Cancellation propagation · Not all async functions that make a request accept an AbortSignal · ×1
  • Not all async functions that make a request accept an AbortSignal — Only 3/14 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
X5 · Nullable reference types · Strict null checking is not enabled everywhere the repository type-checks · ×1
  • Strict null checking is not enabled everywhere the repository type-checks — 1/4 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
X5 · Nullable reference types · Null assertions (`!`) override strict null checking · ×1
  • Null assertions (`!`) override strict null checking — ~1.0 `!` null assertions per 1k TypeScript source lines — 362 assertion(s) across the 362318 source line(s) of the 1885 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeExpansion.clienttest.ts (39), langfuse/web/src/components/ui/AdvancedJsonViewer/utils/treeStructure.clienttest.ts (17), langfuse/web/src/features/trace-graph-view/buildGraphCanvasData.ts (17). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Minor — 10 finding(s)
D12 · Dependency Hygiene · Outdated · ×6
  • Outdated: cisco-ai-skill-scanner — `cisco-ai-skill-scanner` is pinned to 1.0.2, but 2.3.2 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 1.0.2 until the declaration is edited. This crosses a major version, so it is a migration rather than a bump.
  • Outdated: greenlet — `greenlet` is pinned to 3.3.1, but 3.5.6 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 3.3.1 until the declaration is edited.
  • Outdated: hf-xet — `hf-xet` is pinned to 1.2.0, but 1.8.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 1.2.0 until the declaration is edited.
  • Outdated: pycparser — `pycparser` is pinned to 3.0, but 3.12 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 3.0 until the declaration is edited.
  • Outdated: pywin32 — `pywin32` is pinned to 311, but 312 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 311 until the declaration is edited. This crosses a major version, so it is a migration rather than a bump.
  • Outdated: uvloop — `uvloop` is pinned to 0.21.0, but 0.23.0 is the current stable release on PyPI. An exact pin never moves on its own, so this repository installs 0.21.0 until the declaration is edited.
D24 · Comment Value · doc comments repeat the names · ×3
  • doc comments repeat the names langfuse/packages/shared/src/server/ingestion/processEventBatch.ts:85 — 5 of 135 documented parameters and 11 of 536 summaries in `@langfuse/shared` only repeat the member or parameter name (e.g. "Options for event batch processing." for `ProcessEventBatchOptions`). 8 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names langfuse/web/src/components/layouts/app-layout/hooks/useFilteredNavigation.ts:75 — 16 of 540 documented parameters and 19 of 1417 summaries in `web` only repeat the member or parameter name (e.g. "Current organization object" for `organization`). 3 documentation tag(s) are empty. Delete the restating tags, or add what the name does not say.
  • doc comments repeat the names langfuse/worker/src/features/evaluation/evalService.ts:703 — 3 of 57 documented parameters and 1 of 205 summaries in `worker` only repeat the member or parameter name (e.g. "The project ID" for `projectId`). Delete the restating tags, or add what the name does not say.
D5 · Coupling · Off the main sequence · ×1
  • Off the main sequence: @langfuse/shared — @langfuse/shared: abstractness 0.03, instability 0.00, distance 0.97 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.

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/canine-gitleaks.toml --log-opts "--full-history --all --skip=0 --max-count=200" --report-format json --report-path /tmp/watchdog-gitleaks-8ac382eb6a264e86948457fdb4053a83/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --log-opts "--full-history --all --skip=200 --max-count=207" --report-format json --report-path /tmp/watchdog-gitleaks-8ac382eb6a264e86948457fdb4053a83/history-1.json --exit-code 0 --source .7artifacts/raw/gitleaks-history-1.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-8ac382eb6a264e86948457fdb4053a83/tree.json --exit-code 0 --source .0artifacts/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/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude langfuse/packages/shared/prisma/generated .74artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiestrivy—trivy fs --scanners vuln --format json --quiet --severity CRITICAL,HIGH,MEDIUM,LOW --skip-dirs **/bin/** --skip-dirs **/obj/** .191artifacts/raw/trivy-fs.json
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .33artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep --config /opt/semgrep-rules/gdpr.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt --exclude langfuse/packages/shared/prisma/generated .2artifacts/raw/semgrep-gdpr.json
D36 · Supply-chain Provenance & Signingprovenance—provenance: not applicable — No CI/build pipeline found (.github/.forgejo/.gitea workflows, .circleci, .buildkite, .woodpecker, .teamcity, .gitlab-ci.yml, .travis.yml, bitbucket-pipelines.yml, .drone.yml, .cirrus.yml, .woodpecker.yml, appveyor.yml, azure-pipelines*.yml, .pipelines/, .vsts-ci/, .azuredevops/, Jenkinsfile); there is no build to attest provenance for.0—
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.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/** .0artifacts/raw/trivy-fs.json

Run 01a1eb29-1c19-7b40-90d7-8204a17dc425 · 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