Public report of oxc-project/oxc, published 12 October 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 reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog 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, 12 October 2026, 04:51 UTC · Survey ID cd_33ad240d91314ce68e5944ccf175cb35
Very large · 804,000 LoC · 83 projects · rebuild ~5.8 person-years · weakest lens: Code Health (45%)
Findings by grade
88 critical3300 serious134 minor6 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
12 October 2026, 04:30 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
3458findings with an exact file:lineof 3522 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
79/132dimensions across the health lenses804000 LoC · 83 projects — wide & deep
⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.
The platform is a massive, high-value asset currently rated at risk, with an overall health score of 50%. While performance is strong, the system’s sheer size—representing nearly six person-years of effort to rebuild—means that underlying code quality issues pose a significant threat to delivery speed and long-term maintainability. The business is effectively paying a hidden tax on every change, where technical debt slows down new features and increases the likelihood of defects.
The primary concern is fragile foundations. With code health scoring only 45%, the system lacks the structural integrity needed for rapid evolution. This weakness acts as a velocity tax, plausibly adding 3–7% to the cost of every modification. Over time, this compounds, meaning that simple updates take longer and cost more than they should. The risk is not immediate failure, but a steady erosion of agility that makes the business slower to respond to market changes.
A secondary theme is operational friction. Although security and performance are solid, the architecture and production readiness scores suggest that changes can ripple unpredictably. The lack of measured coverage for key JavaScript components creates blind spots, making it difficult to ensure that fixes do not break existing functionality. This uncertainty increases the cost of release cycles and raises the potential for unexpected outages or regressions in production.
The most impactful action is to migrate remaining JavaScript files to TypeScript. This single move offers the highest return on investment, paying for itself within one to two months by reducing the annual drag on engineering capacity. It addresses the root cause of the velocity tax and improves the system’s overall reliability. Focusing here first provides immediate leverage, stabilizing the codebase and freeing up resources for other critical improvements. The picture remains partial in areas like domain modeling, but the current data clearly points to code quality as the critical bottleneck.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
Raise Code Health 45 → 70 (the Healthy floor) ⇒ headline 50 → ~55.
Code composition — where the lines go
Tests 100%
New since the last scan (100+)
252 finding(s) are new versus the previous scan (2026-09-27) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €280,000–€1,400,000
0.7× (at 50% quality) — the last 20% of quality is most of the work
Size & shape
Very large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~5.8 person-years of build effort (about ~€850,000 to rebuild). Its weakest lens is Code Health at 45% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 0.7× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Migrate the remaining .js/.jsx files to TypeScript.
Value concentrated against a weak lens · High · Value at risk
This is a Very large asset (~5.8 person-years to rebuild), and its weakest lens is Code Health at 45%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
Evidence: valuation: Very large, ~5.8 person-years rebuild (804,000 LoC) · weakest lens: Code Health 45%
→ Direct remediation budget at Code Health first — highest risk-reduction per euro on an asset this size.
The top fix pays for itself · High · Economics
The top-ranked fix costs roughly 3–10 engineer-days once. Not doing it costs about 157.3–943.6 engineer-days every year, paid as drag on the ~1,963,449 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 3–7% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 484,138 line(s) changed over a 90-day window ⇒ ~1,963,449/year · D1/D2/D4/D6 code quality: averaging 6.7/10 ⇒ a 3–7% drag on each change · top-ranked remediation: Medium effort ⇒ about 3–10 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Migrate the remaining .js/.jsx files to TypeScript. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Migrate the remaining .js/.jsx files to TypeScript.
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 6.7/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 3–7% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 6.7/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
3372 modules, 9844 dependencies. 4 dependency cycles across 340 modules, marked above the diagonal.
Showing the 40 most-connected modules; 3332 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
oxc_ast_tools.schema.defs.enum uses oxc_react_compiler.react_compiler_hir. Changing oxc_react_compiler.react_compiler_hir can break oxc_ast_tools.schema.defs.enum, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
5→2 oxc_formatter_core.write depends on oxc_estree.serialize.formatter✕
Type pairs
1 distinct (type in oxc_formatter_core.write → type in oxc_estree.serialize.formatter) reference.
oxc_formatter_core.write uses oxc_estree.serialize.formatter. Changing oxc_estree.serialize.formatter can break oxc_formatter_core.write, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
6→1 oxc_span.span depends on oxc_allocator.allocator✕
Type pairs
1 distinct (type in oxc_span.span → type in oxc_allocator.allocator) reference.
oxc_ast_tools.schema uses oxc_react_compiler.react_compiler_hir. Changing oxc_react_compiler.react_compiler_hir can break oxc_ast_tools.schema, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
10→6 oxc_linter.rules.import.default depends on oxc_span.span✕
Type pairs
1 distinct (type in oxc_linter.rules.import.default → type in oxc_span.span) reference.
oxc_str.compact_str uses oxc_linter.rules.import.prefer_default_export. Changing oxc_linter.rules.import.prefer_default_export can break oxc_str.compact_str, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
12→26 oxc_str.compact_str depends on oxc_str.identcycle✕
Type pairs
1 distinct (type in oxc_str.compact_str → type in oxc_str.ident) reference.
oxc_semantic.scoping uses oxc_react_compiler.react_compiler_hir. Changing oxc_react_compiler.react_compiler_hir can break oxc_semantic.scoping, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
15→1 oxc_str.str depends on oxc_allocator.allocator✕
Type pairs
1 distinct (type in oxc_str.str → type in oxc_allocator.allocator) reference.
oxc_str.str uses oxc_linter.rules.import.prefer_default_export. Changing oxc_linter.rules.import.prefer_default_export can break oxc_str.str, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
oxc_syntax.reference uses oxc_react_compiler.react_compiler_hir. Changing oxc_react_compiler.react_compiler_hir can break oxc_syntax.reference, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
17→1 oxc_ast.ast.ts depends on oxc_allocator.allocator✕
Type pairs
91 distinct (type in oxc_ast.ast.ts → type in oxc_allocator.allocator) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
255 distinct (type in oxc_ast.ast.ts → type in oxc_span.span) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
170 distinct (type in oxc_ast.ast.ts → type in oxc_syntax.node) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_ast.ast.ts uses oxc_ast.ast.literal. Changing oxc_ast.ast.literal can break oxc_ast.ast.ts, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
17→31 oxc_ast.ast.ts depends on oxc_ast.ast.jscycle✕
Type pairs
43 distinct (type in oxc_ast.ast.ts → type in oxc_ast.ast.js) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
58 distinct (type in oxc_ast.ast.ts → type in oxc_codegen) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_formatter.ast_nodes.node uses oxc_estree.serialize.formatter. Changing oxc_estree.serialize.formatter can break oxc_formatter.ast_nodes.node, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
18→5 oxc_formatter.ast_nodes.node depends on oxc_formatter_core.write✕
Type pairs
1 distinct (type in oxc_formatter.ast_nodes.node → type in oxc_formatter_core.write) reference.
oxc_formatter.ast_nodes.node uses oxc_linter.rules.import.prefer_default_export. Changing oxc_linter.rules.import.prefer_default_export can break oxc_formatter.ast_nodes.node, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
18→26 oxc_formatter.ast_nodes.node depends on oxc_str.identcycle✕
Type pairs
1 distinct (type in oxc_formatter.ast_nodes.node → type in oxc_str.ident) reference.
oxc_formatter.ast_nodes.node uses oxc_react_compiler.react_compiler_hir. Changing oxc_react_compiler.react_compiler_hir can break oxc_formatter.ast_nodes.node, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
18→28 oxc_formatter.ast_nodes.node depends on oxc_ast.ast.literalcycle✕
Type pairs
1 distinct (type in oxc_formatter.ast_nodes.node → type in oxc_ast.ast.literal) reference.
oxc_linter.fixer.fix uses oxc_linter.rules.import.prefer_default_export. Changing oxc_linter.rules.import.prefer_default_export can break oxc_linter.fixer.fix, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
23→1 oxc_linter.context.host depends on oxc_allocator.allocator✕
Type pairs
1 distinct (type in oxc_linter.context.host → type in oxc_allocator.allocator) reference.
oxc_linter.context.host uses oxc_estree.serialize.formatter. Changing oxc_estree.serialize.formatter can break oxc_linter.context.host, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→10 oxc_linter.context.host depends on oxc_linter.rules.import.default✕
Type pairs
1 distinct (type in oxc_linter.context.host → type in oxc_linter.rules.import.default) reference.
oxc_linter.context.host uses oxc_linter.rules.import.default. Changing oxc_linter.rules.import.default can break oxc_linter.context.host, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→11 oxc_linter.context.host depends on oxc_span.source_type✕
Type pairs
1 distinct (type in oxc_linter.context.host → type in oxc_span.source_type) reference.
oxc_linter.context uses oxc_linter.rules.import.prefer_default_export. Changing oxc_linter.rules.import.prefer_default_export can break oxc_linter.context, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
24→31 oxc_linter.context depends on oxc_ast.ast.jscycle✕
Type pairs
1 distinct (type in oxc_linter.context → type in oxc_ast.ast.js) reference.
oxc_linter.rules.import.prefer_default_export uses oxc_span.span. Changing oxc_span.span can break oxc_linter.rules.import.prefer_default_export, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→21 oxc_linter.rules.import.prefer_default_export depends on oxc_linter.rule✕
Type pairs
2 distinct (type in oxc_linter.rules.import.prefer_default_export → type in oxc_linter.rule) references.
oxc_linter.rules.import.prefer_default_export uses oxc_linter.rule. Changing oxc_linter.rule can break oxc_linter.rules.import.prefer_default_export, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→24 oxc_linter.rules.import.prefer_default_export depends on oxc_linter.context✕
Type pairs
1 distinct (type in oxc_linter.rules.import.prefer_default_export → type in oxc_linter.context) reference.
oxc_linter.rules.import.prefer_default_export uses oxc_linter.context. Changing oxc_linter.context can break oxc_linter.rules.import.prefer_default_export, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→38 oxc_linter.rules.import.prefer_default_export depends on oxc_diagnosticscycle✕
Type pairs
1 distinct (type in oxc_linter.rules.import.prefer_default_export → type in oxc_diagnostics) reference.
oxc_linter.rules.import.prefer_default_export uses oxc_diagnostics. Changing oxc_diagnostics can break oxc_linter.rules.import.prefer_default_export, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
26→1 oxc_str.ident depends on oxc_allocator.allocator✕
Type pairs
1 distinct (type in oxc_str.ident → type in oxc_allocator.allocator) reference.
oxc_str.ident uses oxc_linter.rules.import.prefer_default_export. Changing oxc_linter.rules.import.prefer_default_export can break oxc_str.ident, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
27→1 oxc_react_compiler.react_compiler_hir depends on oxc_allocator.allocator✕
Type pairs
17 distinct (type in oxc_react_compiler.react_compiler_hir → type in oxc_allocator.allocator) references.
oxc_react_compiler.react_compiler_hir uses oxc_allocator.allocator. Changing oxc_allocator.allocator can break oxc_react_compiler.react_compiler_hir, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
27→2 oxc_react_compiler.react_compiler_hir depends on oxc_estree.serialize.formatter✕
Type pairs
7 distinct (type in oxc_react_compiler.react_compiler_hir → type in oxc_estree.serialize.formatter) references.
oxc_react_compiler.react_compiler_hir uses oxc_estree.serialize.formatter. Changing oxc_estree.serialize.formatter can break oxc_react_compiler.react_compiler_hir, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
27→6 oxc_react_compiler.react_compiler_hir depends on oxc_span.span✕
Type pairs
18 distinct (type in oxc_react_compiler.react_compiler_hir → type in oxc_span.span) references.
oxc_ast.ast.literal uses oxc_react_compiler.react_compiler_hir. Changing oxc_react_compiler.react_compiler_hir can break oxc_ast.ast.literal, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→33 oxc_ast.ast.literal depends on oxc_codegencycle✕
Type pairs
6 distinct (type in oxc_ast.ast.literal → type in oxc_codegen) references.
66 distinct (type in oxc_ast.ast.jsx → type in oxc_span.span) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
44 distinct (type in oxc_ast.ast.jsx → type in oxc_syntax.node) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
42 distinct (type in oxc_parser → type in oxc_ast.ast.js) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_parser uses oxc_diagnostics. Changing oxc_diagnostics can break oxc_parser, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
31→1 oxc_ast.ast.js depends on oxc_allocator.allocator✕
Type pairs
134 distinct (type in oxc_ast.ast.js → type in oxc_allocator.allocator) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
365 distinct (type in oxc_ast.ast.js → type in oxc_span.span) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_ast.ast.js uses oxc_span.span. Changing oxc_span.span can break oxc_ast.ast.js, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→7 oxc_ast.ast.js depends on oxc_syntax.operator✕
Type pairs
32 distinct (type in oxc_ast.ast.js → type in oxc_syntax.operator) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
242 distinct (type in oxc_ast.ast.js → type in oxc_syntax.node) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
64 distinct (type in oxc_ast.ast.js → type in oxc_ast.ast.ts) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_ast.ast.js uses oxc_str.ident. Changing oxc_str.ident can break oxc_ast.ast.js, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
31→27 oxc_ast.ast.js depends on oxc_react_compiler.react_compiler_hir✕
Type pairs
30 distinct (type in oxc_ast.ast.js → type in oxc_react_compiler.react_compiler_hir) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
109 distinct (type in oxc_ast.ast.js → type in oxc_codegen) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_ast.generated.ast_kind uses oxc_syntax.node. Changing oxc_syntax.node can break oxc_ast.generated.ast_kind, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→17 oxc_ast.generated.ast_kind depends on oxc_ast.ast.ts✕
Type pairs
74 distinct (type in oxc_ast.generated.ast_kind → type in oxc_ast.ast.ts) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_ast.generated.ast_kind uses oxc_ast.ast.jsx. Changing oxc_ast.ast.jsx can break oxc_ast.generated.ast_kind, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→31 oxc_ast.generated.ast_kind depends on oxc_ast.ast.js✕
Type pairs
98 distinct (type in oxc_ast.generated.ast_kind → type in oxc_ast.ast.js) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_minifier.traverse_context uses oxc_react_compiler.react_compiler_hir. Changing oxc_react_compiler.react_compiler_hir can break oxc_minifier.traverse_context, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→31 oxc_minifier.traverse_context depends on oxc_ast.ast.js✕
Type pairs
10 distinct (type in oxc_minifier.traverse_context → type in oxc_ast.ast.js) references.
oxc_ast_visit.generated.visit_js uses oxc_react_compiler.react_compiler_hir. Changing oxc_react_compiler.react_compiler_hir can break oxc_ast_visit.generated.visit_js, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
35→28 oxc_ast_visit.generated.visit_js depends on oxc_ast.ast.literal✕
Type pairs
6 distinct (type in oxc_ast_visit.generated.visit_js → type in oxc_ast.ast.literal) references.
oxc_ast_visit.generated.visit_js uses oxc_ast.ast.jsx. Changing oxc_ast.ast.jsx can break oxc_ast_visit.generated.visit_js, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
35→31 oxc_ast_visit.generated.visit_js depends on oxc_ast.ast.js✕
Type pairs
122 distinct (type in oxc_ast_visit.generated.visit_js → type in oxc_ast.ast.js) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_ast_visit.generated.visit_js uses oxc_ast.generated.ast_kind. Changing oxc_ast.generated.ast_kind can break oxc_ast_visit.generated.visit_js, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
oxc_linter.fixer uses oxc_diagnostics. Changing oxc_diagnostics can break oxc_linter.fixer, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
37→17 oxc_minifier.generated.traverse depends on oxc_ast.ast.ts✕
Type pairs
85 distinct (type in oxc_minifier.generated.traverse → type in oxc_ast.ast.ts) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_minifier.generated.traverse uses oxc_ast.ast.jsx. Changing oxc_ast.ast.jsx can break oxc_minifier.generated.traverse, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→31 oxc_minifier.generated.traverse depends on oxc_ast.ast.js✕
Type pairs
122 distinct (type in oxc_minifier.generated.traverse → type in oxc_ast.ast.js) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
oxc_minifier.generated.traverse uses oxc_minifier.traverse_context. Changing oxc_minifier.traverse_context can break oxc_minifier.generated.traverse, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→2 oxc_diagnostics depends on oxc_estree.serialize.formatter✕
Type pairs
3 distinct (type in oxc_diagnostics → type in oxc_estree.serialize.formatter) references.
oxc_diagnostics uses oxc_linter.rules.import.prefer_default_export. Changing oxc_linter.rules.import.prefer_default_export can break oxc_diagnostics, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→36 oxc_diagnostics depends on oxc_linter.fixer✕
Type pairs
1 distinct (type in oxc_diagnostics → type in oxc_linter.fixer) reference.
oxc_allocator.vec uses oxc_linter.rules.import.prefer_default_export. Changing oxc_linter.rules.import.prefer_default_export can break oxc_allocator.vec, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
39→38 oxc_allocator.vec depends on oxc_diagnostics✕
Type pairs
1 distinct (type in oxc_allocator.vec → type in oxc_diagnostics) reference.
oxc_react_compiler.react_compiler_hir.environment uses oxc_allocator.allocator. Changing oxc_allocator.allocator can break oxc_react_compiler.react_compiler_hir.environment, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→6 oxc_react_compiler.react_compiler_hir.environment depends on oxc_span.span✕
Type pairs
1 distinct (type in oxc_react_compiler.react_compiler_hir.environment → type in oxc_span.span) reference.
oxc_react_compiler.react_compiler_hir.environment uses oxc_span.span. Changing oxc_span.span can break oxc_react_compiler.react_compiler_hir.environment, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→8 oxc_react_compiler.react_compiler_hir.environment depends on oxc_syntax.symbol✕
Type pairs
1 distinct (type in oxc_react_compiler.react_compiler_hir.environment → type in oxc_syntax.symbol) reference.
oxc_react_compiler.react_compiler_hir.environment uses oxc_syntax.symbol. Changing oxc_syntax.symbol can break oxc_react_compiler.react_compiler_hir.environment, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→26 oxc_react_compiler.react_compiler_hir.environment depends on oxc_str.ident✕
Type pairs
1 distinct (type in oxc_react_compiler.react_compiler_hir.environment → type in oxc_str.ident) reference.
oxc_react_compiler.react_compiler_hir.environment uses oxc_str.ident. Changing oxc_str.ident can break oxc_react_compiler.react_compiler_hir.environment, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→27 oxc_react_compiler.react_compiler_hir.environment depends on oxc_react_compiler.react_compiler_hir✕
Type pairs
15 distinct (type in oxc_react_compiler.react_compiler_hir.environment → type in oxc_react_compiler.react_compiler_hir) references.
oxc_react_compiler.react_compiler_hir.environment uses oxc_react_compiler.react_compiler_hir. Changing oxc_react_compiler.react_compiler_hir can break oxc_react_compiler.react_compiler_hir.environment, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
40→38 oxc_react_compiler.react_compiler_hir.environment depends on oxc_diagnostics✕
Type pairs
3 distinct (type in oxc_react_compiler.react_compiler_hir.environment → type in oxc_diagnostics) references.
oxc_react_compiler.react_compiler_hir.environment uses oxc_diagnostics. Changing oxc_diagnostics can break oxc_react_compiler.react_compiler_hir.environment, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
At a glance — Code Health · 45% · Weak · gated by D2, X4 ·
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 category
Findings
Severity
A05:2025 — Injection
57
High / Critical
A03:2025 — Software Supply Chain Failures
23
High / Critical
A07:2025 — Authentication Failures
9
High / Critical
A02:2025 — Security Misconfiguration
1
Medium
Roadmap
First, migrate the remaining JavaScript files to TypeScript to establish type safety and enable strict null checking across the codebase. Next, thread AbortSignals through async request functions to ensure proper cancellation propagation and prevent resource leaks. Then, replace interpolated log messages with structured logging to improve observability and debugging capabilities. Finally, refactor branch-heavy functions to reduce cyclomatic complexity, aiming for a P95 score of five or lower to enhance maintainability.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Migrate the remaining .js/.jsx files to TypeScript.
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 `?`).
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 — 88
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 — 3300
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 — 134
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 6
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 75 of 79 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 79 dimensions across the health lenses
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
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, 3458 of 3522 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.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
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.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
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 — Watchdog measured this, but not all of it. What it 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,897 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 213 test source file(s) (.rs) 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 — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT MEASURED: the JavaScript/TypeScript suite could not be re-run in the analyzer sandbox — the dependency install for apps/oxfmt/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repo — it is excluded from the score.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in apps/oxfmt/ was NOT MEASURED: the dependency install for apps/oxfmt/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in apps/oxlint/ was NOT MEASURED: the dependency install for apps/oxlint/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in apps/shared/ was NOT MEASURED: the dependency install for apps/shared/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in napi/minify/ was NOT MEASURED: the dependency install for napi/minify/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in napi/parser/ was NOT MEASURED: the dependency install for napi/parser/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in napi/transform/ was NOT MEASURED: the dependency install for napi/transform/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in napi/transform-react/ was NOT MEASURED: the dependency install for napi/transform-react/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in napi/transform-relay/ was NOT MEASURED: the dependency install for napi/transform-relay/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in packages/codegen/ was NOT MEASURED: the dependency install for packages/codegen/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in tasks/e2e/ was NOT MEASURED: the dependency install for tasks/e2e/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability for the vitest suite in tasks/transform_conformance/ was NOT MEASURED: the dependency install for tasks/transform_conformance/ failed in the analyzer sandbox (ERR_PNPM_BROKEN_LOCKFILE The lockfile at "REDACTED" is broken: expected a single document in the stream, but found more), so the suite never ran. This is OUR limitation, not a defect in the repository, and the suite is excluded from the measurement rather than counted against it.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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 package.json, but the licence verdict published here was taken over its crate 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 — Watchdog measured this, but not all of it. What it 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 crates/oxc_lexer/src/token.rs 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.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `apps/oxfmt/src-js/cli/worker-proxy.ts`, `apps/oxfmt/src-js/index.ts`, `apps/oxlint/conformance/src/groups/cypress.ts`, `apps/oxlint/conformance/src/groups/e18e.ts`, `apps/oxlint/conformance/src/groups/eslint.ts`, … (+194 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.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
P5 DR & Backup — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
R10 Code Duplication — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 68 further occurrence(s) are not listed individually; the score already reflects all 108.
R4 Test Coverage — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 341 further occurrence(s) are not listed individually; the score already reflects all 381.
R7 Dead Code — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 6 further occurrence(s) are not listed individually; the score already reflects all 46.
X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and PHP, Java, Kotlin, Python, Ruby, Scala, Dart, Swift, Erlang and Go source only, and no C# was loaded and no PHP, Java, Kotlin, Python, Ruby, Scala, Dart, Swift, Erlang or Go was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it 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. 20 further occurrence(s) are not listed individually; the score already reflects all 60.
Repo exclusion declarations: 19 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
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.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
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.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
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.
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.
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.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (4): D19, D21, D22, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
595 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was oxc_lexer::pipeline::carve::jsx::carve_jsx at 126. A further 60 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 AstKind::debug_name at 194 — they are counted neither in the figure above nor in this dimension's score. 26 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: crates/oxc_ast/src/ast_kind_impl.rs (AstKind::debug_name at 194), crates/oxc_lexer/src/token.rs (TokenKind::from_u8 at 170), crates/oxc_parser/src/lexer/kind.rs (Kind::to_str at 166), crates/oxc_linter/src/globals.rs (AriaProperty::try_from at 54), crates/oxc_semantic/src/checker/mod.rs (oxc_semantic::checker::check at 37), and 21 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.
+ 280 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 14 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with oxc_lexer::pipeline::carve::jsx::carve_jsx (cyclomatic 126), regeneratorRuntime._regeneratorRuntime (cyclomatic 107), regeneratorRuntime._regeneratorRuntime (cyclomatic 107). — 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 14 together lifts Cyclomatic Complexity from 5.3 to about 6.3/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
+ 483 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 9 bodies over 120 down to 120 or less in Cognitive Complexity — start with oxc_lexer::pipeline::carve::jsx::carve_jsx (cognitive 354), oxc_lexer::pipeline::disambiguate::type_context::type_list::type_list_legal (cognitive 185), PeepholeOptimizations::substitute_single_use_symbol_in_expression (cognitive 172). — 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 9 together lifts Cognitive Complexity from 2.0 to about 3.4/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.8 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 96 FileTooLong finding(s) in God Classes — start with REDACTED (4), js.rs (3), lib.rs (3). — One of this dimension's main actionable groups (96 warning-level).
Resolve the 55 MethodTooLong finding(s) in God Classes — start with REDACTED (4), lib.rs (3), class.rs (2). — One of this dimension's main actionable groups (55 warning-level).
Resolve the 45 FunctionTooLong finding(s) in God Classes — start with REDACTED (4), minify.wasip1-deferred.js (2), parser.wasip1-deferred.js (2). — One of this dimension's main actionable groups (45 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
472 duplicated block group(s) detected. A further 21 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 2 of the 493 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 119 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 39 Duplicated block (9 lines × 2) finding(s) in Code Duplication — start with REDACTED (2), prefer_array_flat.rs (2), builder.rs (2). — One of this dimension's main actionable groups (39 warning-level).
Resolve the 35 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with scoping.rs (3), gen.rs (2), REDACTED (2). — One of this dimension's main actionable groups (35 warning-level).
Resolve the 34 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with builder.rs (3), parse.rs (2), parser_impl.rs (2). — One of this dimension's main actionable groups (34 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.7 / 10Strong✓ 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.
83 production modules (Cargo+npm), 0 dependency cycle(s), 6 unstable depended-on module(s). Read from the build's own module declarations; 8 module(s) off the main sequence, with abstractness counted on 63 of the 83 (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: website_common · ×8
Unstable project oxc_formatter_json
Unstable project oxc_isolated_declarations
Unstable project oxc_lexer
Unstable project oxc_linter
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 8 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 1 Unstable project oxc_formatter_json finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project oxc_isolated_declarations finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 13 Low cohesion finding(s) in Cohesion (LCOM4) — start with lib.rs (2), annotations.rs, node.rs. — One of this dimension's main actionable groups (13 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution9.9 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
6327 test methods: 4979 unit, 1321 integration, 0 BDD, 27 e2e. The JavaScript/TypeScript suite contributes 1897 `it`/`test` case(s) across 70 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 4430 `#[test]` function(s) across 1183 file(s) declaring at least one; its unit/integration split is Cargo's own — 106 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.8 / 10Adequategated by 1 critical finding✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
20 skipped (20 with a documented reason), 19 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 1897 tests. Measured on the JavaScript/TypeScript suite only — at least 213 test source file(s) (.rs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions (empty test): (unnamed test)apps/oxlint/fixtures/cli/overrides_with_plugin/index.test.ts:4
No assertions: empty visitor · ×18napi/parser/test/visit.test.ts:7
Resolve the 1 No assertions (empty test) finding(s) in Test Quality — start with index.test.ts. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 18 No assertions finding(s) in Test Quality — start with parse-raw.test.ts (17), visit.test.ts. — One of this dimension's main actionable groups (18 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
16 outdated, 0 yanked direct Cargo dependencies. 89 of 90 direct crates were graded against crates.io (0 not published there, 1 not resolved by a committed Cargo.lock). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from Cargo.lock there.
Outdated: bitflags · ×16
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
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.
0 of 365 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's Cargo.lock closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, 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.
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.
Top hotspots: crates/oxc_minifier/src/peephole/minimize_statements.rs (52×101=5252); crates/oxc_lexer/src/token.rs (17×170=2890); crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs (27×85=2295) Repeated repair below the complexity floor: crates/oxc_parser/src/diagnostics.rs (10 of 19 changes were fixes); crates/oxc_formatter/src/formatter/trivia.rs (8 of 14 changes were fixes); tasks/ast_tools/src/generators/formatter/format.rs (7 of 13 changes were fixes)
Resolve the 164 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (7), class.rs (4), statement.rs (3). — One of this dimension's main actionable groups (164 warning-level).
Resolve the 24 Repeated repair finding(s) in Churn × Complexity Hotspots — start with diagnostics.rs, trivia.rs, format.rs. — One of this dimension's main actionable groups (24 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor8.6 / 10Strong✓ 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.
257 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/oxc_react_compiler/src/react_compiler_lowering/build_hir.rs. Counted over 1822 of the 2220 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 · ×6
Further sole-owners (lower concentration)
What to do
Resolve the 6 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (6 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
534 deducted task-comment markers across 804000 LoC (0.1/KLoC) → score 9.9. 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.
Resolve the 499 TodoComment finding(s) in Explicit Debt — start with private_field.rs (23), class.rs (22), tokens.test.ts (21). — One of this dimension's main actionable groups (499 warning-level).
Resolve the 23 FixmeComment finding(s) in Explicit Debt — start with typescript_eslint.rs (5), oxc.rs (4), REDACTED (2). — One of this dimension's main actionable groups (23 warning-level).
Resolve the 7 XxxComment finding(s) in Explicit Debt — start with types.rs (5), worker-proxy.ts, no_warning_comments.rs. — One of this dimension's main actionable groups (7 warning-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's root README and the crates/oxc/README.md are clear and complete for a Rust toolchain project: it is an Oxidation Compiler collection of high-performance tools written in Rust, part of VoidZero's unified toolchain vision, powering Rolldown and enabling ultra-fast development tools. The root README gives an overview, installation, usage, and contribution guidance; the crates/oxc/README.md documents each crate (Oxc, Oxc Allocator, Oxc AST, etc.) with a quick start, features, architecture, and usage examples for its own directory. All visible sections are present in the outline and are well-structured. The oxc project's READMEs document the crates/oxc_... directories (language server, lexer, linter, mangler, minifier, napi, parser, react compiler) rather than the repository as a whole. Each crate's README is focused on its own directory and provides an overview plus usage examples for that tier; there are no single root-level READMEs covering installation, usage, or contribution guidance. The oxc_linter README gives architecture (rule system, performance design, ESLint compatibility) with concrete rule categories like `fixKind` values and a detailed Usage section, while the oxc_minifier README is exemplary in describing its compression benchmarks, test infrastructure, and dependency list.
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyWeak◐ Sampled · advisory
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
7 API inconsistencies across a 400-member sample of 972 exposed types.
Duplicate high-level entry point. `Compiler.execute` and `CompilerInterface.compile` appear to perform the same full compilation pipeline given identical inputs. The distinction between a concrete `Compiler` type and a `CompilerInterface` trait for the primary entry point is confusing.
Redundant methods with identical semantics. `contains` and `has_bit` both check for the presence of a bit.
Ambiguous naming convention for accessor vs consumer. `get_` usually implies borrowing, while `into_` implies consuming. However, `Expression` is likely an arena-allocated node where 'consuming' might just mean returning the owned value from the arena context. If `into_inner_expression` returns the same type as `get_inner_expression` (which it appears to, based on typical arena patterns), the naming is inconsistent with standard Rust idioms where `into_` consumes `self`.
Three methods for converting an Expression to a MemberExpression. `as_` implies borrowing, `into_` implies consuming, but `to_` is ambiguous and often duplicates `as_` in non-standard libraries.
Duplicate accessor for MemberExpression. `get_member_expr` and `as_member_expression` likely perform the same cast/check.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 Duplicate high-level entry point. `Compiler.execute` and… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Redundant methods with identical semantics. `contains` and `has_bit`… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Ambiguous naming convention for accessor vs consumer. `get_` usually… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_recommendation.md · top locations in Appendix A, every location in findings.md.
11 of 72 build units (Cargo, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
8 finding(s): 0 critical, 8 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (4), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (8 issue-level).
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.
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).
57 finding(s): 0 critical, 47 high, 10 medium, 0 low. semgrep hit a parse error in 245 file(s) — `apps/oxfmt/conformance/download-fixtures.js` (line 10), `apps/oxfmt/conformance/fixtures/edge-cases/css-in-js/issue-19667.ts`, `apps/oxfmt/src-js/cli/worker-proxy.ts` (line 61, line 74, line 87, …), `apps/oxfmt/src-js/index.ts` (line 23), `apps/oxlint/conformance/src/groups/cypress.ts` (line 1), … (+240 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 4 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
+ 9 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 33 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (21), REDACTED (6), REDACTED. — One of this dimension's main actionable groups (33 issue-level).
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
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.
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.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 9 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (9). — One of this dimension's main actionable groups (9 issue-level).
Resolve the 3 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
14 of 1822 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/oxc_linter/src/rules/vitest/valid_expect_in_promise.rs. Counted over 1822 of the 2220 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 2 Orphaned knowledge finding(s) in Knowledge Freshness — start with valid_expect_in_promise.rs, jsx_no_constructed_context_values.rs. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
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.
Resolve the 4 Boundary-crossing change coupling finding(s) in Change Coupling — start with from_prettier_doc.rs (2), oxfmtrc.rs, server_linter.rs. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 8 Change coupling finding(s) in Change Coupling — start with REDACTED (2), css.rs, text-to-doc.ts. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with REDACTED, graphql.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 0 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.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
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.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
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.
Do you agree with this assessment?
AX8 · Test isolation0.0 / 10Critical✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
`oxc_formatter` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`oxc_formatter_css` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`oxc_formatter_graphql` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`oxc_formatter_json` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`oxc_formatter_markdown` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`oxc_formatter_yaml` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
What to do
Remove every production → test project reference: extract any shared test helper into a production support library (which the tests reference), or invert the dependency so the test project depends on production — not the reverse.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a 'Testing' section to the root README — how to run the test suite.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 50 of 101 project(s) that lack one — worth up to 1 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
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.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability4.5 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 3/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/oxc_linter/fixtures/import/no-unused-modules`, `crates/oxc_linter/fixtures/import/no-unused-modules/binObject`, `tasks/ast_tools`, `tasks/compat_data`, `tasks/coverage` and 9 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Consider OpenTelemetry tracing/metrics (opentelemetry with tracing-opentelemetry) and a health-check endpoint (a /health route on your axum/actix router) for operability.
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.
What to do
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
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.
What to do
The release job declares an environment, but its protection rules are not visible from the repository — confirm required reviewers are attached, or publish as a draft release so a bad build can be stopped before users can download it.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, 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.
`getModules` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — tasks/e2e/test/utils.ts:34
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.
Do you agree with this assessment?
R1 · Type Safety4.1 / 10Weak✓ 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.
212 typed · 307 plain JS — the untyped files are apps/oxfmt/conformance/download-fixtures.js, apps/oxfmt/scripts/build.js, napi/disable-reused-workers.mjs, napi/minify/browser.js, napi/minify/minify.wasi-browser.js, napi/minify/minify.wasip1-browser.js (+301 more). 1 production file(s) opt out entirely with @ts-nocheck · 3 @ts-ignore suppression(s); the opted-out files are apps/oxlint/src-js/package/config.generated.ts.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
11 of the duplicated blocks reported below have copies in at least two of the sibling directories minify, parser, playground, transform, transform-react, transform-relay under napi/. That concentration is one structural fact, not 11 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 11 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. — napi/minify/minify.wasip1-deferred.js:2
napi/minify/minify.wasip1-deferred.js:2 · napi/parser/src-js/parser.wasip1-deferred.js:2 · napi/transform-react/transform-react.wasip1-deferred.js:2 · napi/transform-relay/transform-relay.wasip1-deferred.js:2 · +1 more site(s) not listed — these 5 files are line-for-line copies of one another — 745 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. — napi/minify/minify.wasip1-deferred.js:2
napi/minify/minify.wasip1-browser.js:10 · napi/parser/src-js/parser.wasip1-browser.js:10 · napi/transform-react/transform-react.wasip1-browser.js:10 · napi/transform-relay/transform-relay.wasip1-browser.js:10 · +1 more site(s) not listed — the 5 copies are spread across 5 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — napi/minify/minify.wasip1-browser.js:10
napi/minify/minify.wasi-browser.js:2 · napi/parser/src-js/parser.wasi-browser.js:2 · napi/playground/playground.wasi-browser.js:2 · napi/transform-react/transform-react.wasi-browser.js:2 · +2 more site(s) not listed — these 6 files are line-for-line copies of one another — 505 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. — napi/minify/minify.wasi-browser.js:2
apps/oxlint/src-js/plugins/tokens_methods.ts:144 · apps/oxlint/src-js/plugins/tokens_methods.ts:893 — the two spans are one implementation copied and then locally edited — 1703 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. — apps/oxlint/src-js/plugins/tokens_methods.ts:144
npm/runtime/src/helpers/esm/regeneratorRuntime.js:2 · npm/runtime/src/helpers/regeneratorRuntime.js:2 — these 2 files are line-for-line copies of one another — 236 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. — npm/runtime/src/helpers/esm/regeneratorRuntime.js:2
napi/minify/minify.wasip1-browser.js:1099 · napi/parser/src-js/parser.wasip1-browser.js:1099 · napi/transform-react/transform-react.wasip1-browser.js:1099 · napi/transform-relay/transform-relay.wasip1-browser.js:1099 · +1 more site(s) not listed — the 5 copies are spread across 5 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. — napi/minify/minify.wasip1-browser.js:1099
apps/oxlint/src-js/plugins/comments.ts:83 · apps/oxlint/src-js/plugins/tokens.ts:154 — the two spans are one implementation copied and then locally edited — 1174 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. — apps/oxlint/src-js/plugins/comments.ts:83
npm/runtime/src/helpers/applyDecs.js:4 · npm/runtime/src/helpers/esm/applyDecs.js:4 — these 2 files are line-for-line copies of one another — 178 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. — npm/runtime/src/helpers/applyDecs.js:4
npm/runtime/src/helpers/applyDecs2301.js:5 · npm/runtime/src/helpers/esm/applyDecs2301.js:5 — these 2 files are line-for-line copies of one another — 164 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. — npm/runtime/src/helpers/applyDecs2301.js:5
npm/runtime/src/helpers/applyDecs2203.js:2 · npm/runtime/src/helpers/esm/applyDecs2203.js:2 — these 2 files are line-for-line copies of one another — 141 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. — npm/runtime/src/helpers/applyDecs2203.js:2
npm/runtime/src/helpers/applyDecs2203R.js:4 · npm/runtime/src/helpers/esm/applyDecs2203R.js:4 — these 2 files are line-for-line copies of one another — 140 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. — npm/runtime/src/helpers/applyDecs2203R.js:4
npm/runtime/src/helpers/applyDecs2305.js:5 · npm/runtime/src/helpers/esm/applyDecs2305.js:5 — these 2 files are line-for-line copies of one another — 103 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. — npm/runtime/src/helpers/applyDecs2305.js:5
npm/runtime/src/helpers/applyDecs2311.js:5 · npm/runtime/src/helpers/esm/applyDecs2311.js:5 — these 2 files are line-for-line copies of one another — 94 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. — npm/runtime/src/helpers/applyDecs2311.js:5
napi/minify/wasi-worker.mjs:1 · napi/parser/src-js/wasi-worker.mjs:1 · napi/playground/wasi-worker.mjs:1 · napi/transform-react/wasi-worker.mjs:1 · +2 more site(s) not listed — these 6 files are line-for-line copies of one another — 91 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. — napi/minify/wasi-worker.mjs:1
npm/runtime/src/helpers/esm/usingCtx.js:1 · npm/runtime/src/helpers/usingCtx.js:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — npm/runtime/src/helpers/esm/usingCtx.js:1
npm/runtime/src/helpers/esm/wrapAsyncGenerator.js:2 · npm/runtime/src/helpers/wrapAsyncGenerator.js:2 — these 2 files are line-for-line copies of one another — 53 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. — npm/runtime/src/helpers/esm/wrapAsyncGenerator.js:2
npm/runtime/src/helpers/createForOfIteratorHelper.js:2 · npm/runtime/src/helpers/esm/createForOfIteratorHelper.js:2 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — npm/runtime/src/helpers/createForOfIteratorHelper.js:2
REDACTED:7 · REDACTED:7 — 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. — REDACTED:7
napi/minify/wasi-worker-browser.mjs:9 · napi/parser/src-js/wasi-worker-browser.mjs:9 · napi/playground/wasi-worker-browser.mjs:9 · napi/transform-react/wasi-worker-browser.mjs:9 · +2 more site(s) not listed — the 6 copies are spread across 6 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 6 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — napi/minify/wasi-worker-browser.mjs:9
apps/oxfmt/src-js/cli/migration/migrate-biome.ts:256 · apps/oxfmt/src-js/cli/migration/migrate-biome.ts:301 — the two spans are one implementation copied and then locally edited — 140 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. — apps/oxfmt/src-js/cli/migration/migrate-biome.ts:256
npm/runtime/src/helpers/asyncIterator.js:13 · npm/runtime/src/helpers/esm/asyncIterator.js:13 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — npm/runtime/src/helpers/asyncIterator.js:13
npm/runtime/src/helpers/esm/iterableToArrayLimit.js:1 · npm/runtime/src/helpers/iterableToArrayLimit.js:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — npm/runtime/src/helpers/esm/iterableToArrayLimit.js:1
npm/runtime/src/helpers/esm/importDeferProxy.js:1 · npm/runtime/src/helpers/importDeferProxy.js:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — npm/runtime/src/helpers/esm/importDeferProxy.js:1
apps/oxlint/src-js/package/parse.ts:159 · napi/parser/src-js/raw-transfer/supported.js:30 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — apps/oxlint/src-js/package/parse.ts:159
napi/parser/src-js/parser.wasi-browser.js:1424 · napi/parser/src-js/parser.wasip1-browser.js:1371 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — napi/parser/src-js/parser.wasi-browser.js:1424
napi/transform/transform.wasi-browser.js:1424 · napi/transform/transform.wasip1-browser.js:1371 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — napi/transform/transform.wasi-browser.js:1424
npm/runtime/src/helpers/asyncGeneratorDelegate.js:2 · npm/runtime/src/helpers/esm/asyncGeneratorDelegate.js:2 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — npm/runtime/src/helpers/asyncGeneratorDelegate.js:2
apps/oxlint/src-js/plugins/tokens_methods.ts:117 · apps/oxlint/src-js/plugins/tokens_methods.ts:202 · apps/oxlint/src-js/plugins/tokens_methods.ts:282 · apps/oxlint/src-js/plugins/tokens_methods.ts:363 · +10 more site(s) not listed — all 14 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. — apps/oxlint/src-js/plugins/tokens_methods.ts:117
apps/oxlint/src-js/plugins/tokens_methods.ts:1001 · apps/oxlint/src-js/plugins/tokens_methods.ts:1167 — 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. — apps/oxlint/src-js/plugins/tokens_methods.ts:1001
npm/runtime/src/helpers/esm/jsx.js:2 · npm/runtime/src/helpers/jsx.js:2 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — npm/runtime/src/helpers/esm/jsx.js:2
npm/runtime/src/helpers/esm/wrapNativeSuper.js:7 · npm/runtime/src/helpers/wrapNativeSuper.js:7 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — npm/runtime/src/helpers/esm/wrapNativeSuper.js:7
apps/oxfmt/src-js/cli/migration/migrate-biome.ts:126 · apps/oxfmt/src-js/cli/migration/migrate-prettier.ts:110 — the two spans are one implementation copied and then locally edited — 76 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. — apps/oxfmt/src-js/cli/migration/migrate-biome.ts:126
apps/oxlint/src-js/plugins/tokens_methods.ts:173 · apps/oxlint/src-js/plugins/tokens_methods.ts:335 · apps/oxlint/src-js/plugins/tokens_methods.ts:498 · apps/oxlint/src-js/plugins/tokens_methods.ts:667 — all 4 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. — apps/oxlint/src-js/plugins/tokens_methods.ts:173
apps/oxlint/src-js/plugins/tokens_methods.ts:1330 · apps/oxlint/src-js/plugins/tokens_methods.ts:1398 — 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. — apps/oxlint/src-js/plugins/tokens_methods.ts:1330
napi/transform-react/scripts/patch.js:6 · napi/transform-relay/scripts/patch.js:6 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — napi/transform-react/scripts/patch.js:6
napi/transform-react/webcontainer-fallback.cjs:4 · napi/transform-relay/webcontainer-fallback.cjs:4 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — napi/transform-react/webcontainer-fallback.cjs:4
npm/runtime/src/helpers/esm/interopRequireWildcard.js:10 · npm/runtime/src/helpers/interopRequireWildcard.js:10 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — npm/runtime/src/helpers/esm/interopRequireWildcard.js:10
apps/oxlint/conformance/src/groups/e18e.ts:7 · apps/oxlint/conformance/src/groups/testing_library.ts:8 — 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. — apps/oxlint/conformance/src/groups/e18e.ts:7
apps/oxlint/src-js/plugins/tokens_methods.ts:924 · apps/oxlint/src-js/plugins/tokens_methods.ts:1088 — 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. — apps/oxlint/src-js/plugins/tokens_methods.ts:924
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.
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.
apps/oxlint/conformance/src/groups/storybook.ts:68 reaches into another package with a relative path (../../../../package.json) — import the package by name instead. — apps/oxlint/conformance/src/groups/storybook.ts:68
napi/minify/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead. — napi/minify/scripts/patch.js:4
napi/parser/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead. — napi/parser/scripts/patch.js:4
napi/playground/scripts/patch-wasi-browser.js:3 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead. — napi/playground/scripts/patch-wasi-browser.js:3
napi/transform-react/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead. — napi/transform-react/scripts/patch.js:4
napi/transform-relay/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead. — napi/transform-relay/scripts/patch.js:4
napi/transform/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead. — napi/transform/scripts/patch.js:4
What to do
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
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.
applyDec has cyclomatic complexity 45 and cognitive complexity 75; 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) — npm/runtime/src/helpers/applyDecs2311.js:29, npm/runtime/src/helpers/esm/applyDecs2311.js:29
applyDec has cyclomatic complexity 45 and cognitive complexity 72; 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) — npm/runtime/src/helpers/applyDecs2305.js:19, npm/runtime/src/helpers/esm/applyDecs2305.js:19
applyMemberDec has cyclomatic complexity 41 and cognitive complexity 60; 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) — npm/runtime/src/helpers/applyDecs2301.js:100, npm/runtime/src/helpers/esm/applyDecs2301.js:100
old_applyMemberDec has cyclomatic complexity 40 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. (×2) — npm/runtime/src/helpers/applyDecs.js:123, npm/runtime/src/helpers/esm/applyDecs.js:123
applyMemberDec has cyclomatic complexity 40 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. (×2) — npm/runtime/src/helpers/applyDecs2203R.js:75, npm/runtime/src/helpers/esm/applyDecs2203R.js:75
applyMemberDec has cyclomatic complexity 38 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. (×2) — npm/runtime/src/helpers/applyDecs2203.js:73, npm/runtime/src/helpers/esm/applyDecs2203.js:73
analyzeSelector has cyclomatic complexity 31 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. — apps/oxlint/src-js/plugins/selector.ts:222
registerPlugin has cyclomatic complexity 25 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. — apps/oxlint/src-js/plugins/load.ts:159
(anonymous) has cyclomatic complexity 25 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — apps/oxlint/test/compile_visitor.test.ts:584
report has cyclomatic complexity 25 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 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. — apps/oxlint/src-js/plugins/report.ts:105
runMigratePrettier has cyclomatic complexity 23 and cognitive complexity 34; 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. — apps/oxfmt/src-js/cli/migration/migrate-prettier.ts:14
memberDec has cyclomatic complexity 23 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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) — npm/runtime/src/helpers/applyDecs2301.js:16, npm/runtime/src/helpers/esm/applyDecs2301.js:16
getFirstToken has cyclomatic complexity 22 and cognitive complexity 40; 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. — apps/oxlint/src-js/plugins/tokens_methods.ts:188
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files7.0 / 10Strong✓ 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.
napi/minify/minify.wasip1-deferred.js has 1819 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/minify/minify.wasip1-deferred.js
napi/parser/src-js/parser.wasip1-deferred.js has 1819 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/parser/src-js/parser.wasip1-deferred.js
napi/transform-react/transform-react.wasip1-deferred.js has 1819 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/transform-react/transform-react.wasip1-deferred.js
napi/transform-relay/transform-relay.wasip1-deferred.js has 1819 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/transform-relay/transform-relay.wasip1-deferred.js
napi/transform/transform.wasip1-deferred.js has 1819 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/transform/transform.wasip1-deferred.js
apps/oxlint/src-js/package/rule_tester.ts has 1603 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxlint/src-js/package/rule_tester.ts
apps/oxlint/src-js/plugins/tokens_methods.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. — apps/oxlint/src-js/plugins/tokens_methods.ts
napi/parser/src-js/parser.wasi-browser.js has 1390 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/parser/src-js/parser.wasi-browser.js
napi/transform/transform.wasi-browser.js has 1389 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/transform/transform.wasi-browser.js
napi/minify/minify.wasi-browser.js has 1385 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/minify/minify.wasi-browser.js
napi/transform-react/transform-react.wasi-browser.js has 1384 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/transform-react/transform-react.wasi-browser.js
napi/transform-relay/transform-relay.wasi-browser.js has 1384 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/transform-relay/transform-relay.wasi-browser.js
napi/parser/src-js/parser.wasip1-browser.js has 1343 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/parser/src-js/parser.wasip1-browser.js
napi/transform/transform.wasip1-browser.js has 1342 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/transform/transform.wasip1-browser.js
napi/minify/minify.wasip1-browser.js has 1338 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/minify/minify.wasip1-browser.js
napi/transform-react/transform-react.wasip1-browser.js has 1337 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/transform-react/transform-react.wasip1-browser.js
napi/transform-relay/transform-relay.wasip1-browser.js has 1337 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — napi/transform-relay/transform-relay.wasip1-browser.js
packages/codegen/src-js/print/typescript.ts has 1090 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/codegen/src-js/print/typescript.ts
packages/codegen/src-js/print/expression.ts has 899 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/codegen/src-js/print/expression.ts
packages/codegen/src-js/print/write.ts has 820 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/codegen/src-js/print/write.ts
packages/codegen/src-js/print/statement.ts has 728 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/codegen/src-js/print/statement.ts
apps/oxlint/src-js/plugins/visitor.ts has 702 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxlint/src-js/plugins/visitor.ts
apps/oxlint/src-js/plugins/tokens.ts has 547 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxlint/src-js/plugins/tokens.ts
apps/oxfmt/conformance/run.ts has 511 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxfmt/conformance/run.ts
apps/oxlint/src-js/plugins/context.ts has 505 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxlint/src-js/plugins/context.ts
apps/oxlint/src-js/package/compat.ts has 476 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxlint/src-js/package/compat.ts
apps/oxlint/src-js/plugins/load.ts has 434 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxlint/src-js/plugins/load.ts
apps/oxlint/src-js/plugins/location.ts has 421 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxlint/src-js/plugins/location.ts
apps/oxlint/src-js/plugins/comments.ts has 415 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxlint/src-js/plugins/comments.ts
apps/oxlint/src-js/plugins/scope.ts has 403 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — apps/oxlint/src-js/plugins/scope.ts
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage1.2 / 10Critical✓ 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.
apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups.ts:5 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups.ts
apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups_selector_modifiers.ts:9 imports './sibling', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups_selector_modifiers.ts
apps/oxfmt/test/cli/stdin_pipe/fixtures/parser.ts:1 imports './_namespaces/ts.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — apps/oxfmt/test/cli/stdin_pipe/fixtures/parser.ts
apps/oxlint/fixtures/cli/import/test.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — apps/oxlint/fixtures/cli/import/test.js
apps/oxlint/test/fixtures/print_config_js_config_extends/files/test.js:1 imports './side-effect.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — apps/oxlint/test/fixtures/print_config_js_config_extends/files/test.js
apps/oxlint/test/utils.ts:17 imports './fixtures/', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — apps/oxlint/test/utils.ts
crates/oxc_linter/fixtures/import/deep/cache-1.js:1 imports './cache-2', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — crates/oxc_linter/fixtures/import/deep/cache-1.js
crates/oxc_linter/fixtures/import/exports-missing.js:1 imports './does-not-exist', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — crates/oxc_linter/fixtures/import/exports-missing.js
crates/oxc_linter/fixtures/import/unresolvable-namespace.js:1 imports './does-not-exist', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — crates/oxc_linter/fixtures/import/unresolvable-namespace.js
napi/minify/test/minify.test.ts:4 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — napi/minify/test/minify.test.ts
napi/minify/test/terser.test.ts:22 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — napi/minify/test/terser.test.ts
napi/transform-react/test/transform.test.ts:3 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — napi/transform-react/test/transform.test.ts
napi/transform-relay/test/transform.test.ts:3 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — napi/transform-relay/test/transform.test.ts
napi/transform/test/id.test.ts:3 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — napi/transform/test/id.test.ts
napi/transform/test/moduleRunnerTransform.test.ts:2 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — napi/transform/test/moduleRunnerTransform.test.ts
napi/transform/test/transform.test.ts:4 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — napi/transform/test/transform.test.ts
tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/typescript/class-fields-with-computed-key/input.ts:1 imports './collection.ts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/typescript/class-fields-with-computed-key/input.ts
tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/typescript/class-fields-with-computed-key/output.js:1 imports './collection.ts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/typescript/class-fields-with-computed-key/output.js
tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/import-after-component/input.js:2 imports './useFoo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/import-after-component/input.js
tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/import-after-component/output.js:2 imports './useFoo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/import-after-component/output.js
tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/includes-custom-hooks-into-the-signatures-when-commonjs-target-is-used/input.jsx:3 imports './hooks', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/includes-custom-hooks-into-the-signatures-when-commonjs-target-is-used/input.jsx
tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/includes-custom-hooks-into-the-signatures-when-commonjs-target-is-used/output.js:5 imports './hooks', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/includes-custom-hooks-into-the-signatures-when-commonjs-target-is-used/output.js
tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-jsx-at-definition-site/input.jsx:6 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-jsx-at-definition-site/input.jsx
tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-jsx-at-definition-site/output.js:1 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-jsx-at-definition-site/output.js
tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-react-create-element-at-definition-site/input.jsx:6 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-react-create-element-at-definition-site/input.jsx
tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-react-create-element-at-definition-site/output.js:1 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-react-create-element-at-definition-site/output.js
tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/elimination-empty-export-named/input.ts:2 imports './app.ts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/elimination-empty-export-named/input.ts
tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/elimination-empty-export-named/output.js:2 imports './app.ts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/elimination-empty-export-named/output.js
tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/preserve-import-=/input.js:1 imports './module-a', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/preserve-import-=/input.js
tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/preserve-import-=/output.js:1 imports './module-a', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/preserve-import-=/output.js
tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/redeclarations/input.ts:2 imports './a', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (3 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/redeclarations/input.ts
tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/redeclarations/output.js:6 imports './t', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-plugin-transform-typescript/test/fixtures/redeclarations/output.js
tasks/transform_conformance/tests/babel-preset-typescript/test/fixtures/removeImportExtensions/input.ts:1 imports './a.ts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (10 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-preset-typescript/test/fixtures/removeImportExtensions/input.ts
tasks/transform_conformance/tests/babel-preset-typescript/test/fixtures/removeImportExtensions/output.js:1 imports './a', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (10 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-preset-typescript/test/fixtures/removeImportExtensions/output.js
tasks/transform_conformance/tests/babel-preset-typescript/test/fixtures/rewriteImportExtensions/input.ts:1 imports './a.ts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (11 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-preset-typescript/test/fixtures/rewriteImportExtensions/input.ts
tasks/transform_conformance/tests/babel-preset-typescript/test/fixtures/rewriteImportExtensions/output.js:1 imports './a.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (11 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/babel-preset-typescript/test/fixtures/rewriteImportExtensions/output.js
tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/cross-file-imported-enum/input.ts:5 imports './enums', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/cross-file-imported-enum/input.ts
tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/cross-file-imported-enum/output.js:1 imports './enums', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/cross-file-imported-enum/output.js
tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/erased-import-no-type-keyword/input.ts:5 imports './m', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/erased-import-no-type-keyword/input.ts
tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/erased-import-no-type-keyword/output.js:1 imports './m', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing. — tasks/transform_conformance/tests/legacy-decorators/test/fixtures/oxc/metadata/erased-import-no-type-keyword/output.js
What to do
Add tests that import the unreached modules (directly or through their public entry).
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
This repository declares test tooling, and the ✓ above records that declaration — but apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups.ts and 49 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to. — apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups.ts
Do you agree with this assessment?
R7 · Dead Code6.3 / 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.
305 file(s) (~23456 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: apps/oxfmt/conformance/run.ts imports '../dist/index.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — apps/oxfmt
888 file(s) (~44209 LoC) were excluded from dead-code analysis. This package's entry point(s) resolved, but the walk stopped one hop in: apps/oxlint/conformance/tester.ts imports './submodules/eslint/lib/unsupported-api.js', which is not in the scanned tree. That is usually a generated or build-output module, so reachability cannot see past it and no dead-code claim is made about this package. Nothing is necessarily wrong here. — apps/oxlint
116 file(s) (~2599 LoC) were excluded from dead-code analysis. This package DOES declare main/module/exports — but every declared target is missing from the scanned tree, which is what a build-output entry (dist/, lib/, out/) looks like before the package is built. Point a declared target at the source entry, or build the package before scanning, so reachability can follow it. — npm/runtime
Unreachable from the 227 application, 244 tooling and 2515 test entry point(s) detected in this repo. Gate removals on `pnpm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (227 application, 244 tooling, 2515 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) — napi/minify/minify.wasip1-deferred.js, napi/parser/src-js/parser.wasip1-deferred.js, napi/transform-react/transform-react.wasip1-deferred.js, …
Nothing ultimately consumes this binding: its only referrer is the re-export in apps/oxlint/src-js/plugins.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in apps/oxlint/src-js/plugins.ts in the same commit, or the barrel will import a name that no longer exists. (×3) — apps/oxlint/src-js/package/compat.ts:39, apps/oxlint/src-js/package/define.ts:15, apps/oxlint/src-js/package/define.ts:27
Nothing ultimately consumes this binding: its only referrer is the re-export in apps/oxlint/src-js/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in apps/oxlint/src-js/index.ts in the same commit, or the barrel will import a name that no longer exists. — apps/oxlint/src-js/package/config.ts:50
Nothing imports this binding — it is safe to review for removal. (×4) — apps/oxlint/src-js/plugins/location.ts:286, apps/oxlint/src-js/plugins/source_code.ts:167, napi/parser/src-js/raw-transfer/eager.js:15, …
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
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 package.json — installs work only by hoisting accident. (×4) — napi/minify/wasi-worker-browser.mjs:1, napi/transform/wasi-worker-browser.mjs:1, napi/transform-react/wasi-worker-browser.mjs:1, …
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
Do you agree with this assessment?
R9 · Circular Imports3.0 / 10Weak✓ 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.
apps/oxlint/src-js/plugins/comments.ts → apps/oxlint/src-js/plugins/location.ts → apps/oxlint/src-js/plugins/source_code.ts → apps/oxlint/src-js/plugins/comments.ts (one verified cycle inside a mutually-dependent group of 12 files) — apps/oxlint/src-js/plugins/comments.ts
apps/oxlint/src-js/plugins/load.ts → apps/oxlint/src-js/plugins/options.ts → apps/oxlint/src-js/plugins/load.ts (one verified cycle inside a mutually-dependent group of 3 files) — apps/oxlint/src-js/plugins/load.ts
packages/codegen/src-js/print/assignment_target.ts → packages/codegen/src-js/print/binding_pattern.ts → packages/codegen/src-js/print/expression.ts → packages/codegen/src-js/print/assignment_target.ts (one verified cycle inside a mutually-dependent group of 10 files) — packages/codegen/src-js/print/assignment_target.ts
What to do
Break each cycle by extracting the shared piece into a module both sides can import.
Other · Security — Read from this repository's Rust 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. This repository serves no HTTP of its own — no HTTP-server crate (actix-web, axum, Rocket, warp, poem, tide, salvo, tonic, a hyper server, …) among its Cargo manifests' run-time dependencies, and no server started in its production source — so HTTPS enforcement, HSTS, cookie flags and input validation are N/A here, as they are for a C# library or worker.
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+ (`sha2::Sha256::digest(…)`) 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. — crates/oxc_transformer/src/jsx/refresh.rs:608
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.
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.
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.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. 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 `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader3.5 / 10Weak✓ Tool-verified
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
`size` is read from the bytes being parsed at line 1284 (`u32::from_le_bytes`), then used to size a `vec![…; n]` at line 1294 — and nowhere in its scope is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `size` against the bytes actually remaining and a maximum the format allows before allocating. — crates/oxc_linter/src/tsgolint.rs:1294
What to do
Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
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.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document3.5 / 10Weak✓ 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.
`deepCloneJsonObject` is exported and takes `obj: JsonObject` from its caller, and it calls itself at line 94 (`deepCloneJsonObject`) with a piece of `obj` — and nowhere in `deepCloneJsonObject` 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 `deepCloneJsonObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — apps/oxlint/src-js/plugins/json.ts:94
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.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
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.
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 0/2 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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.
`loadFixture` 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 })`. — packages/codegen/bench.bench.ts:83
`updateGitHubIssue` 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 })`. — tasks/lint_rules/src/result-reporter.mjs:5
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
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.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
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.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
Do you agree with this assessment?
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.
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 `package.json` 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.
`debug!` at line 156 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/api/text_to_doc_api.rs:156
`debug!` at line 210 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/api/text_to_doc_api.rs:210
`debug!` at line 76 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/core/embed/prettier_string.rs:76
`debug!` at line 37 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/core/embed/prettier_doc.rs:37
`debug!` at line 73 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/core/embed/prettier_doc.rs:73
`debug!` at line 328 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/core/embed/dispatcher.rs:328
`debug!` at line 338 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/core/embed/dispatcher.rs:338
`debug!` at line 354 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/core/embed/dispatcher.rs:354
`debug!` at line 62 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/lsp/server_formatter.rs:62
`error!` at line 76 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/lsp/server_formatter.rs:76
`warn!` at line 383 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/lsp/server_formatter.rs:383
`debug!` at line 392 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. (×2) — apps/oxfmt/src/lsp/server_formatter.rs:392, crates/oxc_language_server/src/worker_manager.rs:392
`debug!` at line 397 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/lsp/server_formatter.rs:397
`debug!` at line 412 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/lsp/server_formatter.rs:412
`debug!` at line 420 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/lsp/server_formatter.rs:420
`debug!` at line 433 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/lsp/server_formatter.rs:433
`warn!` at line 448 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxfmt/src/lsp/server_formatter.rs:448
`warn!` at line 89 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/server_linter.rs:89
`error!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/server_linter.rs:337
`warn!` at line 452 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/server_linter.rs:452
`warn!` at line 462 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/server_linter.rs:462
`warn!` at line 500 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/server_linter.rs:500
`debug!` at line 788 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/server_linter.rs:788
`debug!` at line 793 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/server_linter.rs:793
`debug!` at line 802 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/server_linter.rs:802
`debug!` at line 845 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/server_linter.rs:845
`error!` at line 140 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/options.rs:140
`debug!` at line 87 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/code_actions.rs:87
`debug!` at line 160 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/code_actions.rs:160
`debug!` at line 183 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/code_actions.rs:183
`debug!` at line 213 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — apps/oxlint/src/lsp/code_actions.rs:213
`debug!` at line 276 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/oxc_language_server/src/worker_manager.rs:276
`debug!` at line 457 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/oxc_language_server/src/worker_manager.rs:457
`debug!` at line 278 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/oxc_language_server/src/worker.rs:278
`info!` at line 116 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/oxc_language_server/src/backend.rs:116
`info!` at line 117 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/oxc_language_server/src/backend.rs:117
`debug!` at line 122 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/oxc_language_server/src/backend.rs:122
`debug!` at line 167 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/oxc_language_server/src/backend.rs:167
`debug!` at line 239 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/oxc_language_server/src/backend.rs:239
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.
31/48 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.
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 `?`).
Do you agree with this assessment?
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.
Unscored — 4 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.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 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.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 48 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — Not applicable: Angular's root injector cannot see a component-level provider, so a root service asking for one fails with NullInjectorError instead of capturing it.
AX2 Stateful singletons — Not applicable: Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — the image ran but published no HTTP port — nothing to crawl (EXPOSE the web port to unlock runtime evidence) This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
C2 Access Controls — No access-control surface detected in the analyzed source — this repository starts no server another machine can reach (no actix-web HttpServer, axum::serve, Rocket launch, warp::serve, poem or salvo Server, tonic Server::builder, hyper or tiny_http server outside examples and tests, none bound beyond loopback). Access control is therefore N/A here — a crate is authorized by the application that serves it, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D11 Test Reliability — Test reliability not measured — JavaScript/TypeScript suite did not run
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 199 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
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 — apps/oxfmt/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. 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. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (875 value object(s))
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
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
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the JavaScript/TypeScript, Rust source, so there is no service whose uptime a failing dependency could take down
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb. TypeScript/JavaScript runs on a garbage-collected runtime that gives a program no allocation-control idiom to choose on a hot path — no pools, stack allocation or value types — so allocation awareness is not something this code can be rated on.
R5 Dependency Freshness — uses a yarn 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.
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.
X26 Unsynchronised callback handoff — Not applicable: this check looks for a collection written by a callback on one thread while the body waiting on it touches it on another, and in this repository's languages no collection is reachable from two threads at once. Rust's compiler refuses the unsynchronised version: a collection shared between a callback's thread and the waiting body must be `Sync`, which a `Vec`, `VecDeque` or `HashMap` is only behind a `Mutex`/`RwLock`, so the race this check looks for cannot be written in safe Rust. TypeScript/JavaScript runs every callback on the one thread that owns its objects: a callback runs only when the body waiting on it has yielded, never alongside it, and a worker thread receives a COPY of what it is sent. A SharedArrayBuffer carries raw bytes, never an Array, Map or Set, so no collection is reachable from two threads at once. Not a gap in the analyzer and not a finding about your code.
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
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.
AX8 · Test isolation· Production project references a test project · ×6
Production project references a test project: oxc_formatter → oxc_formatter_tests — `oxc_formatter` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: oxc_formatter_css → oxc_formatter_tests — `oxc_formatter_css` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: oxc_formatter_graphql → oxc_formatter_tests — `oxc_formatter_graphql` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: oxc_formatter_json → oxc_formatter_tests — `oxc_formatter_json` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: oxc_formatter_markdown → oxc_formatter_tests — `oxc_formatter_markdown` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: oxc_formatter_yaml → oxc_formatter_tests — `oxc_formatter_yaml` (production) references the test project `oxc_formatter_tests`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Boundary-crossing change coupling: oxfmtrc.rs ↔ options.rs apps/oxfmt/src/core/oxfmtrc.rs— `apps/oxfmt/src/core/oxfmtrc.rs` (context oxfmt) and `crates/oxc_formatter/src/ir_transform/sort_imports/options.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 90% of the time (9 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `5ff57f83` fix(formatter/sort-imports): handle custom side effect groups (#26217); `00f490d7` refactor(oxfmt,formatter): split `sortImports` validation and use typ…; `43b99784` fix(formatter/sort_imports): Treat subpath imports as internal (#22440) — run `git show` on any of them.
Boundary-crossing change coupling: from_prettier_doc.rs ↔ REDACTED apps/oxfmt/src/prettier_compat/from_prettier_doc.rs— `apps/oxfmt/src/prettier_compat/from_prettier_doc.rs` (context oxfmt) and `crates/oxc_formatter/src/print/template/embed/mod.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `033ddf6d` refactor(oxfmt,formatter): simplify js-in-html-in-js handling (#25464); `89ec3d9f` feat(formatter_core): add literal line and root indention primitives …; `23050fab` feat(oxfmt): Support markdown-in-js substitution (#20683) — run `git show` on any of them.
Boundary-crossing change coupling: server_linter.rs ↔ worker.rs apps/oxlint/src/lsp/server_linter.rs— `apps/oxlint/src/lsp/server_linter.rs` (context oxlint) and `crates/oxc_language_server/src/worker.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 51% of the time (45 of the 89 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 45 shared commits counted here, the most recent 3 are `a5a4ac88` refactor(lsp): ToolTrait consume `TextDocument` & `CodeActionParams` …; `c7583238` refactor(lsp): add `ToolBuildResult` struct for optional client messa…; `b0817ae6` refactor(lsp): remove `Tool::name` trait method (#21530) — run `git show` on any of them.
Boundary-crossing change coupling: from_prettier_doc.rs ↔ graphql.rs apps/oxfmt/src/prettier_compat/from_prettier_doc.rs— `apps/oxfmt/src/prettier_compat/from_prettier_doc.rs` (context oxfmt) and `crates/oxc_formatter/src/print/template/embed/graphql.rs` (context crates) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `033ddf6d` refactor(oxfmt,formatter): simplify js-in-html-in-js handling (#25464); `a7fd35e7` refactor(oxfmt): handle gql-in-js by `oxc_formatter_graphql` (#23319); `ee262157` feat(oxfmt): Support css-in-js substitution (#20019) — run `git show` on any of them.
Unlisted import '@napi-rs/wasm-runtime' napi/minify/wasi-worker-browser.mjs:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@napi-rs/wasm-runtime' napi/transform/wasi-worker-browser.mjs:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@napi-rs/wasm-runtime' napi/transform-react/wasi-worker-browser.mjs:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Unlisted import '@napi-rs/wasm-runtime' napi/transform-relay/wasi-worker-browser.mjs:1— Imported but not declared in any reachable package.json — installs work only by hoisting accident.
Orphaned knowledge crates/oxc_linter/src/rules/vitest/valid_expect_in_promise.rs— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge crates/oxc_linter/src/rules/react/jsx_no_constructed_context_values.rs— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Import cycle (3 files) apps/oxlint/src-js/plugins/comments.ts— apps/oxlint/src-js/plugins/comments.ts → apps/oxlint/src-js/plugins/location.ts → apps/oxlint/src-js/plugins/source_code.ts → apps/oxlint/src-js/plugins/comments.ts (one verified cycle inside a mutually-dependent group of 12 files)
Import cycle (3 files) packages/codegen/src-js/print/assignment_target.ts— packages/codegen/src-js/print/assignment_target.ts → packages/codegen/src-js/print/binding_pattern.ts → packages/codegen/src-js/print/expression.ts → packages/codegen/src-js/print/assignment_target.ts (one verified cycle inside a mutually-dependent group of 10 files)
D10 · Test Quality· No assertions (empty test) · ×1
No assertions (empty test): (unnamed test) apps/oxlint/fixtures/cli/overrides_with_plugin/index.test.ts:4— Test method has an empty body — it asserts nothing and exercises no code.
TodoComment apps/oxfmt/src-js/cli/migration/migrate-prettier.ts:126— // TODO: Create napi `validateConfig()` and use to ensure validity? — 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 apps/oxfmt/src-js/cli/migration/migrate-biome.ts:82— // TODO: Create napi `validateConfig()` and use to ensure validity? — 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 apps/oxfmt/src-js/cli/migration/migrate-biome.ts:140— // TODO: Create napi `validateConfig()` and use to ensure validity? — 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 apps/oxfmt/src-js/cli/migration/init.ts:19— // TODO: Create napi `validateConfig()` and use to ensure validity? — 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 apps/oxfmt/src-js/cli/migration/migrate-biome.ts:134— // TODO: Oxfmt now supports `overrides`, — 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 apps/oxfmt/src/prettier_compat/to_prettier_doc.rs:8— // TODO: Currently, we build a Prettier Doc tree using `serde_json::Value`, — 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 apps/oxlint/src-js/package/rule_tester.ts:1427— // TODO: Tests for `env` in `RuleTester` tests — 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 apps/oxlint/src-js/package/parse.ts:82— // TODO: Get parsing error details from Rust to display nicely. — 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 apps/oxlint/src-js/plugins/visitor.ts:317— // TODO: Combine the two hashmaps `NODE_TYPE_IDS_MAP` and selectors cache into one `Map` — 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 apps/oxlint/src-js/plugins/visitor.ts:375— // TODO: Add 2 arrays for "enter all" and "exit all" selectors. — 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 apps/oxlint/src-js/plugins/source_code.ts:294— // @ts-expect-error - TODO: `parent` property should be present on `Node` type — 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 apps/oxlint/src-js/plugins/selector.ts:49— // TODO: Does TS-ESLint alter this function in any way to handle TS nodes? — 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 apps/oxlint/src-js/plugins/selector.ts:270— // TODO: Faster way to do this? Sort and then dedupe manually? — 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 apps/oxlint/src-js/plugins/selector.ts:278— // TODO: Can `childSelectors` have 0 length? — 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 apps/oxlint/src-js/plugins/selector.ts:293— // TODO: Could make this faster if `analyzeSelector` always returned an ordered array. — 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 apps/oxlint/src-js/plugins/scope.ts:133— // @ts-expect-error - TODO: Our types don't quite align 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 apps/oxlint/src-js/plugins/scope.ts:286— // @ts-expect-error - TODO: Our types don't quite align 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 apps/oxlint/src-js/plugins/scope.ts:295— // @ts-expect-error - TODO: Our types don't quite align 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 apps/oxlint/src-js/plugins/scope.ts:307— // @ts-expect-error - TODO: Our types don't quite align 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 apps/oxlint/src-js/plugins/scope.ts:322— // @ts-expect-error - TODO: Our types don't quite align 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 apps/oxlint/src-js/plugins/scope.ts:373— // @ts-expect-error - TODO: Our types don't quite align 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 apps/oxlint/src-js/plugins/scope.ts:393— // @ts-expect-error - TODO: Our types don't quite align 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 apps/oxlint/src-js/plugins/scope.ts:404— // @ts-expect-error - TODO: Our types don't quite align 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 apps/oxlint/src-js/plugins/scope.ts:403— // TODO: Is it possible to get here? Doesn't `Program` always have a scope? — 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 apps/oxlint/src-js/plugins/report.ts:121— // TODO: Validate `diagnostic` — 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.
Hotspot: crates/oxc_minifier/src/peephole/minimize_statements.rs crates/oxc_minifier/src/peephole/minimize_statements.rs:1644— crates/oxc_minifier/src/peephole/minimize_statements.rs changed 52 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 101 in PeepholeOptimizations::substitute_single_use_symbol_in_expression at line 1644. 8 of those changes were fix/bug commits, and the other 44 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_minifier/src/peephole/minimize_statements.rs`: 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: crates/oxc_lexer/src/token.rs crates/oxc_lexer/src/token.rs:29— crates/oxc_lexer/src/token.rs changed 17 times in last 90 days, max cyclomatic complexity 170 in TokenKind::from_u8 at line 29. 1 of those changes was a fix/bug commit, and the other 16 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_lexer/src/token.rs`: 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: crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:665— crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in PeepholeOptimizations::try_rewrite_arguments_copy_loop at line 665. 5 of those changes were fix/bug commits, and the other 22 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs`: 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: crates/oxc_react_compiler/src/react_compiler_inference/infer_mutation_aliasing_effects.rs crates/oxc_react_compiler/src/react_compiler_inference/infer_mutation_aliasing_effects.rs:1483— crates/oxc_react_compiler/src/react_compiler_inference/infer_mutation_aliasing_effects.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in oxc_react_compiler::react_compiler_inference::infer_mutation_aliasing_effects::apply_effect_ref at line 1483. 11 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/react_compiler_inference/infer_mutation_aliasing_effects.rs`: 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: crates/oxc_react_compiler/src/react_compiler_lowering/build_hir.rs crates/oxc_react_compiler/src/react_compiler_lowering/build_hir.rs:3561— crates/oxc_react_compiler/src/react_compiler_lowering/build_hir.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 69 in oxc_react_compiler::react_compiler_lowering::build_hir::lower_expression at line 3561. 21 of those changes were fix/bug commits, so the churn is repair rather than feature work. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/react_compiler_lowering/build_hir.rs`: 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: crates/oxc_lexer/src/pipeline/disambiguate/type_context/type_list.rs crates/oxc_lexer/src/pipeline/disambiguate/type_context/type_list.rs:59— crates/oxc_lexer/src/pipeline/disambiguate/type_context/type_list.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 95 in oxc_lexer::pipeline::disambiguate::type_context::type_list::type_list_legal at line 59. 4 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_lexer/src/pipeline/disambiguate/type_context/type_list.rs`: 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: crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs:49— crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in PeepholeOptimizations::minimize_conditional_expression at line 49. 3 of those changes were fix/bug commits, and the other 14 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs`: 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: crates/oxc_react_compiler/src/react_compiler_reactive_scopes/codegen_reactive_function.rs crates/oxc_react_compiler/src/react_compiler_reactive_scopes/codegen_reactive_function.rs:1915— crates/oxc_react_compiler/src/react_compiler_reactive_scopes/codegen_reactive_function.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in oxc_react_compiler::react_compiler_reactive_scopes::codegen_reactive_function::ox_codegen_base_instruction_value at line 1915. 11 of those changes were fix/bug commits, and the other 17 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/react_compiler_reactive_scopes/codegen_reactive_function.rs`: 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: crates/oxc_lexer/src/pipeline/coalesce/mod.rs crates/oxc_lexer/src/pipeline/coalesce/mod.rs:26— crates/oxc_lexer/src/pipeline/coalesce/mod.rs changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in oxc_lexer::pipeline::coalesce::coalesce at line 26. 1 of those changes was a fix/bug commit, and the other 36 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_lexer/src/pipeline/coalesce/mod.rs`: 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: packages/codegen/src-js/print/expression.ts packages/codegen/src-js/print/expression.ts:90— packages/codegen/src-js/print/expression.ts changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in expression.printExpression at line 90. 4 of those changes were fix/bug commits, and the other 19 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- packages/codegen/src-js/print/expression.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/codegen/src-js/print/typescript.ts packages/codegen/src-js/print/typescript.ts:80— packages/codegen/src-js/print/typescript.ts changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in typescript.printTSType at line 80. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- packages/codegen/src-js/print/typescript.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/oxc_minifier/src/peephole/mod.rs crates/oxc_minifier/src/peephole/mod.rs:529— crates/oxc_minifier/src/peephole/mod.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in PeepholeOptimizations::exit_expression at line 529. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_minifier/src/peephole/mod.rs`: 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: crates/oxc_ast/src/ast_kind_impl.rs crates/oxc_ast/src/ast_kind_impl.rs:371— crates/oxc_ast/src/ast_kind_impl.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 194 in AstKind::debug_name at line 371. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_ast/src/ast_kind_impl.rs`: 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: crates/oxc_react_compiler/src/react_compiler_hir/mod.rs crates/oxc_react_compiler/src/react_compiler_hir/mod.rs:1836— crates/oxc_react_compiler/src/react_compiler_hir/mod.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in InstructionValue::clone_in_impl at line 1836. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/react_compiler_hir/mod.rs`: 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: packages/codegen/src-js/print/write.ts packages/codegen/src-js/print/write.ts:849— packages/codegen/src-js/print/write.ts changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in write.debugAssertCategoryMatches at line 849. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- packages/codegen/src-js/print/write.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/oxc_parser/src/js/module.rs crates/oxc_parser/src/js/module.rs:73— crates/oxc_parser/src/js/module.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in ParserImpl::parse_import_declaration at line 73. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_parser/src/js/module.rs`: 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: apps/oxlint/src/lint.rs apps/oxlint/src/lint.rs:78— apps/oxlint/src/lint.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 72 in CliRunner::run at line 78. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- apps/oxlint/src/lint.rs`: 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: crates/oxc_react_compiler/src/react_compiler_validation/validate_no_ref_access_in_render.rs crates/oxc_react_compiler/src/react_compiler_validation/validate_no_ref_access_in_render.rs:495— crates/oxc_react_compiler/src/react_compiler_validation/validate_no_ref_access_in_render.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 96 in oxc_react_compiler::react_compiler_validation::validate_no_ref_access_in_render::validate_no_ref_access_in_render_impl at line 495. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/react_compiler_validation/validate_no_ref_access_in_render.rs`: 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: crates/oxc_react_compiler/src/react_compiler_validation/validate_exhaustive_dependencies.rs crates/oxc_react_compiler/src/react_compiler_validation/validate_exhaustive_dependencies.rs:453— crates/oxc_react_compiler/src/react_compiler_validation/validate_exhaustive_dependencies.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 85 in oxc_react_compiler::react_compiler_validation::validate_exhaustive_dependencies::collect_dependencies at line 453. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/react_compiler_validation/validate_exhaustive_dependencies.rs`: 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: crates/oxc_lexer/src/pipeline/disambiguate/operator/mod.rs crates/oxc_lexer/src/pipeline/disambiguate/operator/mod.rs:55— crates/oxc_lexer/src/pipeline/disambiguate/operator/mod.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in oxc_lexer::pipeline::disambiguate::operator::not_operator_position at line 55. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_lexer/src/pipeline/disambiguate/operator/mod.rs`: 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: crates/oxc_formatter_core/src/printer/mod.rs crates/oxc_formatter_core/src/printer/mod.rs:1236— crates/oxc_formatter_core/src/printer/mod.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in FitsMeasurer::fits_element at line 1236. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter_core/src/printer/mod.rs`: 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: crates/oxc_formatter/src/utils/assignment_like.rs crates/oxc_formatter/src/utils/assignment_like.rs:163— crates/oxc_formatter/src/utils/assignment_like.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in AssignmentLike::write_left at line 163. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/utils/assignment_like.rs`: 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: packages/codegen/src-js/print/source_map.ts packages/codegen/src-js/print/source_map.ts:47— packages/codegen/src-js/print/source_map.ts changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 47 in source_map.generateSourceMap at line 47. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- packages/codegen/src-js/print/source_map.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/oxc_react_compiler/src/react_compiler_inference/infer_mutation_aliasing_ranges.rs crates/oxc_react_compiler/src/react_compiler_inference/infer_mutation_aliasing_ranges.rs:433— crates/oxc_react_compiler/src/react_compiler_inference/infer_mutation_aliasing_ranges.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in oxc_react_compiler::react_compiler_inference::infer_mutation_aliasing_ranges::infer_mutation_aliasing_ranges at line 433. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/react_compiler_inference/infer_mutation_aliasing_ranges.rs`: 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: crates/oxc_react_compiler/src/react_compiler_reactive_scopes/build_reactive_function.rs crates/oxc_react_compiler/src/react_compiler_reactive_scopes/build_reactive_function.rs:298— crates/oxc_react_compiler/src/react_compiler_reactive_scopes/build_reactive_function.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 80 in Driver::visit_block at line 298. 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-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/react_compiler_reactive_scopes/build_reactive_function.rs`: 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.
oxc_linter::rules::react::display_name::is_react_component_node (cognitive 111) crates/oxc_linter/src/rules/react/display_name.rs:411— oxc_linter::rules::react::display_name::is_react_component_node has cognitive complexity 111 (threshold 15). Drivers by points: if/else 26 (85 pts), boolean chains 12, match/switch 3 (10 pts), loops 1 (4 pts) (nesting depth added 69). 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.
oxc_linter::rules::unicorn::no_invalid_fetch_options::is_invalid_fetch_options (cognitive 92) crates/oxc_linter/src/rules/unicorn/no_invalid_fetch_options.rs:95— oxc_linter::rules::unicorn::no_invalid_fetch_options::is_invalid_fetch_options has cognitive complexity 92 (threshold 15). Drivers by points: if/else 20 (65 pts), match/switch 5 (22 pts), boolean chains 4, loops 1 (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_linter::execute_rules (cognitive 53) crates/oxc_linter/src/lib.rs:186— oxc_linter::execute_rules has cognitive complexity 53 (threshold 15). Drivers by points: loops 11 (32 pts), if/else 9 (20 pts), boolean chains 1 (nesting depth added 32). 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.
oxc_linter::rules::eslint::no_useless_escape::check_character (cognitive 53) crates/oxc_linter/src/rules/eslint/no_useless_escape.rs:180— oxc_linter::rules::eslint::no_useless_escape::check_character has cognitive complexity 53 (threshold 15). Drivers by points: if/else 19 (50 pts), boolean chains 3 (nesting depth added 31). 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.
oxc_linter::rules::unicorn::no_useless_iterator_to_array::check_call_expr (cognitive 51) crates/oxc_linter/src/rules/unicorn/no_useless_iterator_to_array.rs:254— oxc_linter::rules::unicorn::no_useless_iterator_to_array::check_call_expr has cognitive complexity 51 (threshold 15). Drivers by points: if/else 24 (44 pts), boolean chains 5, match/switch 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.
oxc_linter::rules::shared::jest_vitest::valid_expect_in_promise::process_statements (cognitive 50) crates/oxc_linter/src/rules/shared/jest_vitest/valid_expect_in_promise.rs:130— oxc_linter::rules::shared::jest_vitest::valid_expect_in_promise::process_statements has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (41 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_linter::rules::import::no_duplicates::merge_imports_fix (cognitive 49) crates/oxc_linter/src/rules/import/no_duplicates.rs:389— oxc_linter::rules::import::no_duplicates::merge_imports_fix has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 14, loops 4 (7 pts), match/switch 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.
oxc_linter::rules::unicorn::escape_case::check_case (cognitive 49) crates/oxc_linter/src/rules/unicorn/escape_case.rs:68— oxc_linter::rules::unicorn::escape_case::check_case has cognitive complexity 49 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 5 (21 pts), match/switch 1 (3 pts) (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.
oxc_linter::rules::eslint::no_unreachable_loop::has_next_iteration_path (cognitive 47) crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:184— oxc_linter::rules::eslint::no_unreachable_loop::has_next_iteration_path has cognitive complexity 47 (threshold 15). Drivers by points: if/else 7 (26 pts), match/switch 2 (8 pts), loops 3 (7 pts), boolean chains 6 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_linter::ast_util::is_default_this_binding (cognitive 46) crates/oxc_linter/src/ast_util.rs:658— oxc_linter::ast_util::is_default_this_binding has cognitive complexity 46 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 12, match/switch 3 (6 pts), loops 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.
oxc_linter::rules::react::no_unstable_nested_components::find_parent_component_name (cognitive 45) crates/oxc_linter/src/rules/react/no_unstable_nested_components.rs:301— oxc_linter::rules::react::no_unstable_nested_components::find_parent_component_name has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (37 pts), boolean chains 5, match/switch 1 (2 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_linter::rules::unicorn::no_useless_promise_resolve_reject::generate_fix (cognitive 45) crates/oxc_linter/src/rules/unicorn/no_useless_promise_resolve_reject.rs:274— oxc_linter::rules::unicorn::no_useless_promise_resolve_reject::generate_fix has cognitive complexity 45 (threshold 15). Drivers by points: if/else 25 (45 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.
oxc_linter::rules::unicorn::prefer_spread::check_unicorn_prefer_spread (cognitive 41) crates/oxc_linter/src/rules/unicorn/prefer_spread.rs:61— oxc_linter::rules::unicorn::prefer_spread::check_unicorn_prefer_spread has cognitive complexity 41 (threshold 15). Drivers by points: if/else 20 (38 pts), boolean chains 2, match/switch 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.
oxc_linter::utils::jsdoc::collect_params::get_param_name (cognitive 41) crates/oxc_linter/src/utils/jsdoc.rs:198— oxc_linter::utils::jsdoc::collect_params::get_param_name has cognitive complexity 41 (threshold 15). Drivers by points: match/switch 7 (17 pts), if/else 6 (16 pts), loops 3 (8 pts) (nesting depth added 25). 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.
oxc_linter::rules::unicorn::no_immediate_mutation::expression_references_variable (cognitive 40) crates/oxc_linter/src/rules/unicorn/no_immediate_mutation.rs:476— oxc_linter::rules::unicorn::no_immediate_mutation::expression_references_variable has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 10, match/switch 4 (7 pts) (nesting depth added 12). 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.
oxc_linter::rules::vue::no_required_prop_with_default::handle_prop_object (cognitive 40) crates/oxc_linter/src/rules/vue/no_required_prop_with_default.rs:329— oxc_linter::rules::vue::no_required_prop_with_default::handle_prop_object has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (35 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 25). 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.
oxc_linter::utils::jest::parse_jest_fn::parse_jest_fn_call (cognitive 40) crates/oxc_linter/src/utils/jest/parse_jest_fn.rs:24— oxc_linter::utils::jest::parse_jest_fn::parse_jest_fn_call has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (31 pts), boolean chains 6, match/switch 1 (3 pts) (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.
oxc_linter::rules::shared::jest_vitest::expect_expect::run (cognitive 39) crates/oxc_linter/src/rules/shared/jest_vitest/expect_expect.rs:200— oxc_linter::rules::shared::jest_vitest::expect_expect::run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (34 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 25). 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.
oxc_linter::rules::eslint::array_callback_return::get_array_method_info (cognitive 38) crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs:333— oxc_linter::rules::eslint::array_callback_return::get_array_method_info has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (32 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (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.
oxc_linter::rules::react::exhaustive_deps::is_stable_value (cognitive 38) crates/oxc_linter/src/rules/react/exhaustive_deps.rs:1087— oxc_linter::rules::react::exhaustive_deps::is_stable_value has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 5, match/switch 3 (5 pts) (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.
oxc_linter::rules::shared::jest_vitest::prefer_mock_promise_shorthand::run (cognitive 37) crates/oxc_linter/src/rules/shared/jest_vitest/prefer_mock_promise_shorthand.rs:58— oxc_linter::rules::shared::jest_vitest::prefer_mock_promise_shorthand::run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 2, match/switch 1 (2 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.
oxc_linter::utils::react_perf::find_initialized_binding (cognitive 37) crates/oxc_linter/src/utils/react_perf.rs:174— oxc_linter::utils::react_perf::find_initialized_binding has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 4 (10 pts), match/switch 2 (3 pts) (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.
oxc_linter::rules::shared::jest_vitest::valid_describe_callback::run (cognitive 36) crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs:35— oxc_linter::rules::shared::jest_vitest::valid_describe_callback::run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 9, match/switch 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.
oxc_linter::rules::typescript::prefer_function_type::check_member (cognitive 36) crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:108— oxc_linter::rules::typescript::prefer_function_type::check_member has cognitive complexity 36 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 4 (6 pts), loops 1 (4 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.
oxc_linter::rules::eslint::prefer_arrow_callback::get_callback_info (cognitive 35) crates/oxc_linter/src/rules/eslint/prefer_arrow_callback.rs:153— oxc_linter::rules::eslint::prefer_arrow_callback::get_callback_info has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (29 pts), boolean chains 3, match/switch 1 (2 pts), loops 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.
FileTooLong: src/builder.rs crates/oxc_semantic/src/builder.rs— FileTooLong — 1780 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: SemanticBuilder (5 blocks, 70-3037). The bar is 500 significant lines; this is 1280 over it, 3.56× 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: ast/js.rs crates/oxc_ast/src/ast/js.rs— FileTooLong — 1624 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 1124 over it, 3.25× 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: print/at_rule.rs crates/oxc_formatter_css/src/print/at_rule.rs— FileTooLong — 1470 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 62 free functions. The bar is 500 significant lines; this is 970 over it, 2.94× 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: src/main.rs tasks/rulegen/src/main.rs— FileTooLong — 1391 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 891 over it, 2.78× 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: peephole/minimize_statements.rs crates/oxc_minifier/src/peephole/minimize_statements.rs— FileTooLong — 1365 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: PeepholeOptimizations (36-2262). 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: class_properties/private_field.rs crates/oxc_transformer/src/es2022/class_properties/private_field.rs— FileTooLong — 1265 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: ClassProperties (33-2290). The bar is 500 significant lines; this is 765 over it, 2.53× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: print/mod.rs crates/oxc_formatter/src/print/mod.rs— FileTooLong — 1235 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: AstNode (111 blocks, 130-2090). The bar is 500 significant lines; this is 735 over it, 2.47× 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: peephole/substitute_alternate_syntax.rs crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs— FileTooLong — 1231 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: PeepholeOptimizations (31-2053). The bar is 500 significant lines; this is 731 over it, 2.46× 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: jsx_a11y/role_supports_aria_props.rs crates/oxc_linter/src/rules/jsx_a11y/role_supports_aria_props.rs— FileTooLong — 1198 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 698 over it, 2.40× 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: ts/types.rs crates/oxc_parser/src/ts/types.rs— FileTooLong — 1172 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 99% of them inside a single declaration: ParserImpl (15-1658). The bar is 500 significant lines; this is 672 over it, 2.34× 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: pattern_parser/pattern_parser_impl.rs crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs— FileTooLong — 1148 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 648 over it, 2.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: js/expression.rs crates/oxc_parser/src/js/expression.rs— FileTooLong — 1084 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 584 over it, 2.17× 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: generators/raw_transfer.rs tasks/ast_tools/src/generators/raw_transfer.rs— FileTooLong — 1065 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 565 over it, 2.13× 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: minify/minify.wasip1-deferred.js napi/minify/minify.wasip1-deferred.js— FileTooLong — 1028 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 528 over it, 2.06× 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: src-js/parser.wasip1-deferred.js napi/parser/src-js/parser.wasip1-deferred.js— FileTooLong — 1028 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 528 over it, 2.06× 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: transform-react/transform-react.wasip1-deferred.js napi/transform-react/transform-react.wasip1-deferred.js— FileTooLong — 1028 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 528 over it, 2.06× 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: transform-relay/transform-relay.wasip1-deferred.js napi/transform-relay/transform-relay.wasip1-deferred.js— FileTooLong — 1028 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 528 over it, 2.06× 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: transform/transform.wasip1-deferred.js napi/transform/transform.wasip1-deferred.js— FileTooLong — 1028 significant lines (blank, comment-only and punctuation-only lines excluded; the length bar is tripled for a single-responsibility module of 4 or fewer top-level units). The bar is 500 significant lines; this is 528 over it, 2.06× 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: ast_impl/js.rs crates/oxc_ast/src/ast_impl/js.rs— FileTooLong — 968 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 468 over it, 1.94× 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: react/exhaustive_deps.rs crates/oxc_linter/src/rules/react/exhaustive_deps.rs— FileTooLong — 958 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 458 over it, 1.92× 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: ast/ts.rs crates/oxc_ast/src/ast/ts.rs— FileTooLong — 932 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 432 over it, 1.86× 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: printer/mod.rs crates/oxc_formatter_core/src/printer/mod.rs— FileTooLong — 912 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 412 over it, 1.82× 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: src/tsgolint.rs crates/oxc_linter/src/tsgolint.rs— FileTooLong — 889 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 389 over it, 1.78× 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: plugins/tokens_methods.ts apps/oxlint/src-js/plugins/tokens_methods.ts— FileTooLong — 861 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 361 over it, 1.72× 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: src/lanes.rs crates/oxc_lexer/src/lanes.rs— FileTooLong — 858 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 358 over it, 1.72× 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.
oxc_linter::rules::unicorn::no_immediate_mutation::expression_references_variable (cyclomatic 47) crates/oxc_linter/src/rules/unicorn/no_immediate_mutation.rs:476— oxc_linter::rules::unicorn::no_immediate_mutation::expression_references_variable has cyclomatic complexity 47 (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.
oxc_linter::rules::react::display_name::is_react_component_node (cyclomatic 44) crates/oxc_linter/src/rules/react/display_name.rs:411— oxc_linter::rules::react::display_name::is_react_component_node 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.
oxc_linter::rules::import::no_duplicates::merge_imports_fix (cyclomatic 38) crates/oxc_linter/src/rules/import/no_duplicates.rs:389— oxc_linter::rules::import::no_duplicates::merge_imports_fix 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.
oxc_linter::ast_util::is_default_this_binding (cyclomatic 37) crates/oxc_linter/src/ast_util.rs:658— oxc_linter::ast_util::is_default_this_binding has cyclomatic complexity 37 (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.
oxc_linter::rules::jsx_a11y::role_supports_aria_props::get_implicit_role (cyclomatic 35) crates/oxc_linter/src/rules/jsx_a11y/role_supports_aria_props.rs:124— oxc_linter::rules::jsx_a11y::role_supports_aria_props::get_implicit_role has cyclomatic complexity 35 (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. This is NOT this file's highest cyclomatic complexity: oxc_linter::rules::jsx_a11y::role_supports_aria_props::is_valid_aria_property_for_role (cyclomatic 47) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
oxc_linter::rules::unicorn::no_invalid_fetch_options::is_invalid_fetch_options (cyclomatic 33) crates/oxc_linter/src/rules/unicorn/no_invalid_fetch_options.rs:95— oxc_linter::rules::unicorn::no_invalid_fetch_options::is_invalid_fetch_options has cyclomatic complexity 33 (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.
oxc_linter::rules::unicorn::no_useless_iterator_to_array::check_call_expr (cyclomatic 31) crates/oxc_linter/src/rules/unicorn/no_useless_iterator_to_array.rs:254— oxc_linter::rules::unicorn::no_useless_iterator_to_array::check_call_expr 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.
oxc_linter::ast_util::get_function_name_with_kind (cyclomatic 30) crates/oxc_linter/src/ast_util.rs:845— oxc_linter::ast_util::get_function_name_with_kind 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.
oxc_linter::rules::shared::jest_vitest::valid_describe_callback::run (cyclomatic 29) crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs:35— oxc_linter::rules::shared::jest_vitest::valid_describe_callback::run 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.
oxc_linter::rules::eslint::no_unreachable_loop::has_next_iteration_path (cyclomatic 28) crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:184— oxc_linter::rules::eslint::no_unreachable_loop::has_next_iteration_path 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.
oxc_linter::rules::react::exhaustive_deps::is_stable_value (cyclomatic 27) crates/oxc_linter/src/rules/react/exhaustive_deps.rs:1087— oxc_linter::rules::react::exhaustive_deps::is_stable_value 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.
oxc_linter::rules::unicorn::prefer_spread::check_unicorn_prefer_spread (cyclomatic 26) crates/oxc_linter/src/rules/unicorn/prefer_spread.rs:61— oxc_linter::rules::unicorn::prefer_spread::check_unicorn_prefer_spread 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.
oxc_linter::utils::unicorn::is_same_expression (cyclomatic 25) crates/oxc_linter/src/utils/unicorn.rs:241— oxc_linter::utils::unicorn::is_same_expression 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.
oxc_linter::rules::react::no_unstable_nested_components::find_parent_component_name (cyclomatic 24) crates/oxc_linter/src/rules/react/no_unstable_nested_components.rs:301— oxc_linter::rules::react::no_unstable_nested_components::find_parent_component_name 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.
oxc_linter::rules::unicorn::custom_error_definition::check_class (cyclomatic 24) crates/oxc_linter/src/rules/unicorn/custom_error_definition.rs:160— oxc_linter::rules::unicorn::custom_error_definition::check_class has cyclomatic complexity 24 (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.
oxc_linter::utils::jest::parse_jest_fn::parse_jest_fn_call (cyclomatic 24) crates/oxc_linter/src/utils/jest/parse_jest_fn.rs:24— oxc_linter::utils::jest::parse_jest_fn::parse_jest_fn_call 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.
oxc_linter::rules::eslint::no_duplicate_imports::can_merge_imports (cyclomatic 23) crates/oxc_linter/src/rules/eslint/no_duplicate_imports.rs:430— oxc_linter::rules::eslint::no_duplicate_imports::can_merge_imports 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.
oxc_linter::rules::shared::jest_vitest::valid_expect_in_promise::process_statements (cyclomatic 23) crates/oxc_linter/src/rules/shared/jest_vitest/valid_expect_in_promise.rs:130— oxc_linter::rules::shared::jest_vitest::valid_expect_in_promise::process_statements 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.
oxc_linter::rules::unicorn::prefer_array_flat::check_array_reduce_case (cyclomatic 23) crates/oxc_linter/src/rules/unicorn/prefer_array_flat.rs:207— oxc_linter::rules::unicorn::prefer_array_flat::check_array_reduce_case 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.
oxc_linter::rules::unicorn::prefer_default_parameters::check_parameter_default (cyclomatic 23) crates/oxc_linter/src/rules/unicorn/prefer_default_parameters.rs:203— oxc_linter::rules::unicorn::prefer_default_parameters::check_parameter_default 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.
oxc_linter::rules::eslint::prefer_arrow_callback::get_callback_info (cyclomatic 22) crates/oxc_linter/src/rules/eslint/prefer_arrow_callback.rs:153— oxc_linter::rules::eslint::prefer_arrow_callback::get_callback_info 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.
oxc_linter::rules::typescript::consistent_type_imports::fix_to_type_import_declaration (cyclomatic 22) crates/oxc_linter/src/rules/typescript/consistent_type_imports.rs:389— oxc_linter::rules::typescript::consistent_type_imports::fix_to_type_import_declaration 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.
oxc_linter::rules::typescript::prefer_function_type::check_member (cyclomatic 22) crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:108— oxc_linter::rules::typescript::prefer_function_type::check_member 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.
oxc_linter::execute_rules (cyclomatic 21) crates/oxc_linter/src/lib.rs:186— oxc_linter::execute_rules has cyclomatic complexity 21 (threshold 15). 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.
oxc_linter::rules::eslint::no_unused_private_class_members::is_read (cyclomatic 21) crates/oxc_linter/src/rules/eslint/no_unused_private_class_members.rs:125— oxc_linter::rules::eslint::no_unused_private_class_members::is_read 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.
oxc_formatter::formatter::jsdoc::mdast_serialize::detect::needs_mdast_parsing (cognitive 96) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/detect.rs:14— oxc_formatter::formatter::jsdoc::mdast_serialize::detect::needs_mdast_parsing has cognitive complexity 96 (threshold 15). Drivers by points: if/else 15 (48 pts), loops 5 (19 pts), boolean chains 18, match/switch 3 (11 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_formatter::formatter::jsdoc::param_order::find_function_params_start (cognitive 92) crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:102— oxc_formatter::formatter::jsdoc::param_order::find_function_params_start has cognitive complexity 92 (threshold 15). Drivers by points: boolean chains 31, loops 14 (31 pts), if/else 15 (30 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_formatter::ir_transform::sort_imports::transform (cognitive 92) crates/oxc_formatter/src/ir_transform/sort_imports/mod.rs:61— oxc_formatter::ir_transform::sort_imports::transform has cognitive complexity 92 (threshold 15). Drivers by points: if/else 18 (50 pts), loops 10 (31 pts), match/switch 3 (7 pts), boolean chains 4 (nesting depth added 57). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_children (cognitive 85) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:19— oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_children has cognitive complexity 85 (threshold 15). Drivers by points: if/else 20 (55 pts), loops 4 (12 pts), boolean chains 9, match/switch 2 (9 pts) (nesting depth added 50). 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.
oxc_formatter::formatter::jsdoc::serialize::format_default_value (cognitive 73) crates/oxc_formatter/src/formatter/jsdoc/serialize.rs:810— oxc_formatter::formatter::jsdoc::serialize::format_default_value has cognitive complexity 73 (threshold 15). Drivers by points: if/else 20 (52 pts), boolean chains 7, loops 3 (7 pts), match/switch 3 (7 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_paragraph (cognitive 63) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:286— oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_paragraph has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (48 pts), boolean chains 9, loops 3 (6 pts) (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.
oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_list (cognitive 59) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:549— oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_list has cognitive complexity 59 (threshold 15). Drivers by points: if/else 18 (46 pts), loops 4 (12 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_formatter::formatter::jsdoc::normalize::normalize_markdown_emphasis (cognitive 53) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:41— oxc_formatter::formatter::jsdoc::normalize::normalize_markdown_emphasis has cognitive complexity 53 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 4 (10 pts), boolean chains 7 (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.
oxc_formatter::formatter::jsdoc::normalize::emphasis_needs_change (cognitive 48) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:149— oxc_formatter::formatter::jsdoc::normalize::emphasis_needs_change has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 4 (10 pts), boolean chains 7 (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.
oxc_formatter::formatter::jsdoc::normalize::normalize_type_whitespace (cognitive 48) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:1140— oxc_formatter::formatter::jsdoc::normalize::normalize_type_whitespace has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (35 pts), boolean chains 9, loops 2 (4 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.
oxc_formatter::utils::jsx::jsx_split_children (cognitive 48) crates/oxc_formatter/src/utils/jsx.rs:280— oxc_formatter::utils::jsx::jsx_split_children has cognitive complexity 48 (threshold 15). Drivers by points: if/else 8 (34 pts), match/switch 3 (10 pts), loops 2 (4 pts) (nesting depth added 35). 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.
oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_pipe_prefixed_paragraph (cognitive 47) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:435— oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_pipe_prefixed_paragraph has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 6 (15 pts), boolean chains 9 (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.
oxc_formatter::formatter::jsdoc::wrap::format_table_block (cognitive 45) crates/oxc_formatter/src/formatter/jsdoc/wrap.rs:67— oxc_formatter::formatter::jsdoc::wrap::format_table_block has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 7 (18 pts) (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.
oxc_formatter::print::template::embed::graphql::format_graphql_doc (cognitive 45) crates/oxc_formatter/src/print/template/embed/graphql.rs:23— oxc_formatter::print::template::embed::graphql::format_graphql_doc has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 8, loops 3 (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.
oxc_formatter::formatter::jsdoc::normalize::normalize_type_quotes (cognitive 41) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:895— oxc_formatter::formatter::jsdoc::normalize::normalize_type_quotes has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 3 (8 pts), boolean chains 6, match/switch 1 (nesting depth added 20). 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.
oxc_formatter::utils::string::normalize_jsx_string (cognitive 41) crates/oxc_formatter/src/utils/string.rs:412— oxc_formatter::utils::string::normalize_jsx_string has cognitive complexity 41 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 3 (9 pts), boolean chains 4, match/switch 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.
oxc_formatter::formatter::jsdoc::param_order::parse_param_names (cognitive 40) crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:333— oxc_formatter::formatter::jsdoc::param_order::parse_param_names has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 4 (8 pts), boolean chains 5 (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.
oxc_formatter::print::call_like_expression::arguments::write_grouped_arguments (cognitive 39) crates/oxc_formatter/src/print/call_like_expression/arguments.rs:615— oxc_formatter::print::call_like_expression::arguments::write_grouped_arguments has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 7, match/switch 3 (6 pts) (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.
oxc_formatter::formatter::jsdoc::mdast_serialize::collect::collect_inline_impl (cognitive 38) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/collect.rs:27— oxc_formatter::formatter::jsdoc::mdast_serialize::collect::collect_inline_impl has cognitive complexity 38 (threshold 15). Drivers by points: loops 11 (22 pts), if/else 4 (8 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 17). 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.
oxc_formatter::formatter::jsdoc::mdast_serialize::format_description_mdast (cognitive 37) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/mod.rs:30— oxc_formatter::formatter::jsdoc::mdast_serialize::format_description_mdast has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (29 pts), boolean chains 4, loops 2 (4 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.
oxc_formatter::formatter::jsdoc::normalize::is_whitespace_normalized (cognitive 37) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:1087— oxc_formatter::formatter::jsdoc::normalize::is_whitespace_normalized has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 8, 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.
oxc_formatter::print::template::embed::html::format_html_doc (cognitive 33) crates/oxc_formatter/src/print/template/embed/html.rs:32— oxc_formatter::print::template::embed::html::format_html_doc has cognitive complexity 33 (threshold 15). Drivers by points: if/else 17 (27 pts), loops 3 (5 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.
oxc_formatter::formatter::jsdoc::wrap::tokenize_words (cognitive 30) crates/oxc_formatter/src/formatter/jsdoc/wrap.rs:186— oxc_formatter::formatter::jsdoc::wrap::tokenize_words has cognitive complexity 30 (threshold 15). Drivers by points: loops 7 (15 pts), boolean chains 7, if/else 2 (4 pts), match/switch 1 (4 pts) (nesting depth added 13). 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.
oxc_formatter::parentheses::expression::is_first_in_statement (cognitive 29) crates/oxc_formatter/src/parentheses/expression.rs:1120— oxc_formatter::parentheses::expression::is_first_in_statement has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 1 (2 pts), boolean chains 1, 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.
oxc_formatter::formatter::jsdoc::embedded::update_template_depth (cognitive 27) crates/oxc_formatter/src/formatter/jsdoc/embedded.rs:41— oxc_formatter::formatter::jsdoc::embedded::update_template_depth has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 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.
MethodTooLong: PeepholeOptimizations.minimize_conditional_expression crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs:49— MethodTooLong — minimize_conditional_expression runs 366 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 266 over it, 3.66× 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: PeepholeOptimizations.substitute_single_use_symbol_in_expression crates/oxc_minifier/src/peephole/minimize_statements.rs:1644— MethodTooLong — substitute_single_use_symbol_in_expression runs 355 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 255 over it, 3.55× 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: CliRunner.run apps/oxlint/src/lint.rs:78— MethodTooLong — run runs 335 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 235 over it, 3.35× 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: ExhaustiveDeps.run crates/oxc_linter/src/rules/react/exhaustive_deps.rs:286— MethodTooLong — run runs 292 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 192 over it, 2.92× 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: FormatElementSlice.fmt crates/oxc_formatter_core/src/format_element/debug.rs:90— MethodTooLong — fmt runs 247 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 147 over it, 2.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.
MethodTooLong: AsyncGeneratorFunctions.build_for_await crates/oxc_transformer/src/es2018/async_generator_functions/for_await.rs:205— MethodTooLong — build_for_await runs 247 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 147 over it, 2.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.
MethodTooLong: NoUselessAssignment.run_once crates/oxc_linter/src/rules/eslint/no_useless_assignment.rs:150— MethodTooLong — run_once runs 245 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 145 over it, 2.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.
MethodTooLong: PeepholeOptimizations.try_rewrite_arguments_copy_loop crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:665— MethodTooLong — try_rewrite_arguments_copy_loop runs 231 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 131 over it, 2.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: ConsistentIndexedObjectStyle.run crates/oxc_linter/src/rules/typescript/consistent_indexed_object_style.rs:121— MethodTooLong — run runs 227 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× 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: OxlintRules.json_schema crates/oxc_linter/src/config/rules.rs:265— MethodTooLong — json_schema runs 207 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 107 over it, 2.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.
MethodTooLong: ClassProperties.transform_class_body_on_entry crates/oxc_transformer/src/es2022/class_properties/class.rs:59— MethodTooLong — transform_class_body_on_entry runs 190 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 90 over it, 1.90× 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: DisableDirectivesBuilder.build_impl crates/oxc_linter/src/disable_directives.rs:530— MethodTooLong — build_impl runs 189 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× 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: IsolatedDeclarations.transform_class crates/oxc_isolated_declarations/src/class.rs:488— MethodTooLong — transform_class runs 185 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 85 over it, 1.85× 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: NoDuplicateImports.run_once crates/oxc_linter/src/rules/eslint/no_duplicate_imports.rs:149— MethodTooLong — run_once runs 181 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× 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: IsolatedDeclarations.transform_statements_on_demand crates/oxc_isolated_declarations/src/lib.rs:191— MethodTooLong — transform_statements_on_demand runs 175 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 75 over it, 1.75× 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: JsdocFormatter.format crates/oxc_formatter/src/formatter/jsdoc/serialize.rs:103— MethodTooLong — format runs 171 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× 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: Kind.to_str crates/oxc_parser/src/lexer/kind.rs:555— MethodTooLong — to_str runs 169 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 69 over it, 1.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.
MethodTooLong: PreferConst.should_be_const crates/oxc_linter/src/rules/eslint/prefer_const.rs:443— MethodTooLong — should_be_const runs 163 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) 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: Printer.print_element crates/oxc_formatter_core/src/printer/mod.rs:123— MethodTooLong — print_element runs 162 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 62 over it, 1.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: ExplicitResourceManagement.enter_program crates/oxc_transformer/src/es2026/explicit_resource_management.rs:361— MethodTooLong — enter_program runs 158 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× 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: FormatJsxChildList.fmt_children crates/oxc_formatter/src/print/jsx/child_list.rs:35— MethodTooLong — fmt_children runs 157 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) 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: Linter.convert_and_call_external_linter crates/oxc_linter/src/lib.rs:727— MethodTooLong — convert_and_call_external_linter runs 155 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× 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: ClassProperties.transform_update_expression_impl crates/oxc_transformer/src/es2022/class_properties/private_field.rs:927— MethodTooLong — transform_update_expression_impl runs 152 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: WalkRunner.run apps/oxfmt/src/cli/walk_runner.rs:67— MethodTooLong — run runs 149 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 49 over it, 1.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.
MethodTooLong: ConfigStoreBuilder.from_oxlintrc crates/oxc_linter/src/config/config_builder.rs:100— MethodTooLong — from_oxlintrc runs 146 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: minify.wasip1-deferred.__createInstance napi/minify/minify.wasip1-deferred.js:1181— FunctionTooLong — __createInstance runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: parser.wasip1-deferred.__createInstance napi/parser/src-js/parser.wasip1-deferred.js:1181— FunctionTooLong — __createInstance runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: transform-react.wasip1-deferred.__createInstance napi/transform-react/transform-react.wasip1-deferred.js:1181— FunctionTooLong — __createInstance runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: transform-relay.wasip1-deferred.__createInstance napi/transform-relay/transform-relay.wasip1-deferred.js:1181— FunctionTooLong — __createInstance runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: transform.wasip1-deferred.__createInstance napi/transform/transform.wasip1-deferred.js:1181— FunctionTooLong — __createInstance runs 266 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 166 over it, 2.66× 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: regeneratorRuntime._regeneratorRuntime npm/runtime/src/helpers/regeneratorRuntime.js:2— FunctionTooLong — _regeneratorRuntime runs 240 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 140 over it, 2.40× 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: regeneratorRuntime._regeneratorRuntime npm/runtime/src/helpers/esm/regeneratorRuntime.js:2— FunctionTooLong — _regeneratorRuntime runs 239 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 139 over it, 2.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: oxc_linter_codegen::rules_enum::generate_rule_enum_impl tasks/linter_codegen/src/rules_enum.rs:137— FunctionTooLong — oxc_linter_codegen::rules_enum::generate_rule_enum_impl runs 220 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 120 over it, 2.20× 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: oxc_lexer::pipeline::disambiguate::type_context::type_list::type_list_legal crates/oxc_lexer/src/pipeline/disambiguate/type_context/type_list.rs:59— FunctionTooLong — oxc_lexer::pipeline::disambiguate::type_context::type_list::type_list_legal runs 205 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× 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: oxc_formatter_markdown::print::inline::collect_inlines crates/oxc_formatter_markdown/src/print/inline.rs:226— FunctionTooLong — oxc_formatter_markdown::print::inline::collect_inlines runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× 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: applyDecs2301.applyDecs2301Factory npm/runtime/src/helpers/applyDecs2301.js:5— FunctionTooLong — applyDecs2301Factory runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× 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: applyDecs2301.applyDecs2301Factory npm/runtime/src/helpers/esm/applyDecs2301.js:5— FunctionTooLong — applyDecs2301Factory runs 174 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 74 over it, 1.74× 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: oxc_lexer::pipeline::coalesce::coalesce crates/oxc_lexer/src/pipeline/coalesce/mod.rs:26— FunctionTooLong — oxc_lexer::pipeline::coalesce::coalesce runs 172 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 72 over it, 1.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: applyDecs2203R.applyDecs2203RFactory npm/runtime/src/helpers/applyDecs2203R.js:4— FunctionTooLong — applyDecs2203RFactory runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: applyDecs2203R.applyDecs2203RFactory npm/runtime/src/helpers/esm/applyDecs2203R.js:4— FunctionTooLong — applyDecs2203RFactory runs 152 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 52 over it, 1.52× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: oxc_ecmascript::constant_evaluation::binary_operation_evaluate_value_to crates/oxc_ecmascript/src/constant_evaluation/mod.rs:210— FunctionTooLong — oxc_ecmascript::constant_evaluation::binary_operation_evaluate_value_to runs 151 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× 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: applyDecs2203.applyDecs2203Factory npm/runtime/src/helpers/applyDecs2203.js:2— FunctionTooLong — applyDecs2203Factory runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.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: applyDecs2203.applyDecs2203Factory npm/runtime/src/helpers/esm/applyDecs2203.js:2— FunctionTooLong — applyDecs2203Factory runs 149 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 49 over it, 1.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: report.generateReport apps/oxlint/conformance/src/report.ts:31— FunctionTooLong — generateReport runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 46 over it, 1.46× 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: oxc_ast_tools::generators::raw_transfer::generate_deserializers tasks/ast_tools/src/generators/raw_transfer.rs:132— FunctionTooLong — oxc_ast_tools::generators::raw_transfer::generate_deserializers runs 141 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 41 over it, 1.41× 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: oxc_ast_tools::generators::formatter::ast_nodes::generate_struct_impls tasks/ast_tools/src/generators/formatter/ast_nodes.rs:204— FunctionTooLong — oxc_ast_tools::generators::formatter::ast_nodes::generate_struct_impls runs 140 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× 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: oxc_ast_tools::generators::raw_transfer_lazy::generate_struct tasks/ast_tools/src/generators/raw_transfer_lazy.rs:595— FunctionTooLong — oxc_ast_tools::generators::raw_transfer_lazy::generate_struct runs 139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 39 over it, 1.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: oxc_ast_tools::generators::traverse::ancestor::generate_ancestor tasks/ast_tools/src/generators/traverse/ancestor.rs:23— FunctionTooLong — oxc_ast_tools::generators::traverse::ancestor::generate_ancestor runs 135 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 35 over it, 1.35× 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: minify.wasip1-deferred.__createManagedEmnapiContext napi/minify/minify.wasip1-deferred.js:1000— FunctionTooLong — __createManagedEmnapiContext runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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: parser.wasip1-deferred.__createManagedEmnapiContext napi/parser/src-js/parser.wasip1-deferred.js:1000— FunctionTooLong — __createManagedEmnapiContext runs 130 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 30 over it, 1.30× 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.
PeepholeOptimizations::substitute_single_use_symbol_in_expression (cognitive 172) crates/oxc_minifier/src/peephole/minimize_statements.rs:1644— PeepholeOptimizations::substitute_single_use_symbol_in_expression has cognitive complexity 172 (threshold 15). Drivers by points: if/else 46 (123 pts), boolean chains 17, match/switch 6 (17 pts), loops 7 (15 pts) (nesting depth added 96). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PeepholeOptimizations::minimize_conditional_expression (cognitive 124) crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs:49— PeepholeOptimizations::minimize_conditional_expression has cognitive complexity 124 (threshold 15). Drivers by points: if/else 46 (100 pts), boolean chains 18, match/switch 6 (nesting depth added 54). 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.
PeepholeOptimizations::try_rewrite_arguments_copy_loop (cognitive 113) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:665— PeepholeOptimizations::try_rewrite_arguments_copy_loop has cognitive complexity 113 (threshold 15). Drivers by points: if/else 66 (91 pts), boolean chains 11, match/switch 6 (7 pts), loops 2 (4 pts) (nesting depth added 28). Of this number, 100 points are the body's own statements and 13 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.
PeepholeOptimizations::try_minimize_if (cognitive 55) crates/oxc_minifier/src/peephole/minimize_if_statement.rs:13— PeepholeOptimizations::try_minimize_if has cognitive complexity 55 (threshold 15). Drivers by points: if/else 21 (48 pts), match/switch 2 (5 pts), boolean chains 2 (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.
PeepholeOptimizations::try_fold_if (cognitive 51) crates/oxc_minifier/src/peephole/remove_dead_code.rs:59— PeepholeOptimizations::try_fold_if has cognitive complexity 51 (threshold 15). Drivers by points: if/else 22 (49 pts), boolean chains 1, match/switch 1 (nesting depth added 27). 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.
PeepholeOptimizations::merge_import_export (cognitive 50) crates/oxc_minifier/src/peephole/minimize_statements.rs:368— PeepholeOptimizations::merge_import_export has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 4 (8 pts), match/switch 2 (5 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.
PeepholeOptimizations::handle_for_statement (cognitive 48) crates/oxc_minifier/src/peephole/minimize_statements.rs:1178— PeepholeOptimizations::handle_for_statement has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (40 pts), boolean chains 4, match/switch 2 (4 pts) (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.
PeepholeOptimizations::substitute_object_or_array_constructor (cognitive 48) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1190— PeepholeOptimizations::substitute_object_or_array_constructor has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (39 pts), boolean chains 3, loops 1 (3 pts), match/switch 3 (nesting depth added 25). 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.
PeepholeOptimizations::handle_if_statement (cognitive 44) crates/oxc_minifier/src/peephole/minimize_statements.rs:892— PeepholeOptimizations::handle_if_statement has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (38 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 24). 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.
PeepholeOptimizations::substitute_iife_call (cognitive 44) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1868— PeepholeOptimizations::substitute_iife_call has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 11, match/switch 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.
PeepholeOptimizations::minimize_expression_in_boolean_context (cognitive 43) crates/oxc_minifier/src/peephole/minimize_expression_in_boolean_context.rs:13— PeepholeOptimizations::minimize_expression_in_boolean_context has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (40 pts), boolean chains 2, match/switch 1 (nesting depth added 21). 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.
PeepholeOptimizations::handle_return_statement (cognitive 42) crates/oxc_minifier/src/peephole/minimize_statements.rs:1014— PeepholeOptimizations::handle_return_statement has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 20). 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.
PeepholeOptimizations::remove_unused_logical_expr (cognitive 42) crates/oxc_minifier/src/peephole/remove_unused_expression.rs:123— PeepholeOptimizations::remove_unused_logical_expr has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 6, match/switch 1 (3 pts) (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.
PeepholeOptimizations::try_fold_concat (cognitive 42) crates/oxc_minifier/src/peephole/replace_known_methods.rs:202— PeepholeOptimizations::try_fold_concat has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 2 (5 pts), match/switch 3 (4 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.
PeepholeOptimizations::drop_unreachable_switch_cases (cognitive 41) crates/oxc_minifier/src/peephole/minimize_switch_statements.rs:13— PeepholeOptimizations::drop_unreachable_switch_cases has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (30 pts), boolean chains 7, loops 3 (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.
PeepholeOptimizations::handle_for_in_statement (cognitive 37) crates/oxc_minifier/src/peephole/minimize_statements.rs:1288— PeepholeOptimizations::handle_for_in_statement has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 2 (6 pts), boolean chains 3 (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.
PeepholeOptimizations::replace_known_property_access (cognitive 36) crates/oxc_minifier/src/peephole/replace_known_methods.rs:371— PeepholeOptimizations::replace_known_property_access has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 5 (8 pts), boolean chains 3 (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.
PeepholeOptimizations::inject_optional_chaining_if_matched_inner (cognitive 33) crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs:715— PeepholeOptimizations::inject_optional_chaining_if_matched_inner has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (30 pts), match/switch 2 (3 pts) (nesting depth added 19). 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.
PeepholeOptimizations::minimize_for_statement (cognitive 32) crates/oxc_minifier/src/peephole/minimize_for_statement.rs:11— PeepholeOptimizations::minimize_for_statement has cognitive complexity 32 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 3 (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.
PeepholeOptimizations::try_fold_for (cognitive 29) crates/oxc_minifier/src/peephole/remove_dead_code.rs:178— PeepholeOptimizations::try_fold_for has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 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.
PeepholeOptimizations::try_fold_switch (cognitive 29) crates/oxc_minifier/src/peephole/remove_dead_code.rs:296— PeepholeOptimizations::try_fold_switch has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 1 (4 pts), match/switch 1 (3 pts), boolean chains 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.
PeepholeOptimizations::classify_class_removability (cognitive 29) crates/oxc_minifier/src/peephole/remove_unused_expression.rs:1088— PeepholeOptimizations::classify_class_removability has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 2 (5 pts), boolean chains 1, 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.
PeepholeOptimizations::try_compress_is_object_and_not_null_for_left_and_right (cognitive 29) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:489— PeepholeOptimizations::try_compress_is_object_and_not_null_for_left_and_right has cognitive complexity 29 (threshold 15). Drivers by points: if/else 23 (26 pts), loops 1 (2 pts), boolean chains 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.
PeepholeOptimizations::try_flatten_array_expression_elements (cognitive 27) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1621— PeepholeOptimizations::try_flatten_array_expression_elements has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2 (5 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.
PeepholeOptimizations::fold_object_exp (cognitive 26) crates/oxc_minifier/src/peephole/fold_constants.rs:881— PeepholeOptimizations::fold_object_exp has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 5 (8 pts), loops 2 (5 pts), boolean chains 3 (nesting depth added 12). Of this number, 23 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.
TooManyMethods: ParserImpl crates/oxc_parser/src/lib.rs:626— TooManyMethods — 404 methods, declared across 16 files: js/expression.rs (68), ts/types.rs (68), src/cursor.rs (45), js/statement.rs (36), +12 more file(s). The bar is 30 methods; this is 374 over it, 13.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: PeepholeOptimizations crates/oxc_minifier/src/peephole/mod.rs:35— TooManyMethods — 259 methods, declared across 21 files: peephole/substitute_alternate_syntax.rs (54), peephole/fold_constants.rs (29), peephole/minimize_statements.rs (29), peephole/remove_unused_expression.rs (27), +17 more file(s). The bar is 30 methods; this is 229 over it, 8.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: AstNode crates/oxc_formatter/src/ast_nodes/node.rs:13— TooManyMethods — 146 methods, declared across 2 files: generated/ast_nodes.rs (134), ast_nodes/node.rs (12). The bar is 30 methods; this is 116 over it, 4.87× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Expression crates/oxc_ast/src/ast/js.rs:81— TooManyMethods — 110 methods, declared across 5 files: generated/ast_builder.rs (51), ast_impl/js.rs (42), generated/inherit_variants.rs (13), builder/custom.rs (3), +1 more file(s). The bar is 30 methods; this is 80 over it, 3.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Lexer crates/oxc_parser/src/lexer/mod.rs:75— TooManyMethods — 105 methods, declared across 13 files: lexer/mod.rs (38), lexer/unicode.rs (14), lexer/numeric.rs (12), lexer/identifier.rs (8), +9 more file(s). The bar is 30 methods; this is 75 over it, 3.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: ClassProperties crates/oxc_transformer/src/es2022/class_properties/mod.rs:241— TooManyMethods — 103 methods, declared across 10 files: class_properties/private_field.rs (58), class_properties/prop_decl.rs (11), class_properties/class.rs (10), class_properties/constructor.rs (6), +6 more file(s). The bar is 30 methods; this is 73 over it, 3.43× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Codegen crates/oxc_codegen/src/lib.rs:87— TooManyMethods — 91 methods, declared across 3 files: src/lib.rs (70), src/comment.rs (17), src/str.rs (4). The bar is 30 methods; this is 61 over it, 3.03× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: TraverseCtx crates/oxc_minifier/src/traverse_context/mod.rs:124— TooManyMethods — 82 methods, declared across 2 files: traverse_context/mod.rs (49), traverse_context/ecma_context.rs (33). The bar is 30 methods; this is 52 over it, 2.73× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Scoping crates/oxc_semantic/src/scoping.rs:95— TooManyMethods — 80 methods. The bar is 30 methods; this is 50 over it, 2.67× 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: Walk crates/oxc_lexer/src/pipeline/disambiguate/context/walker.rs:40— TooManyMethods — 75 methods, declared across 7 files: context/walker.rs (40), context/punct.rs (13), context/words.rs (7), context/types.rs (6), +3 more file(s). The bar is 30 methods; this is 45 over it, 2.50× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: PropertyKey crates/oxc_ast/src/ast/js.rs:389— TooManyMethods — 74 methods, declared across 4 files: generated/ast_builder.rs (53), generated/inherit_variants.rs (12), ast_impl/js.rs (8), generated/get_id.rs (1). The bar is 30 methods; this is 44 over it, 2.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: IsolatedDeclarations crates/oxc_isolated_declarations/src/lib.rs:62— TooManyMethods — 74 methods, declared across 10 files: src/class.rs (19), src/lib.rs (13), src/module.rs (9), src/declaration.rs (8), +6 more file(s). The bar is 30 methods; this is 44 over it, 2.47× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: ArrowFunctionBody crates/oxc_ast/src/ast/js.rs:1997— TooManyMethods — 71 methods, declared across 4 files: generated/ast_builder.rs (52), generated/inherit_variants.rs (12), ast_impl/js.rs (6), generated/get_id.rs (1). The bar is 30 methods; this is 41 over it, 2.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: ExportDefaultDeclarationKind crates/oxc_ast/src/ast/js.rs:2889— TooManyMethods — 71 methods, declared across 4 files: generated/ast_builder.rs (57), generated/inherit_variants.rs (12), ast_impl/js.rs (1), generated/get_id.rs (1). The bar is 30 methods; this is 41 over it, 2.37× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: ArrayExpressionElement crates/oxc_ast/src/ast/js.rs:308— TooManyMethods — 68 methods, declared across 4 files: generated/ast_builder.rs (53), generated/inherit_variants.rs (12), ast_impl/js.rs (2), generated/get_id.rs (1). The bar is 30 methods; this is 38 over it, 2.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Statement crates/oxc_ast/src/ast/js.rs:1087— TooManyMethods — 67 methods, declared across 4 files: generated/ast_builder.rs (49), generated/inherit_variants.rs (12), ast_impl/js.rs (5), generated/get_id.rs (1). The bar is 30 methods; this is 37 over it, 2.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: ForStatementInit crates/oxc_ast/src/ast/js.rs:1315— TooManyMethods — 67 methods, declared across 4 files: generated/ast_builder.rs (52), generated/inherit_variants.rs (12), ast_impl/js.rs (2), generated/get_id.rs (1). The bar is 30 methods; this is 37 over it, 2.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Argument crates/oxc_ast/src/ast/js.rs:678— TooManyMethods — 66 methods, declared across 4 files: generated/ast_builder.rs (52), generated/inherit_variants.rs (12), ast_impl/js.rs (1), generated/get_id.rs (1). The bar is 30 methods; this is 36 over it, 2.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: JSXExpression crates/oxc_ast/src/ast/jsx.rs:306— TooManyMethods — 66 methods, declared across 4 files: generated/ast_builder.rs (52), generated/inherit_variants.rs (12), ast_impl/jsx.rs (1), generated/get_id.rs (1). The bar is 30 methods; this is 36 over it, 2.20× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Symbol crates/oxc_linter/src/rules/eslint/no_unused_vars/symbol.rs:20— TooManyMethods — 60 methods, declared across 5 files: no_unused_vars/usage.rs (25), no_unused_vars/symbol.rs (24), fixers/fix_symbol.rs (6), no_unused_vars/allowed.rs (3), +1 more file(s). The bar is 30 methods; this is 30 over it, 2.00× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: TSTupleElement crates/oxc_ast/src/ast/ts.rs:554— TooManyMethods — 50 methods, declared across 3 files: generated/ast_builder.rs (43), generated/inherit_variants.rs (6), generated/get_id.rs (1). The bar is 30 methods; this is 20 over it, 1.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: Comments crates/oxc_formatter/src/formatter/comments.rs:133— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× 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: TraverseCtx crates/oxc_traverse/src/context/mod.rs:116— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× 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: TSType crates/oxc_ast/src/ast/ts.rs:250— TooManyMethods — 49 methods, declared across 4 files: generated/ast_builder.rs (41), ast_impl/ts.rs (6), generated/get_id.rs (1), generated/inherit_variants.rs (1). The bar is 30 methods; this is 19 over it, 1.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: PatternParser crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:20— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× 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.
+ 18 more in this group — see findings.md.
R4 · Test Coverage· This test file cannot be loaded · ×40
This test file cannot be loaded apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups.ts— apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups.ts:5 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups_selector_modifiers.ts— apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups_selector_modifiers.ts:9 imports './sibling', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded apps/oxfmt/test/cli/stdin_pipe/fixtures/parser.ts— apps/oxfmt/test/cli/stdin_pipe/fixtures/parser.ts:1 imports './_namespaces/ts.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded apps/oxlint/fixtures/cli/import/test.js— apps/oxlint/fixtures/cli/import/test.js:1 imports './foo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded apps/oxlint/test/fixtures/print_config_js_config_extends/files/test.js— apps/oxlint/test/fixtures/print_config_js_config_extends/files/test.js:1 imports './side-effect.js', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded apps/oxlint/test/utils.ts— apps/oxlint/test/utils.ts:17 imports './fixtures/', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded crates/oxc_linter/fixtures/import/deep/cache-1.js— crates/oxc_linter/fixtures/import/deep/cache-1.js:1 imports './cache-2', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded crates/oxc_linter/fixtures/import/exports-missing.js— crates/oxc_linter/fixtures/import/exports-missing.js:1 imports './does-not-exist', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded crates/oxc_linter/fixtures/import/unresolvable-namespace.js— crates/oxc_linter/fixtures/import/unresolvable-namespace.js:1 imports './does-not-exist', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded napi/minify/test/minify.test.ts— napi/minify/test/minify.test.ts:4 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded napi/minify/test/terser.test.ts— napi/minify/test/terser.test.ts:22 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded napi/transform-react/test/transform.test.ts— napi/transform-react/test/transform.test.ts:3 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded napi/transform-relay/test/transform.test.ts— napi/transform-relay/test/transform.test.ts:3 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded napi/transform/test/id.test.ts— napi/transform/test/id.test.ts:3 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded napi/transform/test/moduleRunnerTransform.test.ts— napi/transform/test/moduleRunnerTransform.test.ts:2 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded napi/transform/test/transform.test.ts— napi/transform/test/transform.test.ts:4 imports '../index', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/typescript/class-fields-with-computed-key/input.ts— tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/typescript/class-fields-with-computed-key/input.ts:1 imports './collection.ts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/typescript/class-fields-with-computed-key/output.js— tasks/transform_conformance/tests/babel-plugin-transform-class-properties/test/fixtures/typescript/class-fields-with-computed-key/output.js:1 imports './collection.ts', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/import-after-component/input.js— tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/import-after-component/input.js:2 imports './useFoo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/import-after-component/output.js— tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/import-after-component/output.js:2 imports './useFoo', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/includes-custom-hooks-into-the-signatures-when-commonjs-target-is-used/input.jsx— tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/includes-custom-hooks-into-the-signatures-when-commonjs-target-is-used/input.jsx:3 imports './hooks', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/includes-custom-hooks-into-the-signatures-when-commonjs-target-is-used/output.js— tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/includes-custom-hooks-into-the-signatures-when-commonjs-target-is-used/output.js:5 imports './hooks', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either. The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-jsx-at-definition-site/input.jsx— tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-jsx-at-definition-site/input.jsx:6 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-jsx-at-definition-site/output.js— tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-jsx-at-definition-site/output.js:1 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
This test file cannot be loaded tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-react-create-element-at-definition-site/input.jsx— tasks/transform_conformance/tests/babel-plugin-transform-react-jsx/test/fixtures/refresh/react-refresh/registers-identifiers-used-in-react-create-element-at-definition-site/input.jsx:6 imports './A', which names no file in this repository — and no rule in its .gitignore chain could cover one, so no build writes it either (1 further unresolvable import(s) in the same file). The import throws as the runner collects this file, so none of its test cases run and nothing it was written to verify is verified. Restore the missing module or delete the test. It is excluded from the reachability measured above, because a file that cannot load reaches nothing.
Duplicated block (9 lines × 2) apps/oxfmt/src/core/options/to_oxc_formatter.rs:36— apps/oxfmt/src/core/options/to_oxc_formatter.rs:36-45 | napi/playground/src/lib.rs:479-487 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (9 lines × 2) crates/oxc_ast/src/builder/custom.rs:266— crates/oxc_ast/src/builder/custom.rs:266-274 | crates/oxc_ast/src/builder/custom.rs:276-284 — 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 (9 lines × 2) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:147— crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:147-155 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:181-189 — 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 (9 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/collect.rs:85— crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/collect.rs:85-93 | crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/collect.rs:115-123 — 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 (9 lines × 2) crates/oxc_formatter/src/parentheses/ts_type.rs:91— crates/oxc_formatter/src/parentheses/ts_type.rs:91-99 | crates/oxc_formatter/src/parentheses/ts_type.rs:165-173 — 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 (9 lines × 2) crates/oxc_formatter_core/src/write/builders.rs:787— crates/oxc_formatter_core/src/write/builders.rs:787-795 | crates/oxc_formatter_core/src/write/builders.rs:814-822 — 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 (9 lines × 2) crates/oxc_formatter_css/src/print/at_rule.rs:1151— crates/oxc_formatter_css/src/print/at_rule.rs:1151-1159 | crates/oxc_formatter_css/src/print/at_rule.rs:1282-1290 — 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 (9 lines × 2) crates/oxc_formatter_css/src/print/selector.rs:340— crates/oxc_formatter_css/src/print/selector.rs:340-348 | crates/oxc_formatter_css/src/print/selector.rs:359-367 — 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 (9 lines × 2) crates/oxc_formatter_css/src/print/value.rs:2065— crates/oxc_formatter_css/src/print/value.rs:2065-2073 | crates/oxc_formatter_css/src/print/value.rs:2220-2228 — 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 (9 lines × 2) crates/oxc_isolated_declarations/src/enum.rs:266— crates/oxc_isolated_declarations/src/enum.rs:266-274 | crates/oxc_semantic/src/ts_enum/eval.rs:268-276 — before extracting anything, compare `crates/oxc_isolated_declarations/src/enum.rs` and `crates/oxc_semantic/src/ts_enum/eval.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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.
Duplicated block (9 lines × 2) crates/oxc_lexer/src/comment_meta.rs:159— crates/oxc_lexer/src/comment_meta.rs:159-167 | crates/oxc_parser/src/lexer/trivia_builder.rs:541-549 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (9 lines × 2) crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:235— crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:235-243 | crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:251-260 — 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 (9 lines × 2) crates/oxc_linter/src/loader/partial_loader/svelte.rs:30— crates/oxc_linter/src/loader/partial_loader/svelte.rs:30-38 | crates/oxc_linter/src/loader/partial_loader/vue.rs:30-38 — 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) crates/oxc_linter/src/rules/eslint/func_name_matching.rs:338— crates/oxc_linter/src/rules/eslint/func_name_matching.rs:338-346 | crates/oxc_linter/src/rules/eslint/func_name_matching.rs:365-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.
Duplicated block (9 lines × 2) crates/oxc_linter/src/rules/eslint/max_params.rs:104— crates/oxc_linter/src/rules/eslint/max_params.rs:104-112 | crates/oxc_linter/src/rules/eslint/max_params.rs:189-197 — 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 (9 lines × 2) crates/oxc_linter/src/rules/eslint/require_unicode_regexp.rs:183— crates/oxc_linter/src/rules/eslint/require_unicode_regexp.rs:183-191 | crates/oxc_linter/src/rules/eslint/require_unicode_regexp.rs:193-201 — 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 (9 lines × 2) crates/oxc_linter/src/rules/jsx_a11y/no_noninteractive_element_to_interactive_role.rs:159— crates/oxc_linter/src/rules/jsx_a11y/no_noninteractive_element_to_interactive_role.rs:159-170 | crates/oxc_linter/src/rules/jsx_a11y/role_has_required_aria_props.rs:68-76 — 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) crates/oxc_linter/src/rules/nextjs/no_async_client_component.rs:108— crates/oxc_linter/src/rules/nextjs/no_async_client_component.rs:108-116 | crates/oxc_linter/src/rules/nextjs/no_async_client_component.rs:132-141 — 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 (9 lines × 2) crates/oxc_linter/src/rules/unicorn/no_immediate_mutation.rs:527— crates/oxc_linter/src/rules/unicorn/no_immediate_mutation.rs:527-536 | crates/oxc_linter/src/rules/unicorn/no_immediate_mutation.rs:564-572 — 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 (9 lines × 2) crates/oxc_linter/src/rules/unicorn/prefer_array_flat.rs:256— crates/oxc_linter/src/rules/unicorn/prefer_array_flat.rs:256-264 | crates/oxc_linter/src/rules/unicorn/prefer_array_flat.rs:301-309 — 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 (9 lines × 2) crates/oxc_linter/src/rules/unicorn/prefer_array_flat.rs:266— crates/oxc_linter/src/rules/unicorn/prefer_array_flat.rs:266-274 | crates/oxc_linter/src/rules/unicorn/prefer_array_flat.rs:311-319 — 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 (9 lines × 2) crates/oxc_linter/src/rules/vue/prefer_import_from_vue.rs:64— crates/oxc_linter/src/rules/vue/prefer_import_from_vue.rs:64-72 | crates/oxc_linter/src/rules/vue/prefer_import_from_vue.rs:75-83 — 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 (9 lines × 2) crates/oxc_linter/src/utils/jsdoc.rs:234— crates/oxc_linter/src/utils/jsdoc.rs:234-242 | crates/oxc_linter/src/utils/jsdoc.rs:257-265 — 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 (9 lines × 2) crates/oxc_minifier/src/peephole/remove_unused_expression.rs:373— crates/oxc_minifier/src/peephole/remove_unused_expression.rs:373-384 | crates/oxc_minifier/src/peephole/remove_unused_expression.rs:403-411 — 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 (9 lines × 2) crates/oxc_parser/src/lexer/byte_handlers.rs:192— crates/oxc_parser/src/lexer/byte_handlers.rs:192-200 | crates/oxc_parser/src/lexer/byte_handlers.rs:394-402 — 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) crates/oxc_codegen/src/gen.rs:850— crates/oxc_codegen/src/gen.rs:850-856 | crates/oxc_codegen/src/gen.rs:3043-3049 — 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) crates/oxc_formatter_css/src/print/value.rs:2311— crates/oxc_formatter_css/src/print/value.rs:2311-2317 | crates/oxc_formatter_css/src/print/value.rs:2327-2333 — 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) crates/oxc_formatter_graphql/src/print/common.rs:223— crates/oxc_formatter_graphql/src/print/common.rs:223-229 | crates/oxc_formatter_graphql/src/print/common.rs:291-297 — 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) crates/oxc_language_server/src/backend.rs:655— crates/oxc_language_server/src/backend.rs:655-661 | crates/oxc_language_server/src/backend.rs:717-723 — 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) crates/oxc_lexer/src/pipeline/compress/avx2/mod.rs:170— crates/oxc_lexer/src/pipeline/compress/avx2/mod.rs:170-176 | crates/oxc_lexer/src/pipeline/compress/generic.rs:58-64 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (7 lines × 2) crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs:104— crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs:104-110 | crates/oxc_linter/src/rules/jsdoc/no_defaults.rs:87-93 — 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) crates/oxc_linter/src/rules/typescript/consistent_indexed_object_style.rs:152— crates/oxc_linter/src/rules/typescript/consistent_indexed_object_style.rs:152-158 | crates/oxc_linter/src/rules/typescript/consistent_indexed_object_style.rs:262-271 — 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) crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:154— crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:154-160 | crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs:146-152 — before extracting anything, compare `crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs` and `crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 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.
Duplicated block (7 lines × 2) crates/oxc_parser/src/js/expression.rs:724— crates/oxc_parser/src/js/expression.rs:724-730 | crates/oxc_parser/src/js/expression.rs:1176-1182 — 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) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1751— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1751-1757 | crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1781-1787 — 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) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:2029— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:2029-2035 | crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:2087-2093 — 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) crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:96— crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:96-102 | crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs:73-79 — `crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs` and `crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 2) crates/oxc_semantic/src/builder.rs:1489— crates/oxc_semantic/src/builder.rs:1489-1495 | crates/oxc_semantic/src/builder.rs:1613-1619 — 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) crates/oxc_semantic/src/builder.rs:1553— crates/oxc_semantic/src/builder.rs:1553-1559 | crates/oxc_semantic/src/builder.rs:2015-2021 — 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) tasks/ast_tools/src/generators/traverse/walk.rs:331— tasks/ast_tools/src/generators/traverse/walk.rs:331-337 | tasks/ast_tools/src/generators/traverse/walk.rs:462-468 — 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) tasks/ast_tools/src/generators/typescript.rs:381— tasks/ast_tools/src/generators/typescript.rs:381-387 | tasks/ast_tools/src/generators/typescript.rs:415-421 — 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) tasks/rulegen/src/main.rs:291— tasks/rulegen/src/main.rs:291-297 | tasks/rulegen/src/main.rs:332-338 — 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) crates/oxc_linter/src/rules/jest/no_large_snapshots.rs:22— crates/oxc_linter/src/rules/jest/no_large_snapshots.rs:22-28 | crates/oxc_linter/src/rules/vitest/no_large_snapshots.rs:22-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (7 lines × 2) apps/oxfmt/src/cli/command.rs:12— apps/oxfmt/src/cli/command.rs:12-18 | apps/oxlint/src/command/mod.rs:41-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (7 lines × 2) crates/oxc_linter/src/module_record.rs:397— crates/oxc_linter/src/module_record.rs:397-403 | crates/oxc_syntax/src/module_record.rs:339-345 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (7 lines × 2) crates/oxc_linter/src/rules/eslint/max_lines_per_function.rs:192— crates/oxc_linter/src/rules/eslint/max_lines_per_function.rs:192-199 | crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs:453-459 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (7 lines × 2) crates/oxc_linter/src/rules/eslint/no_implied_eval.rs:134— crates/oxc_linter/src/rules/eslint/no_implied_eval.rs:134-140 | crates/oxc_linter/src/rules/eslint/no_new_func.rs:103-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.
Duplicated block (7 lines × 2) crates/oxc_minifier/src/traverse_context/ancestry.rs:70— crates/oxc_minifier/src/traverse_context/ancestry.rs:70-76 | crates/oxc_traverse/src/context/ancestry.rs:70-76 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/ancestry.rs` and `crates/oxc_traverse/src/context/ancestry.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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.
Duplicated block (7 lines × 2) crates/oxc_minifier/src/traverse_context/scoping.rs:279— crates/oxc_minifier/src/traverse_context/scoping.rs:279-285 | crates/oxc_traverse/src/context/scoping.rs:304-310 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/scoping.rs` and `crates/oxc_traverse/src/context/scoping.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 94 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.
Duplicated block (7 lines × 2) crates/oxc_minifier/src/traverse_context/scoping.rs:292— crates/oxc_minifier/src/traverse_context/scoping.rs:292-298 | crates/oxc_traverse/src/context/scoping.rs:317-323 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/scoping.rs` and `crates/oxc_traverse/src/context/scoping.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 94 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.
oxc_lexer::pipeline::carve::jsx::carve_jsx (cognitive 354) crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:65— oxc_lexer::pipeline::carve::jsx::carve_jsx has cognitive complexity 354 (threshold 15). Drivers by points: if/else 89 (276 pts), match/switch 10 (38 pts), loops 5 (21 pts), boolean chains 19 (nesting depth added 231). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_lexer::pipeline::disambiguate::type_context::type_list::type_list_legal (cognitive 185) crates/oxc_lexer/src/pipeline/disambiguate/type_context/type_list.rs:59— oxc_lexer::pipeline::disambiguate::type_context::type_list::type_list_legal has cognitive complexity 185 (threshold 15). Drivers by points: if/else 49 (146 pts), boolean chains 31, match/switch 2 (7 pts), loops 1 (nesting depth added 102). 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.
oxc_lexer::lanes::cook_decode (cognitive 149) crates/oxc_lexer/src/lanes.rs:964— oxc_lexer::lanes::cook_decode has cognitive complexity 149 (threshold 15). Drivers by points: if/else 37 (122 pts), boolean chains 15, loops 3 (10 pts), match/switch 1 (2 pts) (nesting depth added 93). 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.
oxc_lexer::pipeline::coalesce::coalesce (cognitive 87) crates/oxc_lexer/src/pipeline/coalesce/mod.rs:26— oxc_lexer::pipeline::coalesce::coalesce has cognitive complexity 87 (threshold 15). Drivers by points: if/else 26 (72 pts), boolean chains 8, loops 3 (7 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_lexer::pipeline::disambiguate::operator::not_operator_position (cognitive 79) crates/oxc_lexer/src/pipeline/disambiguate/operator/mod.rs:55— oxc_lexer::pipeline::disambiguate::operator::not_operator_position has cognitive complexity 79 (threshold 15). Drivers by points: if/else 23 (67 pts), boolean chains 11, loops 1 (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_lexer::lanes::validate_number (cognitive 60) crates/oxc_lexer/src/lanes.rs:780— oxc_lexer::lanes::validate_number has cognitive complexity 60 (threshold 15). Drivers by points: if/else 22 (46 pts), boolean chains 5, match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 29). 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.
oxc_lexer::pipeline::misc::pre::misc_pre_impl (cognitive 60) crates/oxc_lexer/src/pipeline/misc/pre.rs:36— oxc_lexer::pipeline::misc::pre::misc_pre_impl has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (53 pts), boolean chains 4, loops 2 (3 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.
oxc_lexer::pipeline::disambiguate::type_context::bytes::resolve_lists (cognitive 58) crates/oxc_lexer/src/pipeline/disambiguate/type_context/bytes.rs:166— oxc_lexer::pipeline::disambiguate::type_context::bytes::resolve_lists has cognitive complexity 58 (threshold 15). Drivers by points: if/else 12 (44 pts), match/switch 2 (6 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 37). 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.
oxc_lexer::comment_meta::classify (cognitive 46) crates/oxc_lexer/src/comment_meta.rs:75— oxc_lexer::comment_meta::classify has cognitive complexity 46 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 7, match/switch 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_lexer::pipeline::coalesce::glue_number (cognitive 44) crates/oxc_lexer/src/pipeline/coalesce/mod.rs:236— oxc_lexer::pipeline::coalesce::glue_number has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (40 pts), boolean chains 3, loops 1 (nesting depth added 26). 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.
oxc_lexer::pipeline::scan::common::scan_number (cognitive 44) crates/oxc_lexer/src/pipeline/scan/common.rs:171— oxc_lexer::pipeline::scan::common::scan_number has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 3 (7 pts), boolean chains 6 (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.
oxc_lexer::pipeline::scan::common::scan_regex (cognitive 39) crates/oxc_lexer/src/pipeline/scan/common.rs:41— oxc_lexer::pipeline::scan::common::scan_regex has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 7, 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.
oxc_lexer::pipeline::disambiguate::context::anchor::anchor_of (cognitive 37) crates/oxc_lexer/src/pipeline/disambiguate/context/anchor.rs:88— oxc_lexer::pipeline::disambiguate::context::anchor::anchor_of has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 13, match/switch 5 (9 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.
oxc_lexer::pipeline::carve::js::carve_js (cognitive 36) crates/oxc_lexer/src/pipeline/carve/js.rs:13— oxc_lexer::pipeline::carve::js::carve_js has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
oxc_lexer::pipeline::disambiguate::type_context::bytes::raw_template_end (cognitive 36) crates/oxc_lexer/src/pipeline/disambiguate/type_context/bytes.rs:361— oxc_lexer::pipeline::disambiguate::type_context::bytes::raw_template_end has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (21 pts), match/switch 4 (14 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_lexer::pipeline::disambiguate::type_context::runs::run_shortcut (cognitive 35) crates/oxc_lexer/src/pipeline/disambiguate/type_context/runs.rs:43— oxc_lexer::pipeline::disambiguate::type_context::runs::run_shortcut has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (29 pts), match/switch 1 (3 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.
oxc_lexer::pipeline::scan::avx2::scan_line_comment (cognitive 32) crates/oxc_lexer/src/pipeline/scan/avx2.rs:55— oxc_lexer::pipeline::scan::avx2::scan_line_comment has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 7, loops 3 (4 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.
oxc_lexer::pipeline::scan::generic::scan_line_comment (cognitive 32) crates/oxc_lexer/src/pipeline/scan/generic.rs:53— oxc_lexer::pipeline::scan::generic::scan_line_comment has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 7, loops 3 (4 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.
oxc_lexer::pipeline::scan::avx2::scan_block_comment (cognitive 31) crates/oxc_lexer/src/pipeline/scan/avx2.rs:7— oxc_lexer::pipeline::scan::avx2::scan_block_comment has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 4, 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.
oxc_lexer::lanes::parse_number (cognitive 30) crates/oxc_lexer/src/lanes.rs:697— oxc_lexer::lanes::parse_number has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 5, match/switch 2 (5 pts), loops 3 (4 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.
oxc_lexer::pipeline::carve::jsx::angle_brackets::ts_angle_verdict (cognitive 29) crates/oxc_lexer/src/pipeline/carve/jsx/angle_brackets.rs:75— oxc_lexer::pipeline::carve::jsx::angle_brackets::ts_angle_verdict has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 8, 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.
oxc_lexer::pipeline::disambiguate::common::walk::delim_memo_opener (cognitive 28) crates/oxc_lexer/src/pipeline/disambiguate/common/walk.rs:132— oxc_lexer::pipeline::disambiguate::common::walk::delim_memo_opener has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 2 (6 pts), loops 2 (5 pts) (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.
oxc_lexer::pipeline::scan::common::scan_ident_esc (cognitive 28) crates/oxc_lexer/src/pipeline/scan/common.rs:140— oxc_lexer::pipeline::scan::common::scan_ident_esc has cognitive complexity 28 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 4 (10 pts), boolean chains 6 (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.
oxc_lexer::pipeline::carve::common::html_close_at_line_start (cognitive 27) crates/oxc_lexer/src/pipeline/carve/common.rs:344— oxc_lexer::pipeline::carve::common::html_close_at_line_start has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (17 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (2 pts) (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.
oxc_lexer::pipeline::scan::generic::scan_block_comment (cognitive 25) crates/oxc_lexer/src/pipeline/scan/generic.rs:5— oxc_lexer::pipeline::scan::generic::scan_block_comment has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 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.
Duplicated block (10 lines × 2) apps/oxlint/src/js_plugins/parse.rs:185— apps/oxlint/src/js_plugins/parse.rs:185-194 | napi/parser/src/raw_transfer.rs:255-264 — before extracting anything, compare `apps/oxlint/src/js_plugins/parse.rs` and `napi/parser/src/raw_transfer.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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.
Duplicated block (10 lines × 2) apps/oxlint/src/js_plugins/parse.rs:226— apps/oxlint/src/js_plugins/parse.rs:226-235 | crates/oxc_linter/src/lib.rs:738-747 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (10 lines × 2) crates/oxc_codegen/src/gen.rs:2155— crates/oxc_codegen/src/gen.rs:2155-2164 | crates/oxc_codegen/src/gen.rs:3193-3202 — 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 (10 lines × 2) crates/oxc_diagnostics/src/handlers/graphical/label.rs:113— crates/oxc_diagnostics/src/handlers/graphical/label.rs:113-122 | crates/oxc_diagnostics/src/handlers/graphical/label.rs:129-138 — 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 (10 lines × 2) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:609— crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:609-618 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:631-641 — 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 (10 lines × 2) crates/oxc_ecmascript/src/constant_evaluation/equality_comparison.rs:25— crates/oxc_ecmascript/src/constant_evaluation/equality_comparison.rs:25-34 | crates/oxc_ecmascript/src/constant_evaluation/equality_comparison.rs:41-50 — 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 (10 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/imports.rs:172— crates/oxc_formatter/src/formatter/jsdoc/imports.rs:172-181 | crates/oxc_formatter/src/formatter/jsdoc/imports.rs:187-196 — 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 (10 lines × 2) REDACTED:583— REDACTED:583-592 | REDACTED:642-651 — 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 (10 lines × 2) crates/oxc_linter/src/ast_util.rs:856— crates/oxc_linter/src/ast_util.rs:856-865 | crates/oxc_linter/src/ast_util.rs:867-876 — 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 (10 lines × 2) crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs:326— crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs:326-335 | crates/oxc_linter/src/rules/jsx_a11y/alt_text.rs:347-356 — 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 (10 lines × 2) crates/oxc_linter/src/rules/jsx_a11y/label_has_associated_control.rs:160— crates/oxc_linter/src/rules/jsx_a11y/label_has_associated_control.rs:160-169 | crates/oxc_linter/src/rules/jsx_a11y/label_has_associated_control.rs:171-180 — 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 (10 lines × 2) crates/oxc_linter/src/rules/nextjs/no_before_interactive_script_outside_document.rs:105— crates/oxc_linter/src/rules/nextjs/no_before_interactive_script_outside_document.rs:105-115 | crates/oxc_linter/src/rules/nextjs/no_unwanted_polyfillio.rs:92-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.
Duplicated block (10 lines × 2) crates/oxc_linter/src/rules/shared/jest_vitest/consistent_test_it.rs:149— crates/oxc_linter/src/rules/shared/jest_vitest/consistent_test_it.rs:149-158 | crates/oxc_linter/src/rules/shared/jest_vitest/no_duplicate_hooks.rs:118-127 — 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 (10 lines × 2) crates/oxc_linter/src/rules/shared/jest_vitest/prefer_comparison_matcher.rs:159— crates/oxc_linter/src/rules/shared/jest_vitest/prefer_comparison_matcher.rs:159-168 | crates/oxc_linter/src/rules/shared/jest_vitest/prefer_equality_matcher.rs:139-148 — 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 (10 lines × 2) crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs:89— crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs:89-98 | crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs:108-117 — 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 (10 lines × 2) crates/oxc_linter/src/rules/typescript/no_restricted_types.rs:364— crates/oxc_linter/src/rules/typescript/no_restricted_types.rs:364-373 | crates/oxc_linter/src/rules/typescript/no_restricted_types.rs:379-388 — 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 (10 lines × 2) crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:350— crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:350-359 | crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:377-386 — 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 (10 lines × 2) crates/oxc_linter/src/rules/unicorn/prefer_ternary.rs:195— crates/oxc_linter/src/rules/unicorn/prefer_ternary.rs:195-204 | crates/oxc_linter/src/rules/unicorn/prefer_ternary.rs:209-218 — 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 (10 lines × 2) crates/oxc_linter/src/service/runtime.rs:613— crates/oxc_linter/src/service/runtime.rs:613-622 | crates/oxc_linter/src/service/runtime.rs:847-856 — 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 (10 lines × 2) crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:243— crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:243-252 | crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs:204-213 — `crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs` and `crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (10 lines × 2) crates/oxc_semantic/src/builder.rs:1149— crates/oxc_semantic/src/builder.rs:1149-1158 | crates/oxc_semantic/src/builder.rs:1448-1457 — 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 (10 lines × 2) crates/oxc_semantic/src/builder.rs:1618— crates/oxc_semantic/src/builder.rs:1618-1627 | crates/oxc_semantic/src/builder.rs:2020-2029 — 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 (10 lines × 2) crates/oxc_semantic/src/builder.rs:2149— crates/oxc_semantic/src/builder.rs:2149-2158 | crates/oxc_semantic/src/builder.rs:2520-2529 — 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 (10 lines × 2) crates/oxc_transformer/src/es2017/async_to_generator.rs:347— crates/oxc_transformer/src/es2017/async_to_generator.rs:347-356 | crates/oxc_transformer/src/es2017/async_to_generator.rs:549-558 — 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 (10 lines × 2) tasks/ast_tools/src/generators/raw_transfer.rs:683— tasks/ast_tools/src/generators/raw_transfer.rs:683-692 | tasks/ast_tools/src/generators/typescript.rs:228-237 — 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.
oxc_formatter_css::print::value::base_separator (cognitive 89) crates/oxc_formatter_css/src/print/value.rs:1351— oxc_formatter_css::print::value::base_separator has cognitive complexity 89 (threshold 15). Drivers by points: if/else 34 (49 pts), boolean chains 40 (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.
oxc_formatter_css::print::statement::write_declaration (cognitive 85) crates/oxc_formatter_css/src/print/statement.rs:339— oxc_formatter_css::print::statement::write_declaration has cognitive complexity 85 (threshold 15). Drivers by points: if/else 33 (57 pts), boolean chains 15, loops 3 (10 pts), match/switch 1 (3 pts) (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.
oxc_formatter_css::print::value::adjust_numbers_and_strings (cognitive 79) crates/oxc_formatter_css/src/print/value.rs:150— oxc_formatter_css::print::value::adjust_numbers_and_strings has cognitive complexity 79 (threshold 15). Drivers by points: if/else 25 (48 pts), boolean chains 18, loops 7 (13 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_formatter_css::print::scss::write_sass_map (cognitive 63) crates/oxc_formatter_css/src/print/scss.rs:201— oxc_formatter_css::print::scss::write_sass_map has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (48 pts), loops 5 (8 pts), boolean chains 7 (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.
oxc_formatter_css::print::value::write_value_groups (cognitive 60) crates/oxc_formatter_css/src/print/value.rs:755— oxc_formatter_css::print::value::write_value_groups has cognitive complexity 60 (threshold 15). Drivers by points: if/else 19 (44 pts), loops 4 (12 pts), boolean chains 4 (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.
oxc_formatter_css::print::value::write_comma_group (cognitive 60) crates/oxc_formatter_css/src/print/value.rs:1085— oxc_formatter_css::print::value::write_comma_group has cognitive complexity 60 (threshold 15). Drivers by points: if/else 18 (40 pts), loops 5 (10 pts), boolean chains 8, match/switch 1 (2 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.
oxc_formatter_css::print::value::write_component_value (cognitive 55) crates/oxc_formatter_css/src/print/value.rs:1602— oxc_formatter_css::print::value::write_component_value has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (36 pts), match/switch 4 (7 pts), boolean chains 6, loops 2 (6 pts) (nesting depth added 27). 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.
oxc_formatter_css::print::value::write_sass_binary (cognitive 54) crates/oxc_formatter_css/src/print/value.rs:1881— oxc_formatter_css::print::value::write_sass_binary has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (37 pts), boolean chains 12, loops 3 (5 pts) (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.
oxc_formatter_css::print::at_rule::write_import_path_list (cognitive 48) crates/oxc_formatter_css/src/print/at_rule.rs:906— oxc_formatter_css::print::at_rule::write_import_path_list has cognitive complexity 48 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 6 (13 pts), boolean chains 4 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_formatter_css::print::at_rule::write_commented_value_params (cognitive 41) crates/oxc_formatter_css/src/print/at_rule.rs:417— oxc_formatter_css::print::at_rule::write_commented_value_params has cognitive complexity 41 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 5, loops 4 (5 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.
oxc_formatter_css::print::at_rule::write_at_rule (cognitive 40) crates/oxc_formatter_css/src/print/at_rule.rs:43— oxc_formatter_css::print::at_rule::write_at_rule has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (27 pts), boolean chains 9, loops 1 (2 pts), match/switch 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.
oxc_formatter_css::print::at_rule::write_token_comma_group_after (cognitive 38) crates/oxc_formatter_css/src/print/at_rule.rs:1126— oxc_formatter_css::print::at_rule::write_token_comma_group_after has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (10 pts), boolean chains 5 (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.
oxc_formatter_css::print::value::write_function (cognitive 37) crates/oxc_formatter_css/src/print/value.rs:2280— oxc_formatter_css::print::value::write_function has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 4 (8 pts), boolean chains 6 (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.
oxc_formatter_css::print::statement::write_custom_property_block (cognitive 36) crates/oxc_formatter_css/src/print/statement.rs:579— oxc_formatter_css::print::statement::write_custom_property_block has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 3 (4 pts), boolean chains 2, match/switch 1 (2 pts) (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.
oxc_formatter_css::print::at_rule::write_token_run (cognitive 32) crates/oxc_formatter_css/src/print/at_rule.rs:1275— oxc_formatter_css::print::at_rule::write_token_run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 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.
oxc_formatter_css::print::selector::write_selector_list (cognitive 31) crates/oxc_formatter_css/src/print/selector.rs:53— oxc_formatter_css::print::selector::write_selector_list has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (6 pts), match/switch 1 (3 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.
oxc_formatter_css::print::at_rule::tokenize (cognitive 30) crates/oxc_formatter_css/src/print/at_rule.rs:539— oxc_formatter_css::print::at_rule::tokenize has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (25 pts), boolean chains 2, match/switch 1 (2 pts), loops 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.
oxc_formatter_css::print::at_rule::write_token_value (cognitive 30) crates/oxc_formatter_css/src/print/at_rule.rs:1029— oxc_formatter_css::print::at_rule::write_token_value has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 3 (5 pts), boolean chains 4 (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.
oxc_formatter_css::print::selector::normalize_an_plus_b (cognitive 29) crates/oxc_formatter_css/src/print/selector.rs:548— oxc_formatter_css::print::selector::normalize_an_plus_b has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (10 pts), boolean chains 4 (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.
oxc_formatter_css::print::at_rule::write_at_rule_prelude (cognitive 25) crates/oxc_formatter_css/src/print/at_rule.rs:738— oxc_formatter_css::print::at_rule::write_at_rule_prelude has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 5 (9 pts), loops 2 (4 pts) (nesting depth added 13). 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.
oxc_formatter_css::print::statement::write_statement_sequence_bounded (cognitive 25) crates/oxc_formatter_css/src/print/statement.rs:89— oxc_formatter_css::print::statement::write_statement_sequence_bounded has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, 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.
oxc_formatter_css::print::value::write_less_binary_operation (cognitive 24) crates/oxc_formatter_css/src/print/value.rs:2124— oxc_formatter_css::print::value::write_less_binary_operation has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 6 (7 pts), boolean chains 6, loops 3 (4 pts) (nesting depth added 4). Of this number, 12 points are the body's own statements and 12 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.
oxc_formatter_css::print::value::normalize_quoted_numbers (cognitive 20) crates/oxc_formatter_css/src/print/value.rs:331— oxc_formatter_css::print::value::normalize_quoted_numbers has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (15 pts), boolean chains 4, loops 1 (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.
oxc_formatter_css::print::value::write_url (cognitive 19) crates/oxc_formatter_css/src/print/value.rs:2455— oxc_formatter_css::print::value::write_url has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 8). 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.
oxc_formatter_css::print::at_rule::write_structured_paren (cognitive 18) crates/oxc_formatter_css/src/print/at_rule.rs:607— oxc_formatter_css::print::at_rule::write_structured_paren has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 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.
Duplicated block (8 lines × 2) apps/oxlint/src/lsp/code_actions.rs:112— apps/oxlint/src/lsp/code_actions.rs:112-119 | apps/oxlint/src/lsp/code_actions.rs:137-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/oxc_allocator/src/allocator.rs:379— crates/oxc_allocator/src/allocator.rs:379-386 | crates/oxc_allocator/src/string_builder.rs:182-189 — before extracting anything, compare `crates/oxc_allocator/src/allocator.rs` and `crates/oxc_allocator/src/string_builder.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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.
Duplicated block (8 lines × 2) crates/oxc_codegen/src/gen.rs:1069— crates/oxc_codegen/src/gen.rs:1069-1078 | crates/oxc_codegen/src/gen.rs:1266-1273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/oxc_diagnostics/src/handlers/graphical/label.rs:202— crates/oxc_diagnostics/src/handlers/graphical/label.rs:202-209 | crates/oxc_diagnostics/src/handlers/graphical/label.rs:272-279 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:218— crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:218-225 | crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:321-328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/oxc_language_server/src/backend.rs:392— crates/oxc_language_server/src/backend.rs:392-399 | crates/oxc_language_server/src/backend.rs:457-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/oxc_lexer/src/lanes.rs:940— crates/oxc_lexer/src/lanes.rs:940-947 | crates/oxc_lexer/src/lanes.rs:1061-1068 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/oxc_lexer/src/pipeline/scan/avx2.rs:65— crates/oxc_lexer/src/pipeline/scan/avx2.rs:65-72 | crates/oxc_lexer/src/pipeline/scan/generic.rs:62-69 — before extracting anything, compare `crates/oxc_lexer/src/pipeline/scan/avx2.rs` and `crates/oxc_lexer/src/pipeline/scan/generic.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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.
Duplicated block (8 lines × 2) crates/oxc_linter/src/rules/eslint/no_magic_numbers.rs:436— crates/oxc_linter/src/rules/eslint/no_magic_numbers.rs:436-443 | crates/oxc_linter/src/rules/eslint/no_magic_numbers.rs:453-460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:128— crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:128-135 | crates/oxc_linter/src/rules/jsdoc/require_param_type.rs:126-133 — before extracting anything, compare `crates/oxc_linter/src/rules/jsdoc/require_param_description.rs` and `crates/oxc_linter/src/rules/jsdoc/require_param_type.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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.
Duplicated block (8 lines × 2) crates/oxc_linter/src/rules/jsx_a11y/control_has_associated_label.rs:244— crates/oxc_linter/src/rules/jsx_a11y/control_has_associated_label.rs:244-251 | crates/oxc_linter/src/rules/jsx_a11y/label_has_associated_control.rs:347-354 — 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) crates/oxc_linter/src/rules/react/no_is_mounted.rs:56— crates/oxc_linter/src/rules/react/no_is_mounted.rs:56-63 | crates/oxc_linter/src/rules/react/no_set_state.rs:61-69 — 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) crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:97— crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:97-104 | crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs:89-96 — before extracting anything, compare `crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs` and `crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 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.
Duplicated block (8 lines × 2) crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:145— crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:145-152 | crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs:137-144 — before extracting anything, compare `crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs` and `crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 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.
Duplicated block (8 lines × 2) crates/oxc_linter/src/rules/vue/no_arrow_functions_in_watch.rs:117— crates/oxc_linter/src/rules/vue/no_arrow_functions_in_watch.rs:117-124 | crates/oxc_linter/src/rules/vue/no_required_prop_with_default.rs:118-125 — 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) crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs:218— crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs:218-225 | crates/oxc_linter/src/rules/vue/no_watch_after_await.rs:213-220 — before extracting anything, compare `crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs` and `crates/oxc_linter/src/rules/vue/no_watch_after_await.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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.
Duplicated block (8 lines × 2) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1915— crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1915-1922 | crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1951-1959 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/oxc_minifier/src/traverse_context/ancestry.rs:117— crates/oxc_minifier/src/traverse_context/ancestry.rs:117-124 | crates/oxc_traverse/src/context/ancestry.rs:117-124 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/ancestry.rs` and `crates/oxc_traverse/src/context/ancestry.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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.
Duplicated block (8 lines × 2) tasks/ast_tools/src/generators/traverse/ancestor.rs:180— tasks/ast_tools/src/generators/traverse/ancestor.rs:180-187 | tasks/ast_tools/src/generators/traverse/ancestor.rs:193-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) tasks/ast_tools/src/generators/traverse/walk.rs:147— tasks/ast_tools/src/generators/traverse/walk.rs:147-154 | tasks/ast_tools/src/generators/traverse/walk.rs:527-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) tasks/ast_tools/src/generators/traverse/walk.rs:351— tasks/ast_tools/src/generators/traverse/walk.rs:351-359 | tasks/ast_tools/src/generators/traverse/walk.rs:474-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) tasks/rulegen/src/main.rs:1754— tasks/rulegen/src/main.rs:1754-1761 | tasks/rulegen/src/template.rs:59-66 — 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) crates/oxc_linter/src/rules/jest/max_expects.rs:22— crates/oxc_linter/src/rules/jest/max_expects.rs:22-29 | crates/oxc_linter/src/rules/vitest/max_expects.rs:22-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (8 lines × 2) crates/oxc_linter/src/rules/jest/max_nested_describe.rs:22— crates/oxc_linter/src/rules/jest/max_nested_describe.rs:22-29 | crates/oxc_linter/src/rules/vitest/max_nested_describe.rs:22-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (8 lines × 2) crates/oxc_linter/src/rules/jest/prefer_snapshot_hint.rs:22— crates/oxc_linter/src/rules/jest/prefer_snapshot_hint.rs:22-29 | crates/oxc_linter/src/rules/vitest/prefer_snapshot_hint.rs:22-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
PeepholeOptimizations::substitute_single_use_symbol_in_expression (cyclomatic 101) crates/oxc_minifier/src/peephole/minimize_statements.rs:1644— PeepholeOptimizations::substitute_single_use_symbol_in_expression has cyclomatic complexity 101 (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.
PeepholeOptimizations::try_rewrite_arguments_copy_loop (cyclomatic 85) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:665— PeepholeOptimizations::try_rewrite_arguments_copy_loop has cyclomatic complexity 85 (threshold 15). Of this number, 77 points are the body's own statements and 8 belong 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.
PeepholeOptimizations::minimize_conditional_expression (cyclomatic 72) crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs:49— PeepholeOptimizations::minimize_conditional_expression 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.
PeepholeOptimizations::exit_expression (cyclomatic 36) crates/oxc_minifier/src/peephole/mod.rs:529— PeepholeOptimizations::exit_expression has cyclomatic complexity 36 (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.
PeepholeOptimizations::substitute_iife_call (cyclomatic 31) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1868— PeepholeOptimizations::substitute_iife_call 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.
PeepholeOptimizations::drop_unreachable_switch_cases (cyclomatic 28) crates/oxc_minifier/src/peephole/minimize_switch_statements.rs:13— PeepholeOptimizations::drop_unreachable_switch_cases 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.
PeepholeOptimizations::minimize_expression_in_boolean_context (cyclomatic 25) crates/oxc_minifier/src/peephole/minimize_expression_in_boolean_context.rs:13— PeepholeOptimizations::minimize_expression_in_boolean_context 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.
PeepholeOptimizations::exit_statement (cyclomatic 25) crates/oxc_minifier/src/peephole/mod.rs:414— PeepholeOptimizations::exit_statement 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.
PeepholeOptimizations::substitute_object_or_array_constructor (cyclomatic 25) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1190— PeepholeOptimizations::substitute_object_or_array_constructor 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.
PeepholeOptimizations::try_minimize_if (cyclomatic 24) crates/oxc_minifier/src/peephole/minimize_if_statement.rs:13— PeepholeOptimizations::try_minimize_if 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.
PeepholeOptimizations::handle_for_statement (cyclomatic 23) crates/oxc_minifier/src/peephole/minimize_statements.rs:1178— PeepholeOptimizations::handle_for_statement 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.
PeepholeOptimizations::try_fold_if (cyclomatic 23) crates/oxc_minifier/src/peephole/remove_dead_code.rs:59— PeepholeOptimizations::try_fold_if 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.
PeepholeOptimizations::remove_unused_logical_expr (cyclomatic 23) crates/oxc_minifier/src/peephole/remove_unused_expression.rs:123— PeepholeOptimizations::remove_unused_logical_expr 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.
PeepholeOptimizations::fold_binary_expr (cyclomatic 22) crates/oxc_minifier/src/peephole/fold_constants.rs:307— PeepholeOptimizations::fold_binary_expr has cyclomatic complexity 22 (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.
PeepholeOptimizations::merge_import_export (cyclomatic 22) crates/oxc_minifier/src/peephole/minimize_statements.rs:368— PeepholeOptimizations::merge_import_export 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.
PeepholeOptimizations::replace_known_property_access (cyclomatic 22) crates/oxc_minifier/src/peephole/replace_known_methods.rs:371— PeepholeOptimizations::replace_known_property_access 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.
PeepholeOptimizations::handle_return_statement (cyclomatic 21) crates/oxc_minifier/src/peephole/minimize_statements.rs:1014— PeepholeOptimizations::handle_return_statement 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.
PeepholeOptimizations::try_fold_concat (cyclomatic 21) crates/oxc_minifier/src/peephole/replace_known_methods.rs:202— PeepholeOptimizations::try_fold_concat 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.
PeepholeOptimizations::fold_object_exp (cyclomatic 20) crates/oxc_minifier/src/peephole/fold_constants.rs:881— PeepholeOptimizations::fold_object_exp has cyclomatic complexity 20 (threshold 15). Of this number, 14 points are the body's own statements and 6 belong to one function item inside it that branches. 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.
PeepholeOptimizations::inject_optional_chaining_if_matched_inner (cyclomatic 20) crates/oxc_minifier/src/peephole/minimize_conditional_expression.rs:715— PeepholeOptimizations::inject_optional_chaining_if_matched_inner 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.
PeepholeOptimizations::minimize_for_statement (cyclomatic 20) crates/oxc_minifier/src/peephole/minimize_for_statement.rs:11— PeepholeOptimizations::minimize_for_statement 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.
PeepholeOptimizations::try_compress_is_object_and_not_null_for_left_and_right (cyclomatic 20) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:489— PeepholeOptimizations::try_compress_is_object_and_not_null_for_left_and_right 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.
PeepholeOptimizations::substitute_simple_function_call (cyclomatic 19) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1088— PeepholeOptimizations::substitute_simple_function_call has cyclomatic complexity 19 (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.
PeepholeOptimizations::minimize_binary (cyclomatic 18) crates/oxc_minifier/src/peephole/minimize_conditions.rs:68— PeepholeOptimizations::minimize_binary 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.
PeepholeOptimizations::classify_class_removability (cyclomatic 18) crates/oxc_minifier/src/peephole/remove_unused_expression.rs:1088— PeepholeOptimizations::classify_class_removability 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.
ParserImpl::parse_import_declaration (cognitive 74) crates/oxc_parser/src/js/module.rs:73— ParserImpl::parse_import_declaration has cognitive complexity 74 (threshold 15). Drivers by points: if/else 35 (64 pts), boolean chains 7, match/switch 1 (3 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.
ParserImpl::parse_binary_expression_rest (cognitive 56) crates/oxc_parser/src/js/expression.rs:1322— ParserImpl::parse_binary_expression_rest has cognitive complexity 56 (threshold 15). Drivers by points: if/else 19 (47 pts), boolean chains 4, match/switch 1 (4 pts), loops 1 (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.
ParserImpl::is_parenthesized_arrow_function_expression_worker (cognitive 49) crates/oxc_parser/src/js/arrow.rs:77— ParserImpl::is_parenthesized_arrow_function_expression_worker has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (29 pts), match/switch 6 (15 pts), boolean chains 5 (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.
ParserImpl::parse_export_default_declaration_kind (cognitive 41) crates/oxc_parser/src/js/module.rs:713— ParserImpl::parse_export_default_declaration_kind has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 4 (12 pts), boolean chains 2 (nesting depth added 23). 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.
ParserImpl::parse_formal_parameters_list_into (cognitive 40) crates/oxc_parser/src/js/function.rs:82— ParserImpl::parse_formal_parameters_list_into has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 2 (5 pts), boolean chains 4 (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.
ParserImpl::parse_directives_and_statements (cognitive 35) crates/oxc_parser/src/js/statement.rs:33— ParserImpl::parse_directives_and_statements has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 7, match/switch 1 (3 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.
ParserImpl::parse_import_or_export_specifier (cognitive 31) crates/oxc_parser/src/js/module.rs:868— ParserImpl::parse_import_or_export_specifier has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 5, match/switch 2 (3 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.
ParserImpl::parse_call_expression_rest (cognitive 27) crates/oxc_parser/src/js/expression.rs:1091— ParserImpl::parse_call_expression_rest has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 2, loops 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.
ParserImpl::parse_for_statement (cognitive 27) crates/oxc_parser/src/js/statement.rs:353— ParserImpl::parse_for_statement has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 5, match/switch 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.
ParserImpl::parse_delimited_list_with_rest_into (cognitive 26) crates/oxc_parser/src/cursor.rs:568— ParserImpl::parse_delimited_list_with_rest_into has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (23 pts), boolean chains 2, 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.
ParserImpl::parse_property_declaration (cognitive 25) crates/oxc_parser/src/js/class.rs:746— ParserImpl::parse_property_declaration has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 6 (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.
ParserImpl::reparse_potential_top_level_awaits (cognitive 24) crates/oxc_parser/src/lib.rs:870— ParserImpl::reparse_potential_top_level_awaits has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (7 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.
ParserImpl::parse_formal_parameter_with_decorators (cognitive 23) crates/oxc_parser/src/js/function.rs:177— ParserImpl::parse_formal_parameter_with_decorators has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, loops 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.
ParserImpl::parse_function (cognitive 23) crates/oxc_parser/src/js/function.rs:269— ParserImpl::parse_function has cognitive complexity 23 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5, match/switch 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.
ParserImpl::parse_import_declaration_specifiers (cognitive 23) crates/oxc_parser/src/js/module.rs:277— ParserImpl::parse_import_declaration_specifiers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, match/switch 1 (3 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.
ParserImpl::parse_export_declaration (cognitive 23) crates/oxc_parser/src/js/module.rs:472— ParserImpl::parse_export_declaration has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 1 (3 pts), match/switch 2 (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.
ParserImpl::check_method_definition (cognitive 21) crates/oxc_parser/src/js/class.rs:889— ParserImpl::check_method_definition has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 5 (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.
ParserImpl::parse_member_expression_rest (cognitive 21) crates/oxc_parser/src/js/expression.rs:859— ParserImpl::parse_member_expression_rest has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, match/switch 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.
ParserImpl::parse_heritage_clause (cognitive 20) crates/oxc_parser/src/js/class.rs:133— ParserImpl::parse_heritage_clause has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 1 (2 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.
ParserImpl::parse_using_declaration (cognitive 20) crates/oxc_parser/src/js/declaration.rs:179— ParserImpl::parse_using_declaration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (19 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.
ParserImpl::parse_class_element_impl (cognitive 19) crates/oxc_parser/src/js/class.rs:259— ParserImpl::parse_class_element_impl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (12 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 3). Of this number, 18 points are the body's own statements and 1 belongs 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.
ParserImpl::parse_export_named_specifiers (cognitive 19) crates/oxc_parser/src/js/module.rs:593— ParserImpl::parse_export_named_specifiers has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (3 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.
ParserImpl::parse_jsx_children_and_closing_into (cognitive 18) crates/oxc_parser/src/jsx/mod.rs:261— ParserImpl::parse_jsx_children_and_closing_into has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 pts), boolean chains 1, 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.
ParserImpl::parse_ts_interface_extends_clause (cognitive 18) crates/oxc_parser/src/ts/statement.rs:275— ParserImpl::parse_ts_interface_extends_clause has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 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.
ParserImpl::parse_non_array_type (cognitive 18) crates/oxc_parser/src/ts/types.rs:412— ParserImpl::parse_non_array_type has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 5). 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.
oxc_formatter::formatter::jsdoc::param_order::find_function_params_start (cyclomatic 61) crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:102— oxc_formatter::formatter::jsdoc::param_order::find_function_params_start has cyclomatic complexity 61 (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.
oxc_formatter::formatter::jsdoc::mdast_serialize::detect::needs_mdast_parsing (cyclomatic 48) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/detect.rs:14— oxc_formatter::formatter::jsdoc::mdast_serialize::detect::needs_mdast_parsing 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.
oxc_formatter::ir_transform::sort_imports::transform (cyclomatic 40) crates/oxc_formatter/src/ir_transform/sort_imports/mod.rs:61— oxc_formatter::ir_transform::sort_imports::transform 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.
oxc_formatter::formatter::jsdoc::serialize::format_default_value (cyclomatic 39) crates/oxc_formatter/src/formatter/jsdoc/serialize.rs:810— oxc_formatter::formatter::jsdoc::serialize::format_default_value has cyclomatic complexity 39 (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 is NOT this file's highest cyclomatic complexity: oxc_formatter::formatter::jsdoc::serialize::tag_sort_priority (cyclomatic 48) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
oxc_formatter::formatter::jsdoc::mdast_serialize::collect::collect_inline_impl (cyclomatic 37) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/collect.rs:27— oxc_formatter::formatter::jsdoc::mdast_serialize::collect::collect_inline_impl has cyclomatic complexity 37 (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.
oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_children (cyclomatic 33) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:19— oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_children has cyclomatic complexity 33 (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.
oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_paragraph (cyclomatic 31) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:286— oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_paragraph 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.
oxc_formatter::formatter::jsdoc::normalize::normalize_markdown_emphasis (cyclomatic 26) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:41— oxc_formatter::formatter::jsdoc::normalize::normalize_markdown_emphasis 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.
oxc_formatter::formatter::jsdoc::normalize::normalize_type_whitespace (cyclomatic 26) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:1140— oxc_formatter::formatter::jsdoc::normalize::normalize_type_whitespace 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.
oxc_formatter::print::template::embed::graphql::format_graphql_doc (cyclomatic 26) crates/oxc_formatter/src/print/template/embed/graphql.rs:23— oxc_formatter::print::template::embed::graphql::format_graphql_doc 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.
oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_pipe_prefixed_paragraph (cyclomatic 25) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:435— oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_pipe_prefixed_paragraph 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.
oxc_formatter::print::call_like_expression::arguments::write_grouped_arguments (cyclomatic 24) crates/oxc_formatter/src/print/call_like_expression/arguments.rs:615— oxc_formatter::print::call_like_expression::arguments::write_grouped_arguments 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.
oxc_formatter::formatter::jsdoc::normalize::emphasis_needs_change (cyclomatic 23) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:149— oxc_formatter::formatter::jsdoc::normalize::emphasis_needs_change 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.
oxc_formatter::formatter::jsdoc::normalize::is_whitespace_normalized (cyclomatic 23) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:1087— oxc_formatter::formatter::jsdoc::normalize::is_whitespace_normalized 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.
oxc_formatter::utils::call_expression::contains_a_test_pattern (cyclomatic 23) crates/oxc_formatter/src/utils/call_expression.rs:195— oxc_formatter::utils::call_expression::contains_a_test_pattern has cyclomatic complexity 23 (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.
oxc_formatter::parentheses::expression::is_first_in_statement (cyclomatic 22) crates/oxc_formatter/src/parentheses/expression.rs:1120— oxc_formatter::parentheses::expression::is_first_in_statement 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. This is NOT this file's highest cyclomatic complexity: AstNode::needs_parentheses (cyclomatic 45) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
oxc_formatter::utils::assignment_like::is_poorly_breakable_member_or_call_chain (cyclomatic 21) crates/oxc_formatter/src/utils/assignment_like.rs:1077— oxc_formatter::utils::assignment_like::is_poorly_breakable_member_or_call_chain has cyclomatic complexity 21 (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.
oxc_formatter::formatter::jsdoc::param_order::parse_param_names (cyclomatic 20) crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:333— oxc_formatter::formatter::jsdoc::param_order::parse_param_names 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.
oxc_formatter::print::template::embed::html::format_html_doc (cyclomatic 20) crates/oxc_formatter/src/print/template/embed/html.rs:32— oxc_formatter::print::template::embed::html::format_html_doc 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.
oxc_formatter::utils::string::normalize_jsx_string (cyclomatic 20) crates/oxc_formatter/src/utils/string.rs:412— oxc_formatter::utils::string::normalize_jsx_string 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.
oxc_formatter::formatter::jsdoc::mdast_serialize::format_description_mdast (cyclomatic 19) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/mod.rs:30— oxc_formatter::formatter::jsdoc::mdast_serialize::format_description_mdast 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.
oxc_formatter::formatter::jsdoc::normalize::normalize_type_quotes (cyclomatic 19) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:895— oxc_formatter::formatter::jsdoc::normalize::normalize_type_quotes 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.
oxc_formatter::formatter::jsdoc::wrap::tokenize_words (cyclomatic 19) crates/oxc_formatter/src/formatter/jsdoc/wrap.rs:186— oxc_formatter::formatter::jsdoc::wrap::tokenize_words has cyclomatic complexity 19 (threshold 15). 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.
oxc_formatter::print::template::embed::css::format_css_doc (cyclomatic 18) crates/oxc_formatter/src/print/template/embed/css.rs:39— oxc_formatter::print::template::embed::css::format_css_doc 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.
oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_list (cyclomatic 17) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:549— oxc_formatter::formatter::jsdoc::mdast_serialize::nodes::serialize_list 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.
Duplicated block (11 lines × 2) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:172— crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:172-182 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:209-219 — 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 (11 lines × 2) crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:118— crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:118-128 | crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:253-263 — 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 (11 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:61— crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:61-71 | crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:84-96 — 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 (11 lines × 2) crates/oxc_formatter/src/parentheses/expression.rs:560— crates/oxc_formatter/src/parentheses/expression.rs:560-570 | crates/oxc_formatter/src/parentheses/expression.rs:797-807 — 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 (11 lines × 2) crates/oxc_formatter/src/print/template/embed/css.rs:62— crates/oxc_formatter/src/print/template/embed/css.rs:62-72 | crates/oxc_formatter/src/print/template/embed/html.rs:87-98 — 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 (11 lines × 2) crates/oxc_isolated_declarations/src/lib.rs:599— crates/oxc_isolated_declarations/src/lib.rs:599-611 | crates/oxc_isolated_declarations/src/lib.rs:639-649 — 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 (11 lines × 2) crates/oxc_lexer/src/pipeline/carve/common.rs:36— crates/oxc_lexer/src/pipeline/carve/common.rs:36-46 | crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:441-451 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (11 lines × 2) crates/oxc_lexer/src/pipeline/carve/js.rs:25— crates/oxc_lexer/src/pipeline/carve/js.rs:25-35 | crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:87-97 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (11 lines × 2) crates/oxc_lexer/src/pipeline/disambiguate/type_context/bytes.rs:173— crates/oxc_lexer/src/pipeline/disambiguate/type_context/bytes.rs:173-183 | crates/oxc_lexer/src/pipeline/disambiguate/type_context/bytes.rs:281-291 — 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 (11 lines × 2) crates/oxc_linter/src/rules/eslint/new_cap.rs:493— crates/oxc_linter/src/rules/eslint/new_cap.rs:493-503 | crates/oxc_linter/src/rules/eslint/new_cap.rs:522-532 — 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 (11 lines × 2) crates/oxc_linter/src/rules/eslint/new_cap.rs:505— crates/oxc_linter/src/rules/eslint/new_cap.rs:505-515 | crates/oxc_linter/src/rules/eslint/new_cap.rs:534-544 — 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 (11 lines × 2) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:756— crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:756-766 | crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:860-870 — 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 (11 lines × 2) crates/oxc_linter/src/rules/promise/no_callback_in_promise.rs:152— crates/oxc_linter/src/rules/promise/no_callback_in_promise.rs:152-162 | crates/oxc_linter/src/rules/promise/no_nesting.rs:75-85 — 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 (11 lines × 2) crates/oxc_linter/src/rules/shared/jest_vitest/padding_around_after_all_blocks.rs:40— crates/oxc_linter/src/rules/shared/jest_vitest/padding_around_after_all_blocks.rs:40-50 | crates/oxc_linter/src/rules/shared/jest_vitest/padding_around_test_blocks.rs:57-67 — 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 (11 lines × 2) crates/oxc_linter/src/utils/regex.rs:181— crates/oxc_linter/src/utils/regex.rs:181-191 | crates/oxc_linter/src/utils/regex.rs:201-211 — 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 (11 lines × 2) crates/oxc_minifier/src/peephole/normalize.rs:387— crates/oxc_minifier/src/peephole/normalize.rs:387-397 | crates/oxc_minifier/src/peephole/normalize.rs:407-417 — 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 (11 lines × 2) crates/oxc_minifier/src/traverse_context/scoping.rs:220— crates/oxc_minifier/src/traverse_context/scoping.rs:220-230 | crates/oxc_traverse/src/context/scoping.rs:220-230 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/scoping.rs` and `crates/oxc_traverse/src/context/scoping.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 94 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.
Duplicated block (11 lines × 2) crates/oxc_minifier/src/traverse_context/uid.rs:141— crates/oxc_minifier/src/traverse_context/uid.rs:141-151 | crates/oxc_traverse/src/context/uid.rs:141-151 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/uid.rs` and `crates/oxc_traverse/src/context/uid.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 146 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.
Duplicated block (11 lines × 2) crates/oxc_transformer/src/es2018/object_rest_spread.rs:159— crates/oxc_transformer/src/es2018/object_rest_spread.rs:159-169 | crates/oxc_transformer/src/es2018/object_rest_spread.rs:175-185 — 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 (11 lines × 2) crates/oxc_transformer/src/es2020/nullish_coalescing_operator.rs:147— crates/oxc_transformer/src/es2020/nullish_coalescing_operator.rs:147-157 | crates/oxc_transformer/src/typescript/enum.rs:187-197 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (11 lines × 2) napi/transform-react/src/options.rs:411— napi/transform-react/src/options.rs:411-421 | napi/transform/src/transformer.rs:633-643 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (11 lines × 2) tasks/ast_tools/src/generators/visit.rs:389— tasks/ast_tools/src/generators/visit.rs:389-399 | tasks/ast_tools/src/generators/visit_js.rs:425-435 — before extracting anything, compare `tasks/ast_tools/src/generators/visit.rs` and `tasks/ast_tools/src/generators/visit_js.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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.
Duplicated block (11 lines × 2) crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs:24— crates/oxc_linter/src/rules/jest/prefer_lowercase_title.rs:24-34 | crates/oxc_linter/src/rules/vitest/prefer_lowercase_title.rs:24-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (11 lines × 2) crates/oxc_linter/src/rules/jest/require_hook.rs:25— crates/oxc_linter/src/rules/jest/require_hook.rs:25-35 | crates/oxc_linter/src/rules/vitest/require_hook.rs:25-35 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (11 lines × 2) apps/oxlint/src/lint.rs:732— apps/oxlint/src/lint.rs:732-742 | crates/oxc_diagnostics/src/service.rs:249-259 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (5 lines × 2) crates/oxc_diagnostics/src/handlers/graphical/report.rs:65— crates/oxc_diagnostics/src/handlers/graphical/report.rs:65-69 | crates/oxc_diagnostics/src/handlers/graphical/report.rs:91-95 — 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 (5 lines × 2) crates/oxc_estree_tokens/src/visitor.rs:101— crates/oxc_estree_tokens/src/visitor.rs:101-105 | crates/oxc_estree_tokens/src/visitor.rs:109-113 — 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 (5 lines × 2) crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:250— crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:250-254 | crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:270-274 — 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 (5 lines × 2) crates/oxc_linter/src/rules/eslint/capitalized_comments.rs:364— crates/oxc_linter/src/rules/eslint/capitalized_comments.rs:364-368 | crates/oxc_linter/src/rules/eslint/no_inline_comments.rs:174-178 — 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 (5 lines × 2) crates/oxc_linter/src/rules/eslint/capitalized_comments.rs:370— crates/oxc_linter/src/rules/eslint/capitalized_comments.rs:370-374 | crates/oxc_linter/src/rules/eslint/no_inline_comments.rs:181-187 — 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 (5 lines × 2) crates/oxc_linter/src/rules/eslint/id_denylist.rs:146— crates/oxc_linter/src/rules/eslint/id_denylist.rs:146-150 | crates/oxc_linter/src/rules/eslint/id_match.rs:173-177 — 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 (5 lines × 2) crates/oxc_linter/src/rules/oxc/bad_match_all_arg.rs:62— crates/oxc_linter/src/rules/oxc/bad_match_all_arg.rs:62-66 | crates/oxc_linter/src/rules/oxc/bad_replace_all_arg.rs:59-63 — 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 (5 lines × 2) crates/oxc_linter/src/rules/unicorn/prefer_array_flat_map.rs:205— crates/oxc_linter/src/rules/unicorn/prefer_array_flat_map.rs:205-209 | crates/oxc_linter/src/rules/unicorn/prefer_set_size.rs:139-143 — 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 (5 lines × 2) napi/transform-react/src/lib.rs:65— napi/transform-react/src/lib.rs:65-69 | napi/transform-relay/src/lib.rs:58-62 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (5 lines × 2) tasks/ast_tools/src/generators/raw_transfer.rs:1361— tasks/ast_tools/src/generators/raw_transfer.rs:1361-1365 | tasks/ast_tools/src/generators/raw_transfer_lazy.rs:1217-1221 — 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 (5 lines × 2) tasks/ast_tools/src/generators/traverse/walk.rs:502— tasks/ast_tools/src/generators/traverse/walk.rs:502-506 | tasks/ast_tools/src/generators/traverse/walk.rs:513-517 — 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 (5 lines × 2) crates/oxc_linter/src/rules/shared/jest_vitest/prefer_expect_assertions.rs:664— crates/oxc_linter/src/rules/shared/jest_vitest/prefer_expect_assertions.rs:664-668 | crates/oxc_linter/src/rules/vitest/prefer_called_exactly_once_with.rs:439-443 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (5 lines × 2) crates/oxc_minifier/src/traverse_context/ancestry.rs:195— crates/oxc_minifier/src/traverse_context/ancestry.rs:195-199 | crates/oxc_traverse/src/context/ancestry.rs:195-199 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/ancestry.rs` and `crates/oxc_traverse/src/context/ancestry.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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.
Duplicated block (5 lines × 2) crates/oxc_minifier/src/traverse_context/scoping.rs:114— crates/oxc_minifier/src/traverse_context/scoping.rs:114-118 | crates/oxc_traverse/src/context/scoping.rs:114-118 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/scoping.rs` and `crates/oxc_traverse/src/context/scoping.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 94 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.
Duplicated block (5 lines × 2) crates/oxc_minifier/src/traverse_context/scoping.rs:131— crates/oxc_minifier/src/traverse_context/scoping.rs:131-135 | crates/oxc_traverse/src/context/scoping.rs:131-135 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/scoping.rs` and `crates/oxc_traverse/src/context/scoping.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 94 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.
Duplicated block (5 lines × 2) crates/oxc_minifier/src/traverse_context/scoping.rs:148— crates/oxc_minifier/src/traverse_context/scoping.rs:148-152 | crates/oxc_traverse/src/context/scoping.rs:148-152 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/scoping.rs` and `crates/oxc_traverse/src/context/scoping.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 94 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.
Duplicated block (5 lines × 2) tasks/ast_tools/src/schema/defs/enum.rs:192— tasks/ast_tools/src/schema/defs/enum.rs:192-196 | tasks/ast_tools/src/schema/defs/struct.rs:147-151 — 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 (5 lines × 2) crates/oxc_formatter_graphql/src/format.rs:68— crates/oxc_formatter_graphql/src/format.rs:68-72 | crates/oxc_formatter_yaml/src/format.rs:72-76 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (5 lines × 2) crates/oxc_linter/src/rules/eslint/no_continue.rs:59— crates/oxc_linter/src/rules/eslint/no_continue.rs:59-63 | crates/oxc_linter/src/rules/eslint/no_with.rs:48-52 — 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 (5 lines × 2) tasks/ast_tools/src/schema/defs/box.rs:65— tasks/ast_tools/src/schema/defs/box.rs:65-69 | tasks/ast_tools/src/schema/defs/vec.rs: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.
Duplicated block (5 lines × 2) tasks/ast_tools/src/generators/formatter/ast_nodes.rs:190— tasks/ast_tools/src/generators/formatter/ast_nodes.rs:190-196 | tasks/ast_tools/src/generators/formatter/format.rs:381-385 — 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 (5 lines × 2) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:180— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:180-184 | crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:232-237 — 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 (5 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:110— crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:110-114 | crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:215-220 — 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 (5 lines × 2) crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs:92— crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs:92-96 | crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs:97-101 — 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 (5 lines × 2) tasks/linter_codegen/src/member_expression_kinds.rs:15— tasks/linter_codegen/src/member_expression_kinds.rs:15-19 | tasks/linter_codegen/src/regex_node_kinds.rs:16-20 — 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 (6 lines × 2) crates/oxc_formatter/src/utils/assignment_like.rs:193— crates/oxc_formatter/src/utils/assignment_like.rs:193-198 | crates/oxc_formatter/src/utils/assignment_like.rs:223-228 — 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 (6 lines × 2) crates/oxc_formatter_css/src/print/less.rs:114— crates/oxc_formatter_css/src/print/less.rs:114-120 | crates/oxc_formatter_css/src/print/less.rs:143-148 — 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 (6 lines × 2) crates/oxc_isolated_declarations/src/enum.rs:239— crates/oxc_isolated_declarations/src/enum.rs:239-244 | crates/oxc_semantic/src/ts_enum/eval.rs:248-253 — before extracting anything, compare `crates/oxc_isolated_declarations/src/enum.rs` and `crates/oxc_semantic/src/ts_enum/eval.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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.
Duplicated block (6 lines × 2) crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:417— crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:417-422 | crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:592-597 — 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 (6 lines × 2) crates/oxc_lexer/src/pipeline/classify/generic.rs:120— crates/oxc_lexer/src/pipeline/classify/generic.rs:120-125 | crates/oxc_lexer/src/pipeline/classify/generic.rs:157-162 — 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 (6 lines × 2) crates/oxc_lexer/src/pipeline/compress/avx2/mod.rs:23— crates/oxc_lexer/src/pipeline/compress/avx2/mod.rs:23-28 | crates/oxc_lexer/src/pipeline/compress/avx2/mod.rs:41-46 — 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 (6 lines × 2) crates/oxc_linter/src/config/rules.rs:298— crates/oxc_linter/src/config/rules.rs:298-303 | crates/oxc_linter/src/config/rules.rs:329-334 — 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 (6 lines × 2) crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:512— crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:512-517 | crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:548-553 — 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 (6 lines × 2) crates/oxc_minifier/src/peephole/fold_constants.rs:410— crates/oxc_minifier/src/peephole/fold_constants.rs:410-415 | crates/oxc_minifier/src/peephole/fold_constants.rs:420-425 — 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 (6 lines × 2) crates/oxc_minifier/src/peephole/mod.rs:420— crates/oxc_minifier/src/peephole/mod.rs:420-425 | crates/oxc_minifier/src/peephole/mod.rs:460-465 — 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 (6 lines × 2) crates/oxc_regular_expression/src/parser/reader/reader_impl.rs:146— crates/oxc_regular_expression/src/parser/reader/reader_impl.rs:146-151 | crates/oxc_regular_expression/src/parser/reader/reader_impl.rs:160-165 — 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 (6 lines × 2) crates/oxc_transformer_plugins/src/module_runner_transform.rs:765— crates/oxc_transformer_plugins/src/module_runner_transform.rs:765-770 | crates/oxc_transformer_plugins/src/module_runner_transform.rs:890-895 — 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 (6 lines × 2) tasks/ast_tools/src/generators/raw_transfer.rs:1366— tasks/ast_tools/src/generators/raw_transfer.rs:1366-1371 | tasks/ast_tools/src/generators/raw_transfer_lazy.rs:1222-1227 — 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 (6 lines × 2) tasks/ast_tools/src/generators/visit.rs:441— tasks/ast_tools/src/generators/visit.rs:441-446 | tasks/ast_tools/src/generators/visit.rs:612-617 — 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 (6 lines × 2) tasks/ast_tools/src/generators/visit_js.rs:473— tasks/ast_tools/src/generators/visit_js.rs:473-478 | tasks/ast_tools/src/generators/visit_js.rs:649-654 — 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 (6 lines × 2) crates/oxc_linter/src/rules/eslint/id_match.rs:534— crates/oxc_linter/src/rules/eslint/id_match.rs:534-539 | crates/oxc_linter/src/rules/eslint/no_implied_eval.rs: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.
Duplicated block (6 lines × 2) crates/oxc_minifier/src/traverse_context/scoping.rs:305— crates/oxc_minifier/src/traverse_context/scoping.rs:305-310 | crates/oxc_traverse/src/context/scoping.rs:330-335 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/scoping.rs` and `crates/oxc_traverse/src/context/scoping.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 94 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.
Duplicated block (6 lines × 2) tasks/ast_tools/src/derives/clone_in.rs:76— tasks/ast_tools/src/derives/clone_in.rs:76-81 | tasks/ast_tools/src/derives/content_eq.rs:64-69 — 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 (6 lines × 2) crates/oxc_allocator/src/hash_map.rs:126— crates/oxc_allocator/src/hash_map.rs:126-131 | crates/oxc_allocator/src/hash_set.rs:80-85 — 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 (6 lines × 2) crates/oxc_allocator/src/hash_map.rs:143— crates/oxc_allocator/src/hash_map.rs:143-148 | crates/oxc_allocator/src/hash_set.rs:97-102 — 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 (6 lines × 2) crates/oxc_formatter/src/print/assignment_pattern_property_list.rs:27— crates/oxc_formatter/src/print/assignment_pattern_property_list.rs:27-32 | crates/oxc_formatter/src/print/binding_property_list.rs:32-37 — 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 (6 lines × 2) crates/oxc_str/src/ident.rs:275— crates/oxc_str/src/ident.rs:275-280 | crates/oxc_str/src/str.rs:110-115 — 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 (6 lines × 2) crates/oxc_transformer/src/common/arrow_function_converter.rs:515— crates/oxc_transformer/src/common/arrow_function_converter.rs:515-522 | crates/oxc_transformer/src/es2020/nullish_coalescing_operator.rs:61-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (6 lines × 2) crates/oxc_semantic/src/dot.rs:150— crates/oxc_semantic/src/dot.rs:150-155 | crates/oxc_semantic/src/dot.rs:162-168 — 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 (6 lines × 2) crates/oxc_linter/src/rules/shared/jest_vitest/valid_expect.rs:97— crates/oxc_linter/src/rules/shared/jest_vitest/valid_expect.rs:97-102 | crates/oxc_linter/src/rules/shared/jest_vitest/valid_expect.rs:103-108 — 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.
oxc_lexer::pipeline::carve::jsx::carve_jsx (cyclomatic 126) crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:65— oxc_lexer::pipeline::carve::jsx::carve_jsx has cyclomatic complexity 126 (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.
oxc_lexer::pipeline::disambiguate::type_context::type_list::type_list_legal (cyclomatic 95) crates/oxc_lexer/src/pipeline/disambiguate/type_context/type_list.rs:59— oxc_lexer::pipeline::disambiguate::type_context::type_list::type_list_legal has cyclomatic complexity 95 (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.
oxc_lexer::lanes::cook_decode (cyclomatic 60) crates/oxc_lexer/src/lanes.rs:964— oxc_lexer::lanes::cook_decode has cyclomatic complexity 60 (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.
oxc_lexer::pipeline::disambiguate::context::anchor::anchor_of (cyclomatic 41) crates/oxc_lexer/src/pipeline/disambiguate/context/anchor.rs:88— oxc_lexer::pipeline::disambiguate::context::anchor::anchor_of has cyclomatic complexity 41 (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.
oxc_lexer::pipeline::disambiguate::operator::not_operator_position (cyclomatic 36) crates/oxc_lexer/src/pipeline/disambiguate/operator/mod.rs:55— oxc_lexer::pipeline::disambiguate::operator::not_operator_position 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.
oxc_lexer::comment_meta::classify (cyclomatic 33) crates/oxc_lexer/src/comment_meta.rs:75— oxc_lexer::comment_meta::classify has cyclomatic complexity 33 (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.
oxc_lexer::lanes::validate_number (cyclomatic 32) crates/oxc_lexer/src/lanes.rs:780— oxc_lexer::lanes::validate_number 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.
oxc_lexer::pipeline::coalesce::coalesce (cyclomatic 32) crates/oxc_lexer/src/pipeline/coalesce/mod.rs:26— oxc_lexer::pipeline::coalesce::coalesce 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.
oxc_lexer::diagnostics::to_oxc_diagnostic (cyclomatic 29) crates/oxc_lexer/src/diagnostics.rs:333— oxc_lexer::diagnostics::to_oxc_diagnostic has cyclomatic complexity 29 (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.
oxc_lexer::pipeline::disambiguate::type_context::bytes::resolve_lists (cyclomatic 29) crates/oxc_lexer/src/pipeline/disambiguate/type_context/bytes.rs:166— oxc_lexer::pipeline::disambiguate::type_context::bytes::resolve_lists 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.
oxc_lexer::lanes::parse_number (cyclomatic 22) crates/oxc_lexer/src/lanes.rs:697— oxc_lexer::lanes::parse_number 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.
oxc_lexer::pipeline::misc::pre::misc_pre_impl (cyclomatic 22) crates/oxc_lexer/src/pipeline/misc/pre.rs:36— oxc_lexer::pipeline::misc::pre::misc_pre_impl 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.
oxc_lexer::pipeline::scan::common::scan_regex (cyclomatic 22) crates/oxc_lexer/src/pipeline/scan/common.rs:41— oxc_lexer::pipeline::scan::common::scan_regex 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.
oxc_lexer::pipeline::scan::common::scan_number (cyclomatic 22) crates/oxc_lexer/src/pipeline/scan/common.rs:171— oxc_lexer::pipeline::scan::common::scan_number 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.
oxc_lexer::pipeline::carve::js::carve_js (cyclomatic 21) crates/oxc_lexer/src/pipeline/carve/js.rs:13— oxc_lexer::pipeline::carve::js::carve_js 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.
oxc_lexer::pipeline::carve::jsx::angle_brackets::ts_angle_verdict (cyclomatic 21) crates/oxc_lexer/src/pipeline/carve/jsx/angle_brackets.rs:75— oxc_lexer::pipeline::carve::jsx::angle_brackets::ts_angle_verdict 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.
oxc_lexer::pipeline::scan::avx2::scan_line_comment (cyclomatic 19) crates/oxc_lexer/src/pipeline/scan/avx2.rs:55— oxc_lexer::pipeline::scan::avx2::scan_line_comment 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.
oxc_lexer::pipeline::scan::generic::scan_line_comment (cyclomatic 19) crates/oxc_lexer/src/pipeline/scan/generic.rs:53— oxc_lexer::pipeline::scan::generic::scan_line_comment 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.
oxc_lexer::pipeline::disambiguate::type_context::bytes::raw_template_end (cyclomatic 18) crates/oxc_lexer/src/pipeline/disambiguate/type_context/bytes.rs:361— oxc_lexer::pipeline::disambiguate::type_context::bytes::raw_template_end 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.
oxc_lexer::pipeline::disambiguate::type_context::runs::run_shortcut (cyclomatic 18) crates/oxc_lexer/src/pipeline/disambiguate/type_context/runs.rs:43— oxc_lexer::pipeline::disambiguate::type_context::runs::run_shortcut 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.
oxc_lexer::pipeline::classify::generic::cls_table (cyclomatic 17) crates/oxc_lexer/src/pipeline/classify/generic.rs:24— oxc_lexer::pipeline::classify::generic::cls_table 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.
oxc_lexer::pipeline::coalesce::glue_number (cyclomatic 17) crates/oxc_lexer/src/pipeline/coalesce/mod.rs:236— oxc_lexer::pipeline::coalesce::glue_number 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.
oxc_lexer::pipeline::scan::avx2::scan_block_comment (cyclomatic 17) crates/oxc_lexer/src/pipeline/scan/avx2.rs:7— oxc_lexer::pipeline::scan::avx2::scan_block_comment 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.
oxc_lexer::pipeline::carve::common::html_close_at_line_start (cyclomatic 16) crates/oxc_lexer/src/pipeline/carve/common.rs:344— oxc_lexer::pipeline::carve::common::html_close_at_line_start 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.
Repeated repair: crates/oxc_parser/src/diagnostics.rs crates/oxc_parser/src/diagnostics.rs:14— crates/oxc_parser/src/diagnostics.rs changed 19 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is OxcDiagnostic::with_allowed_modifier_help at line 14), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(parser): reject TypeScript class modifiers in JavaScript (#27312)”; “fix(parser): remove type-dependent tuple rest diagnostics (#27234)”; “fix(parser): reject module syntax in script (#27220)”; “fix(parser): reject invalid modifiers on import aliases (#26622)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_parser/src/diagnostics.rs`: 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.
Repeated repair: crates/oxc_formatter/src/formatter/trivia.rs crates/oxc_formatter/src/formatter/trivia.rs:511— crates/oxc_formatter/src/formatter/trivia.rs changed 14 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is FormatCommentText::fmt at line 511), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): keep comments deferred before an assignment operator (#26997)”; “fix(formatter/jsdoc): more alignment with original plugin (#27039)”; “fix(formatter): keep trailing spaces on normal block comments (#27037)”; “fix(formatter): nestle adjacent block comments (#27036)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/formatter/trivia.rs`: 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.
Repeated repair: tasks/ast_tools/src/generators/formatter/format.rs tasks/ast_tools/src/generators/formatter/format.rs:109— tasks/ast_tools/src/generators/formatter/format.rs changed 13 times in last 90 days and 7 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is oxc_ast_tools::generators::formatter::format::generate_struct_implementation at line 109), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): keep after-operator comments in place (#26725)”; “fix(formatter): unify suppress comment behavior (#26547)”; “fix(formatter): re-add suppressed statement terminators per options.semi (#26220)”; “fix(formatter): print suppressed typecast parens (#26218)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- tasks/ast_tools/src/generators/formatter/format.rs`: 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.
Repeated repair: crates/oxc_codegen/src/lib.rs crates/oxc_codegen/src/lib.rs:1063— crates/oxc_codegen/src/lib.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is Codegen::print_space_before_operator at line 1063), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(codegen): remove redundant dollar escapes in minified templates (#26924)”; “fix(codegen): only add mapping names for `PrivateIdentifier`s which have changed (#25958)”; “fix(codegen): preserve property key annotations (#25766)”; “fix(codegen): wrap string literal in parens after directives (#25435)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_codegen/src/lib.rs`: 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.
Repeated repair: crates/oxc_formatter/src/utils/statement_body.rs crates/oxc_formatter/src/utils/statement_body.rs:203— crates/oxc_formatter/src/utils/statement_body.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is FormatStatementBody::fmt at line 203), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): keep comments between callee and its opener on the callee side (#27172)”; “fix(formatter): unify suppress comment behavior (#26547)”; “fix(formatter): apply head body policy everywhere (#26074)”; “fix(formatter): keep comments between a head and its body out of the braces across all constructs (#26071)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/utils/statement_body.rs`: 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.
Repeated repair: crates/oxc_formatter/src/utils/typecast.rs crates/oxc_formatter/src/utils/typecast.rs:82— crates/oxc_formatter/src/utils/typecast.rs changed 9 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is oxc_formatter::utils::typecast::classify_type_cast at line 82), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): treat a JSDoc cast target as opaque in chain layouts (#26375)”; “fix(formatter): keep JSDoc cast parens with a comment inside them (#26374)”; “fix(formatter): print suppressed typecast parens (#26218)”; “fix(formatter): do not skip cast comment lookup (#26216)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/utils/typecast.rs`: 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.
Repeated repair: crates/oxc_linter/src/rules/unicorn/new_for_builtins.rs crates/oxc_linter/src/rules/unicorn/new_for_builtins.rs:67— crates/oxc_linter/src/rules/unicorn/new_for_builtins.rs changed 5 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is NewForBuiltins::run at line 67), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linter): resolve globals by reference, not by name (#25905)”; “fix(linter/unicorn/new-for-builtins): ignore optional chains (#25411)”; “fix(linter/unicorn/new-for-builtins): support `Float16Array` (#25382)”; “fix(linter/unicorn/new-for-builtins): detect parenthesized member expression object (#25249)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_linter/src/rules/unicorn/new_for_builtins.rs`: 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.
Repeated repair: crates/oxc_linter/src/context/host.rs crates/oxc_linter/src/context/host.rs:348— crates/oxc_linter/src/context/host.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is ContextHost::append_diagnostics at line 348), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linter/plugins): fix interaction between JS plugins and Vue rules (#26080)”; “fix(linter): preserve source text for JS plugin ignore fixes (#25280)”; “fix(oxlint): normalize customized rule names (#25316)”; “refactor(oxlint/linter/lsp): extend "ignore fixes" on diagnostic creation (#24958)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_linter/src/context/host.rs`: 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.
Repeated repair: crates/oxc_formatter_css/src/print/less.rs crates/oxc_formatter_css/src/print/less.rs:197— crates/oxc_formatter_css/src/print/less.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is oxc_formatter_css::print::less::write_less_mixin_call at line 197), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter_css): handle less-test-suites failures (#26513)”; “fix(formatter_css): keep comment inside important and simple-vars colon (#26370)”; “fix(formatter_css): hide raw comment printing API, use strcut instead (#26316)”; “fix(formatter_css): preserve comments around SCSS/Less variable values (#26276)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter_css/src/print/less.rs`: 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.
Repeated repair: crates/oxc_formatter_css/src/comments.rs crates/oxc_formatter_css/src/comments.rs:171— crates/oxc_formatter_css/src/comments.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is oxc_formatter_css::comments::write_trailing_same_line_comments at line 171), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter_css): keep a line comment on its comma's line (#26319)”; “fix(formatter_css): hide raw comment printing API, use strcut instead (#26316)”; “fix(oxfmt): correct prose about comment width in fits measurement (#25054)”; “fix(formatter_css): use `line_suffix` for EOL line comment (#24580)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter_css/src/comments.rs`: 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.
Repeated repair: crates/oxc_formatter/src/print/parameters.rs crates/oxc_formatter/src/print/parameters.rs:37— crates/oxc_formatter/src/print/parameters.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is AstNode::write at line 37), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): skip test-call layout when arguments have comments (#27119)”; “fix(formatter): check `this_param` for simple parameters test (#26474)”; “fix(formatter): keep cast-target assignment and commented parameter patterns (#26429)”; “fix(formatter): keep comments after TS this_param (#25459)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/print/parameters.rs`: 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.
Repeated repair: crates/oxc_formatter/src/print/return_or_throw_statement.rs crates/oxc_formatter/src/print/return_or_throw_statement.rs:180— crates/oxc_formatter/src/print/return_or_throw_statement.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is oxc_formatter::print::return_or_throw_statement::has_argument_leading_comments at line 180), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): unify suppress comment behavior (#26547)”; “fix(formatter): keep JSDoc cast parens with a comment inside them (#26374)”; “fix(formatter): print the idempotent placement for comments in dropped parens (#26041)”; “fix(formatter): suppressed trailing semi (#24482)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/print/return_or_throw_statement.rs`: 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.
Repeated repair: crates/oxc_formatter/src/print/switch_statement.rs crates/oxc_formatter/src/print/switch_statement.rs:63— crates/oxc_formatter/src/print/switch_statement.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is AstNode::write at line 63), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): apply head body policy everywhere (#26074)”; “fix(formatter): keep comments between a head and its body out of the braces across all constructs (#26071)”; “fix(formatter): place comments between a head and open paren (#26058)”; “fix(formatter): place comments between a statement head and its body (#26043)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/print/switch_statement.rs`: 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.
Repeated repair: crates/oxc_formatter/src/print/type_parameters.rs crates/oxc_formatter/src/print/type_parameters.rs:166— crates/oxc_formatter/src/print/type_parameters.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is AstNode::write at line 166), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): keep comments between callee and its opener on the callee side (#27172)”; “fix(formatter): skip test-call layout when arguments have comments (#27119)”; “fix(oxfmt): rework tsx-in-vue support (#25106)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/print/type_parameters.rs`: 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.
Repeated repair: crates/oxc_formatter/src/utils/suppressed.rs crates/oxc_formatter/src/utils/suppressed.rs:24— crates/oxc_formatter/src/utils/suppressed.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is oxc_formatter::utils::suppressed::write_suppressed_expression at line 24), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): keep after-operator comments in place (#26725)”; “fix(formatter): unify suppress comment behavior (#26547)”; “fix(formatter): print suppressed typecast parens (#26218)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/utils/suppressed.rs`: 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.
Repeated repair: crates/oxc_linter/src/rules/eslint/require_await.rs crates/oxc_linter/src/rules/eslint/require_await.rs:117— crates/oxc_linter/src/rules/eslint/require_await.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is RequireAwait::check_function_body at line 117), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linter/eslint/require-await): count `await using` as an await (#27080)”; “fix(linter): assert token lookup invariants (#25368)”; “fix(linter/eslint/require-await): bound token lookup (#25199)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_linter/src/rules/eslint/require_await.rs`: 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.
Repeated repair: crates/oxc_linter/src/rules/react/exhaustive_effect_dependencies.rs crates/oxc_linter/src/rules/react/exhaustive_effect_dependencies.rs:32— crates/oxc_linter/src/rules/react/exhaustive_effect_dependencies.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is ExhaustiveEffectDependencies::run_once at line 32), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linter): remove invalid React compiler doc links (#25900)”; “fix(linter): align React Compiler rule categories (#25840)”; “fix(linter): report exhaustive effect dependencies (#25829)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_linter/src/rules/react/exhaustive_effect_dependencies.rs`: 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.
Repeated repair: crates/oxc_linter/src/rules/react/memo_dependencies.rs crates/oxc_linter/src/rules/react/memo_dependencies.rs:32— crates/oxc_linter/src/rules/react/memo_dependencies.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is MemoDependencies::run_once at line 32), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linter): remove invalid React compiler doc links (#25900)”; “fix(linter): align React Compiler rule categories (#25840)”; “fix(linter): resolve inactive React compiler rules (#25830)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_linter/src/rules/react/memo_dependencies.rs`: 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.
Repeated repair: crates/oxc_linter/src/utils/react_compiler.rs crates/oxc_linter/src/utils/react_compiler.rs:105— crates/oxc_linter/src/utils/react_compiler.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is oxc_linter::utils::react_compiler::run_react_compiler_rule at line 105), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(react_compiler): skip node_modules by default (#25859)”; “fix(linter): resolve inactive React compiler rules (#25830)”; “fix(linter): report exhaustive effect dependencies (#25829)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_linter/src/utils/react_compiler.rs`: 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.
Repeated repair: crates/oxc_react_compiler/src/react_compiler_inference/flatten_scopes_with_hooks_or_use_hir.rs crates/oxc_react_compiler/src/react_compiler_inference/flatten_scopes_with_hooks_or_use_hir.rs:50— crates/oxc_react_compiler/src/react_compiler_inference/flatten_scopes_with_hooks_or_use_hir.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 14 (its worst body is oxc_react_compiler::react_compiler_inference::flatten_scopes_with_hooks_or_use_hir::flatten_scopes_with_hooks_or_use_hir at line 50), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(react-compiler): preserve tagged template runtime semantics (#25678)”; “fix(react-compiler): handle tagged template hooks (#25525)”; “fix(react_compiler): preserve source spans (#25462)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/react_compiler_inference/flatten_scopes_with_hooks_or_use_hir.rs`: 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.
Repeated repair: crates/oxc_formatter_yaml/src/print/block_collection.rs crates/oxc_formatter_yaml/src/print/block_collection.rs:126— crates/oxc_formatter_yaml/src/print/block_collection.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is oxc_formatter_yaml::print::block_collection::write_sequence at line 126), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “refactor(formatter_yaml): fix up code and doc comments (#25012)”; “fix(formatter_yaml): let ancestor collection values claim end comments after block scalars (#24897)”; “fix(formatter_yaml): align sequence container end comments to the dash width (#24891)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter_yaml/src/print/block_collection.rs`: 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.
Repeated repair: crates/oxc_formatter_markdown/src/print/line_shape.rs crates/oxc_formatter_markdown/src/print/line_shape.rs:193— crates/oxc_formatter_markdown/src/print/line_shape.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is oxc_formatter_markdown::print::line_shape::printed_line_opens_block at line 193), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter_markdown): keep a preserved line break before a delimiter row that opens no table (#27278)”; “fix(formatter_markdown): keep a math span after a kept line break from opening a block (#27001)”; “fix(formatter_markdown): fix real-world missmatches (#26785)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter_markdown/src/print/line_shape.rs`: 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.
Repeated repair: crates/oxc_formatter/src/print/call_like_expression/mod.rs crates/oxc_formatter/src/print/call_like_expression/mod.rs:21— crates/oxc_formatter/src/print/call_like_expression/mod.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is AstNode::write at line 21), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(formatter): decide embedded template layout from AST, not source shape (#27218)”; “fix(formatter): keep comments between callee and its opener on the callee side (#27172)”; “fix(formatter): skip test-call layout when arguments have comments (#27119)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_formatter/src/print/call_like_expression/mod.rs`: 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.
Repeated repair: crates/oxc_react_compiler/src/options.rs crates/oxc_react_compiler/src/options.rs:31— crates/oxc_react_compiler/src/options.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is CompilationMode::from_str at line 31), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(react_compiler): honor eslint suppressions (#25394)”; “fix(react_compiler): match eslint suppression gating (#25068)”; “fix(react_compiler): honor default suppressions (#24747)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-14..2026-10-12, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-14 02:44:59 +00:00' --until='2026-10-12 02:44:59 +00:00' --full-history --no-merges -- crates/oxc_react_compiler/src/options.rs`: 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.
FixmeComment crates/oxc_ecmascript/src/constant_evaluation/mod.rs:192— // FIXME: skipped for now to avoid performance regression, can be removed — 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.
FixmeComment crates/oxc_ecmascript/src/side_effects/expressions.rs:286— // FIXME: we should treat `arguments` outside a function scope to have sideeffects — 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.
FixmeComment crates/oxc_formatter/src/formatter/mod.rs:17— // FIXME — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/object_shorthand.rs:1949— // FIXME — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/typescript_eslint.rs:532— // FIXME — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/typescript_eslint.rs:778— // FIXME — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/typescript_eslint.rs:1700— // FIXME — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs:666— // FIXME — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs:830— // FIXME — 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.
FixmeComment crates/oxc_linter/src/rules/unicorn/no_null.rs:444— // FIXME — 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.
FixmeComment crates/oxc_isolated_declarations/src/class.rs:693— // FIXME: missing many fields — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/oxc_linter/src/rules/eslint/no_warning_comments.rs:78— /// Disallows warning comments such as TODO, FIXME, XXX in code. — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_warning_comments.rs:94— /// // FIXME: this is broken — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/typescript_eslint.rs:829— // FIXME - parse error — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/typescript_eslint.rs:1881— // FIXME: Support JSX pragmas — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs:96— // FIXME: b should be deleted as well. — 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.
FixmeComment crates/oxc_linter/src/rules/eslint/no_unused_vars/tests/oxc.rs:1608— // FIXME: ambient classes declared using `declare` are not bound by — 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.
FixmeComment crates/oxc_linter/src/rules/react/exhaustive_deps.rs:1738— // FIXME(@DonIsaac): these should pass — 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.
FixmeComment crates/oxc_linter/src/rules/react/exhaustive_deps.rs:3034— // FIXME: this should pass — 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.
FixmeComment crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:17— // FIXME: use imperative message phrasing — 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.
FixmeComment crates/oxc_linter/src/rules/typescript/explicit_module_boundary_types.rs:1957— // FIXME: resolve to last write reference — 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.
FixmeComment crates/oxc_minifier/tests/peephole/fold_constants.rs:1320— // FIXME: want "x-Infinity" — 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.
FixmeComment crates/oxc_minifier/tests/peephole/fold_constants.rs:1328— // FIXME: want x - 0 — 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.
ClassTooLong: SemanticBuilder crates/oxc_semantic/src/builder.rs:70— ClassTooLong — 1727 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 38 methods, 5 blocks, lines 70-3037. The bar is 400 significant lines; this is 1327 over it, 4.32× 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: ClassStaticBlock crates/oxc_transformer/src/es2022/class_static_block.rs:68— ClassTooLong — 658 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 4 blocks, lines 68-1041. The bar is 400 significant lines; this is 258 over it, 1.65× 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: ExplicitResourceManagement crates/oxc_transformer/src/es2026/explicit_resource_management.rs:52— ClassTooLong — 657 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 4 blocks, lines 52-1164. The bar is 400 significant lines; this is 257 over it, 1.64× 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: ObjectRestSpread crates/oxc_transformer/src/es2018/object_rest_spread.rs:57— ClassTooLong — 655 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 7 blocks, lines 57-1054. The bar is 400 significant lines; this is 255 over it, 1.64× 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: ArrowFunctionConverter crates/oxc_transformer/src/common/arrow_function_converter.rs:146— ClassTooLong — 638 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 4 blocks, lines 146-1297. The bar is 400 significant lines; this is 238 over it, 1.60× 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: Runtime crates/oxc_linter/src/service/runtime.rs:45— ClassTooLong — 563 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 2 blocks, lines 45-1185. The bar is 400 significant lines; this is 163 over it, 1.41× 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: Parser tasks/ast_tools/src/parse/parse.rs:43— ClassTooLong — 560 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 2 blocks, lines 43-902. The bar is 400 significant lines; this is 160 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.
ClassTooLong: Backend crates/oxc_language_server/src/backend.rs:51— ClassTooLong — 551 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 6 methods, 3 blocks, lines 51-1096. The bar is 400 significant lines; this is 151 over it, 1.38× 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: NoUselessAssignment crates/oxc_linter/src/rules/eslint/no_useless_assignment.rs:35— ClassTooLong — 532 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 3 blocks, lines 35-905. The bar is 400 significant lines; this is 132 over it, 1.33× 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: ModuleRunnerTransform crates/oxc_transformer_plugins/src/module_runner_transform.rs:65— ClassTooLong — 497 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 4 blocks, lines 65-896. The bar is 400 significant lines; this is 97 over it, 1.24× 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: ReactRefresh crates/oxc_transformer/src/jsx/refresh.rs:114— ClassTooLong — 496 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 10 methods, 4 blocks, lines 114-909. The bar is 400 significant lines; this is 96 over it, 1.24× 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: AssignmentLike crates/oxc_formatter/src/utils/assignment_like.rs:28— ClassTooLong — 484 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 3 blocks, lines 28-1039. The bar is 400 significant lines; this is 84 over it, 1.21× 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: Printer crates/oxc_formatter_core/src/printer/mod.rs:54— ClassTooLong — 460 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 2 blocks, lines 54-883. The bar is 400 significant lines; this is 60 over it, 1.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: PeepholeOptimizations crates/oxc_minifier/src/peephole/mod.rs:35— ClassTooLong — 456 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 259 methods, 2 blocks, lines 37-822. The bar is 400 significant lines; this is 56 over it, 1.14× 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: ReplaceGlobalDefines crates/oxc_transformer_plugins/src/replace_global_defines.rs:308— ClassTooLong — 454 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 3 blocks, lines 308-1069. The bar is 400 significant lines; this is 54 over it, 1.14× 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: OnlyExportComponents crates/oxc_linter/src/rules/react/only_export_components.rs:49— ClassTooLong — 442 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 3 blocks, lines 51-831. The bar is 400 significant lines; this is 42 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: Scoping crates/oxc_semantic/src/scoping.rs:95— ClassTooLong — 440 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 80 methods, 6 blocks, lines 95-1153. The bar is 400 significant lines; this is 40 over it, 1.10× 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: IsolatedDeclarations crates/oxc_isolated_declarations/src/lib.rs:62— ClassTooLong — 440 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 74 methods, 5 blocks, lines 62-732. The bar is 400 significant lines; this is 40 over it, 1.10× 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: CliRunner apps/oxlint/src/lint.rs:39— ClassTooLong — 428 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 4 blocks, lines 39-725. 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: JsxImpl crates/oxc_transformer/src/jsx/jsx_impl.rs:119— ClassTooLong — 425 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 19 methods, 4 blocks, lines 119-1150. The bar is 400 significant lines; this is 25 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: Linter crates/oxc_linter/src/lib.rs:282— ClassTooLong — 424 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 2 blocks, lines 282-1016. The bar is 400 significant lines; this is 24 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: NoShadow crates/oxc_linter/src/rules/eslint/no_shadow/mod.rs:62— ClassTooLong — 410 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 22 methods, 3 blocks, lines 64-707. The bar is 400 significant lines; this is 10 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: ConfigStoreBuilder crates/oxc_linter/src/config/config_builder.rs:34— ClassTooLong — 407 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 4 blocks, lines 34-743. The bar is 400 significant lines; this is 7 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.
oxc_formatter_css::print::value::base_separator (cyclomatic 72) crates/oxc_formatter_css/src/print/value.rs:1351— oxc_formatter_css::print::value::base_separator 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.
oxc_formatter_css::print::value::write_component_value (cyclomatic 58) crates/oxc_formatter_css/src/print/value.rs:1602— oxc_formatter_css::print::value::write_component_value has cyclomatic complexity 58 (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.
oxc_formatter_css::print::value::adjust_numbers_and_strings (cyclomatic 46) crates/oxc_formatter_css/src/print/value.rs:150— oxc_formatter_css::print::value::adjust_numbers_and_strings 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.
oxc_formatter_css::print::statement::write_declaration (cyclomatic 44) crates/oxc_formatter_css/src/print/statement.rs:339— oxc_formatter_css::print::statement::write_declaration 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.
oxc_formatter_css::print::at_rule::write_at_rule_prelude (cyclomatic 36) crates/oxc_formatter_css/src/print/at_rule.rs:738— oxc_formatter_css::print::at_rule::write_at_rule_prelude has cyclomatic complexity 36 (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.
oxc_formatter_css::print::scss::write_sass_map (cyclomatic 32) crates/oxc_formatter_css/src/print/scss.rs:201— oxc_formatter_css::print::scss::write_sass_map 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.
oxc_formatter_css::print::value::write_comma_group (cyclomatic 32) crates/oxc_formatter_css/src/print/value.rs:1085— oxc_formatter_css::print::value::write_comma_group 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.
oxc_formatter_css::print::value::write_less_binary_operation (cyclomatic 29) crates/oxc_formatter_css/src/print/value.rs:2124— oxc_formatter_css::print::value::write_less_binary_operation 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 4 function items inside it that branch (flatten, push_operand, leftmost_operand, …). 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.
oxc_formatter_css::print::at_rule::write_at_rule (cyclomatic 28) crates/oxc_formatter_css/src/print/at_rule.rs:43— oxc_formatter_css::print::at_rule::write_at_rule 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.
oxc_formatter_css::print::value::write_sass_binary (cyclomatic 27) crates/oxc_formatter_css/src/print/value.rs:1881— oxc_formatter_css::print::value::write_sass_binary 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.
oxc_formatter_css::print::statement::write_statement (cyclomatic 24) crates/oxc_formatter_css/src/print/statement.rs:167— oxc_formatter_css::print::statement::write_statement has cyclomatic complexity 24 (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.
oxc_formatter_css::print::value::write_function (cyclomatic 22) crates/oxc_formatter_css/src/print/value.rs:2280— oxc_formatter_css::print::value::write_function 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.
oxc_formatter_css::print::at_rule::write_import_path_list (cyclomatic 21) crates/oxc_formatter_css/src/print/at_rule.rs:906— oxc_formatter_css::print::at_rule::write_import_path_list 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.
oxc_formatter_css::print::value::write_value_groups (cyclomatic 21) crates/oxc_formatter_css/src/print/value.rs:755— oxc_formatter_css::print::value::write_value_groups 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.
oxc_formatter_css::print::at_rule::write_commented_value_params (cyclomatic 19) crates/oxc_formatter_css/src/print/at_rule.rs:417— oxc_formatter_css::print::at_rule::write_commented_value_params 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.
oxc_formatter_css::print::at_rule::write_token_value (cyclomatic 17) crates/oxc_formatter_css/src/print/at_rule.rs:1029— oxc_formatter_css::print::at_rule::write_token_value 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.
oxc_formatter_css::print::at_rule::write_token_comma_group_after (cyclomatic 17) crates/oxc_formatter_css/src/print/at_rule.rs:1126— oxc_formatter_css::print::at_rule::write_token_comma_group_after 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.
oxc_formatter_css::print::at_rule::write_token_run (cyclomatic 17) crates/oxc_formatter_css/src/print/at_rule.rs:1275— oxc_formatter_css::print::at_rule::write_token_run 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.
oxc_formatter_css::print::statement::write_custom_property_block (cyclomatic 17) crates/oxc_formatter_css/src/print/statement.rs:579— oxc_formatter_css::print::statement::write_custom_property_block 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.
oxc_formatter_css::print::value::write_calc (cyclomatic 17) crates/oxc_formatter_css/src/print/value.rs:2009— oxc_formatter_css::print::value::write_calc 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, 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.
oxc_formatter_css::print::at_rule::tokenize (cyclomatic 16) crates/oxc_formatter_css/src/print/at_rule.rs:539— oxc_formatter_css::print::at_rule::tokenize 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.
Duplicated block (13 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/collect.rs:99— crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/collect.rs:99-111 | crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/collect.rs:127-139 — 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:461— REDACTED:461-473 | REDACTED:1090-1103 — 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) crates/oxc_isolated_declarations/src/enum.rs:223— crates/oxc_isolated_declarations/src/enum.rs:223-235 | crates/oxc_semantic/src/ts_enum/eval.rs:232-244 — before extracting anything, compare `crates/oxc_isolated_declarations/src/enum.rs` and `crates/oxc_semantic/src/ts_enum/eval.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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.
Duplicated block (13 lines × 2) crates/oxc_language_server/src/backend.rs:839— crates/oxc_language_server/src/backend.rs:839-851 | crates/oxc_language_server/src/backend.rs:855-867 — 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) crates/oxc_linter/src/rules/eslint/class_methods_use_this.rs:187— crates/oxc_linter/src/rules/eslint/class_methods_use_this.rs:187-199 | crates/oxc_linter/src/rules/eslint/class_methods_use_this.rs:227-239 — 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) crates/oxc_linter/src/rules/eslint/complexity.rs:169— crates/oxc_linter/src/rules/eslint/complexity.rs:169-181 | crates/oxc_linter/src/rules/eslint/complexity.rs:185-197 — 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) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:741— crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:741-753 | crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:846-858 — 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) crates/oxc_linter/src/rules/eslint/no_useless_rename.rs:255— crates/oxc_linter/src/rules/eslint/no_useless_rename.rs:255-267 | crates/oxc_linter/src/rules/eslint/no_useless_rename.rs:294-306 — 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) crates/oxc_linter/src/rules/vitest/hoisted_apis_on_top.rs:129— crates/oxc_linter/src/rules/vitest/hoisted_apis_on_top.rs:129-141 | crates/oxc_linter/src/rules/vitest/require_mock_type_parameters.rs:138-150 — 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 (13 lines × 2) crates/oxc_minifier/src/peephole/minimize_statements.rs:1956— crates/oxc_minifier/src/peephole/minimize_statements.rs:1956-1968 | crates/oxc_minifier/src/peephole/minimize_statements.rs:2009-2021 — 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) crates/oxc_minifier/src/peephole/remove_unused_expression.rs:325— crates/oxc_minifier/src/peephole/remove_unused_expression.rs:325-337 | crates/oxc_minifier/src/peephole/remove_unused_expression.rs:685-697 — 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) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:167— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:167-179 | crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:219-231 — 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) crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:59— crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:59-71 | crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs:35-47 — `crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs` and `crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (13 lines × 2) crates/oxc_transformer/src/es2022/class_properties/static_block_and_prop_init.rs:430— crates/oxc_transformer/src/es2022/class_properties/static_block_and_prop_init.rs:430-442 | crates/oxc_transformer/src/es2022/class_properties/static_block_and_prop_init.rs:452-464 — 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) crates/oxc_transformer/src/es2026/explicit_resource_management.rs:683— crates/oxc_transformer/src/es2026/explicit_resource_management.rs:683-695 | crates/oxc_transformer/src/es2026/explicit_resource_management.rs:991-1003 — 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) crates/oxc_transformer_plugins/src/inject_global_variables.rs:282— crates/oxc_transformer_plugins/src/inject_global_variables.rs:282-294 | crates/oxc_transformer_plugins/src/inject_global_variables.rs:304-316 — 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) napi/transform-react/src/lib.rs:131— napi/transform-react/src/lib.rs:131-143 | napi/transform-relay/src/lib.rs:92-104 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (13 lines × 2) crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs:22— crates/oxc_linter/src/rules/jest/no_restricted_matchers.rs:22-34 | crates/oxc_linter/src/rules/vitest/no_restricted_matchers.rs:22-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (13 lines × 2) crates/oxc_linter/src/rules/typescript/unified_signatures.rs:381— crates/oxc_linter/src/rules/typescript/unified_signatures.rs:381-393 | crates/oxc_linter/src/rules/typescript/unified_signatures.rs:399-412 — 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) apps/oxfmt/src/api/text_to_doc_api.rs:155— apps/oxfmt/src/api/text_to_doc_api.rs:155-168 | apps/oxfmt/src/api/text_to_doc_api.rs:209-221 — 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) crates/oxc_linter/src/rules/vue/define_emits_declaration.rs:143— crates/oxc_linter/src/rules/vue/define_emits_declaration.rs:143-155 | crates/oxc_linter/src/rules/vue/define_props_declaration.rs:98-110 — 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.
No assertions: empty visitor napi/parser/test/visit.test.ts:7— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:129— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:134— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:141— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:149— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:165— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:170— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:177— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:183— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:203— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:208— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:215— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:221— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: JS napi/parser/test/parse-raw.test.ts:245— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: TS napi/parser/test/parse-raw.test.ts:247— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:280— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:285— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: %s napi/parser/test/parse-raw.test.ts:293— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Duplicated block (12 lines × 2) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:555— crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:555-566 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:584-595 — 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 (12 lines × 2) crates/oxc_ecmascript/src/side_effects/expressions.rs:1018— crates/oxc_ecmascript/src/side_effects/expressions.rs:1018-1029 | crates/oxc_ecmascript/src/side_effects/expressions.rs:1052-1063 — 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 (12 lines × 2) crates/oxc_lexer/src/pipeline/coalesce/mod.rs:143— crates/oxc_lexer/src/pipeline/coalesce/mod.rs:143-154 | crates/oxc_lexer/src/pipeline/coalesce/mod.rs:303-314 — 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 (12 lines × 2) crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs:171— crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs:171-182 | crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs:184-195 — 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 (12 lines × 2) crates/oxc_linter/src/rules/jest/prefer_to_have_been_called.rs:66— crates/oxc_linter/src/rules/jest/prefer_to_have_been_called.rs:66-77 | crates/oxc_linter/src/rules/vitest/prefer_called_times.rs:70-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (12 lines × 2) crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:109— crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:109-120 | crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs:101-112 — before extracting anything, compare `crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs` and `crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 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.
Duplicated block (12 lines × 2) crates/oxc_semantic/src/builder.rs:1494— crates/oxc_semantic/src/builder.rs:1494-1505 | crates/oxc_semantic/src/builder.rs:1558-1569 — 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 (12 lines × 2) crates/oxc_semantic/src/checker/javascript.rs:767— crates/oxc_semantic/src/checker/javascript.rs:767-778 | crates/oxc_semantic/src/checker/javascript.rs:812-823 — 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 (12 lines × 2) crates/oxc_transformer/src/es2026/explicit_resource_management.rs:135— crates/oxc_transformer/src/es2026/explicit_resource_management.rs:135-146 | crates/oxc_transformer/src/es2026/explicit_resource_management.rs:163-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.
Duplicated block (12 lines × 2) napi/parser/src/lib.rs:129— napi/parser/src/lib.rs:129-140 | napi/playground/src/lib.rs:387-398 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (12 lines × 2) tasks/ast_tools/src/parse/parse.rs:368— tasks/ast_tools/src/parse/parse.rs:368-379 | tasks/ast_tools/src/parse/parse.rs:468-479 — 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 (12 lines × 2) crates/oxc_linter/src/rules/jest/no_hooks.rs:23— crates/oxc_linter/src/rules/jest/no_hooks.rs:23-34 | crates/oxc_linter/src/rules/vitest/no_hooks.rs:23-34 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (12 lines × 2) crates/oxc_linter/src/rules/jest/valid_title.rs:26— crates/oxc_linter/src/rules/jest/valid_title.rs:26-37 | crates/oxc_linter/src/rules/vitest/valid_title.rs:26-37 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (12 lines × 2) crates/oxc_minifier/src/traverse_context/scoping.rs:195— crates/oxc_minifier/src/traverse_context/scoping.rs:195-206 | crates/oxc_traverse/src/context/scoping.rs:195-206 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/scoping.rs` and `crates/oxc_traverse/src/context/scoping.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 94 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.
Duplicated block (12 lines × 2) crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs:73— crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs:73-84 | crates/oxc_linter/src/rules/nextjs/no_title_in_document_head.rs:71-82 — before extracting anything, compare `crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs` and `crates/oxc_linter/src/rules/nextjs/no_title_in_document_head.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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.
Duplicated block (12 lines × 2) apps/oxfmt/src/core/external_services.rs:361— apps/oxfmt/src/core/external_services.rs:361-372 | apps/oxfmt/src/core/external_services.rs:389-400 — 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.
ParserImpl::parse_import_declaration (cyclomatic 38) crates/oxc_parser/src/js/module.rs:73— ParserImpl::parse_import_declaration 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.
ParserImpl::is_parenthesized_arrow_function_expression_worker (cyclomatic 32) crates/oxc_parser/src/js/arrow.rs:77— ParserImpl::is_parenthesized_arrow_function_expression_worker 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.
ParserImpl::parse_binary_expression_rest (cyclomatic 25) crates/oxc_parser/src/js/expression.rs:1322— ParserImpl::parse_binary_expression_rest 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.
ParserImpl::parse_non_array_type (cyclomatic 24) crates/oxc_parser/src/ts/types.rs:412— ParserImpl::parse_non_array_type has cyclomatic complexity 24 (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.
ParserImpl::parse_for_statement (cyclomatic 23) crates/oxc_parser/src/js/statement.rs:353— ParserImpl::parse_for_statement 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. This is NOT this file's highest cyclomatic complexity: ParserImpl::parse_statement_list_item (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
ParserImpl::parse_export_declaration (cyclomatic 22) crates/oxc_parser/src/js/module.rs:472— ParserImpl::parse_export_declaration has cyclomatic complexity 22 (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.
ParserImpl::parse_property_declaration (cyclomatic 21) crates/oxc_parser/src/js/class.rs:746— ParserImpl::parse_property_declaration 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.
ParserImpl::parse_import_or_export_specifier (cyclomatic 20) crates/oxc_parser/src/js/module.rs:868— ParserImpl::parse_import_or_export_specifier 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.
ParserImpl::parse_declaration (cyclomatic 20) crates/oxc_parser/src/ts/statement.rs:643— ParserImpl::parse_declaration has cyclomatic complexity 20 (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.
ParserImpl::parse_export_default_declaration_kind (cyclomatic 19) crates/oxc_parser/src/js/module.rs:713— ParserImpl::parse_export_default_declaration_kind 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.
ParserImpl::parse_directives_and_statements (cyclomatic 19) crates/oxc_parser/src/js/statement.rs:33— ParserImpl::parse_directives_and_statements 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. This is NOT this file's highest cyclomatic complexity: ParserImpl::parse_statement_list_item (cyclomatic 30) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
ParserImpl::parse_formal_parameters_list_into (cyclomatic 18) crates/oxc_parser/src/js/function.rs:82— ParserImpl::parse_formal_parameters_list_into 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.
ParserImpl::parse_function (cyclomatic 18) crates/oxc_parser/src/js/function.rs:269— ParserImpl::parse_function 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.
ParserImpl::check_method_definition (cyclomatic 17) crates/oxc_parser/src/js/class.rs:889— ParserImpl::check_method_definition 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.
ParserImpl::at_start_of_ts_declaration_worker (cyclomatic 16) crates/oxc_parser/src/ts/statement.rs:916— ParserImpl::at_start_of_ts_declaration_worker has cyclomatic complexity 16 (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.
Duplicated block (14 lines × 2) apps/oxfmt/src/core/options/to_oxc_formatter_markdown.rs:18— apps/oxfmt/src/core/options/to_oxc_formatter_markdown.rs:18-31 | apps/oxfmt/src/core/options/to_oxc_formatter_yaml.rs:20-33 — 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 (14 lines × 2) crates/oxc_ast/src/ast_kind_impl.rs:349— crates/oxc_ast/src/ast_kind_impl.rs:349-362 | crates/oxc_ast/src/ast_kind_impl.rs:717-730 — 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 (14 lines × 2) crates/oxc_codegen/src/gen.rs:3830— crates/oxc_codegen/src/gen.rs:3830-3843 | crates/oxc_codegen/src/gen.rs:3881-3894 — 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 (14 lines × 2) crates/oxc_linter/src/rules/react/no_danger.rs:70— crates/oxc_linter/src/rules/react/no_danger.rs:70-83 | crates/oxc_linter/src/rules/react/style_prop_object.rs:200-213 — 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 (14 lines × 2) crates/oxc_linter/src/rules/shared/jest_vitest/valid_expect_in_promise.rs:88— crates/oxc_linter/src/rules/shared/jest_vitest/valid_expect_in_promise.rs:88-101 | crates/oxc_linter/src/rules/vitest/prefer_describe_function_title.rs:77-90 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (14 lines × 2) crates/oxc_linter/src/rules/unicorn/no_accessor_recursion.rs:133— crates/oxc_linter/src/rules/unicorn/no_accessor_recursion.rs:133-146 | crates/oxc_linter/src/rules/unicorn/no_accessor_recursion.rs:163-176 — 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 (14 lines × 2) crates/oxc_linter/src/rules/unicorn/no_array_reverse.rs:101— crates/oxc_linter/src/rules/unicorn/no_array_reverse.rs:101-114 | crates/oxc_linter/src/rules/unicorn/no_array_sort.rs:142-155 — 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 (14 lines × 2) crates/oxc_linter/src/rules/unicorn/no_invalid_remove_event_listener.rs:54— crates/oxc_linter/src/rules/unicorn/no_invalid_remove_event_listener.rs:54-67 | crates/oxc_linter/src/rules/unicorn/prefer_dom_node_append.rs:47-60 — 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 (14 lines × 2) crates/oxc_linter/src/rules/vue/no_deprecated_data_object_declaration.rs:66— crates/oxc_linter/src/rules/vue/no_deprecated_data_object_declaration.rs:66-79 | crates/oxc_linter/src/rules/vue/no_shared_component_data.rs:70-83 — 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 (14 lines × 2) crates/oxc_linter/src/rules/vue/no_reserved_keys.rs:261— crates/oxc_linter/src/rules/vue/no_reserved_keys.rs:261-274 | crates/oxc_linter/src/rules/vue/no_reserved_props.rs:183-196 — 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 (14 lines × 2) crates/oxc_minifier/src/traverse_context/ancestry.rs:97— crates/oxc_minifier/src/traverse_context/ancestry.rs:97-110 | crates/oxc_traverse/src/context/ancestry.rs:97-110 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/ancestry.rs` and `crates/oxc_traverse/src/context/ancestry.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 34 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.
Duplicated block (14 lines × 2) crates/oxc_semantic/src/builder.rs:2177— crates/oxc_semantic/src/builder.rs:2177-2190 | crates/oxc_semantic/src/builder.rs:2264-2277 — 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 (14 lines × 2) tasks/ast_tools/src/generators/raw_transfer.rs:1403— tasks/ast_tools/src/generators/raw_transfer.rs:1403-1416 | tasks/ast_tools/src/generators/raw_transfer_lazy.rs:1262-1275 — 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 (14 lines × 2) crates/oxc_linter/src/rules/react/button_has_type.rs:125— crates/oxc_linter/src/rules/react/button_has_type.rs:125-138 | crates/oxc_linter/src/rules/react/iframe_missing_sandbox.rs:144-157 — 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.
oxc_semantic::checker::javascript::check_super (cognitive 86) crates/oxc_semantic/src/checker/javascript.rs:951— oxc_semantic::checker::javascript::check_super has cognitive complexity 86 (threshold 15). Drivers by points: if/else 19 (73 pts), match/switch 3 (7 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_semantic::binder::get_module_instance_state_for_alias_target (cognitive 44) crates/oxc_semantic/src/binder.rs:651— oxc_semantic::binder::get_module_instance_state_for_alias_target has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (28 pts), match/switch 4 (13 pts), loops 2 (3 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.
oxc_semantic::checker::javascript::check_string_literal (cognitive 34) crates/oxc_semantic/src/checker/javascript.rs:430— oxc_semantic::checker::javascript::check_string_literal has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 2 (9 pts), loops 2 (6 pts), boolean chains 1 (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.
oxc_semantic::checker::javascript::check_duplicate_class_elements (cognitive 28) crates/oxc_semantic/src/checker/javascript.rs:84— oxc_semantic::checker::javascript::check_duplicate_class_elements has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, loops 1 (nesting depth added 11). Of this number, 22 points are the body's own statements and 6 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.
oxc_semantic::checker::typescript::check_class (cognitive 27) crates/oxc_semantic/src/checker/typescript.rs:209— oxc_semantic::checker::typescript::check_class has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). 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.
oxc_semantic::checker::javascript::check_private_identifier (cognitive 21) crates/oxc_semantic/src/checker/javascript.rs:374— oxc_semantic::checker::javascript::check_private_identifier has cognitive complexity 21 (threshold 15). Drivers by points: loops 3 (11 pts), if/else 3 (10 pts) (nesting depth added 15). 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.
oxc_semantic::ts_enum::eval::evaluate_enum_members (cognitive 20) crates/oxc_semantic/src/ts_enum/eval.rs:45— oxc_semantic::ts_enum::eval::evaluate_enum_members has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_semantic::binder::get_module_instance_state_for_statement (cognitive 19) crates/oxc_semantic/src/binder.rs:571— oxc_semantic::binder::get_module_instance_state_for_statement has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 2 (3 pts), 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.
oxc_semantic::checker::javascript::check_identifier_reference (cognitive 19) crates/oxc_semantic/src/checker/javascript.rs:288— oxc_semantic::checker::javascript::check_identifier_reference has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 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.
oxc_semantic::checker::javascript::check_binding_identifier (cognitive 16) crates/oxc_semantic/src/checker/javascript.rs:217— oxc_semantic::checker::javascript::check_binding_identifier has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 2 (4 pts), boolean chains 3, loops 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.
oxc_semantic::checker::javascript::check_redeclared_function (cognitive 16) crates/oxc_semantic/src/checker/javascript.rs:672— oxc_semantic::checker::javascript::check_redeclared_function 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.
oxc_semantic::checker::javascript::check_object_expression (cognitive 16) crates/oxc_semantic/src/checker/javascript.rs:1220— oxc_semantic::checker::javascript::check_object_expression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), boolean chains 2, 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.
oxc_semantic::ts_enum::eval::evaluate_expression (cognitive 16) crates/oxc_semantic/src/ts_enum/eval.rs:91— oxc_semantic::ts_enum::eval::evaluate_expression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 2 (6 pts), loops 1 (3 pts) (nesting depth added 10). 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.
oxc_ast_tools::generators::raw_transfer::generate_struct (cognitive 51) tasks/ast_tools/src/generators/raw_transfer.rs:396— oxc_ast_tools::generators::raw_transfer::generate_struct has cognitive complexity 51 (threshold 15). Drivers by points: if/else 21 (37 pts), match/switch 3 (8 pts), boolean chains 3, loops 3 (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.
oxc_ast_tools::generators::formatter::ast_nodes::generate_struct_impls (cognitive 49) tasks/ast_tools/src/generators/formatter/ast_nodes.rs:204— oxc_ast_tools::generators::formatter::ast_nodes::generate_struct_impls has cognitive complexity 49 (threshold 15). Drivers by points: if/else 27 (41 pts), boolean chains 3, match/switch 2 (3 pts), loops 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.
oxc_ast_tools::derives::estree::prepare_field_orders (cognitive 43) tasks/ast_tools/src/derives/estree.rs:253— oxc_ast_tools::derives::estree::prepare_field_orders has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (28 pts), loops 4 (10 pts), match/switch 1 (5 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.
oxc_ast_tools::generators::raw_transfer_lazy::generate_struct (cognitive 35) tasks/ast_tools/src/generators/raw_transfer_lazy.rs:595— oxc_ast_tools::generators::raw_transfer_lazy::generate_struct has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 4, loops 2 (4 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.
oxc_ast_tools::generators::estree_visit::generate (cognitive 33) tasks/ast_tools/src/generators/estree_visit.rs:127— oxc_ast_tools::generators::estree_visit::generate has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 5 (10 pts), loops 3 (5 pts), boolean chains 3 (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.
oxc_ast_tools::generators::typescript::generate_ts_type_def_for_struct_field_impl (cognitive 33) tasks/ast_tools/src/generators/typescript.rs:218— oxc_ast_tools::generators::typescript::generate_ts_type_def_for_struct_field_impl has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (21 pts), match/switch 2 (7 pts), boolean chains 3, loops 1 (2 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.
oxc_ast_tools::derives::estree::parse_estree_attr (cognitive 31) tasks/ast_tools/src/derives/estree.rs:89— oxc_ast_tools::derives::estree::parse_estree_attr has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 6 (11 pts), loops 2 (6 pts) (nesting depth added 18). 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.
oxc_ast_tools::generators::traverse::ancestor::generate_ancestor (cognitive 30) tasks/ast_tools/src/generators/traverse/ancestor.rs:23— oxc_ast_tools::generators::traverse::ancestor::generate_ancestor has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (9 pts), boolean chains 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.
oxc_ast_tools::generators::scopes_collector::generate_visit_method_for_struct (cognitive 25) tasks/ast_tools/src/generators/scopes_collector.rs:318— oxc_ast_tools::generators::scopes_collector::generate_visit_method_for_struct has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 2 (4 pts), boolean chains 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.
oxc_ast_tools::generators::formatter::format::generate_struct_implementation (cognitive 22) tasks/ast_tools/src/generators/formatter/format.rs:109— oxc_ast_tools::generators::formatter::format::generate_struct_implementation has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (17 pts), boolean chains 5 (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.
oxc_ast_tools::generators::typescript::generate_ts_type_def_for_struct (cognitive 21) tasks/ast_tools/src/generators/typescript.rs:109— oxc_ast_tools::generators::typescript::generate_ts_type_def_for_struct has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 3, 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.
oxc_ast_tools::generators::traverse::walk::generate_walk_for_struct (cognitive 17) tasks/ast_tools/src/generators/traverse/walk.rs:142— oxc_ast_tools::generators::traverse::walk::generate_walk_for_struct has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 1 (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.
oxc_ast_tools::generators::raw_transfer::generate_deserializers (cognitive 16) tasks/ast_tools/src/generators/raw_transfer.rs:132— oxc_ast_tools::generators::raw_transfer::generate_deserializers has cognitive complexity 16 (threshold 15). Drivers by points: loops 7 (13 pts), match/switch 1 (2 pts), if/else 1 (nesting depth added 7). 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.
Low cohesion: TypeScriptAnnotations (LCOM4 17) crates/oxc_transformer/src/typescript/annotations.rs:17— TypeScriptAnnotations's methods fall into 17 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 17 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: AstNode (LCOM4 10) crates/oxc_formatter/src/ast_nodes/node.rs:13— AstNode's methods fall into 10 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 10 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: Arena (LCOM4 6) crates/oxc_allocator/src/arena/mod.rs:179— Arena's methods fall into 6 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 6 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: Normalize (LCOM4 6) crates/oxc_minifier/src/peephole/normalize.rs:44— Normalize's methods fall into 6 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 6 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: ExplicitTypesChecker (LCOM4 5) crates/oxc_linter/src/rules/typescript/explicit_module_boundary_types.rs:328— ExplicitTypesChecker'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: Box (LCOM4 4) crates/oxc_allocator/src/boxed.rs:35— Box'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.
Low cohesion: Codegen (LCOM4 4) crates/oxc_codegen/src/lib.rs:87— Codegen'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.
Low cohesion: NonEmptyStack (LCOM4 4) crates/oxc_data_structures/src/stack/non_empty.rs:75— NonEmptyStack'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.
Low cohesion: Visitor (LCOM4 4) crates/oxc_estree_tokens/src/visitor.rs:24— Visitor'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.
Low cohesion: LoopFunctionCollector (LCOM4 4) crates/oxc_linter/src/rules/eslint/no_loop_func.rs:520— LoopFunctionCollector'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.
Low cohesion: BindingMover (LCOM4 4) crates/oxc_transformer/src/es2017/async_to_generator.rs:953— BindingMover'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.
Low cohesion: ObjectRestSpread (LCOM4 4) crates/oxc_transformer/src/es2018/object_rest_spread.rs:57— ObjectRestSpread'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.
Low cohesion: Normalize (LCOM4 4) tasks/codegen_conformance/src/lib.rs:140— Normalize'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.
IsolatedDeclarations::transform_class (cognitive 121) crates/oxc_isolated_declarations/src/class.rs:488— IsolatedDeclarations::transform_class has cognitive complexity 121 (threshold 15). Drivers by points: if/else 33 (97 pts), match/switch 5 (13 pts), boolean chains 10, loops 1 (nesting depth added 72). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IsolatedDeclarations::transform_statements_on_demand (cognitive 93) crates/oxc_isolated_declarations/src/lib.rs:191— IsolatedDeclarations::transform_statements_on_demand has cognitive complexity 93 (threshold 15). Drivers by points: if/else 27 (73 pts), loops 5 (9 pts), match/switch 3 (7 pts), boolean chains 4 (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.
IsolatedDeclarations::report_error_for_expando_function (cognitive 91) crates/oxc_isolated_declarations/src/lib.rs:582— IsolatedDeclarations::report_error_for_expando_function has cognitive complexity 91 (threshold 15). Drivers by points: if/else 17 (63 pts), boolean chains 13, loops 3 (10 pts), match/switch 2 (5 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IsolatedDeclarations::transform_object_expression_to_ts_type (cognitive 47) crates/oxc_isolated_declarations/src/types.rs:100— IsolatedDeclarations::transform_object_expression_to_ts_type has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (39 pts), boolean chains 4, match/switch 2 (3 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IsolatedDeclarations::collect_accessor_annotations (cognitive 42) crates/oxc_isolated_declarations/src/class.rs:396— IsolatedDeclarations::collect_accessor_annotations has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (34 pts), boolean chains 4, match/switch 1 (3 pts), loops 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IsolatedDeclarations::transform_variable_declarator (cognitive 28) crates/oxc_isolated_declarations/src/declaration.rs:46— IsolatedDeclarations::transform_variable_declarator has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 6 (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.
IsolatedDeclarations::transform_declaration (cognitive 26) crates/oxc_isolated_declarations/src/declaration.rs:172— IsolatedDeclarations::transform_declaration has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 7, match/switch 1 (nesting depth added 6). 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.
IsolatedDeclarations::transform_ts_enum_declaration (cognitive 26) crates/oxc_isolated_declarations/src/enum.rs:23— IsolatedDeclarations::transform_ts_enum_declaration has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IsolatedDeclarations::transform_formal_parameter (cognitive 26) crates/oxc_isolated_declarations/src/function.rs:41— IsolatedDeclarations::transform_formal_parameter has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 10, match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IsolatedDeclarations::remove_function_overloads_implementation (cognitive 25) crates/oxc_isolated_declarations/src/lib.rs:458— IsolatedDeclarations::remove_function_overloads_implementation has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 1, match/switch 1 (nesting depth added 12). 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.
IsolatedDeclarations::collect_namespace_properties (cognitive 20) crates/oxc_isolated_declarations/src/lib.rs:528— IsolatedDeclarations::collect_namespace_properties has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), match/switch 2 (4 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.
IsolatedDeclarations::transform_class_property_definition (cognitive 17) crates/oxc_isolated_declarations/src/class.rs:102— IsolatedDeclarations::transform_class_property_definition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (16 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.
Duplicated block (15 lines × 2) crates/oxc_formatter/src/print/class.rs:224— crates/oxc_formatter/src/print/class.rs:224-238 | crates/oxc_formatter/src/print/mod.rs:1837-1851 — 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 (15 lines × 2) crates/oxc_linter/src/config/rules.rs:419— crates/oxc_linter/src/config/rules.rs:419-433 | crates/oxc_linter/src/config/rules.rs:460-474 — 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 (15 lines × 2) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:793— crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:793-807 | crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:897-911 — 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 (15 lines × 2) crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:136— crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:136-150 | crates/oxc_linter/src/rules/jsdoc/require_param_type.rs:134-148 — before extracting anything, compare `crates/oxc_linter/src/rules/jsdoc/require_param_description.rs` and `crates/oxc_linter/src/rules/jsdoc/require_param_type.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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.
Duplicated block (15 lines × 2) crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs:83— crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs:83-97 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_object_as_prop.rs:84-98 — before extracting anything, compare `crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs` and `crates/oxc_linter/src/rules/react_perf/jsx_no_new_object_as_prop.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 50 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.
Duplicated block (15 lines × 2) crates/oxc_linter/src/rules/typescript/no_inferrable_types.rs:248— crates/oxc_linter/src/rules/typescript/no_inferrable_types.rs:248-262 | crates/oxc_linter/src/rules/typescript/no_inferrable_types.rs:298-312 — 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 (15 lines × 2) crates/oxc_linter/src/utils/unicorn.rs:296— crates/oxc_linter/src/utils/unicorn.rs:296-310 | crates/oxc_linter/src/utils/unicorn.rs:313-327 — 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 (15 lines × 2) tasks/ast_tools/src/generators/visit_js.rs:566— tasks/ast_tools/src/generators/visit_js.rs:566-580 | tasks/ast_tools/src/generators/visit_js.rs:696-710 — 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 (15 lines × 2) tasks/ast_tools/src/output/rust.rs:36— tasks/ast_tools/src/output/rust.rs:36-50 | tasks/linter_codegen/src/main.rs:278-292 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (15 lines × 2) tasks/rulegen/src/main.rs:1058— tasks/rulegen/src/main.rs:1058-1072 | tasks/rulegen/src/main.rs:1250-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.
Duplicated block (15 lines × 2) crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs:26— crates/oxc_linter/src/rules/jest/no_restricted_jest_methods.rs:26-40 | crates/oxc_linter/src/rules/vitest/no_restricted_vi_methods.rs:24-38 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (15 lines × 2) tasks/ast_tools/src/generators/raw_transfer_lazy.rs:1037— tasks/ast_tools/src/generators/raw_transfer_lazy.rs:1037-1052 | tasks/ast_tools/src/generators/raw_transfer_lazy.rs:1076-1090 — 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.
IsolatedDeclarations::transform_class (cyclomatic 51) crates/oxc_isolated_declarations/src/class.rs:488— IsolatedDeclarations::transform_class has cyclomatic complexity 51 (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.
IsolatedDeclarations::transform_statements_on_demand (cyclomatic 44) crates/oxc_isolated_declarations/src/lib.rs:191— IsolatedDeclarations::transform_statements_on_demand 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.
IsolatedDeclarations::report_error_for_expando_function (cyclomatic 43) crates/oxc_isolated_declarations/src/lib.rs:582— IsolatedDeclarations::report_error_for_expando_function 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.
IsolatedDeclarations::transform_declaration (cyclomatic 23) crates/oxc_isolated_declarations/src/declaration.rs:172— IsolatedDeclarations::transform_declaration 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.
IsolatedDeclarations::transform_object_expression_to_ts_type (cyclomatic 23) crates/oxc_isolated_declarations/src/types.rs:100— IsolatedDeclarations::transform_object_expression_to_ts_type 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.
IsolatedDeclarations::infer_type_from_expression (cyclomatic 21) crates/oxc_isolated_declarations/src/inferrer.rs:22— IsolatedDeclarations::infer_type_from_expression has cyclomatic complexity 21 (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.
IsolatedDeclarations::eval_binary_expression (cyclomatic 20) crates/oxc_isolated_declarations/src/enum.rs:181— IsolatedDeclarations::eval_binary_expression has cyclomatic complexity 20 (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.
IsolatedDeclarations::transform_expression_to_ts_type_with_const_context (cyclomatic 20) crates/oxc_isolated_declarations/src/types.rs:299— IsolatedDeclarations::transform_expression_to_ts_type_with_const_context has cyclomatic complexity 20 (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.
IsolatedDeclarations::transform_formal_parameter (cyclomatic 19) crates/oxc_isolated_declarations/src/function.rs:41— IsolatedDeclarations::transform_formal_parameter 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.
IsolatedDeclarations::transform_variable_declarator (cyclomatic 18) crates/oxc_isolated_declarations/src/declaration.rs:46— IsolatedDeclarations::transform_variable_declarator 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.
IsolatedDeclarations::collect_accessor_annotations (cyclomatic 16) crates/oxc_isolated_declarations/src/class.rs:396— IsolatedDeclarations::collect_accessor_annotations 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.
oxc_ecmascript::constant_evaluation::binary_operation_evaluate_value_to (cognitive 61) crates/oxc_ecmascript/src/constant_evaluation/mod.rs:210— oxc_ecmascript::constant_evaluation::binary_operation_evaluate_value_to has cognitive complexity 61 (threshold 15). Drivers by points: if/else 17 (43 pts), boolean chains 11, match/switch 5 (7 pts) (nesting depth added 28). 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.
oxc_ecmascript::constant_evaluation::equality_comparison::abstract_equality_comparison (cognitive 40) crates/oxc_ecmascript/src/constant_evaluation/equality_comparison.rs:6— oxc_ecmascript::constant_evaluation::equality_comparison::abstract_equality_comparison has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (34 pts), boolean chains 6 (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.
oxc_ecmascript::is_less_than::is_less_than (cognitive 34) crates/oxc_ecmascript/src/is_less_than.rs:14— oxc_ecmascript::is_less_than::is_less_than has cognitive complexity 34 (threshold 15). Drivers by points: if/else 15 (19 pts), boolean chains 15 (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.
oxc_ecmascript::number_literal::number_literal (cognitive 30) crates/oxc_ecmascript/src/number_literal.rs:20— oxc_ecmascript::number_literal::number_literal has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 4 (10 pts), boolean chains 6 (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.
oxc_ecmascript::side_effects::expressions::is_side_effect_free_unbound_identifier_ref (cognitive 30) crates/oxc_ecmascript/src/side_effects/expressions.rs:992— oxc_ecmascript::side_effects::expressions::is_side_effect_free_unbound_identifier_ref has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (25 pts), boolean chains 4, 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.
oxc_ecmascript::constant_evaluation::call_expr::try_fold_global_parse_int (cognitive 24) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:803— oxc_ecmascript::constant_evaluation::call_expr::try_fold_global_parse_int has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 4 (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.
oxc_ecmascript::constant_evaluation::is_literal_value::can_convert_to_number_transparently (cognitive 24) crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:208— oxc_ecmascript::constant_evaluation::is_literal_value::can_convert_to_number_transparently has cognitive complexity 24 (threshold 15). Drivers by points: boolean chains 13, if/else 2 (6 pts), match/switch 3 (5 pts) (nesting depth added 6). 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.
oxc_ecmascript::constant_evaluation::call_expr::try_fold_to_string (cognitive 23) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:325— oxc_ecmascript::constant_evaluation::call_expr::try_fold_to_string has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, match/switch 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.
oxc_ecmascript::constant_evaluation::call_expr::try_fold_math_variadic (cognitive 23) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:497— oxc_ecmascript::constant_evaluation::call_expr::try_fold_math_variadic has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 4, match/switch 2 (4 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.
oxc_ecmascript::constant_evaluation::call_expr::find_str_decimal_literal_prefix (cognitive 23) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:710— oxc_ecmascript::constant_evaluation::call_expr::find_str_decimal_literal_prefix has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). Most of this is not in the body itself: 11 of the 23 points are its own statements and the rest belongs to 2 function items inside it that branch (match_decimal_digits, match_exponent_part). 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.
oxc_ecmascript::constant_evaluation::url_encoding::dec::decode (cognitive 18) crates/oxc_ecmascript/src/constant_evaluation/url_encoding/dec.rs:9— oxc_ecmascript::constant_evaluation::url_encoding::dec::decode has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 1 (2 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.
oxfmt::prettier_compat::to_prettier_doc::convert_elements (cognitive 92) apps/oxfmt/src/prettier_compat/to_prettier_doc.rs:183— oxfmt::prettier_compat::to_prettier_doc::convert_elements has cognitive complexity 92 (threshold 15). Drivers by points: if/else 25 (78 pts), match/switch 3 (9 pts), boolean chains 4, loops 1 (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxfmt::prettier_compat::from_prettier_doc::postprocess (cognitive 46) apps/oxfmt/src/prettier_compat/from_prettier_doc.rs:501— oxfmt::prettier_compat::from_prettier_doc::postprocess has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (33 pts), loops 3 (8 pts), boolean chains 5 (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.
oxfmt::prettier_compat::from_prettier_doc::convert_align (cognitive 40) apps/oxfmt/src/prettier_compat/from_prettier_doc.rs:307— oxfmt::prettier_compat::from_prettier_doc::convert_align has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (36 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 23). 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.
oxfmt::core::options::to_prettier::to_prettier (cognitive 36) apps/oxfmt/src/core/options/to_prettier.rs:29— oxfmt::core::options::to_prettier::to_prettier has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18, match/switch 9 (18 pts) (nesting depth added 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.
oxfmt::core::options::to_oxc_formatter::to_oxc_formatter (cognitive 35) apps/oxfmt/src/core/options/to_oxc_formatter.rs:24— oxfmt::core::options::to_oxc_formatter::to_oxc_formatter has cognitive complexity 35 (threshold 15). Drivers by points: if/else 21 (25 pts), match/switch 5 (10 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, 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.
oxfmt::core::options::to_oxc_formatter::to_sort_imports (cognitive 21) apps/oxfmt/src/core/options/to_oxc_formatter.rs:156— oxfmt::core::options::to_oxc_formatter::to_sort_imports has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (5 pts), loops 1 (2 pts) (nesting depth added 7). 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.
oxfmt::core::config::editorconfig::apply_editorconfig (cognitive 20) apps/oxfmt/src/core/config/editorconfig.rs:89— oxfmt::core::config::editorconfig::apply_editorconfig has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (9 pts), match/switch 3 (6 pts), boolean chains 5 (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.
oxfmt::lsp::server_formatter::compute_minimal_text_edit (cognitive 16) apps/oxfmt/src/lsp/server_formatter.rs:460— oxfmt::lsp::server_formatter::compute_minimal_text_edit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, 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.
oxfmt::prettier_compat::from_prettier_doc::convert_doc (cognitive 16) apps/oxfmt/src/prettier_compat/from_prettier_doc.rs:84— oxfmt::prettier_compat::from_prettier_doc::convert_doc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 3 (5 pts), loops 1 (2 pts) (nesting depth added 8). 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.
oxfmt::prettier_compat::to_prettier_doc::push_text (cognitive 16) apps/oxfmt/src/prettier_compat/to_prettier_doc.rs:471— oxfmt::prettier_compat::to_prettier_doc::push_text has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, match/switch 1 (2 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.
oxc_ecmascript::constant_evaluation::binary_operation_evaluate_value_to (cyclomatic 54) crates/oxc_ecmascript/src/constant_evaluation/mod.rs:210— oxc_ecmascript::constant_evaluation::binary_operation_evaluate_value_to has cyclomatic complexity 54 (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.
oxc_ecmascript::constant_evaluation::is_literal_value::can_convert_to_number_transparently (cyclomatic 31) crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:208— oxc_ecmascript::constant_evaluation::is_literal_value::can_convert_to_number_transparently has cyclomatic complexity 31 (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.
oxc_ecmascript::is_less_than::is_less_than (cyclomatic 31) crates/oxc_ecmascript/src/is_less_than.rs:14— oxc_ecmascript::is_less_than::is_less_than has cyclomatic complexity 31 (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.
oxc_ecmascript::constant_evaluation::call_expr::try_fold_global_parse_int (cyclomatic 21) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:803— oxc_ecmascript::constant_evaluation::call_expr::try_fold_global_parse_int 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.
oxc_ecmascript::side_effects::expressions::is_side_effect_free_unbound_identifier_ref (cyclomatic 21) crates/oxc_ecmascript/src/side_effects/expressions.rs:992— oxc_ecmascript::side_effects::expressions::is_side_effect_free_unbound_identifier_ref 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. This is NOT this file's highest cyclomatic complexity: Expression::may_have_side_effects (cyclomatic 27) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
oxc_ecmascript::constant_evaluation::equality_comparison::abstract_equality_comparison (cyclomatic 20) crates/oxc_ecmascript/src/constant_evaluation/equality_comparison.rs:6— oxc_ecmascript::constant_evaluation::equality_comparison::abstract_equality_comparison 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.
oxc_ecmascript::number_literal::number_literal (cyclomatic 20) crates/oxc_ecmascript/src/number_literal.rs:20— oxc_ecmascript::number_literal::number_literal 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.
oxc_ecmascript::constant_evaluation::call_expr::try_fold_to_string (cyclomatic 17) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:325— oxc_ecmascript::constant_evaluation::call_expr::try_fold_to_string 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 is NOT this file's highest cyclomatic complexity: oxc_ecmascript::constant_evaluation::call_expr::try_fold_known_global_methods (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
oxc_ecmascript::constant_evaluation::call_expr::find_str_decimal_literal_prefix (cyclomatic 17) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:710— oxc_ecmascript::constant_evaluation::call_expr::find_str_decimal_literal_prefix has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 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. This is NOT this file's highest cyclomatic complexity: oxc_ecmascript::constant_evaluation::call_expr::try_fold_known_global_methods (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
oxc_ast_tools::derives::estree::parse_estree_attr (cyclomatic 44) tasks/ast_tools/src/derives/estree.rs:89— oxc_ast_tools::derives::estree::parse_estree_attr has cyclomatic complexity 44 (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.
oxc_ast_tools::generators::estree_visit::generate (cyclomatic 28) tasks/ast_tools/src/generators/estree_visit.rs:127— oxc_ast_tools::generators::estree_visit::generate has cyclomatic complexity 28 (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.
oxc_ast_tools::generators::formatter::ast_nodes::generate_struct_impls (cyclomatic 28) tasks/ast_tools/src/generators/formatter/ast_nodes.rs:204— oxc_ast_tools::generators::formatter::ast_nodes::generate_struct_impls 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.
oxc_ast_tools::generators::raw_transfer::generate_struct (cyclomatic 27) tasks/ast_tools/src/generators/raw_transfer.rs:396— oxc_ast_tools::generators::raw_transfer::generate_struct 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.
oxc_ast_tools::generators::raw_transfer_lazy::generate_struct (cyclomatic 20) tasks/ast_tools/src/generators/raw_transfer_lazy.rs:595— oxc_ast_tools::generators::raw_transfer_lazy::generate_struct 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.
oxc_ast_tools::generators::typescript::generate_ts_type_def_for_struct_field_impl (cyclomatic 19) tasks/ast_tools/src/generators/typescript.rs:218— oxc_ast_tools::generators::typescript::generate_ts_type_def_for_struct_field_impl 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.
oxc_ast_tools::derives::estree::prepare_field_orders (cyclomatic 16) tasks/ast_tools/src/derives/estree.rs:253— oxc_ast_tools::derives::estree::prepare_field_orders 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.
oxc_ast_tools::generators::raw_transfer::generate_deserializers (cyclomatic 16) tasks/ast_tools/src/generators/raw_transfer.rs:132— oxc_ast_tools::generators::raw_transfer::generate_deserializers has cyclomatic complexity 16 (threshold 15). 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.
oxc_ast_tools::generators::typescript::generate_ts_type_def_for_struct (cyclomatic 16) tasks/ast_tools/src/generators/typescript.rs:109— oxc_ast_tools::generators::typescript::generate_ts_type_def_for_struct has cyclomatic complexity 16 (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.
oxfmt::prettier_compat::to_prettier_doc::convert_elements (cyclomatic 41) apps/oxfmt/src/prettier_compat/to_prettier_doc.rs:183— oxfmt::prettier_compat::to_prettier_doc::convert_elements 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.
oxfmt::core::options::to_prettier::to_prettier (cyclomatic 33) apps/oxfmt/src/core/options/to_prettier.rs:29— oxfmt::core::options::to_prettier::to_prettier has cyclomatic complexity 33 (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.
oxfmt::core::options::to_oxc_formatter::to_oxc_formatter (cyclomatic 25) apps/oxfmt/src/core/options/to_oxc_formatter.rs:24— oxfmt::core::options::to_oxc_formatter::to_oxc_formatter has cyclomatic complexity 25 (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.
oxfmt::prettier_compat::from_prettier_doc::convert_doc (cyclomatic 24) apps/oxfmt/src/prettier_compat/from_prettier_doc.rs:84— oxfmt::prettier_compat::from_prettier_doc::convert_doc has cyclomatic complexity 24 (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.
oxfmt::prettier_compat::from_prettier_doc::convert_align (cyclomatic 20) apps/oxfmt/src/prettier_compat/from_prettier_doc.rs:307— oxfmt::prettier_compat::from_prettier_doc::convert_align 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.
oxfmt::core::config::editorconfig::apply_editorconfig (cyclomatic 19) apps/oxfmt/src/core/config/editorconfig.rs:89— oxfmt::core::config::editorconfig::apply_editorconfig has cyclomatic complexity 19 (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.
oxfmt::prettier_compat::from_prettier_doc::postprocess (cyclomatic 19) apps/oxfmt/src/prettier_compat/from_prettier_doc.rs:501— oxfmt::prettier_compat::from_prettier_doc::postprocess 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.
oxfmt::prettier_compat::to_prettier_doc::build_doc (cyclomatic 19) apps/oxfmt/src/prettier_compat/to_prettier_doc.rs:581— oxfmt::prettier_compat::to_prettier_doc::build_doc has cyclomatic complexity 19 (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.
oxfmt::core::support::classify_file (cyclomatic 16) apps/oxfmt/src/core/support.rs:16— oxfmt::core::support::classify_file has cyclomatic complexity 16 (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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×9
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:137— crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:137-165 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:171-202 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:208-227 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:233-252 — 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) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:551— crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:551-575 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:580-600 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:605-622 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:627-645 — 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) crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:172— crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:172-201 | crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:203-242 | crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:412-440 | crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:442-470 — 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) crates/oxc_linter/src/rules/jsdoc/check_property_names.rs:68— crates/oxc_linter/src/rules/jsdoc/check_property_names.rs:68-117 | crates/oxc_linter/src/rules/jsdoc/require_property_description.rs:54-78 | crates/oxc_linter/src/rules/jsdoc/require_property_name.rs:54-78 | crates/oxc_linter/src/rules/jsdoc/require_property_type.rs:54-78 — 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) crates/oxc_linter/src/rules/jsdoc/require_throws_description.rs:58— crates/oxc_linter/src/rules/jsdoc/require_throws_description.rs:58-81 | crates/oxc_linter/src/rules/jsdoc/require_throws_type.rs:54-79 | crates/oxc_linter/src/rules/jsdoc/require_yields_description.rs:58-81 | crates/oxc_linter/src/rules/jsdoc/require_yields_type.rs:50-75 — 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) crates/oxc_linter/src/rules/react_perf/jsx_no_jsx_as_prop.rs:111— crates/oxc_linter/src/rules/react_perf/jsx_no_jsx_as_prop.rs:111-122 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs:126-159 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_function_as_prop.rs:123-151 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_object_as_prop.rs:127-160 — 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) crates/oxc_linter/src/rules/shared/jest_vitest/no_alias_methods.rs:16— crates/oxc_linter/src/rules/shared/jest_vitest/no_alias_methods.rs:16-48 | crates/oxc_linter/src/rules/shared/jest_vitest/no_interpolation_in_snapshots.rs:50-77 | crates/oxc_linter/src/rules/shared/jest_vitest/prefer_comparison_matcher.rs:59-122 | crates/oxc_linter/src/rules/shared/jest_vitest/require_to_throw_message.rs:54-80 — 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) crates/oxc_minifier/src/peephole/remove_unused_expression.rs:322— crates/oxc_minifier/src/peephole/remove_unused_expression.rs:322-339 | crates/oxc_minifier/src/peephole/remove_unused_expression.rs:342-432 | crates/oxc_minifier/src/peephole/remove_unused_expression.rs:435-521 | crates/oxc_minifier/src/peephole/remove_unused_expression.rs:668-700 — 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) tasks/ast_tools/src/generators/visit.rs:516— tasks/ast_tools/src/generators/visit.rs:516-641 | tasks/ast_tools/src/generators/visit.rs:646-742 | tasks/ast_tools/src/generators/visit_js.rs:559-678 | tasks/ast_tools/src/generators/visit_js.rs:688-767 — 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.
Duplicated block (24 lines × 2) apps/oxlint/src/js_plugins/parse.rs:132— apps/oxlint/src/js_plugins/parse.rs:132-155 | napi/parser/src/raw_transfer.rs:201-224 — before extracting anything, compare `apps/oxlint/src/js_plugins/parse.rs` and `napi/parser/src/raw_transfer.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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.
Duplicated block (24 lines × 2) REDACTED:870— REDACTED:870-893 | REDACTED:1214-1237 — 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 (24 lines × 2) crates/oxc_linter/src/disable_directives.rs:647— crates/oxc_linter/src/disable_directives.rs:647-670 | crates/oxc_linter/src/disable_directives.rs:703-726 — 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 (24 lines × 2) crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:417— crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:417-440 | crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:447-470 — 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 (24 lines × 2) crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:376— crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:376-399 | crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs:427-450 — `crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs` and `crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (24 lines × 2) crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:451— crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:451-474 | crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs:491-514 — `crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs` and `crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (24 lines × 2) crates/oxc_semantic/src/binder.rs:249— crates/oxc_semantic/src/binder.rs:249-272 | crates/oxc_semantic/src/binder.rs:284-307 — 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 (24 lines × 2) tasks/ast_tools/src/generators/visit.rs:348— tasks/ast_tools/src/generators/visit.rs:348-371 | tasks/ast_tools/src/generators/visit_js.rs:388-411 — before extracting anything, compare `tasks/ast_tools/src/generators/visit.rs` and `tasks/ast_tools/src/generators/visit_js.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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.
Duplicated block (24 lines × 2) crates/oxc_data_structures/src/stack/non_empty.rs:417— crates/oxc_data_structures/src/stack/non_empty.rs:417-440 | crates/oxc_data_structures/src/stack/standard.rs:394-417 — 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.
ClassProperties::transform_class_body_on_entry (cognitive 83) crates/oxc_transformer/src/es2022/class_properties/class.rs:59— ClassProperties::transform_class_body_on_entry has cognitive complexity 83 (threshold 15). Drivers by points: if/else 35 (65 pts), match/switch 4 (9 pts), boolean chains 7, loops 2 (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.
ClassProperties::transform_class_declaration_on_exit_impl (cognitive 47) crates/oxc_transformer/src/es2022/class_properties/class.rs:443— ClassProperties::transform_class_declaration_on_exit_impl has cognitive complexity 47 (threshold 15). Drivers by points: if/else 17 (35 pts), loops 2 (7 pts), boolean chains 4, match/switch 1 (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.
ClassProperties::transform_class_expression_on_exit_impl (cognitive 47) crates/oxc_transformer/src/es2022/class_properties/class.rs:613— ClassProperties::transform_class_expression_on_exit_impl has cognitive complexity 47 (threshold 15). Drivers by points: if/else 21 (40 pts), loops 2 (4 pts), boolean chains 3 (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.
ClassProperties::transform_private_field_expression_impl (cognitive 38) crates/oxc_transformer/src/es2022/class_properties/private_field.rs:59— ClassProperties::transform_private_field_expression_impl has cognitive complexity 38 (threshold 15). Drivers by points: if/else 22 (34 pts), match/switch 2 (4 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.
ClassProperties::transform_update_expression_impl (cognitive 26) crates/oxc_transformer/src/es2022/class_properties/private_field.rs:927— ClassProperties::transform_update_expression_impl has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (24 pts), boolean chains 1, match/switch 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.
ClassProperties::transform_private_field_callee (cognitive 24) crates/oxc_transformer/src/es2022/class_properties/private_field.rs:333— ClassProperties::transform_private_field_callee has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (24 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.
ClassProperties::transform_static_assignment_expression (cognitive 22) crates/oxc_transformer/src/es2022/class_properties/private_field.rs:594— ClassProperties::transform_static_assignment_expression has cognitive complexity 22 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 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.
ClassProperties::transform_first_optional_expression (cognitive 16) crates/oxc_transformer/src/es2022/class_properties/private_field.rs:1303— ClassProperties::transform_first_optional_expression has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (nesting depth added 6). 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.
Walk::keyword_word (cognitive 30) crates/oxc_lexer/src/pipeline/disambiguate/context/words.rs:149— Walk::keyword_word has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 6, match/switch 1 (nesting depth added 9). 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.
Walk::step_op (cognitive 28) crates/oxc_lexer/src/pipeline/disambiguate/context/punct.rs:11— Walk::step_op has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 12, match/switch 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.
Walk::step (cognitive 27) crates/oxc_lexer/src/pipeline/disambiguate/context/step.rs:28— Walk::step has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 7, match/switch 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.
Walk::colon (cognitive 20) crates/oxc_lexer/src/pipeline/disambiguate/context/punct.rs:152— Walk::colon has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 4, loops 1, match/switch 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.
Walk::type_op (cognitive 20) crates/oxc_lexer/src/pipeline/disambiguate/context/types.rs:57— Walk::type_op has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 1, match/switch 1 (nesting depth added 6). 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.
Walk::resolve_keyword (cognitive 20) crates/oxc_lexer/src/pipeline/disambiguate/context/words.rs:70— Walk::resolve_keyword has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 17, if/else 2, match/switch 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.
Walk::classify_after (cognitive 17) crates/oxc_lexer/src/pipeline/disambiguate/context/walker.rs:313— Walk::classify_after has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), 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.
Walk::member_word (cognitive 17) crates/oxc_lexer/src/pipeline/disambiguate/context/words.rs:292— Walk::member_word has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 9, if/else 6 (8 pts) (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.
Change coupling: REDACTED ↔ to_prettier.rs apps/oxfmt/src/core/config/mod.rs— `apps/oxfmt/src/core/config/mod.rs` and `apps/oxfmt/src/core/options/to_prettier.rs` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `b92957d1` refactor(oxfmt): simplify `FormatStrategy` and resolution (#27335); `13c5374a` refactor(oxfmt): rename "external_formatter" to "prettier" (#25430); `6e8e8185` feat(oxfmt): Experimental .svelte support (#21700) (at that commit the file was still `apps/oxfmt/src/core/config.rs`) — run `git show` on any of them.
Change coupling: css.rs ↔ html.rs crates/oxc_formatter/src/print/template/embed/css.rs— `crates/oxc_formatter/src/print/template/embed/css.rs` and `crates/oxc_formatter/src/print/template/embed/html.rs` change together 64% of the time (9 of the 14 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `b3ad060c` refactor(formatter): migrate embedded entries to `FormatSession` (#25…; `11e0645d` refactor(oxfmt,formatter_core): add `DispatchOutcome` with recursion …; `4e030183` refactor(oxfmt,formatter): clean up tailwind sorter usage (#23809) — run `git show` on any of them.
Change coupling: text-to-doc.ts ↔ text_to_doc_api.rs apps/oxfmt/src-js/libs/prettier-plugin-oxfmt/text-to-doc.ts— `apps/oxfmt/src-js/libs/prettier-plugin-oxfmt/text-to-doc.ts` and `apps/oxfmt/src/api/text_to_doc_api.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a9e76e9e` fix(oxfmt): rework tsx-in-vue support (#25106); `1b57f783` feat(oxfmt): support tsx-in-vue (#25063); `6e8e8185` feat(oxfmt): Experimental .svelte support (#21700) — run `git show` on any of them.
Change coupling: common.rs ↔ angle_brackets.rs crates/oxc_lexer/src/pipeline/carve/common.rs— `crates/oxc_lexer/src/pipeline/carve/common.rs` and `crates/oxc_lexer/src/pipeline/carve/jsx/angle_brackets.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `feee05dc` perf(lexer): classify keywords without branches (#27169); `3eb18b20` refactor(lexer): move byte classifier functions into separate file (#…; `f35cd186` refactor(lexer): replace `diag_code` consts with `DiagCode` enum (#26… — run `git show` on any of them.
Change coupling: stdin_runner.rs ↔ walk.rs apps/oxfmt/src/cli/stdin_runner.rs— `apps/oxfmt/src/cli/stdin_runner.rs` and `apps/oxfmt/src/cli/walk.rs` change together 55% of the time (17 of the 31 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 17 shared commits counted here, the most recent 3 are `f330f8d6` refactor(oxfmt): rename `FileKind` -> `FormatStrategy`, `FormatStrate…; `fca9d0ec` refactor(oxfmt): introduce `ConfigScopes` to share config loading log…; `676f7b81` refactor(oxfmt): share ignore logic between cli and lsp (#27125) — run `git show` on any of them.
Change coupling: lint.rs ↔ default.rs apps/oxlint/src/lint.rs— `apps/oxlint/src/lint.rs` and `apps/oxlint/src/output_formatter/default.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `a047b67a` feat(linter): report JavaScript plugin rule timings (#26415); `b41bb35b` fix(linter): qualify rules in rules output (#26250); `b46d4dee` feat(linter): add `--debug` options and add per-rule timing info (#22… — run `git show` on any of them.
Change coupling: REDACTED ↔ diagnostics.rs crates/oxc_semantic/src/checker/mod.rs— `crates/oxc_semantic/src/checker/mod.rs` and `crates/oxc_semantic/src/diagnostics.rs` change together 52% of the time (13 of the 25 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `b2793fa2` fix(parser): reject module syntax in script (#27220); `65f92331` refactor(parser): emit all TS1274 checks from parser (#23361); `47991bd7` feat(semantic): report TS1228 for invalid type predicates (#23174) — run `git show` on any of them.
Change coupling: format_api.rs ↔ server_formatter.rs apps/oxfmt/src/api/format_api.rs— `apps/oxfmt/src/api/format_api.rs` and `apps/oxfmt/src/lsp/server_formatter.rs` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `f330f8d6` refactor(oxfmt): rename `FileKind` -> `FormatStrategy`, `FormatStrate…; `673dc6db` docs(oxfmt): move some docs from AGENTS.md to code comment (#25649); `a26f8564` refactor(oxfmt): rename `external_formatter` to `external_services` (… — run `git show` on any of them.
Duplicated block (18 lines × 2) crates/oxc_allocator/src/allocator.rs:420— crates/oxc_allocator/src/allocator.rs:420-437 | crates/oxc_allocator/src/string_builder.rs:223-240 — before extracting anything, compare `crates/oxc_allocator/src/allocator.rs` and `crates/oxc_allocator/src/string_builder.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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.
Duplicated block (18 lines × 2) crates/oxc_diagnostics/src/service.rs:332— crates/oxc_diagnostics/src/service.rs:332-349 | crates/oxc_language_server/src/uri_utils.rs:34-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (18 lines × 2) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:769— crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:769-786 | crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:873-890 — 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 (18 lines × 2) crates/oxc_linter/src/rules/typescript/adjacent_overload_signatures.rs:191— crates/oxc_linter/src/rules/typescript/adjacent_overload_signatures.rs:191-208 | crates/oxc_linter/src/rules/typescript/adjacent_overload_signatures.rs:230-247 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/oxc_linter/src/rules/typescript/no_inferrable_types.rs:106— crates/oxc_linter/src/rules/typescript/no_inferrable_types.rs:106-123 | crates/oxc_linter/src/rules/typescript/no_inferrable_types.rs:126-143 — 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 (18 lines × 2) crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:233— crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:233-250 | crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:253-270 — 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 (18 lines × 2) crates/oxc_linter/src/rules/unicorn/prefer_modern_math_apis.rs:127— crates/oxc_linter/src/rules/unicorn/prefer_modern_math_apis.rs:127-144 | crates/oxc_linter/src/rules/unicorn/prefer_modern_math_apis.rs:186-203 — 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 (18 lines × 2) crates/oxc_minifier/src/peephole/remove_unused_expression.rs:415— crates/oxc_minifier/src/peephole/remove_unused_expression.rs:415-432 | crates/oxc_minifier/src/peephole/remove_unused_expression.rs:504-521 — 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.
Off the main sequence: website_common — website_common: abstractness 0.00, instability 0.00, distance 1.00 — 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.
Off the main sequence: oxc_str — oxc_str: abstractness 0.00, instability 0.08, distance 0.92 — zone of pain — concrete and depended on by 23 project(s), so it's rigid to change.
Off the main sequence: oxc_language_server — oxc_language_server: abstractness 0.12, instability 0.00, distance 0.88 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: oxc_tasks_common — oxc_tasks_common: abstractness 0.00, instability 0.13, distance 0.88 — 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.
Off the main sequence: oxc_diagnostics — oxc_diagnostics: abstractness 0.10, instability 0.04, distance 0.86 — zone of pain — concrete and depended on by 25 project(s), so it's rigid to change.
Off the main sequence: oxc_ast_visit — oxc_ast_visit: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
Off the main sequence: oxc_config — oxc_config: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: oxc_ast — oxc_ast: abstractness 0.01, instability 0.26, distance 0.74 — zone of pain — concrete and depended on by 26 project(s), so it's rigid to change.
Walk::step_op (cyclomatic 44) crates/oxc_lexer/src/pipeline/disambiguate/context/punct.rs:11— Walk::step_op has cyclomatic complexity 44 (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.
Walk::keyword_word (cyclomatic 33) crates/oxc_lexer/src/pipeline/disambiguate/context/words.rs:149— Walk::keyword_word has cyclomatic complexity 33 (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.
Walk::resolve_keyword (cyclomatic 29) crates/oxc_lexer/src/pipeline/disambiguate/context/words.rs:70— Walk::resolve_keyword has cyclomatic complexity 29 (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.
Walk::step (cyclomatic 27) crates/oxc_lexer/src/pipeline/disambiguate/context/step.rs:28— Walk::step 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.
Walk::type_op (cyclomatic 19) crates/oxc_lexer/src/pipeline/disambiguate/context/types.rs:57— Walk::type_op 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.
Walk::colon (cyclomatic 18) crates/oxc_lexer/src/pipeline/disambiguate/context/punct.rs:152— Walk::colon 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.
Walk::member_word (cyclomatic 16) crates/oxc_lexer/src/pipeline/disambiguate/context/words.rs:292— Walk::member_word 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.
XxxComment apps/oxfmt/src-js/cli/worker-proxy.ts:36— // XXX: Use `child_process` instead of `worker_threads`. — 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.
XxxComment crates/oxc_linter/src/rules/eslint/no_warning_comments.rs:97— /// /* XXX: hack */ — 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.
XxxComment crates/oxc_parser/src/ts/types.rs:101— // ( xxx : — 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.
XxxComment crates/oxc_parser/src/ts/types.rs:102— // ( xxx , — 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.
XxxComment crates/oxc_parser/src/ts/types.rs:103— // ( xxx ? — 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.
XxxComment crates/oxc_parser/src/ts/types.rs:104— // ( xxx = — 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.
XxxComment crates/oxc_parser/src/ts/types.rs:112— // ( xxx ) => — 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.
Duplicated block (17 lines × 2) crates/oxc_codegen/src/gen.rs:3022— crates/oxc_codegen/src/gen.rs:3022-3038 | crates/oxc_codegen/src/gen.rs:3077-3093 — 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) REDACTED:375— REDACTED:375-391 | REDACTED:768-784 — 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) crates/oxc_formatter/src/parentheses/expression.rs:576— crates/oxc_formatter/src/parentheses/expression.rs:576-592 | crates/oxc_formatter/src/parentheses/expression.rs:743-759 — 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) crates/oxc_lexer/src/pipeline/scan/avx2.rs:32— crates/oxc_lexer/src/pipeline/scan/avx2.rs:32-48 | crates/oxc_lexer/src/pipeline/scan/generic.rs:30-46 — before extracting anything, compare `crates/oxc_lexer/src/pipeline/scan/avx2.rs` and `crates/oxc_lexer/src/pipeline/scan/generic.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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.
Duplicated block (17 lines × 2) crates/oxc_linter/src/rules/jsdoc/require_yields.rs:132— crates/oxc_linter/src/rules/jsdoc/require_yields.rs:132-148 | crates/oxc_linter/src/rules/jsdoc/require_yields.rs:223-239 — 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) crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:432— crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:432-448 | crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs:472-488 — `crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs` and `crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 118 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 2) crates/oxc_transformer/src/common/arrow_function_converter.rs:955— crates/oxc_transformer/src/common/arrow_function_converter.rs:955-971 | crates/oxc_transformer/src/common/arrow_function_converter.rs:985-1001 — 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.
Boundary violation [package:relative-cross-package] apps/oxlint/conformance/src/groups/storybook.ts:68— apps/oxlint/conformance/src/groups/storybook.ts:68 reaches into another package with a relative path (../../../../package.json) — import the package by name instead.
Boundary violation [package:relative-cross-package] napi/minify/scripts/patch.js:4— napi/minify/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead.
Boundary violation [package:relative-cross-package] napi/parser/scripts/patch.js:4— napi/parser/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead.
Boundary violation [package:relative-cross-package] napi/playground/scripts/patch-wasi-browser.js:3— napi/playground/scripts/patch-wasi-browser.js:3 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead.
Boundary violation [package:relative-cross-package] napi/transform-react/scripts/patch.js:4— napi/transform-react/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead.
Boundary violation [package:relative-cross-package] napi/transform-relay/scripts/patch.js:4— napi/transform-relay/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead.
Boundary violation [package:relative-cross-package] napi/transform/scripts/patch.js:4— napi/transform/scripts/patch.js:4 reaches into another package with a relative path (../../disable-reused-workers.mjs) — import the package by name instead.
applyDecs2301.applyDecs2301Factory::applyMemberDec (cyclomatic 41) npm/runtime/src/helpers/applyDecs2301.js:100— applyDecs2301.applyDecs2301Factory::applyMemberDec 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. This shape REPEATS in the file: 2 other methods here (applyDecs2301.applyDecs2301Factory::memberDec, applyDecs2301.applyDecs2301Factory::applyMemberDecs) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
applyDecs2301.applyDecs2301Factory::applyMemberDec (cyclomatic 41) npm/runtime/src/helpers/esm/applyDecs2301.js:100— applyDecs2301.applyDecs2301Factory::applyMemberDec 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. This shape REPEATS in the file: 2 other methods here (applyDecs2301.applyDecs2301Factory::memberDec, applyDecs2301.applyDecs2301Factory::applyMemberDecs) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
applyDecs2301.applyDecs2301Factory::memberDec (cyclomatic 23) npm/runtime/src/helpers/applyDecs2301.js:16— applyDecs2301.applyDecs2301Factory::memberDec 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. This shape REPEATS in the file: 2 other methods here (applyDecs2301.applyDecs2301Factory::applyMemberDec, applyDecs2301.applyDecs2301Factory::applyMemberDecs) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
applyDecs2301.applyDecs2301Factory::memberDec (cyclomatic 23) npm/runtime/src/helpers/esm/applyDecs2301.js:16— applyDecs2301.applyDecs2301Factory::memberDec 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. This shape REPEATS in the file: 2 other methods here (applyDecs2301.applyDecs2301Factory::applyMemberDec, applyDecs2301.applyDecs2301Factory::applyMemberDecs) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
applyDecs2301.applyDecs2301Factory::applyMemberDecs (cyclomatic 21) npm/runtime/src/helpers/applyDecs2301.js:159— applyDecs2301.applyDecs2301Factory::applyMemberDecs 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. This shape REPEATS in the file: 2 other methods here (applyDecs2301.applyDecs2301Factory::memberDec, applyDecs2301.applyDecs2301Factory::applyMemberDec) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
applyDecs2301.applyDecs2301Factory::applyMemberDecs (cyclomatic 21) npm/runtime/src/helpers/esm/applyDecs2301.js:159— applyDecs2301.applyDecs2301Factory::applyMemberDecs 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. This shape REPEATS in the file: 2 other methods here (applyDecs2301.applyDecs2301Factory::memberDec, applyDecs2301.applyDecs2301Factory::applyMemberDec) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
oxc_formatter_markdown::print::inline::collect_inlines (cognitive 96) crates/oxc_formatter_markdown/src/print/inline.rs:226— oxc_formatter_markdown::print::inline::collect_inlines has cognitive complexity 96 (threshold 15). Drivers by points: if/else 25 (65 pts), boolean chains 18, match/switch 3 (8 pts), loops 2 (5 pts) (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_formatter_markdown::print::text::push_text (cognitive 53) crates/oxc_formatter_markdown/src/print/text.rs:86— oxc_formatter_markdown::print::text::push_text has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (41 pts), boolean chains 7, match/switch 1 (4 pts), loops 1 (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.
oxc_formatter_markdown::print::list::write_list (cognitive 26) crates/oxc_formatter_markdown/src/print/list.rs:31— oxc_formatter_markdown::print::list::write_list has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_formatter_markdown::print::list::write_list_item (cognitive 19) crates/oxc_formatter_markdown/src/print/list.rs:99— oxc_formatter_markdown::print::list::write_list_item has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 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.
oxc_formatter_markdown::print::text::push_whitespace (cognitive 19) crates/oxc_formatter_markdown/src/print/text.rs:182— oxc_formatter_markdown::print::text::push_whitespace has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, if/else 9. 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.
oxc_formatter_markdown::print::escape::escape_delimiter_runs (cognitive 16) crates/oxc_formatter_markdown/src/print/escape.rs:42— oxc_formatter_markdown::print::escape::escape_delimiter_runs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (6 pts), boolean chains 3, match/switch 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.
applyDecs2301Factory::applyMemberDec (cognitive 60) npm/runtime/src/helpers/applyDecs2301.js:100— applyDecs2301Factory::applyMemberDec has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 19 (36 pts), boolean chains 15, if/else 6 (7 pts), loops 1 (2 pts) (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.
applyDecs2301Factory::applyMemberDec (cognitive 60) npm/runtime/src/helpers/esm/applyDecs2301.js:100— applyDecs2301Factory::applyMemberDec has cognitive complexity 60 (threshold 15). Drivers by points: ternaries 19 (36 pts), boolean chains 15, if/else 6 (7 pts), loops 1 (2 pts) (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.
applyDecs2301Factory::applyMemberDecs (cognitive 34) npm/runtime/src/helpers/applyDecs2301.js:159— applyDecs2301Factory::applyMemberDecs has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 12, ternaries 3 (12 pts), if/else 3 (9 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.
applyDecs2301Factory::applyMemberDecs (cognitive 34) npm/runtime/src/helpers/esm/applyDecs2301.js:159— applyDecs2301Factory::applyMemberDecs has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 12, ternaries 3 (12 pts), if/else 3 (9 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.
applyDecs2301Factory::memberDec (cognitive 26) npm/runtime/src/helpers/applyDecs2301.js:16— applyDecs2301Factory::memberDec has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (10 pts), if/else 4 (5 pts), match/switch 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.
applyDecs2301Factory::memberDec (cognitive 26) npm/runtime/src/helpers/esm/applyDecs2301.js:16— applyDecs2301Factory::memberDec has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (10 pts), if/else 4 (5 pts), match/switch 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.
PatternParser::parse_modifiers (cognitive 46) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1610— PatternParser::parse_modifiers has cognitive complexity 46 (threshold 15). Drivers by points: if/else 16 (40 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PatternParser::consume_quantifier (cognitive 41) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1731— PatternParser::consume_quantifier has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (39 pts), boolean chains 2 (nesting depth added 26). 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.
PatternParser::parse_assertion (cognitive 20) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:260— PatternParser::parse_assertion has cognitive complexity 20 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 3 (nesting depth added 1). 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.
PatternParser::parse_atom_escape (cognitive 18) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:488— PatternParser::parse_atom_escape has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 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.
PatternParser::parse_nonempty_class_ranges (cognitive 18) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:851— PatternParser::parse_nonempty_class_ranges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (17 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.
PatternParser::consume_unicode_property_value_expression (cognitive 17) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1867— PatternParser::consume_unicode_property_value_expression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 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.
AstNode::write (cognitive 34) crates/oxc_formatter/src/print/union_type.rs:34— AstNode::write has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 14, match/switch 3, 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, 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.
AstNode::write (cognitive 20) crates/oxc_formatter/src/print/jsx/mod.rs:144— AstNode::write has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 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.
AstNode::fmt (cognitive 18) crates/oxc_formatter/src/print/call_like_expression/arguments.rs:38— AstNode::fmt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, match/switch 1 (nesting depth added 1). 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.
AstNode::write (cognitive 18) crates/oxc_formatter/src/print/call_like_expression/mod.rs:21— AstNode::write has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (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.
AstNode::write (cognitive 18) crates/oxc_formatter/src/print/mod.rs:1616— AstNode::write has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 4 (nesting depth added 1). 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.
AstNode::needs_parentheses (cognitive 17) crates/oxc_formatter/src/parentheses/expression.rs:71— AstNode::needs_parentheses has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), boolean chains 4, match/switch 2 (4 pts), loops 2 (3 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.
Duplicated block (7 lines × 3) crates/oxc_allocator/src/allocator.rs:378— crates/oxc_allocator/src/allocator.rs:378-384 | crates/oxc_allocator/src/string_builder.rs:181-187 | crates/oxc_data_structures/src/code_buffer.rs:508-514 — before extracting anything, compare `crates/oxc_allocator/src/allocator.rs` and `crates/oxc_allocator/src/string_builder.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 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.
Duplicated block (7 lines × 3) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:176— crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:176-182 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:213-219 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:242-248 — 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.
Duplicated block (7 lines × 3) crates/oxc_lexer/src/pipeline/find/generic.rs:26— crates/oxc_lexer/src/pipeline/find/generic.rs:26-32 | crates/oxc_lexer/src/pipeline/find/generic.rs:46-52 | crates/oxc_lexer/src/pipeline/find/generic.rs:66-72 — 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.
Duplicated block (7 lines × 3) crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:225— crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:225-231 | crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:285-291 | crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:367-373 — 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.
Duplicated block (7 lines × 3) crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs:40— crates/oxc_linter/src/rules/shared/jest_vitest/valid_describe_callback.rs:40-46 | crates/oxc_linter/src/rules/shared/jest_vitest/valid_title.rs:187-197 | crates/oxc_linter/src/rules/vitest/consistent_each_for.rs:192-204 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times.
Duplicated block (7 lines × 3) crates/oxc_formatter_css/src/comments.rs:124— crates/oxc_formatter_css/src/comments.rs:124-130 | crates/oxc_formatter_graphql/src/comments.rs:32-38 | crates/oxc_formatter_yaml/src/comments.rs:167-173 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times.
oxc_semantic::checker::javascript::check_super (cyclomatic 31) crates/oxc_semantic/src/checker/javascript.rs:951— oxc_semantic::checker::javascript::check_super 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.
oxc_semantic::binder::get_module_instance_state_for_alias_target (cyclomatic 22) crates/oxc_semantic/src/binder.rs:651— oxc_semantic::binder::get_module_instance_state_for_alias_target 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.
oxc_semantic::ts_enum::eval::eval_binary_expression (cyclomatic 20) crates/oxc_semantic/src/ts_enum/eval.rs:196— oxc_semantic::ts_enum::eval::eval_binary_expression has cyclomatic complexity 20 (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.
oxc_semantic::checker::javascript::check_string_literal (cyclomatic 17) crates/oxc_semantic/src/checker/javascript.rs:430— oxc_semantic::checker::javascript::check_string_literal 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.
oxc_semantic::binder::get_module_instance_state_for_statement (cyclomatic 16) crates/oxc_semantic/src/binder.rs:571— oxc_semantic::binder::get_module_instance_state_for_statement 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.
HackComment crates/oxc_linter/src/rules/eslint/no_fallthrough.rs:425— // >> PLEASE DON'T MAKE IT A REPEATING PATTERN IN THE PROJECT, ONE TIME HACK TO GET IT DONE — 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.
HackComment crates/oxc_linter/src/rules/unicorn/switch_case_braces.rs:283— // HACK: this is a hack — 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.
HackComment crates/oxc_linter/src/rules/unicorn/switch_case_braces.rs:288— // HACK: this is a hack — 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.
HackComment tasks/website_common/src/lib.rs:28— // Hack usage line — 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.
HackComment tasks/website_common/src/lib.rs:34— // Hack the bug on the line containing `###` — 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.
NoRestrictedImports::report_side_effects (cognitive 32) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1086— NoRestrictedImports::report_side_effects has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 6 (9 pts), boolean chains 4, match/switch 1 (3 pts) (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.
NoRestrictedImports::report_export_name_allowed (cognitive 30) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1366— NoRestrictedImports::report_export_name_allowed has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, loops 3 (4 pts), match/switch 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.
NoRestrictedImports::report_import_name_allowed (cognitive 27) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1152— NoRestrictedImports::report_import_name_allowed has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 4, loops 3 (4 pts), match/switch 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.
NoRestrictedImports::report_string_literal_source (cognitive 24) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1283— NoRestrictedImports::report_string_literal_source has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 5, loops 3 (4 pts), match/switch 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.
NoRestrictedImports::from_configuration (cognitive 20) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:968— NoRestrictedImports::from_configuration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (4 pts), loops 1 (2 pts) (nesting depth added 11). 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.
Codegen::print_comments (cognitive 28) crates/oxc_codegen/src/comment.rs:353— Codegen::print_comments has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 3, match/switch 1 (3 pts), 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.
Codegen::print_non_ascii_escaped (cognitive 23) crates/oxc_codegen/src/lib.rs:344— Codegen::print_non_ascii_escaped has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
Codegen::build_comments (cognitive 22) crates/oxc_codegen/src/comment.rs:74— Codegen::build_comments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 8, 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.
Codegen::handle_eof_linked_or_external_comments (cognitive 21) crates/oxc_codegen/src/comment.rs:457— Codegen::handle_eof_linked_or_external_comments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), 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.
Codegen::print_str_escaping_script_close_tag (cognitive 17) crates/oxc_codegen/src/lib.rs:517— Codegen::print_str_escaping_script_close_tag has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts) (nesting depth added 8). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
instantiate (cognitive 17) napi/transform-react/transform-react.wasip1-deferred.js:1699— instantiate has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 6 (8 pts), other 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 4 belong to 10 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.
instantiate (cognitive 17) napi/transform-relay/transform-relay.wasip1-deferred.js:1699— instantiate has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 6 (8 pts), other 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 4 belong to 10 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.
instantiate (cognitive 17) napi/transform/transform.wasip1-deferred.js:1699— instantiate has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 6 (8 pts), other 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 4 belong to 10 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.
instantiate (cognitive 17) napi/minify/minify.wasip1-deferred.js:1699— instantiate has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 6 (8 pts), other 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 4 belong to 10 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.
instantiate (cognitive 17) napi/parser/src-js/parser.wasip1-deferred.js:1699— instantiate has cognitive complexity 17 (threshold 15). Drivers by points: error handling 4 (8 pts), if/else 6 (8 pts), other 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 4 belong to 10 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.
Duplicated block (11 lines × 3) REDACTED:1150— REDACTED:1150-1160 | REDACTED:1191-1201 | REDACTED:1241-1251 — 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.
Duplicated block (11 lines × 3) crates/oxc_linter/src/disable_directives.rs:576— crates/oxc_linter/src/disable_directives.rs:576-586 | crates/oxc_linter/src/disable_directives.rs:634-644 | crates/oxc_linter/src/disable_directives.rs:690-700 — 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.
Duplicated block (11 lines × 3) crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs:146— crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs:146-156 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_function_as_prop.rs:138-148 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_object_as_prop.rs:147-157 — before extracting anything, compare `crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs` and `crates/oxc_linter/src/rules/react_perf/jsx_no_new_function_as_prop.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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.
Duplicated block (11 lines × 3) crates/oxc_linter/src/rules/unicorn/prefer_array_find.rs:83— crates/oxc_linter/src/rules/unicorn/prefer_array_find.rs:83-93 | crates/oxc_linter/src/rules/unicorn/prefer_array_find.rs:109-119 | crates/oxc_linter/src/rules/unicorn/prefer_array_find.rs:123-133 — 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.
Duplicated block (11 lines × 3) crates/oxc_linter/src/rules/vue/no_expose_after_await.rs:142— crates/oxc_linter/src/rules/vue/no_expose_after_await.rs:142-152 | crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs:161-171 | crates/oxc_linter/src/rules/vue/no_watch_after_await.rs:144-154 — before extracting anything, compare `crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs` and `crates/oxc_linter/src/rules/vue/no_watch_after_await.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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.
Duplicated block (9 lines × 3) crates/oxc_linter/src/rules/eslint/no_bitwise.rs:111— crates/oxc_linter/src/rules/eslint/no_bitwise.rs:111-119 | crates/oxc_linter/src/rules/eslint/no_bitwise.rs:121-129 | crates/oxc_linter/src/rules/eslint/no_bitwise.rs:131-139 — 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.
Duplicated block (9 lines × 3) crates/oxc_linter/src/rules/react/no_did_mount_set_state.rs:82— crates/oxc_linter/src/rules/react/no_did_mount_set_state.rs:82-90 | crates/oxc_linter/src/rules/react/no_did_update_set_state.rs:88-96 | crates/oxc_linter/src/rules/react/no_will_update_set_state.rs:76-84 — 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.
Duplicated block (9 lines × 3) crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:314— crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:314-322 | crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:338-346 | crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:349-357 — 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.
Duplicated block (9 lines × 3) crates/oxc_linter/src/rules/unicorn/prefer_at.rs:394— crates/oxc_linter/src/rules/unicorn/prefer_at.rs:394-402 | crates/oxc_linter/src/rules/unicorn/prefer_at.rs:426-434 | crates/oxc_linter/src/rules/unicorn/prefer_at.rs:446-454 — 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.
Duplicated block (9 lines × 3) tasks/ast_tools/src/schema/defs/box.rs:18— tasks/ast_tools/src/schema/defs/box.rs:18-26 | tasks/ast_tools/src/schema/defs/cell.rs:18-26 | tasks/ast_tools/src/schema/defs/option.rs:18-26 — 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.
Dead file (~1865 LoC) napi/minify/minify.wasip1-deferred.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1865 LoC) napi/parser/src-js/parser.wasip1-deferred.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1865 LoC) napi/transform-react/transform-react.wasip1-deferred.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1865 LoC) napi/transform-relay/transform-relay.wasip1-deferred.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1865 LoC) napi/transform/transform.wasip1-deferred.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~186 LoC) napi/minify/wasi-worker.mjs— no import path from any entry point (227 application, 244 tooling, 2515 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 (~186 LoC) napi/parser/src-js/wasi-worker.mjs— no import path from any entry point (227 application, 244 tooling, 2515 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 (~186 LoC) napi/transform-react/wasi-worker.mjs— no import path from any entry point (227 application, 244 tooling, 2515 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 (~186 LoC) napi/transform-relay/wasi-worker.mjs— no import path from any entry point (227 application, 244 tooling, 2515 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 (~186 LoC) napi/transform/wasi-worker.mjs— no import path from any entry point (227 application, 244 tooling, 2515 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
JsdocFormatter::format_type_name_comment_tag (cyclomatic 73) REDACTED:234— JsdocFormatter::format_type_name_comment_tag has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsdocFormatter::format (cyclomatic 55) crates/oxc_formatter/src/formatter/jsdoc/serialize.rs:103— JsdocFormatter::format has cyclomatic complexity 55 (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.
JsdocFormatter::format_generic_tag (cyclomatic 49) REDACTED:917— JsdocFormatter::format_generic_tag has cyclomatic complexity 49 (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.
JsdocFormatter::format_type_comment_tag (cyclomatic 34) REDACTED:707— JsdocFormatter::format_type_comment_tag 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.
ClassProperties::transform_class_body_on_entry (cyclomatic 47) crates/oxc_transformer/src/es2022/class_properties/class.rs:59— ClassProperties::transform_class_body_on_entry 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.
ClassProperties::transform_class_expression_on_exit_impl (cyclomatic 25) crates/oxc_transformer/src/es2022/class_properties/class.rs:613— ClassProperties::transform_class_expression_on_exit_impl 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.
ClassProperties::transform_class_declaration_on_exit_impl (cyclomatic 21) crates/oxc_transformer/src/es2022/class_properties/class.rs:443— ClassProperties::transform_class_declaration_on_exit_impl 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.
ClassProperties::transform_private_field_expression_impl (cyclomatic 17) crates/oxc_transformer/src/es2022/class_properties/private_field.rs:59— ClassProperties::transform_private_field_expression_impl 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.
applyDecs2203R.applyDecs2203RFactory::applyMemberDec (cyclomatic 40) npm/runtime/src/helpers/applyDecs2203R.js:75— applyDecs2203R.applyDecs2203RFactory::applyMemberDec 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. This shape REPEATS in the file: one other method here (applyDecs2203R.applyDecs2203RFactory::applyMemberDecs) 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.
applyDecs2203R.applyDecs2203RFactory::applyMemberDec (cyclomatic 40) npm/runtime/src/helpers/esm/applyDecs2203R.js:75— applyDecs2203R.applyDecs2203RFactory::applyMemberDec 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. This shape REPEATS in the file: one other method here (applyDecs2203R.applyDecs2203RFactory::applyMemberDecs) 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.
applyDecs2203R.applyDecs2203RFactory::applyMemberDecs (cyclomatic 19) npm/runtime/src/helpers/applyDecs2203R.js:131— applyDecs2203R.applyDecs2203RFactory::applyMemberDecs 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. This shape REPEATS in the file: one other method here (applyDecs2203R.applyDecs2203RFactory::applyMemberDec) 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.
applyDecs2203R.applyDecs2203RFactory::applyMemberDecs (cyclomatic 19) npm/runtime/src/helpers/esm/applyDecs2203R.js:131— applyDecs2203R.applyDecs2203RFactory::applyMemberDecs 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. This shape REPEATS in the file: one other method here (applyDecs2203R.applyDecs2203RFactory::applyMemberDec) 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.
AstNode::write (cyclomatic 32) crates/oxc_formatter/src/print/union_type.rs:34— AstNode::write has cyclomatic complexity 32 (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.
AstNode::needs_parentheses (cyclomatic 31) crates/oxc_formatter/src/parentheses/expression.rs:71— AstNode::needs_parentheses has cyclomatic complexity 31 (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. This is NOT this file's highest cyclomatic complexity: AstNode::needs_parentheses (cyclomatic 45) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
AstNode::fmt (cyclomatic 16) crates/oxc_formatter/src/print/call_like_expression/arguments.rs:38— AstNode::fmt has cyclomatic complexity 16 (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.
AstNode::write (cyclomatic 16) crates/oxc_formatter/src/print/mod.rs:1177— AstNode::write has cyclomatic complexity 16 (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.
NoRestrictedImports::report_export_name_allowed (cyclomatic 20) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1366— NoRestrictedImports::report_export_name_allowed 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.
NoRestrictedImports::report_side_effects (cyclomatic 19) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1086— NoRestrictedImports::report_side_effects 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.
NoRestrictedImports::report_import_name_allowed (cyclomatic 18) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1152— NoRestrictedImports::report_import_name_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.
NoRestrictedImports::report_string_literal_source (cyclomatic 18) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1283— NoRestrictedImports::report_string_literal_source 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.
JsdocFormatter::format_type_name_comment_tag (cognitive 164) REDACTED:234— JsdocFormatter::format_type_name_comment_tag has cognitive complexity 164 (threshold 15). Drivers by points: if/else 81 (143 pts), boolean chains 15, loops 2 (5 pts), match/switch 1 (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsdocFormatter::format_generic_tag (cognitive 112) REDACTED:917— JsdocFormatter::format_generic_tag has cognitive complexity 112 (threshold 15). Drivers by points: if/else 46 (85 pts), loops 5 (15 pts), boolean chains 12 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsdocFormatter::format_type_comment_tag (cognitive 87) REDACTED:707— JsdocFormatter::format_type_comment_tag has cognitive complexity 87 (threshold 15). Drivers by points: if/else 37 (69 pts), loops 3 (10 pts), boolean chains 4, match/switch 1 (4 pts) (nesting depth added 42). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsdocFormatter::format (cognitive 85) crates/oxc_formatter/src/formatter/jsdoc/serialize.rs:103— JsdocFormatter::format has cognitive complexity 85 (threshold 15). Drivers by points: if/else 35 (62 pts), boolean chains 19, loops 3, match/switch 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.
applyDecs2311::applyDec (cognitive 75) npm/runtime/src/helpers/applyDecs2311.js:29— applyDecs2311::applyDec has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 18 (44 pts), boolean chains 16, if/else 8 (14 pts), loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
applyDecs2311::applyDec (cognitive 75) npm/runtime/src/helpers/esm/applyDecs2311.js:29— applyDecs2311::applyDec has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 18 (44 pts), boolean chains 16, if/else 8 (14 pts), loops 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
applyDecs2311::p (cognitive 22) npm/runtime/src/helpers/applyDecs2311.js:102— applyDecs2311::p has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 4, if/else 1 (2 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.
applyDecs2311::p (cognitive 22) npm/runtime/src/helpers/esm/applyDecs2311.js:102— applyDecs2311::p has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 4, if/else 1 (2 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.
applyDecs2305::applyDec (cognitive 72) npm/runtime/src/helpers/applyDecs2305.js:19— applyDecs2305::applyDec has cognitive complexity 72 (threshold 15). Drivers by points: ternaries 16 (38 pts), boolean chains 20, if/else 7 (13 pts), loops 1 (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.
applyDecs2305::applyDec (cognitive 72) npm/runtime/src/helpers/esm/applyDecs2305.js:19— applyDecs2305::applyDec has cognitive complexity 72 (threshold 15). Drivers by points: ternaries 16 (38 pts), boolean chains 20, if/else 7 (13 pts), loops 1 (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.
applyDecs2305::p (cognitive 31) npm/runtime/src/helpers/applyDecs2305.js:94— applyDecs2305::p has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 4 (12 pts), boolean chains 9, if/else 3 (9 pts), loops 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.
applyDecs2305::p (cognitive 31) npm/runtime/src/helpers/esm/applyDecs2305.js:94— applyDecs2305::p has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 4 (12 pts), boolean chains 9, if/else 3 (9 pts), loops 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.
applyDecs2203RFactory::applyMemberDec (cognitive 59) npm/runtime/src/helpers/applyDecs2203R.js:75— applyDecs2203RFactory::applyMemberDec has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 19 (36 pts), boolean chains 14, if/else 6 (7 pts), loops 1 (2 pts) (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.
applyDecs2203RFactory::applyMemberDec (cognitive 59) npm/runtime/src/helpers/esm/applyDecs2203R.js:75— applyDecs2203RFactory::applyMemberDec has cognitive complexity 59 (threshold 15). Drivers by points: ternaries 19 (36 pts), boolean chains 14, if/else 6 (7 pts), loops 1 (2 pts) (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.
applyDecs2203RFactory::applyMemberDecs (cognitive 33) npm/runtime/src/helpers/applyDecs2203R.js:131— applyDecs2203RFactory::applyMemberDecs has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 3 (12 pts), boolean chains 11, if/else 3 (9 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.
applyDecs2203RFactory::applyMemberDecs (cognitive 33) npm/runtime/src/helpers/esm/applyDecs2203R.js:131— applyDecs2203RFactory::applyMemberDecs has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 3 (12 pts), boolean chains 11, if/else 3 (9 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.
oxc_formatter_yaml::print::mapping_item::write_mapping_item (cognitive 47) crates/oxc_formatter_yaml/src/print/mapping_item.rs:33— oxc_formatter_yaml::print::mapping_item::write_mapping_item has cognitive complexity 47 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 14, 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.
oxc_formatter_yaml::print::block::write_block_scalar (cognitive 23) crates/oxc_formatter_yaml/src/print/block.rs:53— oxc_formatter_yaml::print::block::write_block_scalar has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, loops 2 (3 pts), match/switch 2 (3 pts) (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, 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.
oxc_formatter_yaml::print::scalar::write_flow_scalar_content (cognitive 19) crates/oxc_formatter_yaml/src/print/scalar.rs:90— oxc_formatter_yaml::print::scalar::write_flow_scalar_content has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts), boolean chains 1, match/switch 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.
oxc_formatter_yaml::print::scalar::flow_scalar_line_contents (cognitive 16) crates/oxc_formatter_yaml/src/print/scalar.rs:156— oxc_formatter_yaml::print::scalar::flow_scalar_line_contents has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, 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, 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.
Symbol::is_self_reassignment (cognitive 31) crates/oxc_linter/src/rules/eslint/no_unused_vars/usage.rs:445— Symbol::is_self_reassignment has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 3 (8 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.
Symbol::get_binding_info (cognitive 30) crates/oxc_linter/src/rules/eslint/no_unused_vars/fixers/fix_symbol.rs:104— Symbol::get_binding_info has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 16). 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.
Symbol::has_usages (cognitive 28) crates/oxc_linter/src/rules/eslint/no_unused_vars/usage.rs:92— Symbol::has_usages has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 7, 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.
Symbol::is_discarded_read (cognitive 17) crates/oxc_linter/src/rules/eslint/no_unused_vars/usage.rs:746— Symbol::is_discarded_read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (21 lines × 2) crates/oxc_allocator/src/string_builder.rs:482— crates/oxc_allocator/src/string_builder.rs:482-502 | crates/oxc_allocator/src/string_builder.rs:534-554 — 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 (21 lines × 2) crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:102— crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:102-122 | crates/oxc_linter/src/rules/jsdoc/require_param_type.rs:100-120 — before extracting anything, compare `crates/oxc_linter/src/rules/jsdoc/require_param_description.rs` and `crates/oxc_linter/src/rules/jsdoc/require_param_type.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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.
Duplicated block (21 lines × 2) crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs:86— crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs:86-106 | crates/oxc_linter/src/rules/nextjs/no_title_in_document_head.rs:84-104 — before extracting anything, compare `crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs` and `crates/oxc_linter/src/rules/nextjs/no_title_in_document_head.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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.
Duplicated block (21 lines × 2) crates/oxc_linter/src/rules/typescript/explicit_member_accessibility.rs:261— crates/oxc_linter/src/rules/typescript/explicit_member_accessibility.rs:261-281 | crates/oxc_linter/src/rules/typescript/explicit_member_accessibility.rs:284-304 — 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 (16 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:56— crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:56-71 | crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:150-165 — 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 (16 lines × 2) crates/oxc_linter/src/rules/eslint/getter_return.rs:286— crates/oxc_linter/src/rules/eslint/getter_return.rs:286-301 | crates/oxc_linter/src/rules/promise/always_return.rs:363-378 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (16 lines × 2) crates/oxc_semantic/src/builder.rs:1015— crates/oxc_semantic/src/builder.rs:1015-1030 | crates/oxc_semantic/src/builder.rs:1121-1136 — 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 (16 lines × 2) crates/oxc_syntax/src/identifier.rs:191— crates/oxc_syntax/src/identifier.rs:191-206 | crates/oxc_syntax/src/identifier.rs:214-229 — 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 (14–15 lines × 2) crates/oxc_isolated_declarations/src/enum.rs:207— crates/oxc_isolated_declarations/src/enum.rs:207-221 | crates/oxc_semantic/src/ts_enum/eval.rs:217-230 — before extracting anything, compare `crates/oxc_isolated_declarations/src/enum.rs` and `crates/oxc_semantic/src/ts_enum/eval.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 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.
Duplicated block (14–15 lines × 2) crates/oxc_linter/src/rules/jest/no_done_callback.rs:123— crates/oxc_linter/src/rules/jest/no_done_callback.rs:123-136 | crates/oxc_linter/src/rules/jest/no_done_callback.rs:138-152 — 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 (14–15 lines × 2) crates/oxc_linter/src/rules/react/no_multi_comp.rs:411— crates/oxc_linter/src/rules/react/no_multi_comp.rs:411-424 | crates/oxc_linter/src/rules/react/only_export_components.rs:768-782 — 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 (14–15 lines × 2) crates/oxc_linter/src/rules/shared/jest_vitest/valid_title.rs:188— crates/oxc_linter/src/rules/shared/jest_vitest/valid_title.rs:188-201 | crates/oxc_linter/src/rules/vitest/consistent_each_for.rs:194-208 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (11–12 lines × 2) crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:184— crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:184-194 | crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:498-509 — 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 (11–12 lines × 2) crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs:505— crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs:505-516 | crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs:519-529 — 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 (11–12 lines × 2) crates/oxc_linter/src/rules/unicorn/prefer_at.rs:429— crates/oxc_linter/src/rules/unicorn/prefer_at.rs:429-439 | crates/oxc_linter/src/rules/unicorn/prefer_at.rs:449-460 — 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 (11–12 lines × 2) tasks/ast_tools/src/generators/visit.rs:431— tasks/ast_tools/src/generators/visit.rs:431-442 | tasks/ast_tools/src/generators/visit_js.rs:464-474 — before extracting anything, compare `tasks/ast_tools/src/generators/visit.rs` and `tasks/ast_tools/src/generators/visit_js.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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.
Duplicated block (6 lines × 3) crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:358— crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:358-363 | crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:385-390 | crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:414-419 — 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.
Duplicated block (6 lines × 3) crates/oxc_parser/src/lexer/byte_handlers.rs:192— crates/oxc_parser/src/lexer/byte_handlers.rs:192-197 | crates/oxc_parser/src/lexer/byte_handlers.rs:394-399 | crates/oxc_parser/src/lexer/byte_handlers.rs:467-472 — 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.
Duplicated block (6 lines × 3) crates/oxc_semantic/src/builder.rs:1609— crates/oxc_semantic/src/builder.rs:1609-1614 | crates/oxc_semantic/src/builder.rs:2011-2016 | crates/oxc_semantic/src/builder.rs:2061-2066 — 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.
Duplicated block (6 lines × 3) crates/oxc_codegen/src/binary_expr_visitor.rs:80— crates/oxc_codegen/src/binary_expr_visitor.rs:80-85 | crates/oxc_codegen/src/binary_expr_visitor.rs:89-94 | crates/oxc_formatter/src/print/binary_like_expression.rs:44-49 — there are 3 copies across 2 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 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (17 lines × 2 locations) apps/oxlint/src-js/plugins/tokens_methods.ts:1330— apps/oxlint/src-js/plugins/tokens_methods.ts:1330 · apps/oxlint/src-js/plugins/tokens_methods.ts:1398 — 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 (17 lines × 2 locations) napi/transform-react/scripts/patch.js:6— napi/transform-react/scripts/patch.js:6 · napi/transform-relay/scripts/patch.js:6 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (17 lines × 2 locations) napi/transform-react/webcontainer-fallback.cjs:4— napi/transform-react/webcontainer-fallback.cjs:4 · napi/transform-relay/webcontainer-fallback.cjs:4 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (17 lines × 2 locations) npm/runtime/src/helpers/esm/interopRequireWildcard.js:10— npm/runtime/src/helpers/esm/interopRequireWildcard.js:10 · npm/runtime/src/helpers/interopRequireWildcard.js:10 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
oxc_formatter_markdown::print::inline::collect_inlines (cyclomatic 56) crates/oxc_formatter_markdown/src/print/inline.rs:226— oxc_formatter_markdown::print::inline::collect_inlines 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.
oxc_formatter_markdown::print::text::push_text (cyclomatic 22) crates/oxc_formatter_markdown/src/print/text.rs:86— oxc_formatter_markdown::print::text::push_text 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.
oxc_formatter_markdown::print::text::push_whitespace (cyclomatic 17) crates/oxc_formatter_markdown/src/print/text.rs:182— oxc_formatter_markdown::print::text::push_whitespace 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.
Symbol::is_self_reassignment (cyclomatic 35) crates/oxc_linter/src/rules/eslint/no_unused_vars/usage.rs:445— Symbol::is_self_reassignment has cyclomatic complexity 35 (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.
Symbol::has_usages (cyclomatic 20) crates/oxc_linter/src/rules/eslint/no_unused_vars/usage.rs:92— Symbol::has_usages 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.
Symbol::is_discarded_read (cyclomatic 16) crates/oxc_linter/src/rules/eslint/no_unused_vars/usage.rs:746— Symbol::is_discarded_read 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.
IdMatch::check_identifier_reference (cyclomatic 24) crates/oxc_linter/src/rules/eslint/id_match.rs:253— IdMatch::check_identifier_reference 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.
IdMatch::check_identifier_name (cyclomatic 24) crates/oxc_linter/src/rules/eslint/id_match.rs:335— IdMatch::check_identifier_name 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.
IdMatch::check_binding_identifier (cyclomatic 18) crates/oxc_linter/src/rules/eslint/id_match.rs:185— IdMatch::check_binding_identifier 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.
ClassStaticBlock::capture_suspended_names (cyclomatic 24) crates/oxc_transformer/src/es2022/class_static_block.rs:536— ClassStaticBlock::capture_suspended_names 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.
ClassStaticBlock::enter_expression (cyclomatic 18) crates/oxc_transformer/src/es2022/class_static_block.rs:168— ClassStaticBlock::enter_expression 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.
ClassStaticBlock::enter_class_body (cyclomatic 18) crates/oxc_transformer/src/es2022/class_static_block.rs:259— ClassStaticBlock::enter_class_body 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.
ConstructorSuper::run (cyclomatic 22) crates/oxc_linter/src/rules/eslint/constructor_super.rs:220— ConstructorSuper::run 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.
ConstructorSuper::find_super_calls_in_cfg (cyclomatic 22) crates/oxc_linter/src/rules/eslint/constructor_super.rs:359— ConstructorSuper::find_super_calls_in_cfg 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.
ConstructorSuper::analyze_super_paths (cyclomatic 20) crates/oxc_linter/src/rules/eslint/constructor_super.rs:496— ConstructorSuper::analyze_super_paths 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.
PatternParser::parse_modifiers (cyclomatic 22) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1610— PatternParser::parse_modifiers 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.
PatternParser::parse_assertion (cyclomatic 18) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:260— PatternParser::parse_assertion 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.
PatternParser::consume_quantifier (cyclomatic 16) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1731— PatternParser::consume_quantifier 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.
TsGoLintState::lint (cognitive 52) crates/oxc_linter/src/tsgolint.rs:146— TsGoLintState::lint has cognitive complexity 52 (threshold 15). Drivers by points: if/else 18 (39 pts), match/switch 4 (7 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsGoLintState::lint_source (cognitive 40) crates/oxc_linter/src/tsgolint.rs:422— TsGoLintState::lint_source has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (33 pts), match/switch 2 (5 pts), loops 2 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsGoLintState::json_input (cognitive 16) crates/oxc_linter/src/tsgolint.rs:570— TsGoLintState::json_input has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 1 (4 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.
BinaryExpression::may_have_side_effects (cognitive 48) crates/oxc_ecmascript/src/side_effects/expressions.rs:143— BinaryExpression::may_have_side_effects has cognitive complexity 48 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 14, match/switch 2 (6 pts) (nesting depth added 17). 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.
BinaryExpression::is_literal_value (cognitive 18) crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:99— BinaryExpression::is_literal_value has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 3 (6 pts), match/switch 2 (3 pts) (nesting depth added 4). 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.
BinaryExpression::value_type (cognitive 16) crates/oxc_ecmascript/src/value_type.rs:118— BinaryExpression::value_type has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, match/switch 1 (nesting depth added 4). 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.
AssignmentLike::write_left (cognitive 46) crates/oxc_formatter/src/utils/assignment_like.rs:163— AssignmentLike::write_left has cognitive complexity 46 (threshold 15). Drivers by points: if/else 29 (44 pts), boolean chains 1, match/switch 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.
AssignmentLike::fmt (cognitive 18) crates/oxc_formatter/src/utils/assignment_like.rs:898— AssignmentLike::fmt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3, match/switch 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.
AssignmentLike::chain_formatting_layout (cognitive 17) crates/oxc_formatter/src/utils/assignment_like.rs:604— AssignmentLike::chain_formatting_layout has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, match/switch 1 (3 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.
ClassStaticBlock::capture_suspended_names (cognitive 46) crates/oxc_transformer/src/es2022/class_static_block.rs:536— ClassStaticBlock::capture_suspended_names has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (39 pts), loops 3 (4 pts), boolean chains 3 (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.
ClassStaticBlock::enter_expression (cognitive 30) crates/oxc_transformer/src/es2022/class_static_block.rs:168— ClassStaticBlock::enter_expression has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 5, loops 1 (2 pts), match/switch 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.
ClassStaticBlock::enter_class_body (cognitive 24) crates/oxc_transformer/src/es2022/class_static_block.rs:259— ClassStaticBlock::enter_class_body has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 3 (6 pts), loops 2 (3 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.
ConstructorSuper::find_super_calls_in_cfg (cognitive 45) crates/oxc_linter/src/rules/eslint/constructor_super.rs:359— ConstructorSuper::find_super_calls_in_cfg has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (36 pts), match/switch 2 (5 pts), boolean chains 3, loops 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.
ConstructorSuper::run (cognitive 42) crates/oxc_linter/src/rules/eslint/constructor_super.rs:220— ConstructorSuper::run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 4 (13 pts), boolean chains 3, match/switch 1 (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.
ConstructorSuper::analyze_super_paths (cognitive 33) crates/oxc_linter/src/rules/eslint/constructor_super.rs:496— ConstructorSuper::analyze_super_paths has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 2 (5 pts), loops 3 (4 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.
oxc_linter_codegen::regex_node_kinds::get_regex_node_kinds (cognitive 34) tasks/linter_codegen/src/regex_node_kinds.rs:7— oxc_linter_codegen::regex_node_kinds::get_regex_node_kinds has cognitive complexity 34 (threshold 15). Drivers by points: if/else 4 (17 pts), loops 3 (9 pts), match/switch 1 (6 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.
oxc_linter_codegen::member_expression_kinds::get_member_expression_kinds (cognitive 24) tasks/linter_codegen/src/member_expression_kinds.rs:7— oxc_linter_codegen::member_expression_kinds::get_member_expression_kinds has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (5 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.
oxc_linter_codegen::generate_rule_runner_impls (cognitive 17) tasks/linter_codegen/src/main.rs:42— oxc_linter_codegen::generate_rule_runner_impls has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (3 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.
Backend::initialized (cognitive 32) crates/oxc_language_server/src/backend.rs:204— Backend::initialized has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 4 (8 pts), match/switch 1 (4 pts), boolean chains 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.
Backend::did_change_configuration (cognitive 20) crates/oxc_language_server/src/backend.rs:333— Backend::did_change_configuration has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, 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, 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.
Backend::did_change_watched_files (cognitive 19) crates/oxc_language_server/src/backend.rs:448— Backend::did_change_watched_files has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 2 (3 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.
ReactRefresh::enter_call_expression (cognitive 32) crates/oxc_transformer/src/jsx/refresh.rs:261— ReactRefresh::enter_call_expression has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 4 (7 pts), boolean chains 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.
ReactRefresh::replace_inner_components (cognitive 16) crates/oxc_transformer/src/jsx/refresh.rs:477— ReactRefresh::replace_inner_components has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 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.
ReactRefresh::process_statement (cognitive 16) crates/oxc_transformer/src/jsx/refresh.rs:717— ReactRefresh::process_statement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 9). 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.
ReplaceGlobalDefines::is_meta_property_define (cognitive 30) crates/oxc_transformer_plugins/src/replace_global_defines.rs:769— ReplaceGlobalDefines::is_meta_property_define has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplaceGlobalDefines::unwrap_chain_expression_if_no_optional (cognitive 21) crates/oxc_transformer_plugins/src/replace_global_defines.rs:873— ReplaceGlobalDefines::unwrap_chain_expression_if_no_optional has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (5 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.
ReplaceGlobalDefines::is_dot_define_parts (cognitive 21) crates/oxc_transformer_plugins/src/replace_global_defines.rs:939— ReplaceGlobalDefines::is_dot_define_parts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 1 (3 pts), boolean chains 1, 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.
GraphicalReportHandler::display_width (cognitive 27) crates/oxc_diagnostics/src/handlers/graphical/report.rs:270— GraphicalReportHandler::display_width has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 3 (7 pts), match/switch 1 (2 pts), boolean chains 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.
GraphicalReportHandler::render_context (cognitive 24) crates/oxc_diagnostics/src/handlers/graphical/snippet.rs:94— GraphicalReportHandler::render_context has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (6 pts), boolean chains 2, match/switch 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.
GraphicalReportHandler::render_single_line_highlights (cognitive 21) crates/oxc_diagnostics/src/handlers/graphical/label.rs:142— GraphicalReportHandler::render_single_line_highlights has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 3 (5 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.
SourceText::get_lines_before (cognitive 25) crates/oxc_formatter/src/source_text.rs:113— SourceText::get_lines_before has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 2 (4 pts), boolean chains 3 (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.
SourceText::has_line_terminator_after_skipping_comments (cognitive 21) crates/oxc_formatter/src/source_text.rs:198— SourceText::has_line_terminator_after_skipping_comments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (10 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 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.
SourceText::lines_after_skipping_terminators (cognitive 18) crates/oxc_formatter/src/source_text.rs:76— SourceText::lines_after_skipping_terminators has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, 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.
IdMatch::check_identifier_reference (cognitive 25) crates/oxc_linter/src/rules/eslint/id_match.rs:253— IdMatch::check_identifier_reference has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, match/switch 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.
IdMatch::check_identifier_name (cognitive 23) crates/oxc_linter/src/rules/eslint/id_match.rs:335— IdMatch::check_identifier_name has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 5, match/switch 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.
IdMatch::check_binding_identifier (cognitive 21) crates/oxc_linter/src/rules/eslint/id_match.rs:185— IdMatch::check_binding_identifier has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, match/switch 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.
NoRestrictedGlobals::run_once (cognitive 25) crates/oxc_linter/src/rules/eslint/no_restricted_globals.rs:260— NoRestrictedGlobals::run_once has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (6 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.
NoRestrictedGlobals::from_configuration (cognitive 20) crates/oxc_linter/src/rules/eslint/no_restricted_globals.rs:182— NoRestrictedGlobals::from_configuration has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 2 (5 pts), loops 2 (5 pts) (nesting depth added 13). 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.
NoRestrictedGlobals::check_global_object_member_access (cognitive 19) crates/oxc_linter/src/rules/eslint/no_restricted_globals.rs:311— NoRestrictedGlobals::check_global_object_member_access has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 2 (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.
ExplicitResourceManagement::transform_switch_statement (cognitive 25) crates/oxc_transformer/src/es2026/explicit_resource_management.rs:782— ExplicitResourceManagement::transform_switch_statement has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 pts), boolean chains 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.
ExplicitResourceManagement::transform_statements (cognitive 20) crates/oxc_transformer/src/es2026/explicit_resource_management.rs:917— ExplicitResourceManagement::transform_statements has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (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.
ExplicitResourceManagement::enter_program (cognitive 16) crates/oxc_transformer/src/es2026/explicit_resource_management.rs:361— ExplicitResourceManagement::enter_program has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 4 (6 pts), loops 1 (2 pts) (nesting depth added 6). 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.
PreferToBe::check_and_fix (cognitive 21) crates/oxc_linter/src/rules/shared/jest_vitest/prefer_to_be.rs:262— PreferToBe::check_and_fix has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 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.
PreferToBe::run (cognitive 18) crates/oxc_linter/src/rules/shared/jest_vitest/prefer_to_be.rs:97— PreferToBe::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2 (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.
PreferToBe::build_suggestion_with_not_modifier (cognitive 16) crates/oxc_linter/src/rules/shared/jest_vitest/prefer_to_be.rs:224— PreferToBe::build_suggestion_with_not_modifier has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (16 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.
StyledComponents::collect_styled_bindings (cognitive 21) crates/oxc_transformer/src/plugins/styled_components.rs:474— StyledComponents::collect_styled_bindings has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (7 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.
StyledComponents::get_component_name (cognitive 21) crates/oxc_transformer/src/plugins/styled_components.rs:548— StyledComponents::get_component_name has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (5 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.
StyledComponents::is_styled (cognitive 17) crates/oxc_transformer/src/plugins/styled_components.rs:715— StyledComponents::is_styled has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), match/switch 3 (7 pts), boolean chains 2 (nesting depth added 7). 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.
TooManyFunctions: oxc_parser::lexer::byte_handlers crates/oxc_parser/src/lexer/byte_handlers.rs:166— TooManyFunctions — 60 free functions. The bar is 30 free functions; this is 30 over it, 2.00× 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.
TooManyFunctions: oxc_semantic::diagnostics crates/oxc_semantic/src/diagnostics.rs:7— TooManyFunctions — 51 free functions. The bar is 30 free functions; 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.
TooManyFunctions: oxc_regular_expression::diagnostics crates/oxc_regular_expression/src/diagnostics.rs:7— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× 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.
Duplicated block (23 lines × 2) crates/oxc_ast/src/ast_kind_impl.rs:317— crates/oxc_ast/src/ast_kind_impl.rs:317-339 | crates/oxc_ast/src/ast_kind_impl.rs:691-713 — 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 (23 lines × 2) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1200— crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1200-1222 | crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1421-1443 — 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 (23 lines × 2) crates/oxc_transformer/src/es2017/async_to_generator.rs:114— crates/oxc_transformer/src/es2017/async_to_generator.rs:114-136 | crates/oxc_transformer/src/es2018/async_generator_functions/mod.rs:120-142 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (20 lines × 2) REDACTED:1186— REDACTED:1186-1205 | REDACTED:1236-1255 — 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 (20 lines × 2) crates/oxc_lexer/src/pipeline/scan/avx2.rs:83— crates/oxc_lexer/src/pipeline/scan/avx2.rs:83-102 | crates/oxc_lexer/src/pipeline/scan/generic.rs:80-99 — before extracting anything, compare `crates/oxc_lexer/src/pipeline/scan/avx2.rs` and `crates/oxc_lexer/src/pipeline/scan/generic.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 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.
Duplicated block (20 lines × 2) crates/oxc_linter/src/disable_directives.rs:626— crates/oxc_linter/src/disable_directives.rs:626-645 | crates/oxc_linter/src/disable_directives.rs:682-701 — 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 (10 lines × 4) crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:189— crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:189-198 | crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:229-238 | crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:429-438 | crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:459-468 — 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.
Duplicated block (10 lines × 4) crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:190— crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:190-199 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:344-353 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:438-447 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:600-609 — 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.
Duplicated block (10 lines × 4) crates/oxc_linter/src/rules/jsdoc/require_throws_description.rs:59— crates/oxc_linter/src/rules/jsdoc/require_throws_description.rs:59-68 | crates/oxc_linter/src/rules/jsdoc/require_throws_type.rs:55-64 | crates/oxc_linter/src/rules/jsdoc/require_yields_description.rs:59-68 | crates/oxc_linter/src/rules/jsdoc/require_yields_type.rs:51-60 — 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 (9 lines × 4) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:552— crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:552-560 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:581-589 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:606-614 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:628-636 — 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.
Duplicated block (9 lines × 4) crates/oxc_linter/src/rules/jsdoc/check_property_names.rs:69— crates/oxc_linter/src/rules/jsdoc/check_property_names.rs:69-77 | crates/oxc_linter/src/rules/jsdoc/require_property_description.rs:55-63 | crates/oxc_linter/src/rules/jsdoc/require_property_name.rs:55-63 | crates/oxc_linter/src/rules/jsdoc/require_property_type.rs:55-63 — 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 (9 lines × 4) crates/oxc_linter/src/rules/react_perf/jsx_no_jsx_as_prop.rs:114— crates/oxc_linter/src/rules/react_perf/jsx_no_jsx_as_prop.rs:114-122 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs:151-159 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_function_as_prop.rs:143-151 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_object_as_prop.rs:152-160 — before extracting anything, compare `crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs` and `crates/oxc_linter/src/rules/react_perf/jsx_no_new_function_as_prop.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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.
Duplicated block (5 lines × 3) apps/oxfmt/src/core/external_services.rs:302— apps/oxfmt/src/core/external_services.rs:302-306 | apps/oxfmt/src/core/external_services.rs:351-355 | apps/oxfmt/src/core/external_services.rs:379-383 — 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.
Duplicated block (5 lines × 3) crates/oxc_linter/src/rules/jest/prefer_importing_jest_globals.rs:274— crates/oxc_linter/src/rules/jest/prefer_importing_jest_globals.rs:274-278 | crates/oxc_linter/src/rules/vitest/prefer_importing_vitest_globals.rs:250-254 | crates/oxc_linter/src/rules/vitest/prefer_importing_vitest_globals.rs:304-308 — there are 3 copies across 2 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 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 3) crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:515— crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:515-519 | crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:551-555 | crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:577-581 — 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.
Dead file (~21 LoC) napi/minify/webcontainer-fallback.cjs— no import path from any entry point (227 application, 244 tooling, 2515 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 (~21 LoC) napi/parser/src-js/webcontainer-fallback.cjs— no import path from any entry point (227 application, 244 tooling, 2515 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 (~21 LoC) napi/transform/webcontainer-fallback.cjs— no import path from any entry point (227 application, 244 tooling, 2515 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
regeneratorRuntime._regeneratorRuntime (cyclomatic 107) npm/runtime/src/helpers/esm/regeneratorRuntime.js:2— regeneratorRuntime._regeneratorRuntime has cyclomatic complexity 107 (threshold 15). Of this number, 25 points are the body's own statements and 82 belong to 22 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.
regeneratorRuntime._regeneratorRuntime (cyclomatic 107) npm/runtime/src/helpers/regeneratorRuntime.js:2— regeneratorRuntime._regeneratorRuntime has cyclomatic complexity 107 (threshold 15). Of this number, 25 points are the body's own statements and 82 belong to 22 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.
Printer::print_element (cyclomatic 51) crates/oxc_formatter_core/src/printer/mod.rs:123— Printer::print_element has cyclomatic complexity 51 (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.
Printer::print_fill_entries (cyclomatic 17) crates/oxc_formatter_core/src/printer/mod.rs:521— Printer::print_fill_entries 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.
applyDecs2305.applyDecs2305::applyDec (cyclomatic 45) npm/runtime/src/helpers/applyDecs2305.js:19— applyDecs2305.applyDecs2305::applyDec has cyclomatic complexity 45 (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.
applyDecs2305.applyDecs2305::applyDec (cyclomatic 45) npm/runtime/src/helpers/esm/applyDecs2305.js:19— applyDecs2305.applyDecs2305::applyDec has cyclomatic complexity 45 (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.
applyDecs2311.applyDecs2311::applyDec (cyclomatic 45) npm/runtime/src/helpers/applyDecs2311.js:29— applyDecs2311.applyDecs2311::applyDec has cyclomatic complexity 45 (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.
applyDecs2311.applyDecs2311::applyDec (cyclomatic 45) npm/runtime/src/helpers/esm/applyDecs2311.js:29— applyDecs2311.applyDecs2311::applyDec has cyclomatic complexity 45 (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.
NoUselessAssignment::run_once (cyclomatic 43) crates/oxc_linter/src/rules/eslint/no_useless_assignment.rs:150— NoUselessAssignment::run_once 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.
NoUselessAssignment::ambiguous_destructuring_assignments (cyclomatic 21) crates/oxc_linter/src/rules/eslint/no_useless_assignment.rs:662— NoUselessAssignment::ambiguous_destructuring_assignments 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.
Parser::set_container_ids (cyclomatic 41) tasks/ast_tools/src/parse/parse.rs:139— Parser::set_container_ids has cyclomatic complexity 41 (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. This is NOT this file's highest cyclomatic complexity: Parser::type_id (cyclomatic 47) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Parser::parse_not_escape_sequence (cyclomatic 21) crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs:229— Parser::parse_not_escape_sequence 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.
applyDecs.old_applyMemberDec (cyclomatic 41) npm/runtime/src/helpers/applyDecs.js:123— applyDecs.old_applyMemberDec has cyclomatic complexity 41 (threshold 15). Of this number, 40 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.
applyDecs.old_applyMemberDec (cyclomatic 41) npm/runtime/src/helpers/esm/applyDecs.js:123— applyDecs.old_applyMemberDec has cyclomatic complexity 41 (threshold 15). Of this number, 40 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.
applyDecs2203.applyDecs2203Factory::applyMemberDec (cyclomatic 38) npm/runtime/src/helpers/applyDecs2203.js:73— applyDecs2203.applyDecs2203Factory::applyMemberDec 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.
applyDecs2203.applyDecs2203Factory::applyMemberDec (cyclomatic 38) npm/runtime/src/helpers/esm/applyDecs2203.js:73— applyDecs2203.applyDecs2203Factory::applyMemberDec 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.
oxc_formatter_yaml::print::mapping_item::write_mapping_item (cyclomatic 34) crates/oxc_formatter_yaml/src/print/mapping_item.rs:33— oxc_formatter_yaml::print::mapping_item::write_mapping_item 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.
oxc_formatter_yaml::print::block::write_block_scalar (cyclomatic 25) crates/oxc_formatter_yaml/src/print/block.rs:53— oxc_formatter_yaml::print::block::write_block_scalar has cyclomatic complexity 25 (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.
AssignmentLike::write_left (cyclomatic 33) crates/oxc_formatter/src/utils/assignment_like.rs:163— AssignmentLike::write_left has cyclomatic complexity 33 (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.
AssignmentLike::fmt (cyclomatic 19) crates/oxc_formatter/src/utils/assignment_like.rs:898— AssignmentLike::fmt 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.
BinaryExpression::may_have_side_effects (cyclomatic 31) crates/oxc_ecmascript/src/side_effects/expressions.rs:143— BinaryExpression::may_have_side_effects 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.
BinaryExpression::is_literal_value (cyclomatic 19) crates/oxc_ecmascript/src/constant_evaluation/is_literal_value.rs:99— BinaryExpression::is_literal_value has cyclomatic complexity 19 (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.
NoEmptyFunction::get_function_name_and_kind (cyclomatic 31) crates/oxc_linter/src/rules/eslint/no_empty_function.rs:348— NoEmptyFunction::get_function_name_and_kind 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.
NoEmptyFunction::is_allowed_method (cyclomatic 16) crates/oxc_linter/src/rules/eslint/no_empty_function.rs:452— NoEmptyFunction::is_allowed_method has cyclomatic complexity 16 (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.
Expression::is_constant (cyclomatic 29) crates/oxc_linter/src/ast_util.rs:93— Expression::is_constant has cyclomatic complexity 29 (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.
Expression::to_number (cyclomatic 16) crates/oxc_ecmascript/src/to_number.rs:16— Expression::to_number has cyclomatic complexity 16 (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.
NoUnusedVars::run_on_symbol_internal (cyclomatic 29) crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs:252— NoUnusedVars::run_on_symbol_internal 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.
NoUnusedVars::is_allowed_argument (cyclomatic 16) crates/oxc_linter/src/rules/eslint/no_unused_vars/allowed.rs:237— NoUnusedVars::is_allowed_argument has cyclomatic complexity 16 (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.
JsxNoTargetBlank::run (cyclomatic 28) crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs:240— JsxNoTargetBlank::run 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.
JsxNoTargetBlank::add_secure_rel (cyclomatic 16) crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs:112— JsxNoTargetBlank::add_secure_rel 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.
TsGoLintState::lint (cyclomatic 27) crates/oxc_linter/src/tsgolint.rs:146— TsGoLintState::lint 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.
TsGoLintState::lint_source (cyclomatic 16) crates/oxc_linter/src/tsgolint.rs:422— TsGoLintState::lint_source 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.
oxc_regular_expression::ast_impl::display::character_to_string (cyclomatic 26) crates/oxc_regular_expression/src/ast_impl/display.rs:299— oxc_regular_expression::ast_impl::display::character_to_string 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.
oxc_regular_expression::parser::pattern_parser::state::parse_capturing_groups (cyclomatic 22) crates/oxc_regular_expression/src/parser/pattern_parser/state.rs:74— oxc_regular_expression::parser::pattern_parser::state::parse_capturing_groups 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.
RuleConfig::visit_object_expression (cyclomatic 25) tasks/rulegen/src/main.rs:1247— RuleConfig::visit_object_expression 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.
RuleConfig::visit_statement (cyclomatic 21) tasks/rulegen/src/main.rs:1161— RuleConfig::visit_statement 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.
PreferNumberProperties::run_once (cyclomatic 23) crates/oxc_linter/src/rules/unicorn/prefer_number_properties.rs:175— PreferNumberProperties::run_once 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.
PreferNumberProperties::run (cyclomatic 20) crates/oxc_linter/src/rules/unicorn/prefer_number_properties.rs:96— PreferNumberProperties::run 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.
Linter::convert_and_call_external_linter (cyclomatic 22) crates/oxc_linter/src/lib.rs:727— Linter::convert_and_call_external_linter 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.
Linter::run_with_disable_directives (cyclomatic 16) crates/oxc_linter/src/lib.rs:357— Linter::run_with_disable_directives 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.
IdLength::handle_identifier_name (cyclomatic 20) crates/oxc_linter/src/rules/eslint/id_length.rs:256— IdLength::handle_identifier_name 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.
IdLength::handle_binding_identifier (cyclomatic 16) crates/oxc_linter/src/rules/eslint/id_length.rs:188— IdLength::handle_binding_identifier 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.
visitor.addVisitorToCompiled (cyclomatic 20) apps/oxlint/src-js/plugins/visitor.ts:268— visitor.addVisitorToCompiled 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.
visitor.addVisitorToCompiled (cyclomatic 20) napi/parser/src-js/visit/visitor.js:194— visitor.addVisitorToCompiled 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.
OnlyExportComponents::classify_export (cyclomatic 19) crates/oxc_linter/src/rules/react/only_export_components.rs:665— OnlyExportComponents::classify_export 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.
OnlyExportComponents::is_compound_component_value (cyclomatic 16) crates/oxc_linter/src/rules/react/only_export_components.rs:273— OnlyExportComponents::is_compound_component_value has cyclomatic complexity 16 (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.
applyDecs.old_applyMemberDecs (cyclomatic 19) npm/runtime/src/helpers/applyDecs.js:179— applyDecs.old_applyMemberDecs 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.
applyDecs.old_applyMemberDecs (cyclomatic 19) npm/runtime/src/helpers/esm/applyDecs.js:179— applyDecs.old_applyMemberDecs 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.
Codegen::print_comments (cyclomatic 18) crates/oxc_codegen/src/comment.rs:353— Codegen::print_comments 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.
Codegen::build_comments (cyclomatic 16) crates/oxc_codegen/src/comment.rs:74— Codegen::build_comments 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.
Backend::initialized (cyclomatic 18) crates/oxc_language_server/src/backend.rs:204— Backend::initialized 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.
Backend::did_change_configuration (cyclomatic 16) crates/oxc_language_server/src/backend.rs:333— Backend::did_change_configuration has cyclomatic complexity 16 (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.
ReplaceGlobalDefines::is_meta_property_define (cyclomatic 18) crates/oxc_transformer_plugins/src/replace_global_defines.rs:769— ReplaceGlobalDefines::is_meta_property_define 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.
ReplaceGlobalDefines::unwrap_chain_expression_if_no_optional (cyclomatic 17) crates/oxc_transformer_plugins/src/replace_global_defines.rs:873— ReplaceGlobalDefines::unwrap_chain_expression_if_no_optional 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.
interopRequireWildcard._interopRequireWildcard (cyclomatic 18) npm/runtime/src/helpers/esm/interopRequireWildcard.js:10— interopRequireWildcard._interopRequireWildcard 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.
interopRequireWildcard._interopRequireWildcard (cyclomatic 18) npm/runtime/src/helpers/interopRequireWildcard.js:10— interopRequireWildcard._interopRequireWildcard 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.
jsx._createRawReactElement (cyclomatic 18) npm/runtime/src/helpers/esm/jsx.js:2— jsx._createRawReactElement 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.
jsx._createRawReactElement (cyclomatic 18) npm/runtime/src/helpers/jsx.js:2— jsx._createRawReactElement 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.
applyDecs2305::p (cyclomatic 18) npm/runtime/src/helpers/applyDecs2305.js:94— applyDecs2305::p 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.
applyDecs2305::p (cyclomatic 18) npm/runtime/src/helpers/esm/applyDecs2305.js:94— applyDecs2305::p 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.
applyDecs2203RFactory::memberDec (cyclomatic 17) npm/runtime/src/helpers/applyDecs2203R.js:12— applyDecs2203RFactory::memberDec has cyclomatic complexity 17 (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.
applyDecs2203RFactory::memberDec (cyclomatic 17) npm/runtime/src/helpers/esm/applyDecs2203R.js:12— applyDecs2203RFactory::memberDec has cyclomatic complexity 17 (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.
applyDecs2203Factory::memberDec (cyclomatic 17) npm/runtime/src/helpers/applyDecs2203.js:10— applyDecs2203Factory::memberDec has cyclomatic complexity 17 (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.
applyDecs2203Factory::memberDec (cyclomatic 17) npm/runtime/src/helpers/esm/applyDecs2203.js:10— applyDecs2203Factory::memberDec has cyclomatic complexity 17 (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.
NoUselessAssignment::run_once (cognitive 103) crates/oxc_linter/src/rules/eslint/no_useless_assignment.rs:150— NoUselessAssignment::run_once has cognitive complexity 103 (threshold 15). Drivers by points: if/else 27 (79 pts), loops 5 (10 pts), boolean chains 7, match/switch 3 (7 pts) (nesting depth added 61). 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.
NoUselessAssignment::ambiguous_destructuring_assignments (cognitive 41) crates/oxc_linter/src/rules/eslint/no_useless_assignment.rs:662— NoUselessAssignment::ambiguous_destructuring_assignments has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (31 pts), boolean chains 6, loops 3 (4 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.
PreferConst::should_be_const (cognitive 92) crates/oxc_linter/src/rules/eslint/prefer_const.rs:443— PreferConst::should_be_const has cognitive complexity 92 (threshold 15). Drivers by points: if/else 30 (66 pts), match/switch 4 (13 pts), boolean chains 9, loops 2 (4 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreferConst::run (cognitive 25) crates/oxc_linter/src/rules/eslint/prefer_const.rs:115— PreferConst::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (8 pts), boolean chains 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.
Renderer::render_sub_schema (cognitive 86) tasks/website_common/src/schema_markdown.rs:214— Renderer::render_sub_schema has cognitive complexity 86 (threshold 15). Drivers by points: if/else 24 (60 pts), loops 6 (22 pts), boolean chains 4 (nesting depth added 52). 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.
Renderer::render_schema_impl (cognitive 20) tasks/website_common/src/schema_markdown.rs:399— Renderer::render_schema_impl has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2, match/switch 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.
regeneratorRuntime._regeneratorRuntime (cognitive 85) npm/runtime/src/helpers/esm/regeneratorRuntime.js:2— regeneratorRuntime._regeneratorRuntime has cognitive complexity 85 (threshold 15). Drivers by points: if/else 20 (39 pts), boolean chains 33, ternaries 5 (7 pts), loops 2 (4 pts), error handling 2 (nesting depth added 23). Of this number, 22 points are the body's own statements and 63 belong to 22 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.
regeneratorRuntime._regeneratorRuntime (cognitive 85) npm/runtime/src/helpers/regeneratorRuntime.js:2— regeneratorRuntime._regeneratorRuntime has cognitive complexity 85 (threshold 15). Drivers by points: if/else 20 (39 pts), boolean chains 33, ternaries 5 (7 pts), loops 2 (4 pts), error handling 2 (nesting depth added 23). Of this number, 22 points are the body's own statements and 63 belong to 22 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.
oxc_transformer::plugins::styled_components::minify_template_literal (cognitive 73) crates/oxc_transformer/src/plugins/styled_components.rs:874— oxc_transformer::plugins::styled_components::minify_template_literal has cognitive complexity 73 (threshold 15). Drivers by points: if/else 15 (49 pts), match/switch 4 (19 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 50). 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.
oxc_transformer::jsx::comments::find_jsx_pragma (cognitive 17) crates/oxc_transformer/src/jsx/comments.rs:102— oxc_transformer::jsx::comments::find_jsx_pragma has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2, match/switch 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.
JsxNoTargetBlank::run (cognitive 68) crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs:240— JsxNoTargetBlank::run has cognitive complexity 68 (threshold 15). Drivers by points: if/else 16 (55 pts), boolean chains 10, match/switch 1 (3 pts) (nesting depth added 41). 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.
JsxNoTargetBlank::add_secure_rel (cognitive 18) crates/oxc_linter/src/rules/react/jsx_no_target_blank.rs:112— JsxNoTargetBlank::add_secure_rel has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), match/switch 3 (5 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.
oxc_syntax::identifier::is_identifier_name_impl (cognitive 64) crates/oxc_syntax/src/identifier.rs:163— oxc_syntax::identifier::is_identifier_name_impl has cognitive complexity 64 (threshold 15). Drivers by points: if/else 18 (49 pts), loops 4 (14 pts), boolean chains 1 (nesting depth added 41). 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.
oxc_syntax::xml_entities::decode_entities (cognitive 33) crates/oxc_syntax/src/xml_entities.rs:277— oxc_syntax::xml_entities::decode_entities has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 2 (4 pts) (nesting depth added 20). 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.
old_applyMemberDec (cognitive 62) npm/runtime/src/helpers/applyDecs.js:123— old_applyMemberDec has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 19 (36 pts), boolean chains 14, if/else 6 (7 pts), loops 2 (5 pts) (nesting depth added 21). Of this number, 59 points are the body's own statements and 3 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.
old_applyMemberDec (cognitive 62) npm/runtime/src/helpers/esm/applyDecs.js:123— old_applyMemberDec has cognitive complexity 62 (threshold 15). Drivers by points: ternaries 19 (36 pts), boolean chains 14, if/else 6 (7 pts), loops 2 (5 pts) (nesting depth added 21). Of this number, 59 points are the body's own statements and 3 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.
Printer::print_element (cognitive 59) crates/oxc_formatter_core/src/printer/mod.rs:123— Printer::print_element has cognitive complexity 59 (threshold 15). Drivers by points: if/else 19 (41 pts), match/switch 6 (12 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 30). 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.
Printer::print_fill_entries (cognitive 40) crates/oxc_formatter_core/src/printer/mod.rs:521— Printer::print_fill_entries has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 3 (6 pts), match/switch 2 (4 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.
applyDecs2203Factory::applyMemberDec (cognitive 58) npm/runtime/src/helpers/applyDecs2203.js:73— applyDecs2203Factory::applyMemberDec has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 19 (36 pts), boolean chains 13, if/else 6 (7 pts), loops 1 (2 pts) (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.
applyDecs2203Factory::applyMemberDec (cognitive 58) npm/runtime/src/helpers/esm/applyDecs2203.js:73— applyDecs2203Factory::applyMemberDec has cognitive complexity 58 (threshold 15). Drivers by points: ternaries 19 (36 pts), boolean chains 13, if/else 6 (7 pts), loops 1 (2 pts) (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.
oxc_cfg::visit::set_depth_first_search (cognitive 57) crates/oxc_cfg/src/visit.rs:67— oxc_cfg::visit::set_depth_first_search has cognitive complexity 57 (threshold 15). Drivers by points: if/else 14 (51 pts), loops 3 (6 pts) (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oxc_cfg::visit::neighbors_filtered_by_edge_weight (cognitive 19) crates/oxc_cfg/src/visit.rs:12— oxc_cfg::visit::neighbors_filtered_by_edge_weight has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (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.
oxc_regular_expression::parser::pattern_parser::state::parse_capturing_groups (cognitive 55) crates/oxc_regular_expression/src/parser/pattern_parser/state.rs:74— oxc_regular_expression::parser::pattern_parser::state::parse_capturing_groups has cognitive complexity 55 (threshold 15). Drivers by points: if/else 14 (41 pts), loops 3 (10 pts), boolean chains 4 (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.
oxc_regular_expression::ast_impl::display::character_to_string (cognitive 16) crates/oxc_regular_expression/src/ast_impl/display.rs:299— oxc_regular_expression::ast_impl::display::character_to_string has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (5 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.
NoEmptyFunction::get_function_name_and_kind (cognitive 54) crates/oxc_linter/src/rules/eslint/no_empty_function.rs:348— NoEmptyFunction::get_function_name_and_kind has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (39 pts), match/switch 3 (9 pts), boolean chains 5, loops 1 (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.
NoEmptyFunction::is_allowed_method (cognitive 16) crates/oxc_linter/src/rules/eslint/no_empty_function.rs:452— NoEmptyFunction::is_allowed_method has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GroupedAccessorPairs::run (cognitive 53) crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:194— GroupedAccessorPairs::run has cognitive complexity 53 (threshold 15). Drivers by points: if/else 16 (44 pts), loops 4 (8 pts), match/switch 1 (nesting depth added 32). 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.
GroupedAccessorPairs::check_ts_signatures (cognitive 18) crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:348— GroupedAccessorPairs::check_ts_signatures has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 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.
NoReservedKeys::run (cognitive 52) crates/oxc_linter/src/rules/vue/no_reserved_keys.rs:127— NoReservedKeys::run has cognitive complexity 52 (threshold 15). Drivers by points: if/else 12 (36 pts), loops 3 (10 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 32). 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.
NoReservedKeys::check_define_props (cognitive 30) crates/oxc_linter/src/rules/vue/no_reserved_keys.rs:232— NoReservedKeys::check_define_props has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (6 pts), boolean chains 2, match/switch 1 (2 pts) (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.
OxlintRules::override_rules (cognitive 49) crates/oxc_linter/src/config/rules.rs:119— OxlintRules::override_rules has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (32 pts), match/switch 2 (10 pts), loops 3 (4 pts), boolean chains 3 (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.
OxlintRules::json_schema (cognitive 17) crates/oxc_linter/src/config/rules.rs:265— OxlintRules::json_schema has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 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 items inside it that branch (rule_config_schema::append_allow_warn_deny_to_schema, resolve_references_in_schema, rule_config_schema). 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.
SuppressionManager::compute_diagnostics (cognitive 48) crates/oxc_linter/src/suppression/mod.rs:246— SuppressionManager::compute_diagnostics has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 4 (10 pts), boolean chains 4 (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.
SuppressionManager::compute_prune (cognitive 22) crates/oxc_linter/src/suppression/mod.rs:208— SuppressionManager::compute_prune has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (4 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.
PreferNumberProperties::run_once (cognitive 47) crates/oxc_linter/src/rules/unicorn/prefer_number_properties.rs:175— PreferNumberProperties::run_once has cognitive complexity 47 (threshold 15). Drivers by points: if/else 15 (31 pts), match/switch 2 (8 pts), boolean chains 5, loops 2 (3 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.
PreferNumberProperties::run (cognitive 30) crates/oxc_linter/src/rules/unicorn/prefer_number_properties.rs:96— PreferNumberProperties::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (22 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 12). 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.
Lanes::validate_ident_escapes (cognitive 46) crates/oxc_lexer/src/lanes.rs:281— Lanes::validate_ident_escapes has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 5, loops 3 (5 pts) (nesting depth added 23). Of this number, 41 points are the body's own statements and 5 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.
Lanes::push_comment_record (cognitive 20) crates/oxc_lexer/src/lanes.rs:432— Lanes::push_comment_record has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 3, loops 2 (3 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.
RuleConfig::visit_object_expression (cognitive 46) tasks/rulegen/src/main.rs:1247— RuleConfig::visit_object_expression has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (40 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuleConfig::visit_statement (cognitive 38) tasks/rulegen/src/main.rs:1161— RuleConfig::visit_statement has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (32 pts), loops 2 (3 pts), match/switch 1 (3 pts) (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.
rulegen::main (cognitive 45) tasks/rulegen/src/main.rs:1445— rulegen::main has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 6, match/switch 5, loops 1 (2 pts) (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.
rulegen::find_parser_arguments (cognitive 18) tasks/rulegen/src/main.rs:650— rulegen::find_parser_arguments has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 1, 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.
NoSelfAssign::each_self_assignment (cognitive 42) crates/oxc_linter/src/rules/eslint/no_self_assign.rs:131— NoSelfAssign::each_self_assignment has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 4 (12 pts), boolean chains 2, 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.
NoSelfAssign::each_property_self_assignment (cognitive 17) crates/oxc_linter/src/rules/eslint/no_self_assign.rs:281— NoSelfAssign::each_property_self_assignment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 7). 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.
oxc_jsdoc::parser::parse::parse_jsdoc (cognitive 41) crates/oxc_jsdoc/src/parser/parse.rs:11— oxc_jsdoc::parser::parse::parse_jsdoc has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (24 pts), boolean chains 11, loops 2 (4 pts), match/switch 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.
oxc_jsdoc::parser::utils::find_type_name_range (cognitive 18) crates/oxc_jsdoc/src/parser/utils.rs:32— oxc_jsdoc::parser::utils::find_type_name_range has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
Linter::convert_and_call_external_linter (cognitive 38) crates/oxc_linter/src/lib.rs:727— Linter::convert_and_call_external_linter has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (24 pts), loops 3 (6 pts), match/switch 4 (6 pts), boolean chains 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.
Linter::run_with_disable_directives (cognitive 24) crates/oxc_linter/src/lib.rs:357— Linter::run_with_disable_directives has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 4 (6 pts), boolean chains 3 (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.
Parser::parse_not_escape_sequence (cognitive 36) crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs:229— Parser::parse_not_escape_sequence has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 2 (5 pts), boolean chains 4, loops 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.
Parser::parse_type_attrs (cognitive 32) tasks/ast_tools/src/parse/parse.rs:676— Parser::parse_type_attrs has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 3 (11 pts), loops 1 (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.
old_applyMemberDecs (cognitive 33) npm/runtime/src/helpers/applyDecs.js:179— old_applyMemberDecs has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 3 (12 pts), boolean chains 11, if/else 3 (9 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.
old_applyMemberDecs (cognitive 33) npm/runtime/src/helpers/esm/applyDecs.js:179— old_applyMemberDecs has cognitive complexity 33 (threshold 15). Drivers by points: ternaries 3 (12 pts), boolean chains 11, if/else 3 (9 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.
JsxNoLiterals::inspect_element_attributes (cognitive 32) crates/oxc_linter/src/rules/react/jsx_no_literals.rs:312— JsxNoLiterals::inspect_element_attributes has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 2 (6 pts), boolean chains 2, 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.
JsxNoLiterals::inspect_element_literals (cognitive 16) crates/oxc_linter/src/rules/react/jsx_no_literals.rs:253— JsxNoLiterals::inspect_element_literals has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (5 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.
TypeScriptNamespace::handle_nested (cognitive 32) crates/oxc_transformer/src/typescript/namespace.rs:119— TypeScriptNamespace::handle_nested has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (24 pts), match/switch 3 (6 pts), boolean chains 1, loops 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.
TypeScriptNamespace::enter_program (cognitive 25) crates/oxc_transformer/src/typescript/namespace.rs:32— TypeScriptNamespace::enter_program has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (5 pts), boolean chains 1, 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.
_regeneratorRuntime::dispatchException (cognitive 32) npm/runtime/src/helpers/regeneratorRuntime.js:234— _regeneratorRuntime::dispatchException has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 1, 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.
_regeneratorRuntime::dispatchException (cognitive 32) npm/runtime/src/helpers/esm/regeneratorRuntime.js:234— _regeneratorRuntime::dispatchException has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 1, 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.
MultipleResolvedChecker::prev_resolved_info (cognitive 31) crates/oxc_linter/src/rules/promise/no_multiple_resolved.rs:409— MultipleResolvedChecker::prev_resolved_info has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (24 pts), boolean chains 3, match/switch 1 (3 pts), loops 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.
MultipleResolvedChecker::check (cognitive 28) crates/oxc_linter/src/rules/promise/no_multiple_resolved.rs:501— MultipleResolvedChecker::check has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 1 (3 pts), loops 2 (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.
NoUnusedVars::run_on_symbol_internal (cognitive 30) crates/oxc_linter/src/rules/eslint/no_unused_vars/mod.rs:252— NoUnusedVars::run_on_symbol_internal has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), match/switch 4 (6 pts), boolean chains 4 (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.
NoUnusedVars::rename_or_remove_var_declaration (cognitive 22) crates/oxc_linter/src/rules/eslint/no_unused_vars/fixers/fix_vars.rs:24— NoUnusedVars::rename_or_remove_var_declaration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, match/switch 2 (3 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.
JsxHandlerNames::run (cognitive 30) crates/oxc_linter/src/rules/react/jsx_handler_names.rs:266— JsxHandlerNames::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, match/switch 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.
JsxHandlerNames::from_configuration (cognitive 27) crates/oxc_linter/src/rules/react/jsx_handler_names.rs:211— JsxHandlerNames::from_configuration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 1 (3 pts), boolean chains 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.
oxc_formatter_graphql::print::string::cook_unicode_escape (cognitive 29) crates/oxc_formatter_graphql/src/print/string.rs:229— oxc_formatter_graphql::print::string::cook_unicode_escape has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 2 (3 pts), loops 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.
oxc_formatter_graphql::print::write_sequence (cognitive 20) crates/oxc_formatter_graphql/src/print/mod.rs:91— oxc_formatter_graphql::print::write_sequence has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (3 pts), boolean chains 1, 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.
OnlyExportComponents::classify_export (cognitive 28) crates/oxc_linter/src/rules/react/only_export_components.rs:665— OnlyExportComponents::classify_export has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 3, match/switch 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.
OnlyExportComponents::analyze_export_default (cognitive 17) crates/oxc_linter/src/rules/react/only_export_components.rs:455— OnlyExportComponents::analyze_export_default has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2, match/switch 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.
PreferImportingVitestGlobals::run_once (cognitive 28) crates/oxc_linter/src/rules/vitest/prefer_importing_vitest_globals.rs:99— PreferImportingVitestGlobals::run_once has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 4 (6 pts), boolean chains 2 (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.
PreferImportingVitestGlobals::try_fix_cjs_require (cognitive 16) crates/oxc_linter/src/rules/vitest/prefer_importing_vitest_globals.rs:245— PreferImportingVitestGlobals::try_fix_cjs_require has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
NoInstanceofBuiltins::from_configuration (cognitive 27) crates/oxc_linter/src/rules/unicorn/no_instanceof_builtins.rs:134— NoInstanceofBuiltins::from_configuration has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 2 (6 pts), match/switch 1 (3 pts), boolean chains 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.
NoInstanceofBuiltins::run (cognitive 17) crates/oxc_linter/src/rules/unicorn/no_instanceof_builtins.rs:177— NoInstanceofBuiltins::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, match/switch 1 (2 pts) (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.
ExhaustiveDepsVisitor::visit_identifier_reference (cognitive 26) crates/oxc_linter/src/rules/react/exhaustive_deps.rs:1401— ExhaustiveDepsVisitor::visit_identifier_reference has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (22 pts), boolean chains 2, match/switch 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.
ExhaustiveDepsVisitor::visit_static_member_expression (cognitive 16) crates/oxc_linter/src/rules/react/exhaustive_deps.rs:1336— ExhaustiveDepsVisitor::visit_static_member_expression 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.
SourcemapBuilder::generate_line_offset_tables (cognitive 25) crates/oxc_codegen/src/sourcemap_builder.rs:385— SourcemapBuilder::generate_line_offset_tables has cognitive complexity 25 (threshold 15). Drivers by points: if/else 2 (10 pts), match/switch 2 (8 pts), loops 3 (7 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.
SourcemapBuilder::update_generated_line_and_column (cognitive 19) crates/oxc_codegen/src/sourcemap_builder.rs:281— SourcemapBuilder::update_generated_line_and_column has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), match/switch 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.
oxlint::js_plugins::parse::parse_raw_impl (cognitive 24) apps/oxlint/src/js_plugins/parse.rs:124— oxlint::js_plugins::parse::parse_raw_impl has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (6 pts), boolean chains 3 (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.
oxlint::config_loader::discover_configs_in_ancestors (cognitive 17) apps/oxlint/src/config_loader.rs:60— oxlint::config_loader::discover_configs_in_ancestors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (3 pts), match/switch 1 (3 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.
UidGenerator::add (cognitive 24) crates/oxc_minifier/src/traverse_context/uid.rs:154— UidGenerator::add has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3, match/switch 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.
UidGenerator::add (cognitive 24) crates/oxc_traverse/src/context/uid.rs:154— UidGenerator::add has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 3, match/switch 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.
NoUselessReturn::analyze_ancestors (cognitive 22) crates/oxc_linter/src/rules/eslint/no_useless_return.rs:127— NoUselessReturn::analyze_ancestors has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3, match/switch 1 (2 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.
NoUselessReturn::has_reachable_code_after (cognitive 20) crates/oxc_linter/src/rules/eslint/no_useless_return.rs:210— NoUselessReturn::has_reachable_code_after has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), match/switch 1 (3 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.
ExplicitLengthCheck::report (cognitive 22) crates/oxc_linter/src/rules/unicorn/explicit_length_check.rs:175— ExplicitLengthCheck::report has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (18 pts), match/switch 2 (3 pts), 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.
ExplicitLengthCheck::run (cognitive 21) crates/oxc_linter/src/rules/unicorn/explicit_length_check.rs:265— ExplicitLengthCheck::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, match/switch 1 (3 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.
LegacyDecorator::lower_accessor_properties (cognitive 22) crates/oxc_transformer/src/decorator/legacy/mod.rs:322— LegacyDecorator::lower_accessor_properties has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 1 (3 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.
LegacyDecorator::get_all_decorators_of_class_method (cognitive 18) crates/oxc_transformer/src/decorator/legacy/mod.rs:1244— LegacyDecorator::get_all_decorators_of_class_method has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (18 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.
applyDecs.old_convertMetadataMapToFinal (cognitive 22) npm/runtime/src/helpers/applyDecs.js:30— applyDecs.old_convertMetadataMapToFinal has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 3 (10 pts), boolean chains 6, if/else 2 (4 pts), 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.
applyDecs.old_convertMetadataMapToFinal (cognitive 22) npm/runtime/src/helpers/esm/applyDecs.js:30— applyDecs.old_convertMetadataMapToFinal has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 3 (10 pts), boolean chains 6, if/else 2 (4 pts), 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.
oxc_formatter_json::comments::has_line_terminator_after_skipping_comments (cognitive 21) crates/oxc_formatter_json/src/comments.rs:187— oxc_formatter_json::comments::has_line_terminator_after_skipping_comments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (10 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 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.
oxc_formatter_json::print::stringify::json_stringify_escape (cognitive 17) crates/oxc_formatter_json/src/print/stringify.rs:192— oxc_formatter_json::print::stringify::json_stringify_escape has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (5 pts), match/switch 2 (5 pts), loops 2 (4 pts), boolean chains 3 (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.
IdLength::handle_binding_identifier (cognitive 21) crates/oxc_linter/src/rules/eslint/id_length.rs:188— IdLength::handle_binding_identifier has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, match/switch 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.
IdLength::handle_identifier_name (cognitive 21) crates/oxc_linter/src/rules/eslint/id_length.rs:256— IdLength::handle_identifier_name has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 2 (3 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.
interopRequireWildcard._interopRequireWildcard (cognitive 21) npm/runtime/src/helpers/esm/interopRequireWildcard.js:10— interopRequireWildcard._interopRequireWildcard has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 2 (6 pts), if/else 4 (5 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.
interopRequireWildcard._interopRequireWildcard (cognitive 21) npm/runtime/src/helpers/interopRequireWildcard.js:10— interopRequireWildcard._interopRequireWildcard has cognitive complexity 21 (threshold 15). Drivers by points: boolean chains 9, ternaries 2 (6 pts), if/else 4 (5 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.
iterableToArrayLimit._iterableToArrayLimit (cognitive 21) npm/runtime/src/helpers/esm/iterableToArrayLimit.js:1— iterableToArrayLimit._iterableToArrayLimit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1 (3 pts), error handling 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.
iterableToArrayLimit._iterableToArrayLimit (cognitive 21) npm/runtime/src/helpers/iterableToArrayLimit.js:1— iterableToArrayLimit._iterableToArrayLimit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 1 (3 pts), error handling 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.
LabelHasAssociatedControl::search_for_accessible_label (cognitive 20) crates/oxc_linter/src/rules/jsx_a11y/label_has_associated_control.rs:341— LabelHasAssociatedControl::search_for_accessible_label has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), boolean chains 1, match/switch 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.
LabelHasAssociatedControl::run (cognitive 16) crates/oxc_linter/src/rules/jsx_a11y/label_has_associated_control.rs:199— LabelHasAssociatedControl::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 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.
PreferAt::handle_computed_member (cognitive 20) crates/oxc_linter/src/rules/unicorn/prefer_at.rs:141— PreferAt::handle_computed_member has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 3 (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.
PreferAt::check_slice_index_access (cognitive 17) crates/oxc_linter/src/rules/unicorn/prefer_at.rs:464— PreferAt::check_slice_index_access has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, match/switch 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.
GetterReturn::run_diagnostic (cognitive 18) crates/oxc_linter/src/rules/eslint/getter_return.rs:207— GetterReturn::run_diagnostic has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (3 pts), 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.
GetterReturn::is_wanted_node (cognitive 17) crates/oxc_linter/src/rules/eslint/getter_return.rs:152— GetterReturn::is_wanted_node has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (5 pts) (nesting depth added 9). 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.
jsx._createRawReactElement (cognitive 18) npm/runtime/src/helpers/esm/jsx.js:2— jsx._createRawReactElement has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 4, loops 2 (4 pts), ternaries 1 (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.
jsx._createRawReactElement (cognitive 18) npm/runtime/src/helpers/jsx.js:2— jsx._createRawReactElement has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 9, if/else 4, loops 2 (4 pts), ternaries 1 (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.
NoConstantBinaryExpression::run (cognitive 17) crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs:120— NoConstantBinaryExpression::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 6). 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.
NoConstantBinaryExpression::has_constant_strict_boolean_comparison (cognitive 16) crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs:338— NoConstantBinaryExpression::has_constant_strict_boolean_comparison has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 7). 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.
Lexer::read_string_escape_sequence (cognitive 17) crates/oxc_parser/src/lexer/unicode.rs:331— Lexer::read_string_escape_sequence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (12 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 10). 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.
Lexer::read_regex (cognitive 16) crates/oxc_parser/src/lexer/regex.rs:29— Lexer::read_regex has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2, match/switch 1 (2 pts), 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.
_usingCtx.using (cognitive 17) npm/runtime/src/helpers/usingCtx.js:8— _usingCtx.using has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 5). Of this number, 15 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.
_usingCtx.using (cognitive 17) npm/runtime/src/helpers/esm/usingCtx.js:8— _usingCtx.using has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 5, error handling 1 (2 pts) (nesting depth added 5). Of this number, 15 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.
usingCtx._usingCtx.d::next (cognitive 16) npm/runtime/src/helpers/esm/usingCtx.js:39— usingCtx._usingCtx.d::next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (2 pts), ternaries 1 (2 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.
usingCtx._usingCtx.d::next (cognitive 16) npm/runtime/src/helpers/usingCtx.js:39— usingCtx._usingCtx.d::next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), error handling 1 (2 pts), ternaries 1 (2 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.
_usingCtx.d (cognitive 16) npm/runtime/src/helpers/usingCtx.js:35— _usingCtx.d has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (3 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 5). None of this is in the body itself: all 16 points belong to 2 function items inside it that branch (next, err). 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.
_usingCtx.d (cognitive 16) npm/runtime/src/helpers/esm/usingCtx.js:35— _usingCtx.d has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 2 (3 pts), boolean chains 1, error handling 1, loops 1 (nesting depth added 5). None of this is in the body itself: all 16 points belong to 2 function items inside it that branch (next, err). 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.
TooManyFields: BabelPlugins crates/oxc_transformer/src/options/babel/plugins.rs:27— TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ReactCompilerEnvironmentOptions napi/transform-react/src/options.rs:241— TooManyFields — 34 stored fields beside 1 method. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Change-coupling hub: REDACTED → common.rs, angle_brackets.rs, REDACTED crates/oxc_lexer/src/pipeline/coalesce/mod.rs— `crates/oxc_lexer/src/pipeline/coalesce/mod.rs` changes together with 3 other files — `crates/oxc_lexer/src/pipeline/carve/common.rs`, `crates/oxc_lexer/src/pipeline/carve/jsx/angle_brackets.rs`, `crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: graphql.rs → css.rs, html.rs, lib.rs, REDACTED crates/oxc_formatter/src/print/template/embed/graphql.rs— `crates/oxc_formatter/src/print/template/embed/graphql.rs` changes together with 4 other files — `crates/oxc_formatter/src/print/template/embed/css.rs`, `crates/oxc_formatter/src/print/template/embed/html.rs`, `crates/oxc_formatter_core/src/lib.rs`, `crates/oxc_formatter_core/src/session/mod.rs` — none of which declares a dependency on it: one file is the hub of 4 separate couplings, not 4 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 4.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/oxc_formatter_css/src/print/scss.rs:205— crates/oxc_formatter_css/src/print/scss.rs:205-428 | crates/oxc_formatter_css/src/print/scss.rs:572-608 | crates/oxc_formatter_css/src/print/selector.rs:448-462 | crates/oxc_formatter_css/src/print/value.rs:1606-1859 | crates/oxc_formatter_css/src/print/value.rs:2284-2429 — These 5 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 5 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 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:189— crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:189-335 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:343-411 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:437-478 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:599-640 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:657-687 — These 5 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 5 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 5 times.
Duplicated block (32 lines × 2) crates/oxc_linter/src/rules/eslint/yoda.rs:386— crates/oxc_linter/src/rules/eslint/yoda.rs:386-417 | crates/oxc_linter/src/rules/eslint/yoda.rs:420-451 — 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 (32 lines × 2) crates/oxc_linter/src/rules/react/checked_requires_onchange_or_readonly.rs:104— crates/oxc_linter/src/rules/react/checked_requires_onchange_or_readonly.rs:104-135 | crates/oxc_linter/src/rules/react/checked_requires_onchange_or_readonly.rs:164-195 — 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 (27 lines × 2) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1622— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1622-1648 | crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1653-1679 — 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 (27 lines × 2) tasks/ast_tools/src/generators/visit_js.rs:207— tasks/ast_tools/src/generators/visit_js.rs:207-233 | tasks/ast_tools/src/generators/visit_js.rs:296-322 — 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 (25 lines × 2) crates/oxc_formatter/src/print/array_pattern.rs:28— crates/oxc_formatter/src/print/array_pattern.rs:28-52 | crates/oxc_formatter/src/print/mod.rs:386-410 — 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 (25 lines × 2) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1168— crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1168-1192 | crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1385-1409 — 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 (21–22 lines × 2) crates/oxc_lexer/src/pipeline/carve/js.rs:38— crates/oxc_lexer/src/pipeline/carve/js.rs:38-58 | crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs:110-131 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (21–22 lines × 2) crates/oxc_linter/src/utils/react_perf.rs:188— crates/oxc_linter/src/utils/react_perf.rs:188-209 | crates/oxc_linter/src/utils/react_perf.rs:215-235 — 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 (22 lines × 2) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1225— crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1225-1246 | crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1446-1467 — 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 (22 lines × 2) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:2200— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:2200-2221 | crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:275-296 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (18–21 lines × 2) crates/oxc_linter/src/rules/shared/jest_vitest/prefer_mock_promise_shorthand.rs:59— crates/oxc_linter/src/rules/shared/jest_vitest/prefer_mock_promise_shorthand.rs:59-76 | crates/oxc_linter/src/rules/shared/jest_vitest/prefer_mock_return_shorthand.rs:78-98 — 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 (18–21 lines × 2) crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs:122— crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs:122-142 | crates/oxc_linter/src/rules/vue/no_watch_after_await.rs:109-126 — before extracting anything, compare `crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs` and `crates/oxc_linter/src/rules/vue/no_watch_after_await.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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.
Duplicated block (18–19 lines × 2) crates/oxc_linter/src/rules/nextjs/google_font_display.rs:83— crates/oxc_linter/src/rules/nextjs/google_font_display.rs:83-101 | crates/oxc_linter/src/rules/nextjs/google_font_preconnect.rs:54-71 — 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 (18–19 lines × 2) crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:156— crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:156-174 | crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:207-224 — 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 (15–17 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:148— crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:148-162 | crates/oxc_formatter/src/formatter/jsdoc/param_order.rs:193-209 — 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 (15–17 lines × 2) tasks/rulegen/src/main.rs:1765— tasks/rulegen/src/main.rs:1765-1781 | tasks/rulegen/src/template.rs:33-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.
Duplicated block (14 lines × 3) crates/oxc_codegen/src/gen.rs:2908— crates/oxc_codegen/src/gen.rs:2908-2921 | crates/oxc_codegen/src/gen.rs:2995-3008 | crates/oxc_codegen/src/gen.rs:3051-3064 — 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.
Duplicated block (14 lines × 3) crates/oxc_linter/src/rules/jsdoc/require_property_description.rs:56— crates/oxc_linter/src/rules/jsdoc/require_property_description.rs:56-69 | crates/oxc_linter/src/rules/jsdoc/require_property_name.rs:56-69 | crates/oxc_linter/src/rules/jsdoc/require_property_type.rs:56-69 — 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.
Duplicated block (13–14 lines × 3) crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:241— crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:241-253 | crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:310-323 | crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:383-395 — 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.
Duplicated block (13–14 lines × 3) crates/oxc_linter/src/rules/eslint/id_length.rs:194— crates/oxc_linter/src/rules/eslint/id_length.rs:194-207 | crates/oxc_linter/src/rules/eslint/id_length.rs:257-269 | crates/oxc_linter/src/rules/eslint/id_length.rs:365-377 — 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.
Duplicated block (13–14 lines × 2) crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:389— crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:389-402 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:458-470 — 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–14 lines × 2) tasks/ast_tools/src/generators/visit.rs:600— tasks/ast_tools/src/generators/visit.rs:600-613 | tasks/ast_tools/src/generators/visit_js.rs:638-650 — before extracting anything, compare `tasks/ast_tools/src/generators/visit.rs` and `tasks/ast_tools/src/generators/visit_js.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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.
Duplicated block (12–14 lines × 2) crates/oxc_linter/src/rules/jsx_a11y/no_interactive_element_to_noninteractive_role.rs:112— crates/oxc_linter/src/rules/jsx_a11y/no_interactive_element_to_noninteractive_role.rs:112-123 | crates/oxc_linter/src/rules/jsx_a11y/no_noninteractive_element_to_interactive_role.rs:164-177 — 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–14 lines × 2) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:778— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:778-789 | crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1347-1360 — 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 (11–13 lines × 2) crates/oxc_jsdoc/src/parser/jsdoc_tag.rs:89— crates/oxc_jsdoc/src/parser/jsdoc_tag.rs:89-99 | crates/oxc_jsdoc/src/parser/jsdoc_tag.rs:132-144 — 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 (11–13 lines × 2) crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:113— crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:113-125 | crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:201-211 — 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 (12–13 lines × 2) crates/oxc_lexer/src/pipeline/carve/common.rs:277— crates/oxc_lexer/src/pipeline/carve/common.rs:277-289 | crates/oxc_lexer/src/pipeline/carve/common.rs:323-334 — 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 (12–13 lines × 2) crates/oxc_semantic/src/builder.rs:1450— crates/oxc_semantic/src/builder.rs:1450-1461 | crates/oxc_semantic/src/builder.rs:2030-2042 — 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 (10–12 lines × 2) crates/oxc_jsdoc/src/parser/parse.rs:149— crates/oxc_jsdoc/src/parser/parse.rs:149-160 | crates/oxc_jsdoc/src/parser/parse.rs:196-205 — 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 (10–12 lines × 2) crates/oxc_semantic/src/builder.rs:1223— crates/oxc_semantic/src/builder.rs:1223-1232 | crates/oxc_semantic/src/builder.rs:1353-1364 — 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 (10–11 lines × 2) crates/oxc_language_server/src/backend.rs:430— crates/oxc_language_server/src/backend.rs:430-439 | crates/oxc_language_server/src/backend.rs:495-505 — 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 (10–11 lines × 2) tasks/ast_tools/src/generators/visit.rs:538— tasks/ast_tools/src/generators/visit.rs:538-547 | tasks/ast_tools/src/generators/visit_js.rs:582-592 — before extracting anything, compare `tasks/ast_tools/src/generators/visit.rs` and `tasks/ast_tools/src/generators/visit_js.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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.
Duplicated block (9–11 lines × 2) crates/oxc_semantic/src/builder.rs:2896— crates/oxc_semantic/src/builder.rs:2896-2906 | crates/oxc_semantic/src/builder.rs:2924-2932 — 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 (9–11 lines × 2) tasks/ast_tools/src/generators/visit.rs:378— tasks/ast_tools/src/generators/visit.rs:378-388 | tasks/ast_tools/src/generators/visit_js.rs:416-424 — before extracting anything, compare `tasks/ast_tools/src/generators/visit.rs` and `tasks/ast_tools/src/generators/visit_js.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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.
Duplicated block (10 lines × 3) crates/oxc_formatter_css/src/options.rs:71— crates/oxc_formatter_css/src/options.rs:71-81 | crates/oxc_formatter_json/src/options.rs:96-106 | crates/oxc_formatter_markdown/src/options.rs:57-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 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 3 times.
Duplicated block (10 lines × 3) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:123— crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:123-132 | crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:138-147 | crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:153-162 — 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.
Duplicated block (7–9 lines × 2) crates/oxc_linter/src/rules/eslint/require_await.rs:129— crates/oxc_linter/src/rules/eslint/require_await.rs:129-135 | crates/oxc_linter/src/rules/eslint/require_await.rs:162-170 — 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–9 lines × 2) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1191— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1191-1197 | crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:1233-1241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 3) tasks/ast_tools/src/generators/utf8_to_utf16.rs:124— tasks/ast_tools/src/generators/utf8_to_utf16.rs:124-131 | tasks/ast_tools/src/generators/visit.rs:354-361 | tasks/ast_tools/src/generators/visit_js.rs:394-401 — before extracting anything, compare `tasks/ast_tools/src/generators/visit.rs` and `tasks/ast_tools/src/generators/visit_js.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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.
Duplicated block (8 lines × 3) crates/oxc_ecmascript/src/constant_evaluation/url_encoding/dec.rs:67— crates/oxc_ecmascript/src/constant_evaluation/url_encoding/dec.rs:67-74 | crates/oxc_lexer/src/lanes.rs:688-695 | crates/oxc_lexer/src/lanes.rs:763-770 — there are 3 copies across 2 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 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7–8 lines × 2) crates/oxc_linter/src/loader/partial_loader/svelte.rs:82— crates/oxc_linter/src/loader/partial_loader/svelte.rs:82-89 | crates/oxc_linter/src/loader/partial_loader/vue.rs:82-88 — 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–8 lines × 2) crates/oxc_transformer/src/es2026/explicit_resource_management.rs:199— crates/oxc_transformer/src/es2026/explicit_resource_management.rs:199-205 | crates/oxc_transformer/src/es2026/explicit_resource_management.rs:597-604 — 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 (6–7 lines × 2) crates/oxc_linter/src/rules/eslint/getter_return.rs:236— crates/oxc_linter/src/rules/eslint/getter_return.rs:236-242 | crates/oxc_linter/src/rules/promise/always_return.rs:326-331 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (6–7 lines × 2) tasks/ast_tools/src/generators/formatter/ast_nodes.rs:540— tasks/ast_tools/src/generators/formatter/ast_nodes.rs:540-545 | tasks/ast_tools/src/generators/formatter/format.rs:300-306 — 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 (6 lines × 4) crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:139— crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:139-144 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:173-178 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:210-215 | crates/oxc_ecmascript/src/constant_evaluation/call_expr.rs:239-244 — 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.
Duplicated block (6 lines × 4) crates/oxc_codegen/src/str.rs:329— crates/oxc_codegen/src/str.rs:329-334 | crates/oxc_parser/src/lexer/string.rs:14-19 | crates/oxc_parser/src/lexer/template.rs:16-21 | crates/oxc_syntax/src/line_terminator.rs:35-40 — 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.
Duplicated block (5–6 lines × 2) crates/oxc_linter/src/rules/typescript/no_var_requires.rs:55— crates/oxc_linter/src/rules/typescript/no_var_requires.rs:55-59 | crates/oxc_linter/src/rules/unicorn/prefer_modern_dom_apis.rs:44-49 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (5–6 lines × 2) crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:515— crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:515-519 | crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:577-582 — 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 (5 lines × 4) crates/oxc_semantic/src/builder.rs:1145— crates/oxc_semantic/src/builder.rs:1145-1149 | crates/oxc_semantic/src/builder.rs:1609-1614 | crates/oxc_semantic/src/builder.rs:2011-2016 | crates/oxc_semantic/src/builder.rs:2061-2066 — 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.
Duplicated block (5 lines × 4) crates/oxc_linter/src/rules/promise/param_names.rs:89— crates/oxc_linter/src/rules/promise/param_names.rs:89-93 | crates/oxc_linter/src/rules/typescript/no_empty_object_type.rs:172-176 | crates/oxc_linter/src/rules/unicorn/catch_error_name.rs:125-129 | crates/oxc_linter/src/rules/unicorn/prefer_object_from_entries.rs:231-235 — 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.
Duplicated block (23 lines × 2 locations) apps/oxlint/src-js/package/parse.ts:159— apps/oxlint/src-js/package/parse.ts:159 · napi/parser/src-js/raw-transfer/supported.js:30 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (23 lines × 2 locations) napi/parser/src-js/parser.wasi-browser.js:1424— napi/parser/src-js/parser.wasi-browser.js:1424 · napi/parser/src-js/parser.wasip1-browser.js:1371 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (22 lines × 2 locations) napi/transform/transform.wasi-browser.js:1424— napi/transform/transform.wasi-browser.js:1424 · napi/transform/transform.wasip1-browser.js:1371 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (22 lines × 2 locations) npm/runtime/src/helpers/asyncGeneratorDelegate.js:2— npm/runtime/src/helpers/asyncGeneratorDelegate.js:2 · npm/runtime/src/helpers/esm/asyncGeneratorDelegate.js:2 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (20 lines × 2 locations) apps/oxlint/src-js/plugins/tokens_methods.ts:1001— apps/oxlint/src-js/plugins/tokens_methods.ts:1001 · apps/oxlint/src-js/plugins/tokens_methods.ts:1167 — 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 (20 lines × 2 locations) npm/runtime/src/helpers/esm/jsx.js:2— npm/runtime/src/helpers/esm/jsx.js:2 · npm/runtime/src/helpers/jsx.js:2 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (16 lines × 2 locations) apps/oxlint/conformance/src/groups/e18e.ts:7— apps/oxlint/conformance/src/groups/e18e.ts:7 · apps/oxlint/conformance/src/groups/testing_library.ts:8 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2 locations) apps/oxlint/src-js/plugins/tokens_methods.ts:924— apps/oxlint/src-js/plugins/tokens_methods.ts:924 · apps/oxlint/src-js/plugins/tokens_methods.ts:1088 — 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.
Complex function applyDec (cyclomatic 45, cognitive 75) npm/runtime/src/helpers/applyDecs2311.js:29— applyDec has cyclomatic complexity 45 and cognitive complexity 75; 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 applyDec (cyclomatic 45, cognitive 75) npm/runtime/src/helpers/esm/applyDecs2311.js:29— applyDec has cyclomatic complexity 45 and cognitive complexity 75; 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 applyDec (cyclomatic 45, cognitive 72) npm/runtime/src/helpers/applyDecs2305.js:19— applyDec has cyclomatic complexity 45 and cognitive complexity 72; 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 applyDec (cyclomatic 45, cognitive 72) npm/runtime/src/helpers/esm/applyDecs2305.js:19— applyDec has cyclomatic complexity 45 and cognitive complexity 72; 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 applyMemberDec (cyclomatic 41, cognitive 60) npm/runtime/src/helpers/applyDecs2301.js:100— applyMemberDec has cyclomatic complexity 41 and cognitive complexity 60; 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 applyMemberDec (cyclomatic 41, cognitive 60) npm/runtime/src/helpers/esm/applyDecs2301.js:100— applyMemberDec has cyclomatic complexity 41 and cognitive complexity 60; 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 old_applyMemberDec (cyclomatic 40, cognitive 59) npm/runtime/src/helpers/applyDecs.js:123— old_applyMemberDec has cyclomatic complexity 40 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.
Complex function old_applyMemberDec (cyclomatic 40, cognitive 59) npm/runtime/src/helpers/esm/applyDecs.js:123— old_applyMemberDec has cyclomatic complexity 40 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.
Complex function applyMemberDec (cyclomatic 40, cognitive 59) npm/runtime/src/helpers/applyDecs2203R.js:75— applyMemberDec has cyclomatic complexity 40 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.
Complex function applyMemberDec (cyclomatic 40, cognitive 59) npm/runtime/src/helpers/esm/applyDecs2203R.js:75— applyMemberDec has cyclomatic complexity 40 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.
Complex function applyMemberDec (cyclomatic 38, cognitive 58) npm/runtime/src/helpers/applyDecs2203.js:73— applyMemberDec has cyclomatic complexity 38 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.
Complex function applyMemberDec (cyclomatic 38, cognitive 58) npm/runtime/src/helpers/esm/applyDecs2203.js:73— applyMemberDec has cyclomatic complexity 38 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.
Complex function memberDec (cyclomatic 23, cognitive 26) npm/runtime/src/helpers/applyDecs2301.js:16— memberDec has cyclomatic complexity 23 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 memberDec (cyclomatic 23, cognitive 26) npm/runtime/src/helpers/esm/applyDecs2301.js:16— memberDec has cyclomatic complexity 23 and cognitive complexity 26; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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.
Dead file (~1445 LoC) napi/transform-react/transform-react.wasi-browser.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1445 LoC) napi/transform-relay/transform-relay.wasi-browser.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1392 LoC) napi/transform-react/transform-react.wasip1-browser.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1392 LoC) napi/transform-relay/transform-relay.wasip1-browser.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~23 LoC) napi/transform-react/webcontainer-fallback.cjs— no import path from any entry point (227 application, 244 tooling, 2515 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 (~23 LoC) napi/transform-relay/webcontainer-fallback.cjs— no import path from any entry point (227 application, 244 tooling, 2515 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
X2 · Cancellation propagation· Async function without AbortSignal · ×2
Async function without AbortSignal: loadFixture packages/codegen/bench.bench.ts:83— `loadFixture` 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: updateGitHubIssue tasks/lint_rules/src/result-reporter.mjs:5— `updateGitHubIssue` 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 })`.
ExhaustiveDeps::run (cyclomatic 76) crates/oxc_linter/src/rules/react/exhaustive_deps.rs:286— ExhaustiveDeps::run has cyclomatic complexity 76 (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.
CliRunner::run (cyclomatic 72) apps/oxlint/src/lint.rs:78— CliRunner::run 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.
rulegen::main (cyclomatic 59) tasks/rulegen/src/main.rs:1445— rulegen::main has cyclomatic complexity 59 (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.
ConsistentIndexedObjectStyle::run (cyclomatic 58) crates/oxc_linter/src/rules/typescript/consistent_indexed_object_style.rs:121— ConsistentIndexedObjectStyle::run has cyclomatic complexity 58 (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.
minify.wasip1-deferred.__createInstance (cyclomatic 56) napi/minify/minify.wasip1-deferred.js:1181— minify.wasip1-deferred.__createInstance has cyclomatic complexity 56 (threshold 15). Of this number, 18 points are the body's own statements and 38 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.
parser.wasip1-deferred.__createInstance (cyclomatic 56) napi/parser/src-js/parser.wasip1-deferred.js:1181— parser.wasip1-deferred.__createInstance has cyclomatic complexity 56 (threshold 15). Of this number, 18 points are the body's own statements and 38 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.
transform-react.wasip1-deferred.__createInstance (cyclomatic 56) napi/transform-react/transform-react.wasip1-deferred.js:1181— transform-react.wasip1-deferred.__createInstance has cyclomatic complexity 56 (threshold 15). Of this number, 18 points are the body's own statements and 38 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.
transform-relay.wasip1-deferred.__createInstance (cyclomatic 56) napi/transform-relay/transform-relay.wasip1-deferred.js:1181— transform-relay.wasip1-deferred.__createInstance has cyclomatic complexity 56 (threshold 15). Of this number, 18 points are the body's own statements and 38 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.
transform.wasip1-deferred.__createInstance (cyclomatic 56) napi/transform/transform.wasip1-deferred.js:1181— transform.wasip1-deferred.__createInstance has cyclomatic complexity 56 (threshold 15). Of this number, 18 points are the body's own statements and 38 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.
typescript.printTSType (cyclomatic 55) packages/codegen/src-js/print/typescript.ts:80— typescript.printTSType has cyclomatic complexity 55 (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.
PreferConst::should_be_const (cyclomatic 54) crates/oxc_linter/src/rules/eslint/prefer_const.rs:443— PreferConst::should_be_const has cyclomatic complexity 54 (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.
FormatElementSlice::fmt (cyclomatic 53) crates/oxc_formatter_core/src/format_element/debug.rs:90— FormatElementSlice::fmt has cyclomatic complexity 53 (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.
FitsMeasurer::fits_element (cyclomatic 53) crates/oxc_formatter_core/src/printer/mod.rs:1236— FitsMeasurer::fits_element 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.
CallExpression::may_have_side_effects (cyclomatic 50) crates/oxc_ecmascript/src/side_effects/expressions.rs:589— CallExpression::may_have_side_effects has cyclomatic complexity 50 (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.
NoUnsafeOptionalChaining::unsafe_context (cyclomatic 49) crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs:98— NoUnsafeOptionalChaining::unsafe_context has cyclomatic complexity 49 (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.
expression.printExpression (cyclomatic 48) packages/codegen/src-js/print/expression.ts:90— expression.printExpression has cyclomatic complexity 48 (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.
source_map.generateSourceMap (cyclomatic 47) packages/codegen/src-js/print/source_map.ts:47— source_map.generateSourceMap 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.
NoDuplicateImports::run_once (cyclomatic 46) crates/oxc_linter/src/rules/eslint/no_duplicate_imports.rs:149— NoDuplicateImports::run_once 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.
OneVar::run_once (cyclomatic 42) crates/oxc_linter/src/rules/eslint/one_var.rs:119— OneVar::run_once has cyclomatic complexity 42 (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.
RequireParam::run (cyclomatic 41) crates/oxc_linter/src/rules/jsdoc/require_param.rs:125— RequireParam::run 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.
Oxc::convert_formatter_options (cyclomatic 39) napi/playground/src/lib.rs:453— Oxc::convert_formatter_options has cyclomatic complexity 39 (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.
ReactCompilerEnvironmentOptions::apply_to (cyclomatic 39) napi/transform-react/src/options.rs:443— ReactCompilerEnvironmentOptions::apply_to 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.
FormatJsxChildList::fmt_children (cyclomatic 37) crates/oxc_formatter/src/print/jsx/child_list.rs:35— FormatJsxChildList::fmt_children has cyclomatic complexity 37 (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.
oxc_jsdoc::parser::parse::parse_jsdoc (cyclomatic 35) crates/oxc_jsdoc/src/parser/parse.rs:11— oxc_jsdoc::parser::parse::parse_jsdoc 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.
PreferDestructuring::run (cyclomatic 35) crates/oxc_linter/src/rules/eslint/prefer_destructuring.rs:208— PreferDestructuring::run 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.
PreferArrayFind::run (cyclomatic 35) crates/oxc_linter/src/rules/unicorn/prefer_array_find.rs:66— PreferArrayFind::run 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.
ExplicitFunctionReturnType::run (cyclomatic 34) crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs:153— ExplicitFunctionReturnType::run 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.
NoRestrictedTypes::run (cyclomatic 34) crates/oxc_linter/src/rules/typescript/no_restricted_types.rs:267— NoRestrictedTypes::run 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.
NoUselessUndefined::run (cyclomatic 34) crates/oxc_linter/src/rules/unicorn/no_useless_undefined.rs:170— NoUselessUndefined::run 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.
Normalize::set_pure_or_no_side_effects_to_new_expr (cyclomatic 34) crates/oxc_minifier/src/peephole/normalize.rs:403— Normalize::set_pure_or_no_side_effects_to_new_expr 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.
TriviaBuilder::parse_annotation (cyclomatic 34) crates/oxc_parser/src/lexer/trivia_builder.rs:356— TriviaBuilder::parse_annotation 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.
NoUselessRename::run (cyclomatic 33) crates/oxc_linter/src/rules/eslint/no_useless_rename.rs:89— NoUselessRename::run has cyclomatic complexity 33 (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.
PreferStringRaw::run (cyclomatic 33) crates/oxc_linter/src/rules/unicorn/prefer_string_raw.rs:71— PreferStringRaw::run has cyclomatic complexity 33 (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.
JsxImpl::transform_jsx (cyclomatic 33) crates/oxc_transformer/src/jsx/jsx_impl.rs:592— JsxImpl::transform_jsx has cyclomatic complexity 33 (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.
NoImplicitCoercion::run (cyclomatic 32) crates/oxc_linter/src/rules/eslint/no_implicit_coercion.rs:189— NoImplicitCoercion::run 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.
CheckedRequiresOnchangeOrReadonly::run (cyclomatic 32) crates/oxc_linter/src/rules/react/checked_requires_onchange_or_readonly.rs:86— CheckedRequiresOnchangeOrReadonly::run 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.
oxc_transformer::plugins::styled_components::minify_template_literal (cyclomatic 32) crates/oxc_transformer/src/plugins/styled_components.rs:874— oxc_transformer::plugins::styled_components::minify_template_literal 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.
ValidExpectConfig::run (cyclomatic 31) crates/oxc_linter/src/rules/shared/jest_vitest/valid_expect.rs:131— ValidExpectConfig::run 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.
NoAccessorRecursion::run (cyclomatic 31) crates/oxc_linter/src/rules/unicorn/no_accessor_recursion.rs:79— NoAccessorRecursion::run 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.
PreferObjectFromEntries::run (cyclomatic 31) crates/oxc_linter/src/rules/unicorn/prefer_object_from_entries.rs:91— PreferObjectFromEntries::run 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.
RuleConfigOutput::extract_output_inner (cyclomatic 31) tasks/rulegen/src/main.rs:732— RuleConfigOutput::extract_output_inner 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.
Renderer::render_sub_schema (cyclomatic 31) tasks/website_common/src/schema_markdown.rs:214— Renderer::render_sub_schema 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.
selector.analyzeSelector (cyclomatic 31) apps/oxlint/src-js/plugins/selector.ts:222— selector.analyzeSelector has cyclomatic complexity 31 (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.
expression.printObjectProperty (cyclomatic 31) packages/codegen/src-js/print/expression.ts:463— expression.printObjectProperty 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.
NoEval::run (cyclomatic 30) crates/oxc_linter/src/rules/eslint/no_eval.rs:98— NoEval::run 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.
ConsistentFunctionScoping::check_function (cyclomatic 30) crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs:188— ConsistentFunctionScoping::check_function 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.
NoStaticOnlyClass::run (cyclomatic 30) crates/oxc_linter/src/rules/unicorn/no_static_only_class.rs:64— NoStaticOnlyClass::run 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.
PreferArraySome::run (cyclomatic 30) crates/oxc_linter/src/rules/unicorn/prefer_array_some.rs:74— PreferArraySome::run 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.
ThrowFinder::visit_throw_statement (cyclomatic 29) crates/oxc_linter/src/rules/eslint/preserve_caught_error.rs:57— ThrowFinder::visit_throw_statement 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.
PreferNegativeIndex::run (cyclomatic 29) crates/oxc_linter/src/rules/unicorn/prefer_negative_index.rs:63— PreferNegativeIndex::run 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.
unmap_writes.unmapWritesPlugin (cyclomatic 29) packages/codegen/tsdown_plugins/unmap_writes.ts:70— unmap_writes.unmapWritesPlugin 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.
FormatClass::fmt (cyclomatic 28) crates/oxc_formatter/src/print/class.rs:276— FormatClass::fmt 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.
FormatConditionalLike::should_extra_indent (cyclomatic 28) crates/oxc_formatter/src/utils/conditional.rs:248— FormatConditionalLike::should_extra_indent 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.
NoThenable::run (cyclomatic 28) crates/oxc_linter/src/rules/unicorn/no_thenable.rs:82— NoThenable::run 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.
Comments::get_trailing_comments (cyclomatic 27) crates/oxc_formatter/src/formatter/comments.rs:363— Comments::get_trailing_comments 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.
PreferObjectSpread::run (cyclomatic 27) crates/oxc_linter/src/rules/eslint/prefer_object_spread.rs:79— PreferObjectSpread::run 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.
NoCommonjs::run (cyclomatic 27) crates/oxc_linter/src/rules/import/no_commonjs.rs:139— NoCommonjs::run 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.
NoWillUpdateSetState::run (cyclomatic 27) crates/oxc_linter/src/rules/react/no_will_update_set_state.rs:75— NoWillUpdateSetState::run 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.
ObjectProperty::r#gen (cyclomatic 26) crates/oxc_codegen/src/gen.rs:1756— ObjectProperty::r#gen 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. This is NOT this file's highest cyclomatic complexity: Expression::gen_expr (cyclomatic 48) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
ConfigStoreBuilder::from_oxlintrc (cyclomatic 26) crates/oxc_linter/src/config/config_builder.rs:100— ConfigStoreBuilder::from_oxlintrc has cyclomatic complexity 26 (threshold 15). Most of this is not in the body itself: 11 of the 26 points are its own statements and the rest belongs to 4 function items inside it that branch (check_no_relative_js_plugins_in_extends, resolve_oxlintrc_config_extends, resolve_oxlintrc_config, …). 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.
ArrayCallbackReturn::run (cyclomatic 26) crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs:191— ArrayCallbackReturn::run 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.
GroupExports::run_once (cyclomatic 26) crates/oxc_linter/src/rules/import/group_exports.rs:68— GroupExports::run_once has cyclomatic complexity 26 (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.
PreferSetHas::run (cyclomatic 26) crates/oxc_linter/src/rules/unicorn/prefer_set_has.rs:134— PreferSetHas::run has cyclomatic complexity 26 (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.
TypeScriptAnnotations::exit_program (cyclomatic 26) crates/oxc_transformer/src/typescript/annotations.rs:58— TypeScriptAnnotations::exit_program 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.
string.printEscapedStringContents (cyclomatic 26) packages/codegen/src-js/print/string.ts:52— string.printEscapedStringContents 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.
ExpressionLeftSide::left (cyclomatic 25) crates/oxc_formatter/src/utils/expression.rs:44— ExpressionLeftSide::left 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.
PreferIncludes::run (cyclomatic 25) crates/oxc_linter/src/rules/unicorn/prefer_includes.rs:69— PreferIncludes::run has cyclomatic complexity 25 (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.
PreferSingleCall::run (cyclomatic 25) crates/oxc_linter/src/rules/unicorn/prefer_single_call.rs:94— PreferSingleCall::run has cyclomatic complexity 25 (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.
TypeScriptNamespace::handle_nested (cyclomatic 25) crates/oxc_transformer/src/typescript/namespace.rs:119— TypeScriptNamespace::handle_nested 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.
State::visit_object_property (cyclomatic 25) tasks/rulegen/src/main.rs:574— State::visit_object_property 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.
load.registerPlugin (cyclomatic 25) apps/oxlint/src-js/plugins/load.ts:159— load.registerPlugin 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.
report.report (cyclomatic 25) apps/oxlint/src-js/plugins/report.ts:105— report.report 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.
WalkRunner::run (cyclomatic 24) apps/oxfmt/src/cli/walk_runner.rs:67— WalkRunner::run 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.
TSSignature::r#gen (cyclomatic 24) crates/oxc_codegen/src/gen.rs:3780— TSSignature::r#gen 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 is NOT this file's highest cyclomatic complexity: Expression::gen_expr (cyclomatic 48) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
ArrowChain::fmt (cyclomatic 24) crates/oxc_formatter/src/print/arrow_function_expression.rs:408— ArrowChain::fmt 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.
ClassMethodsUseThis::run (cyclomatic 24) crates/oxc_linter/src/rules/eslint/class_methods_use_this.rs:179— ClassMethodsUseThis::run has cyclomatic complexity 24 (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.
NoDuplicates::run_once (cyclomatic 24) crates/oxc_linter/src/rules/import/no_duplicates.rs:120— NoDuplicates::run_once 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.
RequireReturns::run_once (cyclomatic 24) crates/oxc_linter/src/rules/jsdoc/require_returns.rs:107— RequireReturns::run_once 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.
JsxHandlerNames::run (cyclomatic 24) crates/oxc_linter/src/rules/react/jsx_handler_names.rs:266— JsxHandlerNames::run 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.
ValidTitleConfig::run_rule (cyclomatic 24) crates/oxc_linter/src/rules/shared/jest_vitest/valid_title.rs:182— ValidTitleConfig::run_rule 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.
PreferDomNodeDataset::run (cyclomatic 24) crates/oxc_linter/src/rules/unicorn/prefer_dom_node_dataset.rs:65— PreferDomNodeDataset::run 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.
PreferQuerySelector::run (cyclomatic 24) crates/oxc_linter/src/rules/unicorn/prefer_query_selector.rs:95— PreferQuerySelector::run 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.
PreferTopLevelAwait::run (cyclomatic 24) crates/oxc_linter/src/rules/unicorn/prefer_top_level_await.rs:72— PreferTopLevelAwait::run has cyclomatic complexity 24 (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.
NoReservedKeys::run (cyclomatic 24) crates/oxc_linter/src/rules/vue/no_reserved_keys.rs:127— NoReservedKeys::run 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.
write.debugAssertCategoryMatches (cyclomatic 24) packages/codegen/src-js/print/write.ts:849— write.debugAssertCategoryMatches has cyclomatic complexity 24 (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.
NoUnexpectedMultiline::run (cyclomatic 23) crates/oxc_linter/src/rules/eslint/no_unexpected_multiline.rs:112— NoUnexpectedMultiline::run 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.
ConsistentTypeSpecifierStyle::run (cyclomatic 23) crates/oxc_linter/src/rules/import/consistent_type_specifier_style.rs:131— ConsistentTypeSpecifierStyle::run 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.
RulesOfHooks::run (cyclomatic 23) crates/oxc_linter/src/rules/react/rules_of_hooks.rs:269— RulesOfHooks::run 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.
PreferFunctionType::run (cyclomatic 23) crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:290— PreferFunctionType::run 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.
LintRuleMeta::parse (cyclomatic 23) crates/oxc_macros/src/declare_oxc_lint.rs:52— LintRuleMeta::parse 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.
TransformOptions::try_from (cyclomatic 23) crates/oxc_transformer/src/options/mod.rs:171— TransformOptions::try_from has cyclomatic complexity 23 (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.
StructDeserializerGenerator::generate_struct_field_owned (cyclomatic 23) tasks/ast_tools/src/generators/raw_transfer.rs:625— StructDeserializerGenerator::generate_struct_field_owned 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.
website_linter::rules::doc_page::upstream_docs_url (cyclomatic 23) tasks/website_linter/src/rules/doc_page.rs:296— website_linter::rules::doc_page::upstream_docs_url has cyclomatic complexity 23 (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.
migrate-prettier.runMigratePrettier (cyclomatic 23) apps/oxfmt/src-js/cli/migration/migrate-prettier.ts:14— migrate-prettier.runMigratePrettier 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.
class.printPropertyDefinition (cyclomatic 23) packages/codegen/src-js/print/class.ts:299— class.printPropertyDefinition 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.
ImportDeclaration::r#gen (cyclomatic 22) crates/oxc_codegen/src/gen.rs:914— ImportDeclaration::r#gen 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. This is NOT this file's highest cyclomatic complexity: Expression::gen_expr (cyclomatic 48) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Lanes::validate_ident_escapes (cyclomatic 22) crates/oxc_lexer/src/lanes.rs:281— Lanes::validate_ident_escapes has cyclomatic complexity 22 (threshold 15). Of this number, 19 points are the body's own statements and 3 belong 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.
NoFallthrough::run (cyclomatic 22) crates/oxc_linter/src/rules/eslint/no_fallthrough.rs:261— NoFallthrough::run 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.
RequireYields::run (cyclomatic 22) crates/oxc_linter/src/rules/jsdoc/require_yields.rs:113— RequireYields::run 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.
NoUselessPromiseResolveReject::run (cyclomatic 22) crates/oxc_linter/src/rules/unicorn/no_useless_promise_resolve_reject.rs:83— NoUselessPromiseResolveReject::run 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.
NoImportingVitestGlobals::run (cyclomatic 22) crates/oxc_linter/src/rules/vitest/no_importing_vitest_globals.rs:75— NoImportingVitestGlobals::run 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.
SuppressionManager::compute_diagnostics (cyclomatic 22) crates/oxc_linter/src/suppression/mod.rs:246— SuppressionManager::compute_diagnostics 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.
Lexer::read_string_escape_sequence (cyclomatic 22) crates/oxc_parser/src/lexer/unicode.rs:331— Lexer::read_string_escape_sequence has cyclomatic complexity 22 (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.
class.printClass (cyclomatic 22) packages/codegen/src-js/print/class.ts:53— class.printClass 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.
class.printMethodDefinition (cyclomatic 22) packages/codegen/src-js/print/class.ts:227— class.printMethodDefinition 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.
UnaryExpression::evaluate_value_to (cyclomatic 21) crates/oxc_ecmascript/src/constant_evaluation/mod.rs:458— UnaryExpression::evaluate_value_to has cyclomatic complexity 21 (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.
DisableDirectivesBuilder::build_impl (cyclomatic 21) crates/oxc_linter/src/disable_directives.rs:530— DisableDirectivesBuilder::build_impl 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.
GroupedAccessorPairs::run (cyclomatic 21) crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:194— GroupedAccessorPairs::run 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.
DisplayName::run_once (cyclomatic 21) crates/oxc_linter/src/rules/react/display_name.rs:146— DisplayName::run_once 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.
JsxCurlyBracePresence::check_expression_container (cyclomatic 21) crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs:435— JsxCurlyBracePresence::check_expression_container 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.
VoidDomElementsNoChildren::run (cyclomatic 21) crates/oxc_linter/src/rules/react/void_dom_elements_no_children.rs:77— VoidDomElementsNoChildren::run 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.
ConsistentTypeImports::run (cyclomatic 21) crates/oxc_linter/src/rules/typescript/consistent_type_imports.rs:200— ConsistentTypeImports::run 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.
NoArraySort::run (cyclomatic 21) crates/oxc_linter/src/rules/unicorn/no_array_sort.rs:90— NoArraySort::run 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.
ReactRefresh::enter_call_expression (cyclomatic 21) crates/oxc_transformer/src/jsx/refresh.rs:261— ReactRefresh::enter_call_expression 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.
TestCase::visit_object_expression (cyclomatic 21) tasks/rulegen/src/main.rs:285— TestCase::visit_object_expression 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.
tokens_methods.getFirstToken (cyclomatic 21) apps/oxlint/src-js/plugins/tokens_methods.ts:188— tokens_methods.getFirstToken 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. This shape REPEATS in the file: 3 other methods here (tokens_methods.getLastToken, tokens_methods.getFirstTokenBetween, tokens_methods.getLastTokenBetween) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
tokens_methods.getLastToken (cyclomatic 21) apps/oxlint/src-js/plugins/tokens_methods.ts:349— tokens_methods.getLastToken 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. This shape REPEATS in the file: 3 other methods here (tokens_methods.getFirstToken, tokens_methods.getFirstTokenBetween, tokens_methods.getLastTokenBetween) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
tokens_methods.getFirstTokenBetween (cyclomatic 21) apps/oxlint/src-js/plugins/tokens_methods.ts:939— tokens_methods.getFirstTokenBetween 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. This shape REPEATS in the file: 3 other methods here (tokens_methods.getFirstToken, tokens_methods.getLastToken, tokens_methods.getLastTokenBetween) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
tokens_methods.getLastTokenBetween (cyclomatic 21) apps/oxlint/src-js/plugins/tokens_methods.ts:1103— tokens_methods.getLastTokenBetween 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. This shape REPEATS in the file: 3 other methods here (tokens_methods.getFirstToken, tokens_methods.getLastToken, tokens_methods.getFirstTokenBetween) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
lint.lintFileImpl (cyclomatic 21) apps/oxlint/src-js/plugins/lint.ts:133— lint.lintFileImpl 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.
report.generateReport (cyclomatic 21) apps/oxlint/conformance/src/report.ts:31— report.generateReport 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.
generate-config-types.getDefinitionPrimitiveTypes (cyclomatic 21) apps/oxlint/scripts/generate-config-types.ts:147— generate-config-types.getDefinitionPrimitiveTypes 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 items inside it that branch (inferPrimitiveTypes, inferPrimitiveTypes::pushType, inferDefinitionByName). 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.
binary.binCheckAndPrepare (cyclomatic 21) packages/codegen/src-js/print/binary.ts:146— binary.binCheckAndPrepare has cyclomatic complexity 21 (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.
module.printImportDeclaration (cyclomatic 21) packages/codegen/src-js/print/module.ts:32— module.printImportDeclaration 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.
module.printExportNamedDeclaration (cyclomatic 21) packages/codegen/src-js/print/module.ts:207— module.printExportNamedDeclaration 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.
ServerLinterBuilder::build (cyclomatic 20) apps/oxlint/src/lsp/server_linter.rs:81— ServerLinterBuilder::build 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.
SourceLine::from_element_range (cyclomatic 20) crates/oxc_formatter/src/ir_transform/sort_imports/source_line.rs:27— SourceLine::from_element_range 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.
Config::apply_overrides (cyclomatic 20) crates/oxc_linter/src/config/config_store.rs:126— Config::apply_overrides 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.
NoConstantBinaryExpression::has_constant_strict_boolean_comparison (cyclomatic 20) crates/oxc_linter/src/rules/eslint/no_constant_binary_expression.rs:338— NoConstantBinaryExpression::has_constant_strict_boolean_comparison has cyclomatic complexity 20 (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.
NoSelfAssign::each_self_assignment (cyclomatic 20) crates/oxc_linter/src/rules/eslint/no_self_assign.rs:131— NoSelfAssign::each_self_assignment 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.
NoUnmodifiedLoopCondition::check_loop_condition (cyclomatic 20) crates/oxc_linter/src/rules/eslint/no_unmodified_loop_condition.rs:149— NoUnmodifiedLoopCondition::check_loop_condition 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.
Namespace::run_once (cyclomatic 20) crates/oxc_linter/src/rules/import/namespace.rs:123— Namespace::run_once 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.
NoNamedAsDefaultMember::run_once (cyclomatic 20) crates/oxc_linter/src/rules/import/no_named_as_default_member.rs:78— NoNamedAsDefaultMember::run_once 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.
MediaHasCaption::run (cyclomatic 20) crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs:112— MediaHasCaption::run 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.
StylePropObject::run (cyclomatic 20) crates/oxc_linter/src/rules/react/style_prop_object.rs:155— StylePropObject::run 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.
PreferForOf::run (cyclomatic 20) crates/oxc_linter/src/rules/typescript/prefer_for_of.rs:110— PreferForOf::run 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.
NoMultipleSlotArgs::run (cyclomatic 20) crates/oxc_linter/src/rules/vue/no_multiple_slot_args.rs:80— NoMultipleSlotArgs::run 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.
FunctionGraph::analyze (cyclomatic 20) crates/oxc_minifier/src/symbol_liveness/mod.rs:278— FunctionGraph::analyze 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.
oxc_syntax::identifier::is_identifier_name_impl (cyclomatic 20) crates/oxc_syntax/src/identifier.rs:163— oxc_syntax::identifier::is_identifier_name_impl 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.
ExplicitResourceManagement::enter_program (cyclomatic 20) crates/oxc_transformer/src/es2026/explicit_resource_management.rs:361— ExplicitResourceManagement::enter_program has cyclomatic complexity 20 (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.
TypeScript::transform_class_fields (cyclomatic 20) crates/oxc_transformer/src/typescript/class.rs:96— TypeScript::transform_class_fields 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.
Context::rule_config (cyclomatic 20) tasks/website_linter/src/rules/doc_page.rs:134— Context::rule_config 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.
tokens_methods.getTokens (cyclomatic 20) apps/oxlint/src-js/plugins/tokens_methods.ts:97— tokens_methods.getTokens 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.
write.markMapNamed (cyclomatic 20) packages/codegen/src-js/print/write.ts:494— write.markMapNamed 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.
binding_pattern.printBindingPattern (cyclomatic 20) packages/codegen/src-js/print/binding_pattern.ts:31— binding_pattern.printBindingPattern 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.
ConfigLoader::load_many (cyclomatic 19) apps/oxlint/src/config_loader.rs:337— ConfigLoader::load_many 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.
CompilerInterface::compile (cyclomatic 19) crates/oxc/src/compiler.rs:127— CompilerInterface::compile 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.
Function::bind (cyclomatic 19) crates/oxc_semantic/src/binder.rs:139— Function::bind 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.
StatsCollector::handle_node (cyclomatic 19) crates/oxc_formatter/src/detect_code_removal/mod.rs:153— StatsCollector::handle_node 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.
NoMagicNumbers::is_skippable (cyclomatic 19) crates/oxc_linter/src/rules/eslint/no_magic_numbers.rs:466— NoMagicNumbers::is_skippable 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.
NoUnneededTernary::run (cyclomatic 19) crates/oxc_linter/src/rules/eslint/no_unneeded_ternary.rs:89— NoUnneededTernary::run 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.
Named::run_once (cyclomatic 19) crates/oxc_linter/src/rules/import/named.rs:119— Named::run_once 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.
AnchorIsValid::run (cyclomatic 19) crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs:163— AnchorIsValid::run 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.
NoDangerWithChildren::run (cyclomatic 19) crates/oxc_linter/src/rules/react/no_danger_with_children.rs:56— NoDangerWithChildren::run 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.
NoInstanceofBuiltins::run (cyclomatic 19) crates/oxc_linter/src/rules/unicorn/no_instanceof_builtins.rs:177— NoInstanceofBuiltins::run 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.
PreferClassFields::run (cyclomatic 19) crates/oxc_linter/src/rules/unicorn/prefer_class_fields.rs:92— PreferClassFields::run 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.
Runtime::resolve_modules (cyclomatic 19) crates/oxc_linter/src/service/runtime.rs:359— Runtime::resolve_modules 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.
StructSerializerGenerator::generate_stmts_for_field (cyclomatic 19) tasks/ast_tools/src/derives/estree.rs:429— StructSerializerGenerator::generate_stmts_for_field 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.
rule_tester.assertInvalidTestCasePasses (cyclomatic 19) apps/oxlint/src-js/package/rule_tester.ts:622— rule_tester.assertInvalidTestCasePasses 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.
regexp.parseSnapshot (cyclomatic 19) apps/oxlint/conformance/src/groups/regexp.ts:164— regexp.parseSnapshot has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 187, 217). 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.
ScopedWalker::run (cyclomatic 18) apps/oxfmt/src/cli/walk.rs:105— ScopedWalker::run 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.
MethodDefinition::r#gen (cyclomatic 18) crates/oxc_codegen/src/gen.rs:2899— MethodDefinition::r#gen 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. This is NOT this file's highest cyclomatic complexity: Expression::gen_expr (cyclomatic 48) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
BinaryExpressionVisitor::check_and_prepare (cyclomatic 18) crates/oxc_codegen/src/binary_expr_visitor.rs:156— BinaryExpressionVisitor::check_and_prepare 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.
oxc_formatter_json::print::stringify::json_stringify_escape (cyclomatic 18) crates/oxc_formatter_json/src/print/stringify.rs:192— oxc_formatter_json::print::stringify::json_stringify_escape has cyclomatic complexity 18 (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.
NoAwaitInLoop::is_looped (cyclomatic 18) crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs:148— NoAwaitInLoop::is_looped 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. This is NOT this file's highest cyclomatic complexity: NoAwaitInLoop::node_matches_expr_span (cyclomatic 24) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
NoInvalidRegexp::run (cyclomatic 18) crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs:88— NoInvalidRegexp::run 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.
NoShadow::is_init_pattern_node (cyclomatic 18) crates/oxc_linter/src/rules/eslint/no_shadow/mod.rs:531— NoShadow::is_init_pattern_node has cyclomatic complexity 18 (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.
PreferArrowCallback::run (cyclomatic 18) crates/oxc_linter/src/rules/eslint/prefer_arrow_callback.rs:91— PreferArrowCallback::run 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.
UseIsnan::run (cyclomatic 18) crates/oxc_linter/src/rules/eslint/use_isnan.rs:106— UseIsnan::run 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.
NoNoninteractiveTabindex::run (cyclomatic 18) crates/oxc_linter/src/rules/jsx_a11y/no_noninteractive_tabindex.rs:99— NoNoninteractiveTabindex::run 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.
PreferAwaitToCallbacks::run (cyclomatic 18) crates/oxc_linter/src/rules/promise/prefer_await_to_callbacks.rs:63— PreferAwaitToCallbacks::run 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.
NoUnknownProperty::run (cyclomatic 18) crates/oxc_linter/src/rules/react/no_unknown_property.rs:505— NoUnknownProperty::run 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.
NoExtraneousClass::run (cyclomatic 18) crates/oxc_linter/src/rules/typescript/no_extraneous_class.rs:122— NoExtraneousClass::run 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.
NoInvalidVoidType::run (cyclomatic 18) crates/oxc_linter/src/rules/typescript/no_invalid_void_type.rs:146— NoInvalidVoidType::run 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.
ParameterProperties::check_prefer_parameter_property (cyclomatic 18) crates/oxc_linter/src/rules/typescript/parameter_properties.rs:186— ParameterProperties::check_prefer_parameter_property 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.
PreferMathTrunc::run (cyclomatic 18) crates/oxc_linter/src/rules/unicorn/prefer_math_trunc.rs:63— PreferMathTrunc::run 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.
oxc_relay::find_definition_name (cyclomatic 18) crates/oxc_relay/src/lib.rs:243— oxc_relay::find_definition_name has cyclomatic complexity 18 (threshold 15). 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.
tokens_methods.getFirstTokens (cyclomatic 18) apps/oxlint/src-js/plugins/tokens_methods.ts:269— tokens_methods.getFirstTokens 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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getLastTokens, tokens_methods.getTokensBefore, tokens_methods.getTokensAfter, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getLastTokens (cyclomatic 18) apps/oxlint/src-js/plugins/tokens_methods.ts:429— tokens_methods.getLastTokens 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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getTokensBefore, tokens_methods.getTokensAfter, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getTokenBefore (cyclomatic 18) apps/oxlint/src-js/plugins/tokens_methods.ts:512— tokens_methods.getTokenBefore 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.
tokens_methods.getTokensBefore (cyclomatic 18) apps/oxlint/src-js/plugins/tokens_methods.ts:608— tokens_methods.getTokensBefore 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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getLastTokens, tokens_methods.getTokensAfter, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getTokenAfter (cyclomatic 18) apps/oxlint/src-js/plugins/tokens_methods.ts:681— tokens_methods.getTokenAfter 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.
tokens_methods.getTokensAfter (cyclomatic 18) apps/oxlint/src-js/plugins/tokens_methods.ts:776— tokens_methods.getTokensAfter 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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getLastTokens, tokens_methods.getTokensBefore, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getTokensBetween (cyclomatic 18) apps/oxlint/src-js/plugins/tokens_methods.ts:855— tokens_methods.getTokensBetween 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.
tokens_methods.getFirstTokensBetween (cyclomatic 18) apps/oxlint/src-js/plugins/tokens_methods.ts:1021— tokens_methods.getFirstTokensBetween 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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getLastTokens, tokens_methods.getTokensBefore, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getLastTokensBetween (cyclomatic 18) apps/oxlint/src-js/plugins/tokens_methods.ts:1187— tokens_methods.getLastTokensBetween 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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getLastTokens, tokens_methods.getTokensBefore, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
rule_tester.modifyTestCase (cyclomatic 18) apps/oxlint/conformance/src/rule_tester.ts:147— rule_tester.modifyTestCase 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.
oxc_cfg::visit::set_depth_first_search (cyclomatic 17) crates/oxc_cfg/src/visit.rs:67— oxc_cfg::visit::set_depth_first_search 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.
BinaryLeftOrRightSide::fmt (cyclomatic 17) crates/oxc_formatter/src/print/binary_like_expression.rs:369— BinaryLeftOrRightSide::fmt 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.
OxlintRules::override_rules (cyclomatic 17) crates/oxc_linter/src/config/rules.rs:119— OxlintRules::override_rules 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.
CapitalizedComments::run_once (cyclomatic 17) crates/oxc_linter/src/rules/eslint/capitalized_comments.rs:191— CapitalizedComments::run_once 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.
NoCondAssign::run (cyclomatic 17) crates/oxc_linter/src/rules/eslint/no_cond_assign.rs:81— NoCondAssign::run has cyclomatic complexity 17 (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.
NoImportAssign::run (cyclomatic 17) crates/oxc_linter/src/rules/eslint/no_import_assign.rs:64— NoImportAssign::run 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.
NoUselessReturn::analyze_ancestors (cyclomatic 17) crates/oxc_linter/src/rules/eslint/no_useless_return.rs:127— NoUselessReturn::analyze_ancestors 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.
CheckTagNames::run_once (cyclomatic 17) crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs:241— CheckTagNames::run_once 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.
NoStaticElementInteractions::run (cyclomatic 17) crates/oxc_linter/src/rules/jsx_a11y/no_static_element_interactions.rs:94— NoStaticElementInteractions::run 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.
InlineScriptId::run (cyclomatic 17) crates/oxc_linter/src/rules/nextjs/inline_script_id.rs:100— InlineScriptId::run 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.
HookUseState::run (cyclomatic 17) crates/oxc_linter/src/rules/react/hook_use_state.rs:93— HookUseState::run 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.
JsxPascalCase::run (cyclomatic 17) crates/oxc_linter/src/rules/react/jsx_pascal_case.rs:120— JsxPascalCase::run 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.
NoThisAlias::run (cyclomatic 17) crates/oxc_linter/src/rules/typescript/no_this_alias.rs:109— NoThisAlias::run 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.
TripleSlashReference::run_once (cyclomatic 17) crates/oxc_linter/src/rules/typescript/triple_slash_reference.rs:101— TripleSlashReference::run_once 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.
PreferDateNow::run (cyclomatic 17) crates/oxc_linter/src/rules/unicorn/prefer_date_now.rs:63— PreferDateNow::run 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.
PreferImportMetaProperties::run (cyclomatic 17) crates/oxc_linter/src/rules/unicorn/prefer_import_meta_properties.rs:103— PreferImportMetaProperties::run 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.
NoImportCompilerMacros::run (cyclomatic 17) crates/oxc_linter/src/rules/vue/no_import_compiler_macros.rs:82— NoImportCompilerMacros::run 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.
generate-config-types.getEnumPrimitiveType (cyclomatic 17) apps/oxlint/scripts/generate-config-types.ts:77— generate-config-types.getEnumPrimitiveType 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.
typescript.printTSSignature (cyclomatic 17) packages/codegen/src-js/print/typescript.ts:476— typescript.printTSSignature 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.
class.printAccessorProperty (cyclomatic 17) packages/codegen/src-js/print/class.ts:390— class.printAccessorProperty 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.
StylishReporter::format_stylish (cyclomatic 16) apps/oxlint/src/output_formatter/stylish.rs:53— StylishReporter::format_stylish 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.
VariableDeclarator::bind (cyclomatic 16) crates/oxc_semantic/src/binder.rs:19— VariableDeclarator::bind 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.
PreferExponentiationOperator::run (cyclomatic 16) crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs:52— PreferExponentiationOperator::run 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.
ImgRedundantAlt::run (cyclomatic 16) crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs:132— ImgRedundantAlt::run 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.
CatchOrReturn::is_allowed_promise_termination (cyclomatic 16) crates/oxc_linter/src/rules/promise/catch_or_return.rs:206— CatchOrReturn::is_allowed_promise_termination has cyclomatic complexity 16 (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.
MultipleResolvedChecker::prev_resolved_info (cyclomatic 16) crates/oxc_linter/src/rules/promise/no_multiple_resolved.rs:409— MultipleResolvedChecker::prev_resolved_info 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.
PreferToBe::run (cyclomatic 16) crates/oxc_linter/src/rules/shared/jest_vitest/prefer_to_be.rs:97— PreferToBe::run has cyclomatic complexity 16 (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.
ConsistentTypeDefinitions::run (cyclomatic 16) crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:100— ConsistentTypeDefinitions::run 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.
NoRequireImports::run (cyclomatic 16) crates/oxc_linter/src/rules/typescript/no_require_imports.rs:133— NoRequireImports::run 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.
NoInvalidRemoveEventListener::run (cyclomatic 16) crates/oxc_linter/src/rules/unicorn/no_invalid_remove_event_listener.rs:53— NoInvalidRemoveEventListener::run has cyclomatic complexity 16 (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.
PreferAt::check_slice_index_access (cyclomatic 16) crates/oxc_linter/src/rules/unicorn/prefer_at.rs:464— PreferAt::check_slice_index_access has cyclomatic complexity 16 (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.
PreferGlobalThis::run (cyclomatic 16) crates/oxc_linter/src/rules/unicorn/prefer_global_this.rs:68— PreferGlobalThis::run 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.
PreferStructuredClone::run (cyclomatic 16) crates/oxc_linter/src/rules/unicorn/prefer_structured_clone.rs:87— PreferStructuredClone::run 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.
HoistedApisOnTop::run (cyclomatic 16) crates/oxc_linter/src/rules/vitest/hoisted_apis_on_top.rs:128— HoistedApisOnTop::run has cyclomatic complexity 16 (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.
PreferCalledExactlyOnceWith::check_block_body (cyclomatic 16) crates/oxc_linter/src/rules/vitest/prefer_called_exactly_once_with.rs:213— PreferCalledExactlyOnceWith::check_block_body 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.
PreferDescribeFunctionTitle::run (cyclomatic 16) crates/oxc_linter/src/rules/vitest/prefer_describe_function_title.rs:76— PreferDescribeFunctionTitle::run 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.
PreferImportingVitestGlobals::run_once (cyclomatic 16) crates/oxc_linter/src/rules/vitest/prefer_importing_vitest_globals.rs:99— PreferImportingVitestGlobals::run_once 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.
SlotAssignment::compute (cyclomatic 16) crates/oxc_mangler/src/lib.rs:591— SlotAssignment::compute 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.
ReactCompilerOptions::into_plugin_options (cyclomatic 16) napi/transform-react/src/options.rs:332— ReactCompilerOptions::into_plugin_options has cyclomatic complexity 16 (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.
LayoutCalculator::calculate_type (cyclomatic 16) tasks/ast_tools/src/generators/assert_layouts.rs:77— LayoutCalculator::calculate_type 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. This is NOT this file's highest cyclomatic complexity: LayoutCalculator::calculate_primitive (cyclomatic 44) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
rule_tester.getGlobalsJson (cyclomatic 16) apps/oxlint/src-js/package/rule_tester.ts:1382— rule_tester.getGlobalsJson has cyclomatic complexity 16 (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.
report.formatError (cyclomatic 16) apps/oxlint/conformance/src/report.ts:279— report.formatError 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.
ExhaustiveDeps::run (cognitive 141) crates/oxc_linter/src/rules/react/exhaustive_deps.rs:286— ExhaustiveDeps::run has cognitive complexity 141 (threshold 15). Drivers by points: if/else 49 (103 pts), match/switch 8 (20 pts), boolean chains 10, loops 6 (8 pts) (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoDuplicateImports::run_once (cognitive 131) crates/oxc_linter/src/rules/eslint/no_duplicate_imports.rs:149— NoDuplicateImports::run_once has cognitive complexity 131 (threshold 15). Drivers by points: if/else 28 (105 pts), loops 7 (16 pts), boolean chains 8, match/switch 1 (2 pts) (nesting depth added 87). 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.
ConsistentIndexedObjectStyle::run (cognitive 117) crates/oxc_linter/src/rules/typescript/consistent_indexed_object_style.rs:121— ConsistentIndexedObjectStyle::run has cognitive complexity 117 (threshold 15). Drivers by points: if/else 47 (94 pts), match/switch 6 (13 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
source_map.generateSourceMap (cognitive 105) packages/codegen/src-js/print/source_map.ts:47— source_map.generateSourceMap has cognitive complexity 105 (threshold 15). Drivers by points: if/else 24 (69 pts), loops 6 (24 pts), boolean chains 11, ternaries 1 (nesting depth added 63). 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.
CliRunner::run (cognitive 102) apps/oxlint/src/lint.rs:78— CliRunner::run has cognitive complexity 102 (threshold 15). Drivers by points: if/else 52 (67 pts), match/switch 10 (17 pts), boolean chains 15, loops 1 (3 pts) (nesting depth added 24). 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.
PreferDestructuring::run (cognitive 86) crates/oxc_linter/src/rules/eslint/prefer_destructuring.rs:208— PreferDestructuring::run has cognitive complexity 86 (threshold 15). Drivers by points: if/else 26 (74 pts), boolean chains 6, match/switch 3 (6 pts) (nesting depth added 51). 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.
RequireParam::run (cognitive 86) crates/oxc_linter/src/rules/jsdoc/require_param.rs:125— RequireParam::run has cognitive complexity 86 (threshold 15). Drivers by points: if/else 24 (66 pts), loops 3 (8 pts), boolean chains 7, match/switch 3 (5 pts) (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoDuplicates::run_once (cognitive 83) crates/oxc_linter/src/rules/import/no_duplicates.rs:120— NoDuplicates::run_once has cognitive complexity 83 (threshold 15). Drivers by points: if/else 17 (54 pts), loops 6 (15 pts), match/switch 2 (12 pts), boolean chains 2 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OneVar::run_once (cognitive 80) crates/oxc_linter/src/rules/eslint/one_var.rs:119— OneVar::run_once has cognitive complexity 80 (threshold 15). Drivers by points: if/else 23 (58 pts), boolean chains 21, loops 1 (nesting depth added 35). 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.
NoEval::run (cognitive 77) crates/oxc_linter/src/rules/eslint/no_eval.rs:98— NoEval::run has cognitive complexity 77 (threshold 15). Drivers by points: if/else 16 (48 pts), match/switch 4 (14 pts), loops 3 (10 pts), boolean chains 5 (nesting depth added 49). 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.
FormatElementSlice::fmt (cognitive 73) crates/oxc_formatter_core/src/format_element/debug.rs:90— FormatElementSlice::fmt has cognitive complexity 73 (threshold 15). Drivers by points: match/switch 10 (34 pts), if/else 12 (32 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 46). 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.
CallExpression::may_have_side_effects (cognitive 72) crates/oxc_ecmascript/src/side_effects/expressions.rs:589— CallExpression::may_have_side_effects has cognitive complexity 72 (threshold 15). Drivers by points: if/else 29 (55 pts), boolean chains 11, match/switch 4 (6 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.
JsxImpl::transform_jsx (cognitive 72) crates/oxc_transformer/src/jsx/jsx_impl.rs:592— JsxImpl::transform_jsx has cognitive complexity 72 (threshold 15). Drivers by points: if/else 26 (53 pts), match/switch 3 (11 pts), boolean chains 6, loops 1 (2 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
minify.wasip1-deferred.__createInstance (cognitive 71) napi/minify/minify.wasip1-deferred.js:1181— minify.wasip1-deferred.__createInstance has cognitive complexity 71 (threshold 15). Drivers by points: if/else 30 (37 pts), error handling 10 (19 pts), boolean chains 8, ternaries 5 (7 pts) (nesting depth added 18). Of this number, 29 points are the body's own statements and 42 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.
parser.wasip1-deferred.__createInstance (cognitive 71) napi/parser/src-js/parser.wasip1-deferred.js:1181— parser.wasip1-deferred.__createInstance has cognitive complexity 71 (threshold 15). Drivers by points: if/else 30 (37 pts), error handling 10 (19 pts), boolean chains 8, ternaries 5 (7 pts) (nesting depth added 18). Of this number, 29 points are the body's own statements and 42 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.
transform-react.wasip1-deferred.__createInstance (cognitive 71) napi/transform-react/transform-react.wasip1-deferred.js:1181— transform-react.wasip1-deferred.__createInstance has cognitive complexity 71 (threshold 15). Drivers by points: if/else 30 (37 pts), error handling 10 (19 pts), boolean chains 8, ternaries 5 (7 pts) (nesting depth added 18). Of this number, 29 points are the body's own statements and 42 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.
transform-relay.wasip1-deferred.__createInstance (cognitive 71) napi/transform-relay/transform-relay.wasip1-deferred.js:1181— transform-relay.wasip1-deferred.__createInstance has cognitive complexity 71 (threshold 15). Drivers by points: if/else 30 (37 pts), error handling 10 (19 pts), boolean chains 8, ternaries 5 (7 pts) (nesting depth added 18). Of this number, 29 points are the body's own statements and 42 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.
transform.wasip1-deferred.__createInstance (cognitive 71) napi/transform/transform.wasip1-deferred.js:1181— transform.wasip1-deferred.__createInstance has cognitive complexity 71 (threshold 15). Drivers by points: if/else 30 (37 pts), error handling 10 (19 pts), boolean chains 8, ternaries 5 (7 pts) (nesting depth added 18). Of this number, 29 points are the body's own statements and 42 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.
NoUselessRename::run (cognitive 68) crates/oxc_linter/src/rules/eslint/no_useless_rename.rs:89— NoUselessRename::run has cognitive complexity 68 (threshold 15). Drivers by points: if/else 19 (48 pts), loops 4 (8 pts), match/switch 3 (8 pts), boolean chains 4 (nesting depth added 38). 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.
NoUselessUndefined::run (cognitive 68) crates/oxc_linter/src/rules/unicorn/no_useless_undefined.rs:170— NoUselessUndefined::run has cognitive complexity 68 (threshold 15). Drivers by points: if/else 24 (61 pts), match/switch 2 (3 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FormatJsxChildList::fmt_children (cognitive 67) crates/oxc_formatter/src/print/jsx/child_list.rs:35— FormatJsxChildList::fmt_children has cognitive complexity 67 (threshold 15). Drivers by points: if/else 29 (53 pts), match/switch 3 (8 pts), boolean chains 5, loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Oxc::convert_formatter_options (cognitive 64) napi/playground/src/lib.rs:453— Oxc::convert_formatter_options has cognitive complexity 64 (threshold 15). Drivers by points: if/else 34 (50 pts), boolean chains 6, match/switch 2 (6 pts), loops 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.
State::visit_object_property (cognitive 63) tasks/rulegen/src/main.rs:574— State::visit_object_property has cognitive complexity 63 (threshold 15). Drivers by points: if/else 14 (41 pts), loops 6 (19 pts), boolean chains 2, match/switch 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreferNegativeIndex::run (cognitive 62) crates/oxc_linter/src/rules/unicorn/prefer_negative_index.rs:63— PreferNegativeIndex::run has cognitive complexity 62 (threshold 15). Drivers by points: if/else 26 (51 pts), loops 3 (6 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CheckedRequiresOnchangeOrReadonly::run (cognitive 61) crates/oxc_linter/src/rules/react/checked_requires_onchange_or_readonly.rs:86— CheckedRequiresOnchangeOrReadonly::run has cognitive complexity 61 (threshold 15). Drivers by points: if/else 23 (48 pts), boolean chains 12, match/switch 1 (nesting depth added 25). 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.
DisableDirectivesBuilder::build_impl (cognitive 60) crates/oxc_linter/src/disable_directives.rs:530— DisableDirectivesBuilder::build_impl has cognitive complexity 60 (threshold 15). Drivers by points: if/else 17 (40 pts), loops 6 (18 pts), match/switch 1 (2 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreferArraySome::run (cognitive 60) crates/oxc_linter/src/rules/unicorn/prefer_array_some.rs:74— PreferArraySome::run has cognitive complexity 60 (threshold 15). Drivers by points: if/else 25 (56 pts), boolean chains 3, match/switch 1 (nesting depth added 31). 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.
PreferArrayFind::run (cognitive 59) crates/oxc_linter/src/rules/unicorn/prefer_array_find.rs:66— PreferArrayFind::run has cognitive complexity 59 (threshold 15). Drivers by points: if/else 13 (38 pts), boolean chains 11, match/switch 3 (7 pts), loops 1 (3 pts) (nesting depth added 31). 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.
load.registerPlugin (cognitive 58) apps/oxlint/src-js/plugins/load.ts:159— load.registerPlugin has cognitive complexity 58 (threshold 15). Drivers by points: if/else 18 (54 pts), boolean chains 3, loops 1 (nesting depth added 36). 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.
ImportDeclaration::r#gen (cognitive 55) crates/oxc_codegen/src/gen.rs:914— ImportDeclaration::r#gen has cognitive complexity 55 (threshold 15). Drivers by points: if/else 20 (49 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FitsMeasurer::fits_element (cognitive 54) crates/oxc_formatter_core/src/printer/mod.rs:1236— FitsMeasurer::fits_element has cognitive complexity 54 (threshold 15). Drivers by points: if/else 21 (40 pts), match/switch 6 (12 pts), boolean chains 2 (nesting depth added 25). 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.
RuleConfigOutput::extract_output_inner (cognitive 53) tasks/rulegen/src/main.rs:732— RuleConfigOutput::extract_output_inner has cognitive complexity 53 (threshold 15). Drivers by points: if/else 17 (40 pts), loops 3 (8 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 29). 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.
expression.printObjectProperty (cognitive 53) packages/codegen/src-js/print/expression.ts:463— expression.printObjectProperty has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 9, ternaries 1 (3 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.
FormatClass::fmt (cognitive 52) crates/oxc_formatter/src/print/class.rs:276— FormatClass::fmt has cognitive complexity 52 (threshold 15). Drivers by points: if/else 33 (48 pts), boolean chains 4 (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.
Comments::get_trailing_comments (cognitive 51) crates/oxc_formatter/src/formatter/comments.rs:363— Comments::get_trailing_comments has cognitive complexity 51 (threshold 15). Drivers by points: if/else 15 (33 pts), loops 5 (11 pts), boolean chains 7 (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.
NoCommonjs::run (cognitive 50) crates/oxc_linter/src/rules/import/no_commonjs.rs:139— NoCommonjs::run has cognitive complexity 50 (threshold 15). Drivers by points: if/else 17 (37 pts), match/switch 3 (8 pts), boolean chains 5 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoAccessorRecursion::run (cognitive 49) crates/oxc_linter/src/rules/unicorn/no_accessor_recursion.rs:79— NoAccessorRecursion::run has cognitive complexity 49 (threshold 15). Drivers by points: if/else 22 (41 pts), boolean chains 4, match/switch 3 (4 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.
NoStaticOnlyClass::run (cognitive 49) crates/oxc_linter/src/rules/unicorn/no_static_only_class.rs:64— NoStaticOnlyClass::run has cognitive complexity 49 (threshold 15). Drivers by points: if/else 24 (40 pts), boolean chains 5, match/switch 2 (3 pts), loops 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.
addVisitorToCompiled (cognitive 49) napi/parser/src-js/visit/visitor.js:194— addVisitorToCompiled has cognitive complexity 49 (threshold 15). Drivers by points: if/else 23 (43 pts), ternaries 1 (4 pts), boolean chains 1, loops 1 (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.
ObjectProperty::r#gen (cognitive 48) crates/oxc_codegen/src/gen.rs:1756— ObjectProperty::r#gen has cognitive complexity 48 (threshold 15). Drivers by points: if/else 18 (41 pts), boolean chains 5, match/switch 1 (2 pts) (nesting depth added 24). 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.
DisplayName::run_once (cognitive 48) crates/oxc_linter/src/rules/react/display_name.rs:146— DisplayName::run_once has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 5 (9 pts), boolean chains 2 (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.
TypeScriptAnnotations::exit_program (cognitive 48) crates/oxc_transformer/src/typescript/annotations.rs:58— TypeScriptAnnotations::exit_program has cognitive complexity 48 (threshold 15). Drivers by points: if/else 21 (40 pts), match/switch 2 (5 pts), boolean chains 3 (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.
RequireReturns::run_once (cognitive 47) crates/oxc_linter/src/rules/jsdoc/require_returns.rs:107— RequireReturns::run_once has cognitive complexity 47 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 4 (14 pts), loops 3 (5 pts), boolean chains 3 (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.
Runtime::resolve_modules (cognitive 47) crates/oxc_linter/src/service/runtime.rs:359— Runtime::resolve_modules has cognitive complexity 47 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 8 (19 pts), boolean chains 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoImplicitCoercion::run (cognitive 46) crates/oxc_linter/src/rules/eslint/no_implicit_coercion.rs:189— NoImplicitCoercion::run has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 14, match/switch 1 (nesting depth added 18). 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.
PreferObjectSpread::run (cognitive 46) crates/oxc_linter/src/rules/eslint/prefer_object_spread.rs:79— PreferObjectSpread::run has cognitive complexity 46 (threshold 15). Drivers by points: if/else 21 (38 pts), boolean chains 5, loops 2, match/switch 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.
ThrowFinder::visit_throw_statement (cognitive 46) crates/oxc_linter/src/rules/eslint/preserve_caught_error.rs:57— ThrowFinder::visit_throw_statement has cognitive complexity 46 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 4 (7 pts), boolean chains 6 (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.
ExplicitFunctionReturnType::run (cognitive 46) crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs:153— ExplicitFunctionReturnType::run has cognitive complexity 46 (threshold 15). Drivers by points: if/else 20 (34 pts), boolean chains 7, match/switch 3 (5 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.
ValidExpectConfig::run (cognitive 45) crates/oxc_linter/src/rules/shared/jest_vitest/valid_expect.rs:131— ValidExpectConfig::run has cognitive complexity 45 (threshold 15). Drivers by points: if/else 24 (36 pts), boolean chains 6, match/switch 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.
NoImportingVitestGlobals::run (cognitive 45) crates/oxc_linter/src/rules/vitest/no_importing_vitest_globals.rs:75— NoImportingVitestGlobals::run has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (35 pts), match/switch 4 (8 pts), loops 1 (2 pts) (nesting depth added 26). 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.
NoNamedAsDefaultMember::run_once (cognitive 44) crates/oxc_linter/src/rules/import/no_named_as_default_member.rs:78— NoNamedAsDefaultMember::run_once has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (37 pts), loops 3 (5 pts), match/switch 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
report.generateReport (cognitive 44) apps/oxlint/conformance/src/report.ts:31— report.generateReport has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 8 (16 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.
build.reformatNodeCompatTable (cognitive 44) tasks/compat_data/build.js:58— build.reformatNodeCompatTable has cognitive complexity 44 (threshold 15). Drivers by points: if/else 7 (35 pts), loops 3 (9 pts) (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.
oxc_estree::serialize::strings::write_str (cognitive 43) crates/oxc_estree/src/serialize/strings.rs:243— oxc_estree::serialize::strings::write_str has cognitive complexity 43 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 4 (12 pts), boolean chains 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.
NoUnneededTernary::run (cognitive 43) crates/oxc_linter/src/rules/eslint/no_unneeded_ternary.rs:89— NoUnneededTernary::run has cognitive complexity 43 (threshold 15). Drivers by points: if/else 17 (34 pts), match/switch 2 (6 pts), boolean chains 3 (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.
NoWillUpdateSetState::run (cognitive 43) crates/oxc_linter/src/rules/react/no_will_update_set_state.rs:75— NoWillUpdateSetState::run has cognitive complexity 43 (threshold 15). Drivers by points: if/else 13 (29 pts), boolean chains 10, match/switch 1 (3 pts), 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.
TriviaBuilder::parse_annotation (cognitive 43) crates/oxc_parser/src/lexer/trivia_builder.rs:356— TriviaBuilder::parse_annotation has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 8, match/switch 2, 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.
StructDeserializerGenerator::generate_struct_field_owned (cognitive 43) tasks/ast_tools/src/generators/raw_transfer.rs:625— StructDeserializerGenerator::generate_struct_field_owned has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 2 (5 pts), match/switch 2 (5 pts) (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.
oxc_tasks_common::diff::print_text_diff (cognitive 43) tasks/common/src/diff.rs:48— oxc_tasks_common::diff::print_text_diff has cognitive complexity 43 (threshold 15). Drivers by points: loops 6 (21 pts), if/else 5 (18 pts), match/switch 1 (4 pts) (nesting depth added 31). 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.
NoImportAssign::run (cognitive 42) crates/oxc_linter/src/rules/eslint/no_import_assign.rs:64— NoImportAssign::run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 6 (21 pts), match/switch 2 (12 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 28). 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.
GroupExports::run_once (cognitive 42) crates/oxc_linter/src/rules/import/group_exports.rs:68— GroupExports::run_once has cognitive complexity 42 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 8 (15 pts), match/switch 4 (9 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.
JsxNoScriptUrl::run (cognitive 42) crates/oxc_linter/src/rules/react/jsx_no_script_url.rs:182— JsxNoScriptUrl::run has cognitive complexity 42 (threshold 15). Drivers by points: if/else 10 (34 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 28). 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.
ConsistentFunctionScoping::check_function (cognitive 42) crates/oxc_linter/src/rules/unicorn/consistent_function_scoping.rs:188— ConsistentFunctionScoping::check_function has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 6, match/switch 3, loops 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.
Normalize::set_pure_or_no_side_effects_to_new_expr (cognitive 42) crates/oxc_minifier/src/peephole/normalize.rs:403— Normalize::set_pure_or_no_side_effects_to_new_expr has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (29 pts), match/switch 4 (8 pts), boolean chains 5 (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.
visitor.addVisitorToCompiled (cognitive 42) apps/oxlint/src-js/plugins/visitor.ts:268— visitor.addVisitorToCompiled has cognitive complexity 42 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 5 (10 pts), boolean chains 1 (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.
ArrayCallbackReturn::run (cognitive 41) crates/oxc_linter/src/rules/eslint/array_callback_return/mod.rs:191— ArrayCallbackReturn::run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (31 pts), boolean chains 7, match/switch 2 (3 pts) (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.
ConsistentTypeImports::run (cognitive 41) crates/oxc_linter/src/rules/typescript/consistent_type_imports.rs:200— ConsistentTypeImports::run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 7 (25 pts), match/switch 3 (8 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 25). 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.
PreferFunctionType::run (cognitive 41) crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:290— PreferFunctionType::run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (34 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 25). 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.
PreferObjectFromEntries::run (cognitive 41) crates/oxc_linter/src/rules/unicorn/prefer_object_from_entries.rs:91— PreferObjectFromEntries::run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24 (35 pts), boolean chains 6 (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.
tokens_methods.getFirstToken (cognitive 41) apps/oxlint/src-js/plugins/tokens_methods.ts:188— tokens_methods.getFirstToken has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 2 (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. This shape REPEATS in the file: 3 other methods here (tokens_methods.getLastToken, tokens_methods.getFirstTokenBetween, tokens_methods.getLastTokenBetween) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
tokens_methods.getLastToken (cognitive 41) apps/oxlint/src-js/plugins/tokens_methods.ts:349— tokens_methods.getLastToken has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 2 (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. This shape REPEATS in the file: 3 other methods here (tokens_methods.getFirstToken, tokens_methods.getFirstTokenBetween, tokens_methods.getLastTokenBetween) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
tokens_methods.getFirstTokenBetween (cognitive 41) apps/oxlint/src-js/plugins/tokens_methods.ts:939— tokens_methods.getFirstTokenBetween has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 2 (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. This shape REPEATS in the file: 3 other methods here (tokens_methods.getFirstToken, tokens_methods.getLastToken, tokens_methods.getLastTokenBetween) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
tokens_methods.getLastTokenBetween (cognitive 41) apps/oxlint/src-js/plugins/tokens_methods.ts:1103— tokens_methods.getLastTokenBetween has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (29 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 2 (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. This shape REPEATS in the file: 3 other methods here (tokens_methods.getFirstToken, tokens_methods.getLastToken, tokens_methods.getFirstTokenBetween) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 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.
StylishReporter::format_stylish (cognitive 40) apps/oxlint/src/output_formatter/stylish.rs:53— StylishReporter::format_stylish has cognitive complexity 40 (threshold 15). Drivers by points: if/else 19 (33 pts), loops 3 (4 pts), match/switch 1 (3 pts) (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.
ArrowChain::fmt (cognitive 40) crates/oxc_formatter/src/print/arrow_function_expression.rs:408— ArrowChain::fmt has cognitive complexity 40 (threshold 15). Drivers by points: if/else 21 (29 pts), boolean chains 10, 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.
oxc_relay::find_definition_name (cognitive 40) crates/oxc_relay/src/lib.rs:243— oxc_relay::find_definition_name has cognitive complexity 40 (threshold 15). Drivers by points: loops 6 (19 pts), if/else 8 (16 pts), boolean chains 5 (nesting depth added 21). 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.
lint.lintFileImpl (cognitive 40) apps/oxlint/src-js/plugins/lint.ts:133— lint.lintFileImpl has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (25 pts), ternaries 3 (10 pts), loops 2 (3 pts), boolean chains 2 (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.
module.printImportDeclaration (cognitive 40) packages/codegen/src-js/print/module.ts:32— module.printImportDeclaration has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (33 pts), boolean chains 3, match/switch 1 (2 pts), loops 1, ternaries 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.
Config::apply_overrides (cognitive 39) crates/oxc_linter/src/config/config_store.rs:126— Config::apply_overrides has cognitive complexity 39 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 5 (10 pts), boolean chains 4 (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.
InlineScriptId::run (cognitive 39) crates/oxc_linter/src/rules/nextjs/inline_script_id.rs:100— InlineScriptId::run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 3 (8 pts), match/switch 1 (3 pts), boolean chains 2 (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.
PreferIncludes::run (cognitive 39) crates/oxc_linter/src/rules/unicorn/prefer_includes.rs:69— PreferIncludes::run has cognitive complexity 39 (threshold 15). Drivers by points: if/else 27 (33 pts), match/switch 3 (5 pts), boolean chains 1 (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.
TestCase::visit_object_expression (cognitive 39) tasks/rulegen/src/main.rs:285— TestCase::visit_object_expression has cognitive complexity 39 (threshold 15). Drivers by points: if/else 4 (20 pts), match/switch 5 (18 pts), loops 1 (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
rule_tester.assertInvalidTestCasePasses (cognitive 38) apps/oxlint/src-js/package/rule_tester.ts:622— rule_tester.assertInvalidTestCasePasses has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 4, loops 2 (4 pts), ternaries 2 (3 pts) (nesting depth added 15). Of this number, 37 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.
unmap_writes.unmapWritesPlugin (cognitive 38) packages/codegen/tsdown_plugins/unmap_writes.ts:70— unmap_writes.unmapWritesPlugin has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 4, loops 2 (3 pts), ternaries 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.
ConfigLoader::load_many (cognitive 37) apps/oxlint/src/config_loader.rs:337— ConfigLoader::load_many has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 5 (10 pts), loops 3 (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.
NoUnexpectedMultiline::run (cognitive 37) crates/oxc_linter/src/rules/eslint/no_unexpected_multiline.rs:112— NoUnexpectedMultiline::run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (34 pts), boolean chains 2, match/switch 1 (nesting depth added 16). 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.
ConsistentTypeSpecifierStyle::run (cognitive 37) crates/oxc_linter/src/rules/import/consistent_type_specifier_style.rs:131— ConsistentTypeSpecifierStyle::run has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 7, loops 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.
SlotAssignment::compute (cognitive 37) crates/oxc_mangler/src/lib.rs:591— SlotAssignment::compute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 6 (15 pts), boolean chains 2 (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.
report.report (cognitive 37) apps/oxlint/src-js/plugins/report.ts:105— report.report has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 4, 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.
FormatConditionalLike::should_extra_indent (cognitive 36) crates/oxc_formatter/src/utils/conditional.rs:248— FormatConditionalLike::should_extra_indent has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (32 pts), match/switch 2 (3 pts), loops 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.
NoUnsafeOptionalChaining::unsafe_context (cognitive 36) crates/oxc_linter/src/rules/eslint/no_unsafe_optional_chaining.rs:98— NoUnsafeOptionalChaining::unsafe_context has cognitive complexity 36 (threshold 15). Drivers by points: boolean chains 15, if/else 5 (15 pts), match/switch 2 (5 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.
Namespace::run_once (cognitive 36) crates/oxc_linter/src/rules/import/namespace.rs:123— Namespace::run_once has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 3 (7 pts), boolean chains 2, loops 1 (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.
CheckTagNames::run_once (cognitive 36) crates/oxc_linter/src/rules/jsdoc/check_tag_names.rs:241— CheckTagNames::run_once has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (27 pts), boolean chains 6, 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.
RequireYields::run (cognitive 36) crates/oxc_linter/src/rules/jsdoc/require_yields.rs:113— RequireYields::run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 5, loops 1 (2 pts), match/switch 1 (nesting depth added 16). 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.
AnchorIsValid::run (cognitive 36) crates/oxc_linter/src/rules/jsx_a11y/anchor_is_valid.rs:163— AnchorIsValid::run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 2 (8 pts), boolean chains 5, loops 1 (2 pts) (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.
NoThenable::run (cognitive 36) crates/oxc_linter/src/rules/unicorn/no_thenable.rs:82— NoThenable::run has cognitive complexity 36 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 3 (7 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 19). 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.
TypeScript::transform_class_fields (cognitive 36) crates/oxc_transformer/src/typescript/class.rs:96— TypeScript::transform_class_fields has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (30 pts), boolean chains 3, match/switch 1 (2 pts), 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.
ReactCompilerEnvironmentOptions::apply_to (cognitive 36) napi/transform-react/src/options.rs:443— ReactCompilerEnvironmentOptions::apply_to has cognitive complexity 36 (threshold 15). Drivers by points: if/else 34, match/switch 1 (2 pts) (nesting depth added 1). 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.
report.formatError (cognitive 36) apps/oxlint/conformance/src/report.ts:279— report.formatError has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 2, loops 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.
TSSignature::r#gen (cognitive 35) crates/oxc_codegen/src/gen.rs:3780— TSSignature::r#gen has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (27 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 17). 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.
SourceLine::from_element_range (cognitive 35) crates/oxc_formatter/src/ir_transform/sort_imports/source_line.rs:27— SourceLine::from_element_range has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (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.
VoidDomElementsNoChildren::run (cognitive 35) crates/oxc_linter/src/rules/react/void_dom_elements_no_children.rs:77— VoidDomElementsNoChildren::run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 4 (8 pts), boolean chains 4 (nesting depth added 16). 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.
BanTsComment::run_once (cognitive 35) crates/oxc_linter/src/rules/typescript/ban_ts_comment.rs:203— BanTsComment::run_once has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (26 pts), boolean chains 5, match/switch 1 (3 pts), loops 1 (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.
ConsistentTypeDefinitions::run (cognitive 35) crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:100— ConsistentTypeDefinitions::run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 2 (5 pts), match/switch 3 (5 pts) (nesting depth added 18). 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.
PreferQuerySelector::run (cognitive 35) crates/oxc_linter/src/rules/unicorn/prefer_query_selector.rs:95— PreferQuerySelector::run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 2 (5 pts), boolean chains 4 (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.
LintRuleMeta::parse (cognitive 35) crates/oxc_macros/src/declare_oxc_lint.rs:52— LintRuleMeta::parse has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 2 (4 pts), loops 2, boolean chains 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.
NoAsyncClientComponent::run_once (cognitive 34) crates/oxc_linter/src/rules/nextjs/no_async_client_component.rs:94— NoAsyncClientComponent::run_once has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (29 pts), boolean chains 3, loops 1 (2 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.
PreferStringRaw::run (cognitive 34) crates/oxc_linter/src/rules/unicorn/prefer_string_raw.rs:71— PreferStringRaw::run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 5, 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.
PreferCalledExactlyOnceWith::check_block_body (cognitive 34) crates/oxc_linter/src/rules/vitest/prefer_called_exactly_once_with.rs:213— PreferCalledExactlyOnceWith::check_block_body has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 2 (5 pts), loops 2 (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.
migrate-prettier.runMigratePrettier (cognitive 34) apps/oxfmt/src-js/cli/migration/migrate-prettier.ts:14— migrate-prettier.runMigratePrettier has cognitive complexity 34 (threshold 15). Drivers by points: if/else 17 (24 pts), ternaries 2 (4 pts), loops 2 (3 pts), error handling 2, 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.
regexp.parseSnapshot (cognitive 34) apps/oxlint/conformance/src/groups/regexp.ts:164— regexp.parseSnapshot has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 4 (6 pts), boolean chains 2, error handling 1 (nesting depth added 14). Most of this is not in the body itself: 2 of the 34 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 187, 217). 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.
typescript.printTSType (cognitive 34) packages/codegen/src-js/print/typescript.ts:80— typescript.printTSType has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (25 pts), loops 2 (4 pts), ternaries 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 17). 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.
ParameterProperties::check_prefer_parameter_property (cognitive 33) crates/oxc_linter/src/rules/typescript/parameter_properties.rs:186— ParameterProperties::check_prefer_parameter_property has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 5 (7 pts), boolean chains 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.
TripleSlashReference::run_once (cognitive 33) crates/oxc_linter/src/rules/typescript/triple_slash_reference.rs:101— TripleSlashReference::run_once has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (7 pts), boolean chains 5, loops 2 (3 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.
tokens_methods.getTokenBefore (cognitive 33) apps/oxlint/src-js/plugins/tokens_methods.ts:512— tokens_methods.getTokenBefore has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 4 (6 pts), loops 2 (4 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.
tokens_methods.getTokenAfter (cognitive 33) apps/oxlint/src-js/plugins/tokens_methods.ts:681— tokens_methods.getTokenAfter has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), ternaries 4 (6 pts), loops 2 (4 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.
rule_tester.modifyTestCase (cognitive 33) apps/oxlint/conformance/src/rule_tester.ts:147— rule_tester.modifyTestCase has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (30 pts), loops 1 (2 pts), boolean chains 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.
write.debugAssertCategoryMatches (cognitive 33) packages/codegen/src-js/print/write.ts:849— write.debugAssertCategoryMatches has cognitive complexity 33 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 8, ternaries 1 (2 pts) (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, 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.
BinaryLeftOrRightSide::fmt (cognitive 32) crates/oxc_formatter/src/print/binary_like_expression.rs:369— BinaryLeftOrRightSide::fmt has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6, match/switch 2 (3 pts), loops 1 (2 pts) (nesting depth added 12). 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.
NoFallthrough::run (cognitive 32) crates/oxc_linter/src/rules/eslint/no_fallthrough.rs:261— NoFallthrough::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 6, loops 1, match/switch 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.
NoInvalidRegexp::run (cognitive 32) crates/oxc_linter/src/rules/eslint/no_invalid_regexp.rs:88— NoInvalidRegexp::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 3 (5 pts), boolean chains 2, loops 1 (2 pts) (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.
NoRedeclare::run_once (cognitive 32) crates/oxc_linter/src/rules/eslint/no_redeclare.rs:79— NoRedeclare::run_once has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 2 (3 pts), boolean chains 2 (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.
NoUnmodifiedLoopCondition::check_loop_condition (cognitive 32) crates/oxc_linter/src/rules/eslint/no_unmodified_loop_condition.rs:149— NoUnmodifiedLoopCondition::check_loop_condition has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 5 (6 pts), boolean chains 4 (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.
NoThisAlias::run (cognitive 32) crates/oxc_linter/src/rules/typescript/no_this_alias.rs:109— NoThisAlias::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 18). 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.
cfg.walkProgramWithCfg (cognitive 32) apps/oxlint/src-js/plugins/cfg.ts:92— cfg.walkProgramWithCfg has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (31 pts), loops 1 (nesting depth added 20). 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.
ScopedWalker::run (cognitive 31) apps/oxfmt/src/cli/walk.rs:105— ScopedWalker::run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (27 pts), loops 2 (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.
DiagnosticService::run (cognitive 31) crates/oxc_diagnostics/src/service.rs:156— DiagnosticService::run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (3 pts), match/switch 1 (3 pts) (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.
First::run_once (cognitive 31) crates/oxc_linter/src/rules/import/first.rs:99— First::run_once has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 2 (5 pts), loops 1 (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.
StylePropObject::run (cognitive 31) crates/oxc_linter/src/rules/react/style_prop_object.rs:155— StylePropObject::run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 3 (5 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). 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.
NoRestrictedTypes::run (cognitive 31) crates/oxc_linter/src/rules/typescript/no_restricted_types.rs:267— NoRestrictedTypes::run has cognitive complexity 31 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 2, match/switch 1 (nesting depth added 14). 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.
WalkRunner::run (cognitive 30) apps/oxfmt/src/cli/walk_runner.rs:67— WalkRunner::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 7 (10 pts), loops 2 (3 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.
ForbidDomProps::run (cognitive 30) crates/oxc_linter/src/rules/react/forbid_dom_props.rs:174— ForbidDomProps::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 1 (2 pts), boolean chains 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.
PreferGlobalThis::run (cognitive 30) crates/oxc_linter/src/rules/unicorn/prefer_global_this.rs:68— PreferGlobalThis::run has cognitive complexity 30 (threshold 15). Drivers by points: if/else 12 (25 pts), boolean chains 5 (nesting depth added 13). 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.
FunctionGraph::analyze (cognitive 30) crates/oxc_minifier/src/symbol_liveness/mod.rs:278— FunctionGraph::analyze has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 7 (8 pts), boolean chains 3 (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.
tokens_methods.getFirstTokens (cognitive 30) apps/oxlint/src-js/plugins/tokens_methods.ts:269— tokens_methods.getFirstTokens has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 3 (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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getLastTokens, tokens_methods.getTokensBefore, tokens_methods.getTokensAfter, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getLastTokens (cognitive 30) apps/oxlint/src-js/plugins/tokens_methods.ts:429— tokens_methods.getLastTokens has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 3 (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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getTokensBefore, tokens_methods.getTokensAfter, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getTokensBefore (cognitive 30) apps/oxlint/src-js/plugins/tokens_methods.ts:608— tokens_methods.getTokensBefore has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 3 (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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getLastTokens, tokens_methods.getTokensAfter, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getTokensAfter (cognitive 30) apps/oxlint/src-js/plugins/tokens_methods.ts:776— tokens_methods.getTokensAfter has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 3 (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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getLastTokens, tokens_methods.getTokensBefore, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getFirstTokensBetween (cognitive 30) apps/oxlint/src-js/plugins/tokens_methods.ts:1021— tokens_methods.getFirstTokensBetween has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 3 (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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getLastTokens, tokens_methods.getTokensBefore, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
tokens_methods.getLastTokensBetween (cognitive 30) apps/oxlint/src-js/plugins/tokens_methods.ts:1187— tokens_methods.getLastTokensBetween has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (6 pts), loops 2 (4 pts), boolean chains 3 (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. This shape REPEATS in the file: 5 other methods here (tokens_methods.getFirstTokens, tokens_methods.getLastTokens, tokens_methods.getTokensBefore, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 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.
NoExtraneousClass::run (cognitive 29) crates/oxc_linter/src/rules/typescript/no_extraneous_class.rs:122— NoExtraneousClass::run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 6, match/switch 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.
NoRequireImports::run (cognitive 29) crates/oxc_linter/src/rules/typescript/no_require_imports.rs:133— NoRequireImports::run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 16). 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.
NoImportCompilerMacros::run (cognitive 29) crates/oxc_linter/src/rules/vue/no_import_compiler_macros.rs:82— NoImportCompilerMacros::run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MatchDetector::extract_variants_from_match_arm (cognitive 29) tasks/linter_codegen/src/match_detector.rs:58— MatchDetector::extract_variants_from_match_arm has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (27 pts), boolean chains 1, match/switch 1 (nesting depth added 12). 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.
tokens_methods.getTokensBetween (cognitive 29) apps/oxlint/src-js/plugins/tokens_methods.ts:855— tokens_methods.getTokensBetween has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (17 pts), ternaries 4 (5 pts), loops 2 (4 pts), boolean chains 3 (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.
string.printEscapedStringContents (cognitive 29) packages/codegen/src-js/print/string.ts:52— string.printEscapedStringContents has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (22 pts), boolean chains 4, match/switch 1 (2 pts), loops 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.
ServerLinter::get_code_actions_or_commands (cognitive 28) apps/oxlint/src/lsp/server_linter.rs:604— ServerLinter::get_code_actions_or_commands has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 2 (4 pts), boolean chains 1, match/switch 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.
FormatCommentText::fmt (cognitive 28) crates/oxc_formatter/src/formatter/trivia.rs:511— FormatCommentText::fmt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (21 pts), loops 1 (4 pts), boolean chains 3 (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.
NoImplicitGlobals::run_once (cognitive 28) crates/oxc_linter/src/rules/eslint/no_implicit_globals.rs:94— NoImplicitGlobals::run_once has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (9 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.
RequireAwait::check_function_body (cognitive 28) crates/oxc_linter/src/rules/eslint/require_await.rs:117— RequireAwait::check_function_body has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (26 pts), boolean chains 1, match/switch 1 (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.
PreferDomNodeDataset::run (cognitive 28) crates/oxc_linter/src/rules/unicorn/prefer_dom_node_dataset.rs:65— PreferDomNodeDataset::run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (26 pts), match/switch 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.
PreferSetHas::run (cognitive 28) crates/oxc_linter/src/rules/unicorn/prefer_set_has.rs:134— PreferSetHas::run has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (24 pts), boolean chains 2, loops 1, match/switch 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.
NoRequiredPropWithDefault::run_on_setup (cognitive 28) crates/oxc_linter/src/rules/vue/no_required_prop_with_default.rs:130— NoRequiredPropWithDefault::run_on_setup has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 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.
Context::rule_config (cognitive 28) tasks/website_linter/src/rules/doc_page.rs:134— Context::rule_config has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (19 pts), boolean chains 5, match/switch 2 (4 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.
expression.printExpression (cognitive 28) packages/codegen/src-js/print/expression.ts:90— expression.printExpression has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 2 (8 pts), boolean chains 3, match/switch 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.
PartitionedChunk::into_sorted_import_units (cognitive 27) crates/oxc_formatter/src/ir_transform/sort_imports/partitioned_chunk.rs:65— PartitionedChunk::into_sorted_import_units has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (24 pts), match/switch 1 (2 pts), 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.
Named::run_once (cognitive 27) crates/oxc_linter/src/rules/import/named.rs:119— Named::run_once has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 2, 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.
AnchorHasContent::run (cognitive 27) crates/oxc_linter/src/rules/jsx_a11y/anchor_has_content.rs:95— AnchorHasContent::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 1 (3 pts), boolean chains 1 (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.
NoReturnWrap::run (cognitive 27) crates/oxc_linter/src/rules/promise/no_return_wrap.rs:148— NoReturnWrap::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 2, 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.
JsxCurlyBracePresence::check_expression_container (cognitive 27) crates/oxc_linter/src/rules/react/jsx_curly_brace_presence.rs:435— JsxCurlyBracePresence::check_expression_container has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 6, match/switch 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.
NoDangerWithChildren::run (cognitive 27) crates/oxc_linter/src/rules/react/no_danger_with_children.rs:56— NoDangerWithChildren::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 3 (5 pts), boolean chains 3 (nesting depth added 11). 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.
ValidTitleConfig::run_rule (cognitive 27) crates/oxc_linter/src/rules/shared/jest_vitest/valid_title.rs:182— ValidTitleConfig::run_rule has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 pts), boolean chains 3, match/switch 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.
NoAwaitExpressionMember::run (cognitive 27) crates/oxc_linter/src/rules/unicorn/no_await_expression_member.rs:54— NoAwaitExpressionMember::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 1 (2 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.
NoUselessPromiseResolveReject::run (cognitive 27) crates/oxc_linter/src/rules/unicorn/no_useless_promise_resolve_reject.rs:83— NoUselessPromiseResolveReject::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 17 (24 pts), match/switch 2, 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.
PreferSingleCall::run (cognitive 27) crates/oxc_linter/src/rules/unicorn/prefer_single_call.rs:94— PreferSingleCall::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 2, match/switch 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.
ConsistentVitestVi::run (cognitive 27) crates/oxc_linter/src/rules/vitest/consistent_vitest_vi.rs:111— ConsistentVitestVi::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (25 pts), boolean chains 1, match/switch 1 (nesting depth added 14). 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.
location.getOffsetFromLineColumn (cognitive 27) apps/oxlint/src-js/plugins/location.ts:194— location.getOffsetFromLineColumn has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (24 pts), boolean chains 3 (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.
location.traverse (cognitive 27) apps/oxlint/src-js/plugins/location.ts:439— location.traverse has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 2 (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.
selector.analyzeSelector (cognitive 27) apps/oxlint/src-js/plugins/selector.ts:222— selector.analyzeSelector has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (6 pts), match/switch 2 (3 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 13). 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.
class.printClass (cognitive 27) packages/codegen/src-js/print/class.ts:53— class.printClass has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 5, loops 1 (2 pts) (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, 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.
Function::bind (cognitive 26) crates/oxc_semantic/src/binder.rs:139— Function::bind has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 5, match/switch 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.
EngineTargets::try_from (cognitive 26) crates/oxc_compat/src/babel_targets.rs:37— EngineTargets::try_from has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 15). 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.
PreferAwaitToCallbacks::run (cognitive 26) crates/oxc_linter/src/rules/promise/prefer_await_to_callbacks.rs:63— PreferAwaitToCallbacks::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 6, match/switch 2 (4 pts) (nesting depth added 12). 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.
PreferMathTrunc::run (cognitive 26) crates/oxc_linter/src/rules/unicorn/prefer_math_trunc.rs:63— PreferMathTrunc::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 2, match/switch 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.
PreferReflectApply::run (cognitive 26) crates/oxc_linter/src/rules/unicorn/prefer_reflect_apply.rs:70— PreferReflectApply::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3 (nesting depth added 12). 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.
PreferStructuredClone::run (cognitive 26) crates/oxc_linter/src/rules/unicorn/prefer_structured_clone.rs:87— PreferStructuredClone::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), loops 1 (2 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.
PreferToBeObject::run (cognitive 26) crates/oxc_linter/src/rules/vitest/prefer_to_be_object.rs:82— PreferToBeObject::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 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.
TransformOptions::try_from (cognitive 26) crates/oxc_transformer/src/options/mod.rs:171— TransformOptions::try_from has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 16, if/else 9 (10 pts) (nesting depth added 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.
tokens_methods.getTokens (cognitive 26) apps/oxlint/src-js/plugins/tokens_methods.ts:97— tokens_methods.getTokens has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 5, ternaries 4 (5 pts), loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
function.printParams (cognitive 26) packages/codegen/src-js/print/function.ts:154— function.printParams has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (22 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InitDeclarations::run (cognitive 25) crates/oxc_linter/src/rules/eslint/init_declarations.rs:129— InitDeclarations::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (6 pts), loops 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.
RequireProperty::run_once (cognitive 25) crates/oxc_linter/src/rules/jsdoc/require_property.rs:68— RequireProperty::run_once has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (20 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.
RulesOfHooks::run (cognitive 25) crates/oxc_linter/src/rules/react/rules_of_hooks.rs:269— RulesOfHooks::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (23 pts), boolean chains 1, match/switch 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.
NoInvalidVoidType::run (cognitive 25) crates/oxc_linter/src/rules/typescript/no_invalid_void_type.rs:146— NoInvalidVoidType::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 3, match/switch 1 (3 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.
PreferImportMetaProperties::run (cognitive 25) crates/oxc_linter/src/rules/unicorn/prefer_import_meta_properties.rs:103— PreferImportMetaProperties::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, match/switch 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.
DefineEmitsDeclaration::run (cognitive 25) crates/oxc_linter/src/rules/vue/define_emits_declaration.rs:142— DefineEmitsDeclaration::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (6 pts), match/switch 2 (4 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.
ServerLinterBuilder::build (cognitive 24) apps/oxlint/src/lsp/server_linter.rs:81— ServerLinterBuilder::build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 6 (7 pts), 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.
VariableDeclarator::bind (cognitive 24) crates/oxc_semantic/src/binder.rs:19— VariableDeclarator::bind has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (6 pts), match/switch 2, 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.
FmtJsonArray::fmt (cognitive 24) crates/oxc_formatter_json/src/print/array.rs:24— FmtJsonArray::fmt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 2, 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.
ClassMethodsUseThis::run (cognitive 24) crates/oxc_linter/src/rules/eslint/class_methods_use_this.rs:179— ClassMethodsUseThis::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 8, match/switch 4 (5 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.
PreferExponentiationOperator::run (cognitive 24) crates/oxc_linter/src/rules/eslint/prefer_exponentiation_operator.rs:52— PreferExponentiationOperator::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 3, match/switch 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.
NoMisusedNew::run (cognitive 24) crates/oxc_linter/src/rules/typescript/no_misused_new.rs:104— NoMisusedNew::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), boolean chains 3, match/switch 1 (nesting depth added 12). 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.
NoMultipleSlotArgs::run (cognitive 24) crates/oxc_linter/src/rules/vue/no_multiple_slot_args.rs:80— NoMultipleSlotArgs::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 3, 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.
BabelOptions::from_test_path (cognitive 24) crates/oxc_transformer/src/options/babel/mod.rs:138— BabelOptions::from_test_path has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 4, 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.
typescript.printTSSignature (cognitive 24) packages/codegen/src-js/print/typescript.ts:476— typescript.printTSSignature has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 1 (nesting depth added 10). 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.
FormatJsArrowFunctionExpression::format (cognitive 23) crates/oxc_formatter/src/print/arrow_function_expression.rs:90— FormatJsArrowFunctionExpression::format has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 9). 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.
EachTemplateTable::fmt (cognitive 23) crates/oxc_formatter/src/print/template/mod.rs:749— EachTemplateTable::fmt has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (17 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LintFilterKind::parse (cognitive 23) crates/oxc_linter/src/options/filter.rs:96— LintFilterKind::parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 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.
CapitalizedComments::run_once (cognitive 23) crates/oxc_linter/src/rules/eslint/capitalized_comments.rs:191— CapitalizedComments::run_once has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 5, match/switch 1 (2 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.
MediaHasCaption::run (cognitive 23) crates/oxc_linter/src/rules/jsx_a11y/media_has_caption.rs:112— MediaHasCaption::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 6). 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.
NewForBuiltins::run (cognitive 23) crates/oxc_linter/src/rules/unicorn/new_for_builtins.rs:67— NewForBuiltins::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, match/switch 1 (nesting depth added 12). 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.
PreferClassFields::run (cognitive 23) crates/oxc_linter/src/rules/unicorn/prefer_class_fields.rs:92— PreferClassFields::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), 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, 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.
PreferDateNow::run (cognitive 23) crates/oxc_linter/src/rules/unicorn/prefer_date_now.rs:63— PreferDateNow::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 2, match/switch 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.
PreferTopLevelAwait::run (cognitive 23) crates/oxc_linter/src/rules/unicorn/prefer_top_level_await.rs:72— PreferTopLevelAwait::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 7, match/switch 2 (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.
HoistedApisOnTop::run (cognitive 23) crates/oxc_linter/src/rules/vitest/hoisted_apis_on_top.rs:128— HoistedApisOnTop::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (21 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, 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.
RawNum::normalize (cognitive 23) crates/oxc_linter/src/utils/number.rs:83— RawNum::normalize has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 1 (2 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.
StructSerializerGenerator::generate_stmts_for_field (cognitive 23) tasks/ast_tools/src/derives/estree.rs:429— StructSerializerGenerator::generate_stmts_for_field has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 3 (6 pts) (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, 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.
binary.binCheckAndPrepare (cognitive 23) packages/codegen/src-js/print/binary.ts:146— binary.binCheckAndPrepare has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 10, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
class.printMethodDefinition (cognitive 23) packages/codegen/src-js/print/class.ts:227— class.printMethodDefinition has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16, boolean chains 7. 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.
class.printPropertyDefinition (cognitive 23) packages/codegen/src-js/print/class.ts:299— class.printPropertyDefinition has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13, boolean chains 10. 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.
CompilerInterface::compile (cognitive 22) crates/oxc/src/compiler.rs:127— CompilerInterface::compile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (20 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.
NoAwaitInLoop::is_looped (cognitive 22) crates/oxc_linter/src/rules/eslint/no_await_in_loop.rs:148— NoAwaitInLoop::is_looped has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 4, match/switch 1 (nesting depth added 9). 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.
UseIsnan::run (cognitive 22) crates/oxc_linter/src/rules/eslint/use_isnan.rs:106— UseIsnan::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, match/switch 1 (nesting depth added 9). 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.
NoAbsolutePath::run (cognitive 22) crates/oxc_linter/src/rules/import/no_absolute_path.rs:118— NoAbsolutePath::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 5, loops 1 (4 pts), match/switch 2 (4 pts) (nesting depth added 11). 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.
NoWebpackLoaderSyntax::run (cognitive 22) crates/oxc_linter/src/rules/import/no_webpack_loader_syntax.rs:58— NoWebpackLoaderSyntax::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 1 (nesting depth added 13). 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.
ImgRedundantAlt::run (cognitive 22) crates/oxc_linter/src/rules/jsx_a11y/img_redundant_alt.rs:132— ImgRedundantAlt::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 4 (5 pts), loops 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.
OnlyUsedInRecursion::run (cognitive 22) crates/oxc_linter/src/rules/oxc/only_used_in_recursion.rs:77— OnlyUsedInRecursion::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (4 pts), match/switch 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.
JsxBooleanValue::run (cognitive 22) crates/oxc_linter/src/rules/react/jsx_boolean_value.rs:121— JsxBooleanValue::run has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), boolean chains 3, match/switch 1 (2 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.
TestRunner::generate_snapshot (cognitive 22) tasks/transform_conformance/src/lib.rs:145— TestRunner::generate_snapshot has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (11 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.
rule_tester.lint (cognitive 22) apps/oxlint/src-js/package/rule_tester.ts:1221— rule_tester.lint has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (19 pts), boolean chains 2, ternaries 1 (nesting depth added 6). Of this number, 15 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.
minify.wasip1-deferred.__normalizeModuleForEmnapi (cognitive 22) napi/minify/minify.wasip1-deferred.js:210— minify.wasip1-deferred.__normalizeModuleForEmnapi has cognitive complexity 22 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 8 (11 pts) (nesting depth added 8). Of this number, 20 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.
visitor.createVisitorsArr (cognitive 22) napi/parser/src-js/raw-transfer/visitor.js:63— visitor.createVisitorsArr has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2, 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.
parser.wasip1-deferred.__normalizeModuleForEmnapi (cognitive 22) napi/parser/src-js/parser.wasip1-deferred.js:210— parser.wasip1-deferred.__normalizeModuleForEmnapi has cognitive complexity 22 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 8 (11 pts) (nesting depth added 8). Of this number, 20 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.
transform-react.wasip1-deferred.__normalizeModuleForEmnapi (cognitive 22) napi/transform-react/transform-react.wasip1-deferred.js:210— transform-react.wasip1-deferred.__normalizeModuleForEmnapi has cognitive complexity 22 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 8 (11 pts) (nesting depth added 8). Of this number, 20 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.
transform-relay.wasip1-deferred.__normalizeModuleForEmnapi (cognitive 22) napi/transform-relay/transform-relay.wasip1-deferred.js:210— transform-relay.wasip1-deferred.__normalizeModuleForEmnapi has cognitive complexity 22 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 8 (11 pts) (nesting depth added 8). Of this number, 20 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.
transform.wasip1-deferred.__normalizeModuleForEmnapi (cognitive 22) napi/transform/transform.wasip1-deferred.js:210— transform.wasip1-deferred.__normalizeModuleForEmnapi has cognitive complexity 22 (threshold 15). Drivers by points: error handling 6 (11 pts), if/else 8 (11 pts) (nesting depth added 8). Of this number, 20 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.
binding_pattern.printBindingPattern (cognitive 22) packages/codegen/src-js/print/binding_pattern.ts:31— binding_pattern.printBindingPattern has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 7, match/switch 1 (nesting depth added 7). 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.
module.printExportNamedDeclaration (cognitive 22) packages/codegen/src-js/print/module.ts:207— module.printExportNamedDeclaration has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), ternaries 1 (3 pts), boolean chains 2, loops 1 (2 pts), match/switch 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.
AssignmentTargetPropertyProperty::r#gen (cognitive 21) crates/oxc_codegen/src/gen.rs:2245— AssignmentTargetPropertyProperty::r#gen has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 3 (6 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.
NewCap::run (cognitive 21) crates/oxc_linter/src/rules/eslint/new_cap.rs:423— NewCap::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 4, match/switch 1 (nesting depth added 8). 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.
Extensions::validate_extension (cognitive 21) crates/oxc_linter/src/rules/import/extensions.rs:586— Extensions::validate_extension has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 3 (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.
RequireParamDescription::run (cognitive 21) crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:92— RequireParamDescription::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (3 pts), match/switch 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.
RequireParamType::run (cognitive 21) crates/oxc_linter/src/rules/jsdoc/require_param_type.rs:90— RequireParamType::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (3 pts), match/switch 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.
RoleSupportsAriaProps::run (cognitive 21) crates/oxc_linter/src/rules/jsx_a11y/role_supports_aria_props.rs:77— RoleSupportsAriaProps::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, loops 1 (2 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.
BranchesSharingCode::run (cognitive 21) crates/oxc_linter/src/rules/oxc/branches_sharing_code.rs:99— BranchesSharingCode::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 2 (6 pts), boolean chains 4 (nesting depth added 6). 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.
ButtonHasType::run (cognitive 21) crates/oxc_linter/src/rules/react/button_has_type.rs:88— ButtonHasType::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 10). 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.
NoArraySort::run (cognitive 21) crates/oxc_linter/src/rules/unicorn/no_array_sort.rs:90— NoArraySort::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 5, match/switch 2 (3 pts) (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.
NoSinglePromiseInPromiseMethods::run (cognitive 21) crates/oxc_linter/src/rules/unicorn/no_single_promise_in_promise_methods.rs:64— NoSinglePromiseInPromiseMethods::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), 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, 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.
PreferExportFrom::get_export_name (cognitive 21) crates/oxc_linter/src/rules/unicorn/prefer_export_from.rs:563— PreferExportFrom::get_export_name has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 pts), match/switch 2 (3 pts) (nesting depth added 9). 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.
NoSideEffectsInComputedProperties::run (cognitive 21) crates/oxc_linter/src/rules/vue/no_side_effects_in_computed_properties.rs:78— NoSideEffectsInComputedProperties::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), boolean chains 3, loops 1 (3 pts), match/switch 1 (nesting depth added 11). 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.
DiagnosticHandler::into_messages_requiring_fixes (cognitive 21) crates/oxc_linter/src/tsgolint.rs:1173— DiagnosticHandler::into_messages_requiring_fixes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2, 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.
OptionalChaining::transform_chain_element_recursion (cognitive 21) crates/oxc_transformer/src/es2020/optional_chaining.rs:447— OptionalChaining::transform_chain_element_recursion has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (19 pts), boolean chains 1, match/switch 1 (nesting depth added 9). 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.
run.writeReport (cognitive 21) apps/oxfmt/conformance/run.ts:433— run.writeReport has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 2 (7 pts) (nesting depth added 13). 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.
index.runGroup (cognitive 21) apps/oxlint/conformance/src/index.ts:245— index.runGroup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 3, loops 3 (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.
index.runAllTests (cognitive 21) apps/oxlint/conformance/src/index.ts:407— index.runAllTests has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (4 pts), ternaries 1 (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.
generate-config-types.getDefinitionPrimitiveTypes (cognitive 21) apps/oxlint/scripts/generate-config-types.ts:147— generate-config-types.getDefinitionPrimitiveTypes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, loops 3 (4 pts) (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 3 function items inside it that branch (inferPrimitiveTypes, inferPrimitiveTypes::pushType, inferDefinitionByName). 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.
FormalParameterConverter::serialize (cognitive 20) crates/oxc_ast/src/serialize/js.rs:595— FormalParameterConverter::serialize has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (20 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.
StatsCollector::handle_node (cognitive 20) crates/oxc_formatter/src/detect_code_removal/mod.rs:153— StatsCollector::handle_node has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, loops 1 (2 pts), match/switch 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.
FormatTemplateExpression::fmt (cognitive 20) crates/oxc_formatter/src/print/template/mod.rs:369— FormatTemplateExpression::fmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 4 (6 pts), 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.
FunctionReturnType::infer (cognitive 20) crates/oxc_isolated_declarations/src/return_type.rs:49— FunctionReturnType::infer has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 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.
JSDocCommentPart::parsed (cognitive 20) crates/oxc_jsdoc/src/parser/jsdoc_parts.rs:130— JSDocCommentPart::parsed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (18 pts), boolean chains 1, 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.
WorkspaceWorker::handle_tool_changes (cognitive 20) crates/oxc_language_server/src/worker.rs:307— WorkspaceWorker::handle_tool_changes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), 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.
NoShadow::is_init_pattern_node (cognitive 20) crates/oxc_linter/src/rules/eslint/no_shadow/mod.rs:531— NoShadow::is_init_pattern_node has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (6 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.
ControlHasAssociatedLabel::check_child_for_label (cognitive 20) crates/oxc_linter/src/rules/jsx_a11y/control_has_associated_label.rs:238— ControlHasAssociatedLabel::check_child_for_label has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (4 pts), boolean chains 1, match/switch 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.
MouseEventsHaveKeyEvents::run (cognitive 20) crates/oxc_linter/src/rules/jsx_a11y/mouse_events_have_key_events.rs:89— MouseEventsHaveKeyEvents::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 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.
NoNoninteractiveTabindex::run (cognitive 20) crates/oxc_linter/src/rules/jsx_a11y/no_noninteractive_tabindex.rs:99— NoNoninteractiveTabindex::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 3, match/switch 1 (2 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.
NoStaticElementInteractions::run (cognitive 20) crates/oxc_linter/src/rules/jsx_a11y/no_static_element_interactions.rs:94— NoStaticElementInteractions::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 2, 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.
NoBeforeInteractiveScriptOutsideDocument::run (cognitive 20) crates/oxc_linter/src/rules/nextjs/no_before_interactive_script_outside_document.rs:94— NoBeforeInteractiveScriptOutsideDocument::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (19 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.
SwitchCaseBraces::run (cognitive 20) crates/oxc_linter/src/rules/unicorn/switch_case_braces.rs:104— SwitchCaseBraces::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (5 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.
PreferDescribeFunctionTitle::run (cognitive 20) crates/oxc_linter/src/rules/vitest/prefer_describe_function_title.rs:76— PreferDescribeFunctionTitle::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), boolean chains 2, match/switch 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.
ModuleRecordBuilder::resolve_export_entries (cognitive 20) crates/oxc_parser/src/module_record.rs:116— ModuleRecordBuilder::resolve_export_entries has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (15 pts), if/else 3 (4 pts), loops 1 (nesting depth added 12). 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.
ReactCompilerOptions::into_plugin_options (cognitive 20) napi/transform-react/src/options.rs:332— ReactCompilerOptions::into_plugin_options has cognitive complexity 20 (threshold 15). Drivers by points: if/else 14 (18 pts), match/switch 1 (2 pts) (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.
ScopesCalculator::calculate_enum (cognitive 20) tasks/ast_tools/src/generators/scopes_collector.rs:180— ScopesCalculator::calculate_enum has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 2 (8 pts), if/else 4 (7 pts), loops 2 (5 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.
BaselineFile::parse (cognitive 20) tasks/coverage/src/typescript/meta.rs:479— BaselineFile::parse has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 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.
EarlyDivergeDetector::extract_variants_from_diverging_match_arm (cognitive 20) tasks/linter_codegen/src/early_diverge_detector.rs:66— EarlyDivergeDetector::extract_variants_from_diverging_match_arm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (5 pts), loops 1 (2 pts) (nesting depth added 10). 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.
BinaryExpressionVisitor::check_and_prepare (cognitive 19) crates/oxc_codegen/src/binary_expr_visitor.rs:156— BinaryExpressionVisitor::check_and_prepare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 6, 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.
FormatClassElementWithSemicolon::fmt (cognitive 19) crates/oxc_formatter/src/print/class.rs:625— FormatClassElementWithSemicolon::fmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, match/switch 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.
AccessorPairs::check_class_body (cognitive 19) crates/oxc_linter/src/rules/eslint/accessor_pairs.rs:203— AccessorPairs::check_class_body has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 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.
NoCompareNegZero::run (cognitive 19) crates/oxc_linter/src/rules/eslint/no_compare_neg_zero.rs:71— NoCompareNegZero::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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.
NoShadowRestrictedNames::run_once (cognitive 19) crates/oxc_linter/src/rules/eslint/no_shadow_restricted_names.rs:107— NoShadowRestrictedNames::run_once has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 3 (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.
NoThisBeforeSuper::run_once (cognitive 19) crates/oxc_linter/src/rules/eslint/no_this_before_super.rs:73— NoThisBeforeSuper::run_once has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 2, match/switch 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.
ExportsStyle::check_module_exports_references (cognitive 19) crates/oxc_linter/src/rules/node/exports_style.rs:149— ExportsStyle::check_module_exports_references has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConstComparisons::check_logical_expression_const_literal_comparison (cognitive 19) crates/oxc_linter/src/rules/oxc/const_comparisons.rs:162— ConstComparisons::check_logical_expression_const_literal_comparison has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (3 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.
JsxPascalCase::run (cognitive 19) crates/oxc_linter/src/rules/react/jsx_pascal_case.rs:120— JsxPascalCase::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 3, loops 1, 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.
NoUnknownProperty::run (cognitive 19) crates/oxc_linter/src/rules/react/no_unknown_property.rs:505— NoUnknownProperty::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 4, match/switch 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.
ConsistentTypeAssertions::run (cognitive 19) crates/oxc_linter/src/rules/typescript/consistent_type_assertions.rs:270— ConsistentTypeAssertions::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 10). 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.
PreferForOf::run (cognitive 19) crates/oxc_linter/src/rules/typescript/prefer_for_of.rs:110— PreferForOf::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16, boolean chains 2, match/switch 1. 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.
NoInvalidRemoveEventListener::run (cognitive 19) crates/oxc_linter/src/rules/unicorn/no_invalid_remove_event_listener.rs:53— NoInvalidRemoveEventListener::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 3 (5 pts) (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, 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.
RelativeUrlStyle::run (cognitive 19) crates/oxc_linter/src/rules/unicorn/relative_url_style.rs:87— RelativeUrlStyle::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (3 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.
DefineOptionsChecker::check_call (cognitive 19) crates/oxc_linter/src/rules/vue/valid_define_options.rs:119— DefineOptionsChecker::check_call has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 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.
ReactDisplayName::enter_call_expression (cognitive 19) crates/oxc_transformer/src/jsx/display_name.rs:64— ReactDisplayName::enter_call_expression has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (5 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.
TestCaseContent::make_units_from_test (cognitive 19) tasks/coverage/src/typescript/meta.rs:146— TestCaseContent::make_units_from_test has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 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.
js_config.validateConfigExtends::visit (cognitive 19) apps/oxlint/src-js/js_config.ts:35— js_config.validateConfigExtends::visit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), ternaries 2 (6 pts), 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.
write.markMapNamed (cognitive 19) packages/codegen/src-js/print/write.ts:494— write.markMapNamed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), boolean chains 6, ternaries 2 (5 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
literal.printNumericLiteral (cognitive 19) packages/codegen/src-js/print/literal.ts:88— literal.printNumericLiteral has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MethodDefinition::r#gen (cognitive 18) crates/oxc_codegen/src/gen.rs:2899— MethodDefinition::r#gen has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 1). 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.
TemplateLike::fmt (cognitive 18) crates/oxc_formatter/src/print/template/mod.rs:242— TemplateLike::fmt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 1, loops 1, match/switch 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.
ConfigStore::number_of_rules (cognitive 18) crates/oxc_linter/src/config/config_store.rs:311— ConfigStore::number_of_rules has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 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.
NoExtendNative::run_once (cognitive 18) crates/oxc_linter/src/rules/eslint/no_extend_native.rs:89— NoExtendNative::run_once has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (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.
NoMagicNumbers::is_skippable (cognitive 18) crates/oxc_linter/src/rules/eslint/no_magic_numbers.rs:466— NoMagicNumbers::is_skippable has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, boolean chains 8. 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.
PreferArrowCallback::run (cognitive 18) crates/oxc_linter/src/rules/eslint/prefer_arrow_callback.rs:91— PreferArrowCallback::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12, boolean chains 6. 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.
NoMutableExports::run (cognitive 18) crates/oxc_linter/src/rules/import/no_mutable_exports.rs:63— NoMutableExports::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 10). 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.
CheckPropertyNames::run_once (cognitive 18) crates/oxc_linter/src/rules/jsdoc/check_property_names.rs:68— CheckPropertyNames::run_once has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 pts), 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.
NoDefaults::run (cognitive 18) crates/oxc_linter/src/rules/jsdoc/no_defaults.rs:70— NoDefaults::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (4 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.
AriaRole::run (cognitive 18) crates/oxc_linter/src/rules/jsx_a11y/aria_role.rs:111— AriaRole::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 4, match/switch 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.
NoCssTags::run (cognitive 18) crates/oxc_linter/src/rules/nextjs/no_css_tags.rs:74— NoCssTags::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 1 (3 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.
NoAsyncEndpointHandlers::check_endpoint_expr (cognitive 18) crates/oxc_linter/src/rules/oxc/no_async_endpoint_handlers.rs:224— NoAsyncEndpointHandlers::check_endpoint_expr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (5 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.
IframeMissingSandbox::run (cognitive 18) crates/oxc_linter/src/rules/react/iframe_missing_sandbox.rs:101— IframeMissingSandbox::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 8). 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.
ConsistentGenericConstructors::check (cognitive 18) crates/oxc_linter/src/rules/typescript/consistent_generic_constructors.rs:122— ConsistentGenericConstructors::check has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3 (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.
ConsistentExistenceIndexCheck::run (cognitive 18) crates/oxc_linter/src/rules/unicorn/consistent_existence_index_check.rs:78— ConsistentExistenceIndexCheck::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (18 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.
NoNegationInEqualityCheck::run (cognitive 18) crates/oxc_linter/src/rules/unicorn/no_negation_in_equality_check.rs:60— NoNegationInEqualityCheck::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (16 pts), 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.
ArrowFunctionConverter::get_scope_id_from_this_affected_block (cognitive 18) crates/oxc_transformer/src/common/arrow_function_converter.rs:580— ArrowFunctionConverter::get_scope_id_from_this_affected_block has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 3, match/switch 1 (2 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.
LegacyDecoratorMetadata::serialize_union_or_intersection_constituents (cognitive 18) crates/oxc_transformer/src/decorator/legacy/metadata.rs:617— LegacyDecoratorMetadata::serialize_union_or_intersection_constituents has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
source_map.findSourceLine (cognitive 18) packages/codegen/src-js/print/source_map.ts:298— source_map.findSourceLine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 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.
write.originalNameFromSource (cognitive 18) packages/codegen/src-js/print/write.ts:653— write.originalNameFromSource has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (3 pts), boolean chains 2, 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.
expression.printArrayExpression (cognitive 18) packages/codegen/src-js/print/expression.ts:579— expression.printArrayExpression has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (13 pts), ternaries 1 (3 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.
statement.printDirectivesAndStatements (cognitive 18) packages/codegen/src-js/print/statement.ts:72— statement.printDirectivesAndStatements has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2, loops 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.
Expression::is_increment_of (cognitive 17) crates/oxc_linter/src/rules/typescript/prefer_for_of.rs:65— Expression::is_increment_of has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 9). 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.
SpanReader::read (cognitive 17) crates/oxc_diagnostics/src/source_impls.rs:364— SpanReader::read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 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.
FuncNameMatching::run (cognitive 17) crates/oxc_linter/src/rules/eslint/func_name_matching.rs:203— FuncNameMatching::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, match/switch 1 (nesting depth added 7). 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.
ValidTypeof::run (cognitive 17) crates/oxc_linter/src/rules/eslint/valid_typeof.rs:103— ValidTypeof::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 3, match/switch 2 (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.
BadMinMaxFunc::run (cognitive 17) crates/oxc_linter/src/rules/oxc/bad_min_max_func.rs:54— BadMinMaxFunc::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 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.
NoThisInExportedFunction::run (cognitive 17) crates/oxc_linter/src/rules/oxc/no_this_in_exported_function.rs:69— NoThisInExportedFunction::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 8). 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.
CatchOrReturn::is_allowed_promise_termination (cognitive 17) crates/oxc_linter/src/rules/promise/catch_or_return.rs:206— CatchOrReturn::is_allowed_promise_termination has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 6 (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.
AssignmentVisitor::check_assignment (cognitive 17) crates/oxc_linter/src/rules/typescript/no_unnecessary_parameter_property_assignment.rs:165— AssignmentVisitor::check_assignment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (16 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.
FilenameCase::run_once (cognitive 17) crates/oxc_linter/src/rules/unicorn/filename_case.rs:276— FilenameCase::run_once has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2, 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.
PreferKeyboardEventKey::check_binding_property (cognitive 17) crates/oxc_linter/src/rules/unicorn/prefer_keyboard_event_key.rs:122— PreferKeyboardEventKey::check_binding_property has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 3). 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.
RequireModuleAttributes::run (cognitive 17) crates/oxc_linter/src/rules/unicorn/require_module_attributes.rs:70— RequireModuleAttributes::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 7). 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.
NoAsyncInComputedProperties::run (cognitive 17) crates/oxc_linter/src/rules/vue/no_async_in_computed_properties.rs:131— NoAsyncInComputedProperties::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 6). 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.
RequirePropTypeConstructor::run (cognitive 17) crates/oxc_linter/src/rules/vue/require_prop_type_constructor.rs:76— RequirePropTypeConstructor::run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (nesting depth added 8). 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.
oxc_parser::lexer::number::parse_int (cognitive 17) crates/oxc_parser/src/lexer/number.rs:17— oxc_parser::lexer::number::parse_int has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 5). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
oxc_parser_napi::raw_transfer::parse_raw_impl (cognitive 17) napi/parser/src/raw_transfer.rs:193— oxc_parser_napi::raw_transfer::parse_raw_impl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 2 (5 pts), boolean chains 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.
LayoutCalculator::calculate_type (cognitive 17) tasks/ast_tools/src/generators/assert_layouts.rs:77— LayoutCalculator::calculate_type has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 1 (nesting depth added 8). 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.
CacheKeyOffsets::is_available_offset (cognitive 17) tasks/ast_tools/src/generators/raw_transfer_lazy.rs:431— CacheKeyOffsets::is_available_offset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 7). 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.
LetElseDetector::from_run_func (cognitive 17) tasks/linter_codegen/src/let_else_detector.rs:16— LetElseDetector::from_run_func has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2 (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.
scope.addGlobals (cognitive 17) apps/oxlint/src-js/plugins/scope.ts:149— scope.addGlobals has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (6 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.
stylistic.createStylisticRuleRunnerMock.run (cognitive 17) apps/oxlint/conformance/src/groups/stylistic.ts:197— stylistic.createStylisticRuleRunnerMock.run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 2, loops 2, ternaries 1 (2 pts) (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.
generate-config-types.getEnumPrimitiveType (cognitive 17) apps/oxlint/scripts/generate-config-types.ts:77— generate-config-types.getEnumPrimitiveType has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, 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.
minify.wasi-browser.__attachCleanupErrors (cognitive 17) napi/minify/minify.wasi-browser.js:175— minify.wasi-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
minify.wasi-browser.__drainWasmEnvCleanup (cognitive 17) napi/minify/minify.wasi-browser.js:710— minify.wasi-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
minify.wasip1-browser.__attachCleanupErrors (cognitive 17) napi/minify/minify.wasip1-browser.js:167— minify.wasip1-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
minify.wasip1-browser.__drainWasmEnvCleanup (cognitive 17) napi/minify/minify.wasip1-browser.js:702— minify.wasip1-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parser.wasi-browser.__attachCleanupErrors (cognitive 17) napi/parser/src-js/parser.wasi-browser.js:175— parser.wasi-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
parser.wasi-browser.__drainWasmEnvCleanup (cognitive 17) napi/parser/src-js/parser.wasi-browser.js:710— parser.wasi-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
parser.wasip1-browser.__attachCleanupErrors (cognitive 17) napi/parser/src-js/parser.wasip1-browser.js:167— parser.wasip1-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
parser.wasip1-browser.__drainWasmEnvCleanup (cognitive 17) napi/parser/src-js/parser.wasip1-browser.js:702— parser.wasip1-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
playground.wasi-browser.__attachCleanupErrors (cognitive 17) napi/playground/playground.wasi-browser.js:175— playground.wasi-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
playground.wasi-browser.__drainWasmEnvCleanup (cognitive 17) napi/playground/playground.wasi-browser.js:710— playground.wasi-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transform-react.wasi-browser.__attachCleanupErrors (cognitive 17) napi/transform-react/transform-react.wasi-browser.js:175— transform-react.wasi-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
transform-react.wasi-browser.__drainWasmEnvCleanup (cognitive 17) napi/transform-react/transform-react.wasi-browser.js:710— transform-react.wasi-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transform-react.wasip1-browser.__attachCleanupErrors (cognitive 17) napi/transform-react/transform-react.wasip1-browser.js:167— transform-react.wasip1-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
transform-react.wasip1-browser.__drainWasmEnvCleanup (cognitive 17) napi/transform-react/transform-react.wasip1-browser.js:702— transform-react.wasip1-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transform-relay.wasi-browser.__attachCleanupErrors (cognitive 17) napi/transform-relay/transform-relay.wasi-browser.js:175— transform-relay.wasi-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
transform-relay.wasi-browser.__drainWasmEnvCleanup (cognitive 17) napi/transform-relay/transform-relay.wasi-browser.js:710— transform-relay.wasi-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transform-relay.wasip1-browser.__attachCleanupErrors (cognitive 17) napi/transform-relay/transform-relay.wasip1-browser.js:167— transform-relay.wasip1-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
transform-relay.wasip1-browser.__drainWasmEnvCleanup (cognitive 17) napi/transform-relay/transform-relay.wasip1-browser.js:702— transform-relay.wasip1-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transform.wasi-browser.__attachCleanupErrors (cognitive 17) napi/transform/transform.wasi-browser.js:175— transform.wasi-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
transform.wasi-browser.__drainWasmEnvCleanup (cognitive 17) napi/transform/transform.wasi-browser.js:710— transform.wasi-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
transform.wasip1-browser.__attachCleanupErrors (cognitive 17) napi/transform/transform.wasip1-browser.js:167— transform.wasip1-browser.__attachCleanupErrors has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, error handling 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.
transform.wasip1-browser.__drainWasmEnvCleanup (cognitive 17) napi/transform/transform.wasip1-browser.js:702— transform.wasip1-browser.__drainWasmEnvCleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), error handling 2 (4 pts), boolean chains 1, loops 1, ternaries 1 (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
class.printAccessorProperty (cognitive 17) packages/codegen/src-js/print/class.ts:390— class.printAccessorProperty has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, boolean chains 7. 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.
expression.printMemberExpression (cognitive 17) packages/codegen/src-js/print/expression.ts:272— expression.printMemberExpression has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), ternaries 2 (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.
ImportExpression::gen_expr (cognitive 16) crates/oxc_codegen/src/gen.rs:2311— ImportExpression::gen_expr has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (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.
QueryCtx::resolve_ctx (cognitive 16) crates/oxc_cfg/src/builder/context.rs:143— QueryCtx::resolve_ctx has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (6 pts), loops 3 (6 pts), match/switch 2 (4 pts) (nesting depth added 9). 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.
AnyJsxTagWithChildren::fmt (cognitive 16) crates/oxc_formatter/src/print/jsx/element.rs:126— AnyJsxTagWithChildren::fmt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (6 pts), 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.
Document::propagate_expand (cognitive 16) crates/oxc_formatter_core/src/format_element/document.rs:90— Document::propagate_expand has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 2 (5 pts), loops 2 (4 pts) (nesting depth added 8). None of this is in the body itself: all 16 points belong to 2 function items inside it that branch (propagate_expands, expand_parent). 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.
ConfigStoreBuilder::from_oxlintrc::check_no_relative_js_plugins_in_extends (cognitive 16) crates/oxc_linter/src/config/config_builder.rs:117— ConfigStoreBuilder::from_oxlintrc::check_no_relative_js_plugins_in_extends has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 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.
DisableDirectives::contains (cognitive 16) crates/oxc_linter/src/disable_directives.rs:306— DisableDirectives::contains has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 2, match/switch 1 (2 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.
ArrowBodyStyle::run_for_arrow_block (cognitive 16) crates/oxc_linter/src/rules/eslint/arrow_body_style.rs:234— ArrowBodyStyle::run_for_arrow_block has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 7). 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.
GuardForIn::run (cognitive 16) crates/oxc_linter/src/rules/eslint/guard_for_in.rs:70— GuardForIn::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 2, match/switch 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.
MaxParams::run (cognitive 16) crates/oxc_linter/src/rules/eslint/max_params.rs:181— MaxParams::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 1 (nesting depth added 8). 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.
RestrictedPattern::get_group_glob_result (cognitive 16) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:918— RestrictedPattern::get_group_glob_result has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 1 (2 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.
NoUndef::run_once (cognitive 16) crates/oxc_linter/src/rules/eslint/no_undef.rs:65— NoUndef::run_once has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortImports::run_once (cognitive 16) crates/oxc_linter/src/rules/eslint/sort_imports.rs:105— SortImports::run_once has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2, 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.
PreferDefaultExport::run_once (cognitive 16) crates/oxc_linter/src/rules/import/prefer_default_export.rs:87— PreferDefaultExport::run_once has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (6 pts), boolean chains 1 (nesting depth added 6). 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.
ImplementsOnClasses::run (cognitive 16) crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs:79— ImplementsOnClasses::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, loops 2 (3 pts), match/switch 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.
RequireReturnsDescription::run (cognitive 16) crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs:53— RequireReturnsDescription::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), boolean chains 2, match/switch 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.
RoleHasRequiredAriaProps::run (cognitive 16) crates/oxc_linter/src/rules/jsx_a11y/role_has_required_aria_props.rs:66— RoleHasRequiredAriaProps::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), 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.
NoDuplicateHead::run (cognitive 16) crates/oxc_linter/src/rules/nextjs/no_duplicate_head.rs:78— NoDuplicateHead::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, 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.
NoScriptComponentInHead::run (cognitive 16) crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs:71— NoScriptComponentInHead::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), 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.
NoTitleInDocumentHead::run (cognitive 16) crates/oxc_linter/src/rules/nextjs/no_title_in_document_head.rs:69— NoTitleInDocumentHead::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 2 (3 pts), 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.
NoUnwantedPolyfillio::run (cognitive 16) crates/oxc_linter/src/rules/nextjs/no_unwanted_polyfillio.rs:76— NoUnwantedPolyfillio::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 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.
NoMapSpread::run (cognitive 16) crates/oxc_linter/src/rules/oxc/no_map_spread.rs:331— NoMapSpread::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2, boolean chains 1, 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.
NoCallbackInPromise::run (cognitive 16) crates/oxc_linter/src/rules/promise/no_callback_in_promise.rs:108— NoCallbackInPromise::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 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.
ForbidElements::run (cognitive 16) crates/oxc_linter/src/rules/react/forbid_elements.rs:136— ForbidElements::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (3 pts) (nesting depth added 9). 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.
HookUseState::run (cognitive 16) crates/oxc_linter/src/rules/react/hook_use_state.rs:93— HookUseState::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 1). 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.
SelfClosingComp::run (cognitive 16) crates/oxc_linter/src/rules/react/self_closing_comp.rs:85— SelfClosingComp::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5 (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.
SnapshotHintMode::check_expects (cognitive 16) crates/oxc_linter/src/rules/shared/jest_vitest/prefer_snapshot_hint.rs:237— SnapshotHintMode::check_expects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 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.
ExplicitTypesChecker::collect_overloaded_methods (cognitive 16) crates/oxc_linter/src/rules/typescript/explicit_module_boundary_types.rs:469— ExplicitTypesChecker::collect_overloaded_methods has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NoWrapperObjectTypes::run (cognitive 16) crates/oxc_linter/src/rules/typescript/no_wrapper_object_types.rs:62— NoWrapperObjectTypes::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 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.
NextTickStyle::run (cognitive 16) crates/oxc_linter/src/rules/vue/next_tick_style.rs:98— NextTickStyle::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (4 pts), 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.
RequirePropTypes::check_define_model (cognitive 16) crates/oxc_linter/src/rules/vue/require_prop_types.rs:113— RequirePropTypes::check_define_model has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), 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.
DiffManager::suppress_lint_diagnostics (cognitive 16) crates/oxc_linter/src/suppression/diff.rs:93— DiffManager::suppress_lint_diagnostics has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1, match/switch 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.
RuleTableSection::render_markdown_table_inner (cognitive 16) crates/oxc_linter/src/table.rs:127— RuleTableSection::render_markdown_table_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 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.
NameSymbolCollector::find_assign_binding_pattern_kind_of_specific_symbol (cognitive 16) crates/oxc_mangler/src/keep_names.rs:168— NameSymbolCollector::find_assign_binding_pattern_kind_of_specific_symbol has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 9). 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.
location.computeLoc (cognitive 16) apps/oxlint/src-js/plugins/location.ts:324— location.computeLoc has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 2 (3 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.
rule_tester.getParseOptions (cognitive 16) apps/oxlint/src-js/package/rule_tester.ts:1325— rule_tester.getParseOptions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), 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.
assignment_target.printArrayAssignmentTarget (cognitive 16) packages/codegen/src-js/print/assignment_target.ts:130— assignment_target.printArrayAssignmentTarget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, 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.
statement.printVariableDeclaration (cognitive 16) packages/codegen/src-js/print/statement.ts:338— statement.printVariableDeclaration has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 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.
D22 · Internal API Consistency· Duplicate high-level entry point. `Compiler.execute` and `CompilerInterface.compile` appear to perform the same full compilation pipeline given identical inputs. The distinction between a concrete `Compiler` type and a `CompilerInterface` trait for the primary entry point is confusing. · ×1
Duplicate high-level entry point. `Compiler.execute` and `CompilerInterface.compile` appear to perform the same full compilation pipeline given identical inputs. The distinction between a concrete `Compiler` type and a `CompilerInterface` trait for the primary entry point is confusing. — Remove `Compiler.execute` and expose only `CompilerInterface.compile`, or rename `execute` to `run` if it implies a different execution model (e.g., async vs sync), though signatures suggest they are identical. (signatures: Compiler.execute(source_text: str, source_type: SourceType, source_path: Path): Result | CompilerInterface.compile(source_text: str, source_type: SourceType, source_path: Path))
D22 · Internal API Consistency· Redundant methods with identical semantics. `contains` and `has_bit` both check for the presence of a bit. · ×1
Redundant methods with identical semantics. `contains` and `has_bit` both check for the presence of a bit. — Deprecate `has_bit` in favor of the standard `contains`. (signatures: BitSet.contains(bit: usize): bool | BitSet.has_bit(bit: usize): bool)
D22 · Internal API Consistency· Ambiguous naming convention for accessor vs consumer. `get_` usually implies borrowing, while `into_` implies consuming. However, `Expression` is likely an arena-allocated node where 'consuming' might just mean returning the owned value from the arena context. If `into_inner_expression` returns the same type as `get_inner_expression` (which it appears to, based on typical arena patterns), the naming is inconsistent with standard Rust idioms where `into_` consumes `self`. · ×1
Ambiguous naming convention for accessor vs consumer. `get_` usually implies borrowing, while `into_` implies consuming. However, `Expression` is likely an arena-allocated node where 'consuming' might just mean returning the owned value from the arena context. If `into_inner_expression` returns the same type as `get_inner_expression` (which it appears to, based on typical arena patterns), the naming is inconsistent with standard Rust idioms where `into_` consumes `self`. — Ensure `into_inner_expression` actually consumes the parent or returns a different type. If they are functionally identical, rename `get_inner_expression` to `as_inner_expression` to clarify the borrowing nature, or remove one if they are truly duplicates. (signatures: Expression.get_inner_expression(): Expression | Expression.into_inner_expression(): Expression)
D22 · Internal API Consistency· Three methods for converting an Expression to a MemberExpression. `as_` implies borrowing, `into_` implies consuming, but `to_` is ambiguous and often duplicates `as_` in non-standard libraries. · ×1
Three methods for converting an Expression to a MemberExpression. `as_` implies borrowing, `into_` implies consuming, but `to_` is ambiguous and often duplicates `as_` in non-standard libraries. — Keep `as_member_expression` (borrow) and `into_member_expression` (consume). Remove `to_member_expression` or rename it to `try_as_member_expression` if it involves a check. (signatures: Expression.as_member_expression(): MemberExpression | Expression.to_member_expression(): MemberExpression | Expression.into_member_expression(): MemberExpression)
D22 · Internal API Consistency· Duplicate accessor for MemberExpression. `get_member_expr` and `as_member_expression` likely perform the same cast/check. · ×1
Duplicate accessor for MemberExpression. `get_member_expr` and `as_member_expression` likely perform the same cast/check. — Unify under `as_member_expression`. (signatures: Expression.get_member_expr(): MemberExpression | Expression.as_member_expression(): MemberExpression)
D22 · Internal API Consistency· Inconsistent naming for mutable access. `to_member_expression_mut` returns `MemberExpression` (likely a reference), but the `to_` prefix is already inconsistent with `as_`. If `to_member_expression` borrows, `to_member_expression_mut` should borrow mutably. If `to_` implies conversion, the naming is non-standard. · ×1
Inconsistent naming for mutable access. `to_member_expression_mut` returns `MemberExpression` (likely a reference), but the `to_` prefix is already inconsistent with `as_`. If `to_member_expression` borrows, `to_member_expression_mut` should borrow mutably. If `to_` implies conversion, the naming is non-standard. — Rename to `as_member_expression` and `as_member_expression_mut`. (signatures: Expression.to_member_expression(): MemberExpression | Expression.to_member_expression_mut(): MemberExpression)
D22 · Internal API Consistency· While `Allocator` and `Arena` are distinct types, the duplication of `alloc_str` with identical signatures across the allocator module suggests a lack of trait abstraction or a copy-paste implementation that should be unified via a common trait if they share behavior. · ×1
While `Allocator` and `Arena` are distinct types, the duplication of `alloc_str` with identical signatures across the allocator module suggests a lack of trait abstraction or a copy-paste implementation that should be unified via a common trait if they share behavior. — Ensure both types implement a common `StrAllocator` trait to enforce consistency, or verify if one is deprecated. (signatures: Allocator.alloc_str(src: str): str | Arena.alloc_str(src: str): str)
Near-duplicate member pair (70 shared lines) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1158— crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1158-1246 | crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:1372-1467 — These two members are variants of one another: 70 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (56 shared lines) crates/oxc_semantic/src/builder.rs:1480— crates/oxc_semantic/src/builder.rs:1480-1542 | crates/oxc_semantic/src/builder.rs:1544-1605 — These two members are variants of one another: 56 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (55 shared lines) tasks/ast_tools/src/generators/visit.rs:342— tasks/ast_tools/src/generators/visit.rs:342-462 | tasks/ast_tools/src/generators/visit_js.rs:380-498 — These two members are variants of one another: 55 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (52 shared lines) apps/oxlint/src/js_plugins/parse.rs:130— apps/oxlint/src/js_plugins/parse.rs:130-312 | napi/parser/src/raw_transfer.rs:199-348 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (41 shared lines) crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:62— crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:62-136 | crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs:59-128 — These two members are variants of one another: 41 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (33 shared lines) crates/oxc_isolated_declarations/src/enum.rs:186— crates/oxc_isolated_declarations/src/enum.rs:186-244 | crates/oxc_semantic/src/ts_enum/eval.rs:199-253 — These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:372— crates/oxc_regular_expression/src/parser/reader/string_literal_parser/parser_impl.rs:372-404 | crates/oxc_regular_expression/src/parser/reader/template_literal_parser/parser_impl.rs:424-454 — These two members are one piece of code written twice and then edited apart: 24 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 (21 corresponding lines) · ×1
Edited copy of a member (21 corresponding lines) crates/oxc_codegen/src/gen.rs:1756— crates/oxc_codegen/src/gen.rs:1756-1850 | crates/oxc_codegen/src/gen.rs:3780-3867 — These two members are one piece of code written twice and then edited apart: 21 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) · ×1
Edited copy of a member (17 corresponding lines) crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:349— crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:349-367 | crates/oxc_linter/src/rules/unicorn/prefer_classlist_toggle.rs:376-394 — 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· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs:79— crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs:79-127 | crates/oxc_linter/src/rules/jsdoc/no_defaults.rs:70-119 | crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:92-170 | crates/oxc_linter/src/rules/jsdoc/require_param_name.rs:52-89 | crates/oxc_linter/src/rules/jsdoc/require_param_type.rs:90-179 | crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs:53-99 | crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs:52-86 — These 7 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 7 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 7 times.
Duplicated block (81 lines × 2) crates/oxc_minifier/src/traverse_context/uid.rs:156— crates/oxc_minifier/src/traverse_context/uid.rs:156-236 | crates/oxc_traverse/src/context/uid.rs:156-236 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/uid.rs` and `crates/oxc_traverse/src/context/uid.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 146 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.
Duplicated block (54 lines × 2) crates/oxc_minifier/src/traverse_context/uid.rs:253— crates/oxc_minifier/src/traverse_context/uid.rs:253-306 | crates/oxc_traverse/src/context/uid.rs:253-306 — before extracting anything, compare `crates/oxc_minifier/src/traverse_context/uid.rs` and `crates/oxc_traverse/src/context/uid.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 146 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.
Duplicated block (35–36 lines × 2) crates/oxc_semantic/src/builder.rs:1507— crates/oxc_semantic/src/builder.rs:1507-1542 | crates/oxc_semantic/src/builder.rs:1571-1605 — 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 (35 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:86— crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:86-120 | crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/nodes.rs:398-432 — 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 (33 lines × 2) crates/oxc_minifier/src/peephole/minimize_statements.rs:1973— crates/oxc_minifier/src/peephole/minimize_statements.rs:1973-2005 | crates/oxc_minifier/src/peephole/minimize_statements.rs:2023-2055 — 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 (23–32 lines × 2) crates/oxc_parser/src/lexer/mod.rs:503— crates/oxc_parser/src/lexer/mod.rs:503-534 | crates/oxc_parser/src/lexer/mod.rs:571-593 — 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 (30 lines × 2) crates/oxc_formatter/src/source_text.rs:201— crates/oxc_formatter/src/source_text.rs:201-230 | crates/oxc_formatter_json/src/comments.rs:189-218 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (23–29 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:97— crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:97-125 | crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:189-211 — 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 (29 lines × 2) crates/oxc_formatter_css/src/print/value.rs:2075— crates/oxc_formatter_css/src/print/value.rs:2075-2103 | crates/oxc_formatter_css/src/print/value.rs:2231-2259 — 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 (26–28 lines × 2) crates/oxc_linter/src/rules/eslint/no_useless_rename.rs:172— crates/oxc_linter/src/rules/eslint/no_useless_rename.rs:172-199 | crates/oxc_linter/src/rules/eslint/no_useless_rename.rs:201-226 — 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 (28 lines × 2) crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs:186— crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs:186-213 | crates/oxc_linter/src/rules/typescript/explicit_function_return_type.rs:255-282 — 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 (27–28 lines × 2) crates/oxc_linter/src/rules/unicorn/no_useless_iterator_to_array.rs:259— crates/oxc_linter/src/rules/unicorn/no_useless_iterator_to_array.rs:259-285 | crates/oxc_linter/src/rules/unicorn/no_useless_iterator_to_array.rs:302-329 — 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 (21–26 lines × 2) crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:70— crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs:70-95 | crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs:67-87 — before extracting anything, compare `crates/oxc_linter/src/rules/unicorn/no_unnecessary_array_splice_count.rs` and `crates/oxc_linter/src/rules/unicorn/no_unnecessary_slice_end.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 61 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.
Duplicated block (26 lines × 2) crates/oxc_linter/src/rules/vue/valid_define_emits.rs:156— crates/oxc_linter/src/rules/vue/valid_define_emits.rs:156-181 | crates/oxc_linter/src/rules/vue/valid_define_props.rs:156-181 — 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 (24–25 lines × 2) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:2039— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:2039-2062 | crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:2097-2121 — 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 (22–25 lines × 2) tasks/ast_tools/src/generators/visit.rs:487— tasks/ast_tools/src/generators/visit.rs:487-511 | tasks/ast_tools/src/generators/visit_js.rs:528-549 — before extracting anything, compare `tasks/ast_tools/src/generators/visit.rs` and `tasks/ast_tools/src/generators/visit_js.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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.
Duplicated block (22–23 lines × 3) REDACTED:665— REDACTED:665-687 | REDACTED:878-899 | REDACTED:1222-1243 — 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.
Duplicated block (14–23 lines × 2) crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:208— crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:208-230 | crates/oxc_linter/src/rules/eslint/grouped_accessor_pairs.rs:359-372 — 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 (19–21 lines × 2) crates/oxc_formatter/src/print/template/embed/html.rs:54— crates/oxc_formatter/src/print/template/embed/html.rs:54-72 | crates/oxc_formatter/src/print/template/embed/html.rs:113-133 — 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 (20–21 lines × 2) crates/oxc_transformer/src/es2026/explicit_resource_management.rs:821— crates/oxc_transformer/src/es2026/explicit_resource_management.rs:821-841 | crates/oxc_transformer/src/es2026/explicit_resource_management.rs:963-982 — 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 (18–20 lines × 2) apps/oxlint/src/js_plugins/parse.rs:160— apps/oxlint/src/js_plugins/parse.rs:160-177 | napi/parser/src/raw_transfer.rs:230-249 — before extracting anything, compare `apps/oxlint/src/js_plugins/parse.rs` and `napi/parser/src/raw_transfer.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 71 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.
Duplicated block (19 lines × 3) crates/oxc_linter/src/rules/vue/no_expose_after_await.rs:67— crates/oxc_linter/src/rules/vue/no_expose_after_await.rs:67-85 | crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs:92-110 | crates/oxc_linter/src/rules/vue/no_watch_after_await.rs:79-97 — before extracting anything, compare `crates/oxc_linter/src/rules/vue/no_lifecycle_after_await.rs` and `crates/oxc_linter/src/rules/vue/no_watch_after_await.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 59 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.
Duplicated block (19 lines × 2) crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:315— crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:315-333 | crates/oxc_linter/src/rules/typescript/prefer_function_type.rs:350-368 — 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–18 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:295— crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:295-312 | crates/oxc_formatter/src/formatter/jsdoc/normalize.rs:325-341 — 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 (16–18 lines × 2) crates/oxc_minifier/src/peephole/minimize_statements.rs:1362— crates/oxc_minifier/src/peephole/minimize_statements.rs:1362-1379 | crates/oxc_minifier/src/peephole/minimize_statements.rs:1419-1434 — 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 (14–18 lines × 2) crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:369— crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:369-382 | crates/oxc_regular_expression/src/parser/pattern_parser/pattern_parser_impl.rs:431-448 — 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 × 3) crates/oxc_codegen/src/gen.rs:1789— crates/oxc_codegen/src/gen.rs:1789-1805 | crates/oxc_codegen/src/gen.rs:3786-3802 | crates/oxc_codegen/src/gen.rs:3848-3864 — 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.
Duplicated block (14–16 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/wrap.rs:161— crates/oxc_formatter/src/formatter/jsdoc/wrap.rs:161-174 | crates/oxc_formatter/src/formatter/jsdoc/wrap.rs:202-217 — 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 (15–16 lines × 2) tasks/ast_tools/src/generators/visit.rs:521— tasks/ast_tools/src/generators/visit.rs:521-535 | tasks/ast_tools/src/generators/visit.rs:651-666 — 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 (12–15 lines × 4) REDACTED:690— REDACTED:690-704 | REDACTED:902-914 | REDACTED:1196-1207 | REDACTED:1246-1258 — 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.
Duplicated block (15 lines × 3) crates/oxc_transformer/src/es2026/explicit_resource_management.rs:662— crates/oxc_transformer/src/es2026/explicit_resource_management.rs:662-676 | crates/oxc_transformer/src/es2026/explicit_resource_management.rs:821-840 | crates/oxc_transformer/src/es2026/explicit_resource_management.rs:963-981 — 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.
Duplicated block (13–15 lines × 2) crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/preprocess.rs:107— crates/oxc_formatter/src/formatter/jsdoc/mdast_serialize/preprocess.rs:107-119 | crates/oxc_formatter/src/formatter/jsdoc/wrap.rs:197-211 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (12–15 lines × 2) crates/oxc_formatter/src/print/template/embed/mod.rs:338— crates/oxc_formatter/src/print/template/embed/mod.rs:338-352 | crates/oxc_formatter/src/print/template/embed/mod.rs:505-516 — 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 (11–15 lines × 2) crates/oxc_formatter_css/src/format.rs:195— crates/oxc_formatter_css/src/format.rs:195-205 | crates/oxc_formatter_markdown/src/format.rs:155-169 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (13–14 lines × 4) crates/oxc_linter/src/rules/jsdoc/no_defaults.rs:71— crates/oxc_linter/src/rules/jsdoc/no_defaults.rs:71-83 | crates/oxc_linter/src/rules/jsdoc/require_param_name.rs:53-66 | crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs:54-67 | crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs:53-66 — before extracting anything, compare `crates/oxc_linter/src/rules/jsdoc/require_param_name.rs` and `crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 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.
Duplicated block (13 lines × 3) crates/oxc_semantic/src/class/builder.rs:58— crates/oxc_semantic/src/class/builder.rs:58-70 | crates/oxc_semantic/src/class/builder.rs:78-90 | crates/oxc_semantic/src/class/builder.rs:127-139 — 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.
Duplicated block (10–13 lines × 2) crates/oxc_parser/src/lexer/source.rs:399— crates/oxc_parser/src/lexer/source.rs:399-408 | crates/oxc_parser/src/lexer/source.rs:558-570 — 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 (10–12 lines × 4) crates/oxc_linter/src/rules/shared/jest_vitest/no_alias_methods.rs:17— crates/oxc_linter/src/rules/shared/jest_vitest/no_alias_methods.rs:17-26 | crates/oxc_linter/src/rules/shared/jest_vitest/no_interpolation_in_snapshots.rs:51-60 | crates/oxc_linter/src/rules/shared/jest_vitest/prefer_comparison_matcher.rs:60-70 | crates/oxc_linter/src/rules/shared/jest_vitest/require_to_throw_message.rs:55-66 — 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 (12 lines × 4) tasks/ast_tools/src/generators/visit.rs:522— tasks/ast_tools/src/generators/visit.rs:522-533 | tasks/ast_tools/src/generators/visit.rs:653-664 | tasks/ast_tools/src/generators/visit_js.rs:567-578 | tasks/ast_tools/src/generators/visit_js.rs:697-708 — before extracting anything, compare `tasks/ast_tools/src/generators/visit.rs` and `tasks/ast_tools/src/generators/visit_js.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 128 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.
Duplicated block (12 lines × 3) crates/oxc_codegen/src/gen.rs:745— crates/oxc_codegen/src/gen.rs:745-756 | crates/oxc_codegen/src/gen.rs:3024-3035 | crates/oxc_codegen/src/gen.rs:3079-3090 — 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.
Duplicated block (10–11 lines × 4) REDACTED:679— REDACTED:679-688 | REDACTED:891-900 | REDACTED:1184-1194 | REDACTED:1235-1244 — 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.
Duplicated block (9–11 lines × 4) crates/oxc_minifier/src/peephole/remove_unused_expression.rs:327— crates/oxc_minifier/src/peephole/remove_unused_expression.rs:327-335 | crates/oxc_minifier/src/peephole/remove_unused_expression.rs:420-430 | crates/oxc_minifier/src/peephole/remove_unused_expression.rs:509-519 | crates/oxc_minifier/src/peephole/remove_unused_expression.rs:687-695 — 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.
Duplicated block (10–11 lines × 3) crates/oxc_semantic/src/builder.rs:1161— crates/oxc_semantic/src/builder.rs:1161-1170 | crates/oxc_semantic/src/builder.rs:1211-1220 | crates/oxc_semantic/src/builder.rs:1335-1345 — 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.
Duplicated block (9–11 lines × 3) crates/oxc_semantic/src/builder.rs:1222— crates/oxc_semantic/src/builder.rs:1222-1230 | crates/oxc_semantic/src/builder.rs:1352-1362 | crates/oxc_semantic/src/builder.rs:2023-2031 — 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.
Duplicated block (8–11 lines × 2) crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:976— crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:976-986 | crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs:999-1006 — 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 (10 lines × 6) crates/oxc_formatter_css/src/print/scss.rs:226— crates/oxc_formatter_css/src/print/scss.rs:226-235 | crates/oxc_formatter_css/src/print/scss.rs:284-293 | crates/oxc_formatter_css/src/print/scss.rs:598-607 | crates/oxc_formatter_css/src/print/selector.rs:452-461 | crates/oxc_formatter_css/src/print/value.rs:1751-1760 | crates/oxc_formatter_css/src/print/value.rs:2419-2428 — there are 6 copies across 3 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (8–10 lines × 3) crates/oxc_linter/src/rules/nextjs/inline_script_id.rs:113— crates/oxc_linter/src/rules/nextjs/inline_script_id.rs:113-122 | crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs:96-103 | crates/oxc_linter/src/rules/nextjs/no_title_in_document_head.rs:94-101 — before extracting anything, compare `crates/oxc_linter/src/rules/nextjs/no_script_component_in_head.rs` and `crates/oxc_linter/src/rules/nextjs/no_title_in_document_head.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 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.
Duplicated block (8–10 lines × 2) crates/oxc_linter/src/rules/typescript/consistent_generic_constructors.rs:386— crates/oxc_linter/src/rules/typescript/consistent_generic_constructors.rs:386-395 | crates/oxc_linter/src/rules/typescript/consistent_generic_constructors.rs:397-404 — 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 (9–10 lines × 2) crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1556— crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1556-1564 | crates/oxc_minifier/src/peephole/substitute_alternate_syntax.rs:1573-1582 — 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 (9 lines × 5) crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:116— crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:116-124 | crates/oxc_linter/src/rules/jsdoc/require_param_name.rs:69-77 | crates/oxc_linter/src/rules/jsdoc/require_param_type.rs:114-122 | crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs:69-77 | crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs:68-76 — before extracting anything, compare `crates/oxc_linter/src/rules/jsdoc/require_param_description.rs` and `crates/oxc_linter/src/rules/jsdoc/require_param_type.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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.
Duplicated block (8–9 lines × 3) crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:118— crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:118-126 | crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:155-163 | crates/oxc_linter/src/rules/typescript/consistent_type_definitions.rs:206-213 — 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.
Duplicated block (8–9 lines × 2) crates/oxc_linter/src/rules/eslint/constructor_super.rs:278— crates/oxc_linter/src/rules/eslint/constructor_super.rs:278-285 | crates/oxc_linter/src/rules/eslint/constructor_super.rs:313-321 — 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 × 7) crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs:92— crates/oxc_linter/src/rules/jsdoc/implements_on_classes.rs:92-98 | crates/oxc_linter/src/rules/jsdoc/no_defaults.rs:77-83 | crates/oxc_linter/src/rules/jsdoc/require_param_description.rs:106-112 | crates/oxc_linter/src/rules/jsdoc/require_param_name.rs:60-66 | crates/oxc_linter/src/rules/jsdoc/require_param_type.rs:104-110 | crates/oxc_linter/src/rules/jsdoc/require_returns_description.rs:61-67 | crates/oxc_linter/src/rules/jsdoc/require_returns_type.rs:60-66 — before extracting anything, compare `crates/oxc_linter/src/rules/jsdoc/require_param_description.rs` and `crates/oxc_linter/src/rules/jsdoc/require_param_type.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 60 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.
Duplicated block (6 lines × 5) crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:190— crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:190-195 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:344-349 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:438-443 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:600-605 | crates/oxc_linter/src/rules/eslint/no_unreachable_loop.rs:662-667 — all 5 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.
Duplicated block (5 lines × 5) tasks/ast_tools/src/parse/parse.rs:147— tasks/ast_tools/src/parse/parse.rs:147-151 | tasks/ast_tools/src/parse/parse.rs:160-164 | tasks/ast_tools/src/parse/parse.rs:173-177 | tasks/ast_tools/src/parse/parse.rs:186-190 | tasks/ast_tools/src/parse/parse.rs:199-203 — all 5 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.
Duplicated block (40 lines × 2) crates/oxc_formatter_graphql/src/options.rs:25— crates/oxc_formatter_graphql/src/options.rs:25-64 | crates/oxc_formatter_yaml/src/options.rs:49-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (7 lines × 18) crates/oxc_linter/src/rules/typescript/consistent_return.rs:63— crates/oxc_linter/src/rules/typescript/consistent_return.rs:63-69 | crates/oxc_linter/src/rules/typescript/consistent_type_exports.rs:55-61 | crates/oxc_linter/src/rules/typescript/no_confusing_void_expression.rs:78-84 | crates/oxc_linter/src/rules/typescript/no_deprecated.rs:71-77 | crates/oxc_linter/src/rules/typescript/no_duplicate_type_constituents.rs:73-79 | crates/oxc_linter/src/rules/typescript/no_meaningless_void_operator.rs:69-75 | crates/oxc_linter/src/rules/typescript/no_misused_spread.rs:75-81 | crates/oxc_linter/src/rules/typescript/no_unnecessary_boolean_literal_compare.rs:22-98 | crates/oxc_linter/src/rules/typescript/no_unnecessary_condition.rs:22-128 | crates/oxc_linter/src/rules/typescript/no_unnecessary_type_assertion.rs:76-82 | crates/oxc_linter/src/rules/typescript/no_unsafe_member_access.rs:71-77 | crates/oxc_linter/src/rules/typescript/prefer_promise_reject_errors.rs:86-92 | crates/oxc_linter/src/rules/typescript/prefer_readonly.rs:60-66 | crates/oxc_linter/src/rules/typescript/prefer_string_starts_ends_with.rs:60-66 | crates/oxc_linter/src/rules/typescript/require_array_sort_compare.rs:18-88 | crates/oxc_linter/src/rules/typescript/return_await.rs:11-115 | crates/oxc_linter/src/rules/typescript/strict_void_return.rs:56-62 | crates/oxc_linter/src/rules/typescript/unbound_method.rs:105-111 — 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 18 call sites, so a change lands once.
Duplicated block (286 lines × 2) crates/oxc_minifier/src/traverse_context/maybe_bound_identifier.rs:39— crates/oxc_minifier/src/traverse_context/maybe_bound_identifier.rs:39-324 | crates/oxc_traverse/src/context/maybe_bound_identifier.rs:39-324 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (596 lines × 2) crates/oxc_minifier/src/traverse_context/mod.rs:139— crates/oxc_minifier/src/traverse_context/mod.rs:139-734 | crates/oxc_traverse/src/context/mod.rs:131-741 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both 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 twice.
Duplicated block (15 lines × 4) crates/oxc_linter/src/rules/react_perf/jsx_no_jsx_as_prop.rs:90— crates/oxc_linter/src/rules/react_perf/jsx_no_jsx_as_prop.rs:90-104 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs:105-119 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_function_as_prop.rs:102-116 | crates/oxc_linter/src/rules/react_perf/jsx_no_new_object_as_prop.rs:106-120 — before extracting anything, compare `crates/oxc_linter/src/rules/react_perf/jsx_no_new_array_as_prop.rs` and `crates/oxc_linter/src/rules/react_perf/jsx_no_new_function_as_prop.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 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.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — apps/oxfmt/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. 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. Alternatively, commit the lcov/Cobertura report your CI produces and it is read without a re-run.
P12 · CI test-gate honesty· Coverage collected but not gated · ×1
Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
Sync-over-async blocking tasks/e2e/test/utils.ts:34— `getModules` is async and calls readFileSync — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Type Safety — 212 typed · 307 plain JS — the untyped files are apps/oxfmt/conformance/download-fixtures.js, apps/oxfmt/scripts/build.js, napi/disable-reused-workers.mjs, napi/minify/browser.js, napi/minify/minify.wasi-browser.js, napi/minify/minify.wasip1-browser.js (+301 more). 1 production file(s) opt out entirely with @ts-nocheck · 3 @ts-ignore suppression(s); the opted-out files are apps/oxlint/src-js/package/config.generated.ts.
Duplication concentrated across 6 sibling directories (11 clone groups) napi/minify/minify.wasip1-deferred.js:2— 11 of the duplicated blocks reported below have copies in at least two of the sibling directories minify, parser, playground, transform, transform-react, transform-relay under napi/. That concentration is one structural fact, not 11 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 11 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.
Wholesale file copy (745 identical lines × 5 files) napi/minify/minify.wasip1-deferred.js:2— napi/minify/minify.wasip1-deferred.js:2 · napi/parser/src-js/parser.wasip1-deferred.js:2 · napi/transform-react/transform-react.wasip1-deferred.js:2 · napi/transform-relay/transform-relay.wasip1-deferred.js:2 · +1 more site(s) not listed — these 5 files are line-for-line copies of one another — 745 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.
Duplicated block (628 lines × 5 locations) napi/minify/minify.wasip1-browser.js:10— napi/minify/minify.wasip1-browser.js:10 · napi/parser/src-js/parser.wasip1-browser.js:10 · napi/transform-react/transform-react.wasip1-browser.js:10 · napi/transform-relay/transform-relay.wasip1-browser.js:10 · +1 more site(s) not listed — the 5 copies are spread across 5 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Wholesale file copy (505 identical lines × 6 files) napi/minify/minify.wasi-browser.js:2— napi/minify/minify.wasi-browser.js:2 · napi/parser/src-js/parser.wasi-browser.js:2 · napi/playground/playground.wasi-browser.js:2 · napi/transform-react/transform-react.wasi-browser.js:2 · +2 more site(s) not listed — these 6 files are line-for-line copies of one another — 505 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 (247 matched lines × 2 locations) · ×1
Duplicated block with local edits (247 matched lines × 2 locations) apps/oxlint/src-js/plugins/tokens_methods.ts:144— apps/oxlint/src-js/plugins/tokens_methods.ts:144 · apps/oxlint/src-js/plugins/tokens_methods.ts:893 — the two spans are one implementation copied and then locally edited — 1703 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.
Wholesale file copy (236 identical lines × 2 files) npm/runtime/src/helpers/esm/regeneratorRuntime.js:2— npm/runtime/src/helpers/esm/regeneratorRuntime.js:2 · npm/runtime/src/helpers/regeneratorRuntime.js:2 — these 2 files are line-for-line copies of one another — 236 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.
Duplicated block (204 lines × 5 locations) napi/minify/minify.wasip1-browser.js:1099— napi/minify/minify.wasip1-browser.js:1099 · napi/parser/src-js/parser.wasip1-browser.js:1099 · napi/transform-react/transform-react.wasip1-browser.js:1099 · napi/transform-relay/transform-relay.wasip1-browser.js:1099 · +1 more site(s) not listed — the 5 copies are spread across 5 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 (183 matched lines × 2 locations) · ×1
Duplicated block with local edits (183 matched lines × 2 locations) apps/oxlint/src-js/plugins/comments.ts:83— apps/oxlint/src-js/plugins/comments.ts:83 · apps/oxlint/src-js/plugins/tokens.ts:154 — the two spans are one implementation copied and then locally edited — 1174 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.
Wholesale file copy (178 identical lines × 2 files) npm/runtime/src/helpers/applyDecs.js:4— npm/runtime/src/helpers/applyDecs.js:4 · npm/runtime/src/helpers/esm/applyDecs.js:4 — these 2 files are line-for-line copies of one another — 178 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 (164 identical lines × 2 files) npm/runtime/src/helpers/applyDecs2301.js:5— npm/runtime/src/helpers/applyDecs2301.js:5 · npm/runtime/src/helpers/esm/applyDecs2301.js:5 — these 2 files are line-for-line copies of one another — 164 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 (141 identical lines × 2 files) npm/runtime/src/helpers/applyDecs2203.js:2— npm/runtime/src/helpers/applyDecs2203.js:2 · npm/runtime/src/helpers/esm/applyDecs2203.js:2 — these 2 files are line-for-line copies of one another — 141 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 (140 identical lines × 2 files) npm/runtime/src/helpers/applyDecs2203R.js:4— npm/runtime/src/helpers/applyDecs2203R.js:4 · npm/runtime/src/helpers/esm/applyDecs2203R.js:4 — these 2 files are line-for-line copies of one another — 140 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 (103 identical lines × 2 files) npm/runtime/src/helpers/applyDecs2305.js:5— npm/runtime/src/helpers/applyDecs2305.js:5 · npm/runtime/src/helpers/esm/applyDecs2305.js:5 — these 2 files are line-for-line copies of one another — 103 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 (94 identical lines × 2 files) npm/runtime/src/helpers/applyDecs2311.js:5— npm/runtime/src/helpers/applyDecs2311.js:5 · npm/runtime/src/helpers/esm/applyDecs2311.js:5 — these 2 files are line-for-line copies of one another — 94 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 (91 identical lines × 6 files) napi/minify/wasi-worker.mjs:1— napi/minify/wasi-worker.mjs:1 · napi/parser/src-js/wasi-worker.mjs:1 · napi/playground/wasi-worker.mjs:1 · napi/transform-react/wasi-worker.mjs:1 · +2 more site(s) not listed — these 6 files are line-for-line copies of one another — 91 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.
Duplicated block (58 lines × 2 locations) npm/runtime/src/helpers/esm/usingCtx.js:1— npm/runtime/src/helpers/esm/usingCtx.js:1 · npm/runtime/src/helpers/usingCtx.js:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Wholesale file copy (53 identical lines × 2 files) npm/runtime/src/helpers/esm/wrapAsyncGenerator.js:2— npm/runtime/src/helpers/esm/wrapAsyncGenerator.js:2 · npm/runtime/src/helpers/wrapAsyncGenerator.js:2 — these 2 files are line-for-line copies of one another — 53 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.
Duplicated block (48 lines × 2 locations) npm/runtime/src/helpers/createForOfIteratorHelper.js:2— npm/runtime/src/helpers/createForOfIteratorHelper.js:2 · npm/runtime/src/helpers/esm/createForOfIteratorHelper.js:2 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (44 lines × 2 locations) REDACTED:7— REDACTED:7 · REDACTED:7 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (43 lines × 6 locations) napi/minify/wasi-worker-browser.mjs:9— napi/minify/wasi-worker-browser.mjs:9 · napi/parser/src-js/wasi-worker-browser.mjs:9 · napi/playground/wasi-worker-browser.mjs:9 · napi/transform-react/wasi-worker-browser.mjs:9 · +2 more site(s) not listed — the 6 copies are spread across 6 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 6 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
R10 · Code Duplication· Duplicated block with local edits (32 matched lines × 2 locations) · ×1
Duplicated block with local edits (32 matched lines × 2 locations) apps/oxfmt/src-js/cli/migration/migrate-biome.ts:256— apps/oxfmt/src-js/cli/migration/migrate-biome.ts:256 · apps/oxfmt/src-js/cli/migration/migrate-biome.ts:301 — the two spans are one implementation copied and then locally edited — 140 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.
Duplicated block (32 lines × 2 locations) npm/runtime/src/helpers/asyncIterator.js:13— npm/runtime/src/helpers/asyncIterator.js:13 · npm/runtime/src/helpers/esm/asyncIterator.js:13 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (27 lines × 2 locations) npm/runtime/src/helpers/esm/iterableToArrayLimit.js:1— npm/runtime/src/helpers/esm/iterableToArrayLimit.js:1 · npm/runtime/src/helpers/iterableToArrayLimit.js:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (26 lines × 2 locations) npm/runtime/src/helpers/esm/importDeferProxy.js:1— npm/runtime/src/helpers/esm/importDeferProxy.js:1 · npm/runtime/src/helpers/importDeferProxy.js:1 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (21 lines × 14 locations) apps/oxlint/src-js/plugins/tokens_methods.ts:117— apps/oxlint/src-js/plugins/tokens_methods.ts:117 · apps/oxlint/src-js/plugins/tokens_methods.ts:202 · apps/oxlint/src-js/plugins/tokens_methods.ts:282 · apps/oxlint/src-js/plugins/tokens_methods.ts:363 · +10 more site(s) not listed — all 14 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.
Duplicated block (19 lines × 2 locations) npm/runtime/src/helpers/esm/wrapNativeSuper.js:7— npm/runtime/src/helpers/esm/wrapNativeSuper.js:7 · npm/runtime/src/helpers/wrapNativeSuper.js:7 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
R10 · Code Duplication· Duplicated block with local edits (17 matched lines × 2 locations) · ×1
Duplicated block with local edits (17 matched lines × 2 locations) apps/oxfmt/src-js/cli/migration/migrate-biome.ts:126— apps/oxfmt/src-js/cli/migration/migrate-biome.ts:126 · apps/oxfmt/src-js/cli/migration/migrate-prettier.ts:110 — the two spans are one implementation copied and then locally edited — 76 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 (17 lines × 4 locations) apps/oxlint/src-js/plugins/tokens_methods.ts:173— apps/oxlint/src-js/plugins/tokens_methods.ts:173 · apps/oxlint/src-js/plugins/tokens_methods.ts:335 · apps/oxlint/src-js/plugins/tokens_methods.ts:498 · apps/oxlint/src-js/plugins/tokens_methods.ts:667 — all 4 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.
Complex function analyzeSelector (cyclomatic 31, cognitive 27) apps/oxlint/src-js/plugins/selector.ts:222— analyzeSelector has cyclomatic complexity 31 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.
Complex function registerPlugin (cyclomatic 25, cognitive 59) apps/oxlint/src-js/plugins/load.ts:159— registerPlugin has cyclomatic complexity 25 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.
Complex function (anonymous) (cyclomatic 25, cognitive 56) apps/oxlint/test/compile_visitor.test.ts:584— (anonymous) has cyclomatic complexity 25 and cognitive complexity 56; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function report (cyclomatic 25, cognitive 38) apps/oxlint/src-js/plugins/report.ts:105— report has cyclomatic complexity 25 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 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 runMigratePrettier (cyclomatic 23, cognitive 34) apps/oxfmt/src-js/cli/migration/migrate-prettier.ts:14— runMigratePrettier has cyclomatic complexity 23 and cognitive complexity 34; 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 getFirstToken (cyclomatic 22, cognitive 40) apps/oxlint/src-js/plugins/tokens_methods.ts:188— getFirstToken has cyclomatic complexity 22 and cognitive complexity 40; 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· napi/minify/minify.wasip1-deferred.js · ×1
napi/minify/minify.wasip1-deferred.js: 1819 lines of code napi/minify/minify.wasip1-deferred.js— napi/minify/minify.wasip1-deferred.js has 1819 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· napi/parser/src-js/parser.wasip1-deferred.js · ×1
napi/parser/src-js/parser.wasip1-deferred.js: 1819 lines of code napi/parser/src-js/parser.wasip1-deferred.js— napi/parser/src-js/parser.wasip1-deferred.js has 1819 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· napi/transform-react/transform-react.wasip1-deferred.js · ×1
napi/transform-react/transform-react.wasip1-deferred.js: 1819 lines of code napi/transform-react/transform-react.wasip1-deferred.js— napi/transform-react/transform-react.wasip1-deferred.js has 1819 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· napi/transform-relay/transform-relay.wasip1-deferred.js · ×1
napi/transform-relay/transform-relay.wasip1-deferred.js: 1819 lines of code napi/transform-relay/transform-relay.wasip1-deferred.js— napi/transform-relay/transform-relay.wasip1-deferred.js has 1819 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· napi/transform/transform.wasip1-deferred.js · ×1
napi/transform/transform.wasip1-deferred.js: 1819 lines of code napi/transform/transform.wasip1-deferred.js— napi/transform/transform.wasip1-deferred.js has 1819 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· apps/oxlint/src-js/package/rule_tester.ts · ×1
apps/oxlint/src-js/package/rule_tester.ts: 1603 lines of code apps/oxlint/src-js/package/rule_tester.ts— apps/oxlint/src-js/package/rule_tester.ts has 1603 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· apps/oxlint/src-js/plugins/tokens_methods.ts · ×1
apps/oxlint/src-js/plugins/tokens_methods.ts: 1394 lines of code apps/oxlint/src-js/plugins/tokens_methods.ts— apps/oxlint/src-js/plugins/tokens_methods.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· napi/parser/src-js/parser.wasi-browser.js · ×1
napi/parser/src-js/parser.wasi-browser.js: 1390 lines of code napi/parser/src-js/parser.wasi-browser.js— napi/parser/src-js/parser.wasi-browser.js has 1390 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· napi/transform/transform.wasi-browser.js · ×1
napi/transform/transform.wasi-browser.js: 1389 lines of code napi/transform/transform.wasi-browser.js— napi/transform/transform.wasi-browser.js has 1389 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· napi/minify/minify.wasi-browser.js · ×1
napi/minify/minify.wasi-browser.js: 1385 lines of code napi/minify/minify.wasi-browser.js— napi/minify/minify.wasi-browser.js has 1385 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· napi/transform-react/transform-react.wasi-browser.js · ×1
napi/transform-react/transform-react.wasi-browser.js: 1384 lines of code napi/transform-react/transform-react.wasi-browser.js— napi/transform-react/transform-react.wasi-browser.js has 1384 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· napi/transform-relay/transform-relay.wasi-browser.js · ×1
napi/transform-relay/transform-relay.wasi-browser.js: 1384 lines of code napi/transform-relay/transform-relay.wasi-browser.js— napi/transform-relay/transform-relay.wasi-browser.js has 1384 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· napi/parser/src-js/parser.wasip1-browser.js · ×1
napi/parser/src-js/parser.wasip1-browser.js: 1343 lines of code napi/parser/src-js/parser.wasip1-browser.js— napi/parser/src-js/parser.wasip1-browser.js has 1343 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· napi/transform/transform.wasip1-browser.js · ×1
napi/transform/transform.wasip1-browser.js: 1342 lines of code napi/transform/transform.wasip1-browser.js— napi/transform/transform.wasip1-browser.js has 1342 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· napi/minify/minify.wasip1-browser.js · ×1
napi/minify/minify.wasip1-browser.js: 1338 lines of code napi/minify/minify.wasip1-browser.js— napi/minify/minify.wasip1-browser.js has 1338 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· napi/transform-react/transform-react.wasip1-browser.js · ×1
napi/transform-react/transform-react.wasip1-browser.js: 1337 lines of code napi/transform-react/transform-react.wasip1-browser.js— napi/transform-react/transform-react.wasip1-browser.js has 1337 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· napi/transform-relay/transform-relay.wasip1-browser.js · ×1
napi/transform-relay/transform-relay.wasip1-browser.js: 1337 lines of code napi/transform-relay/transform-relay.wasip1-browser.js— napi/transform-relay/transform-relay.wasip1-browser.js has 1337 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· packages/codegen/src-js/print/typescript.ts · ×1
packages/codegen/src-js/print/typescript.ts: 1090 lines of code packages/codegen/src-js/print/typescript.ts— packages/codegen/src-js/print/typescript.ts has 1090 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· packages/codegen/src-js/print/expression.ts · ×1
packages/codegen/src-js/print/expression.ts: 899 lines of code packages/codegen/src-js/print/expression.ts— packages/codegen/src-js/print/expression.ts has 899 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· packages/codegen/src-js/print/write.ts · ×1
packages/codegen/src-js/print/write.ts: 820 lines of code packages/codegen/src-js/print/write.ts— packages/codegen/src-js/print/write.ts has 820 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· packages/codegen/src-js/print/statement.ts · ×1
packages/codegen/src-js/print/statement.ts: 728 lines of code packages/codegen/src-js/print/statement.ts— packages/codegen/src-js/print/statement.ts has 728 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· apps/oxlint/src-js/plugins/visitor.ts · ×1
apps/oxlint/src-js/plugins/visitor.ts: 702 lines of code apps/oxlint/src-js/plugins/visitor.ts— apps/oxlint/src-js/plugins/visitor.ts has 702 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· apps/oxlint/src-js/plugins/tokens.ts · ×1
apps/oxlint/src-js/plugins/tokens.ts: 547 lines of code apps/oxlint/src-js/plugins/tokens.ts— apps/oxlint/src-js/plugins/tokens.ts has 547 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· apps/oxfmt/conformance/run.ts · ×1
apps/oxfmt/conformance/run.ts: 511 lines of code apps/oxfmt/conformance/run.ts— apps/oxfmt/conformance/run.ts has 511 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· apps/oxlint/src-js/plugins/context.ts · ×1
apps/oxlint/src-js/plugins/context.ts: 505 lines of code apps/oxlint/src-js/plugins/context.ts— apps/oxlint/src-js/plugins/context.ts has 505 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· apps/oxlint/src-js/package/compat.ts · ×1
apps/oxlint/src-js/package/compat.ts: 476 lines of code apps/oxlint/src-js/package/compat.ts— apps/oxlint/src-js/package/compat.ts has 476 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· apps/oxlint/src-js/plugins/load.ts · ×1
apps/oxlint/src-js/plugins/load.ts: 434 lines of code apps/oxlint/src-js/plugins/load.ts— apps/oxlint/src-js/plugins/load.ts has 434 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· apps/oxlint/src-js/plugins/location.ts · ×1
apps/oxlint/src-js/plugins/location.ts: 421 lines of code apps/oxlint/src-js/plugins/location.ts— apps/oxlint/src-js/plugins/location.ts has 421 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· apps/oxlint/src-js/plugins/comments.ts · ×1
apps/oxlint/src-js/plugins/comments.ts: 415 lines of code apps/oxlint/src-js/plugins/comments.ts— apps/oxlint/src-js/plugins/comments.ts has 415 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· apps/oxlint/src-js/plugins/scope.ts · ×1
apps/oxlint/src-js/plugins/scope.ts: 403 lines of code apps/oxlint/src-js/plugins/scope.ts— apps/oxlint/src-js/plugins/scope.ts has 403 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R6 · Tooling· The declared test suite includes a file that cannot be loaded · ×1
The declared test suite includes a file that cannot be loaded apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups.ts— This repository declares test tooling, and the ✓ above records that declaration — but apps/oxfmt/test/cli/sort_imports/fixtures/custom_groups.ts and 49 other test file(s) in this workspace cannot be loaded at all: it imports a module that names no file in this repository, so the runner throws while collecting it and none of its cases execute. The wiring is present and the suite it points at does not run as written, which is why the tooling tick must not be read as a statement that the tests pass. Fix the unloadable file(s) — each one is reported with its failing import under Test Coverage — then the declared script exercises what it claims to.
Dead file (~1450 LoC) napi/transform/transform.wasi-browser.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1446 LoC) napi/minify/minify.wasi-browser.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1397 LoC) napi/transform/transform.wasip1-browser.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1393 LoC) napi/minify/minify.wasip1-browser.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~365 LoC) napi/parser/src-js/raw-transfer/node-array.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~73 LoC) tasks/lint_rules/src/count-implemented.mjs— no import path from any entry point (227 application, 244 tooling, 2515 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 (~48 LoC) tasks/transform_conformance/reporter.mjs— no import path from any entry point (227 application, 244 tooling, 2515 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 (~9 LoC) npm/runtime/src/helpers/esm/decorateParam.js— no import path from any entry point (227 application, 244 tooling, 2515 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 (~1 LoC) napi/parser/src-js/browser.js— no import path from any entry point (227 application, 244 tooling, 2515 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
Weak hash algorithm crates/oxc_transformer/src/jsx/refresh.rs:608— 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+ (`sha2::Sha256::digest(…)`) 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.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×1
Length read from the parsed input is spent without ever being bounded crates/oxc_linter/src/tsgolint.rs:1294— `size` is read from the bytes being parsed at line 1284 (`u32::from_le_bytes`), then used to size a `vec![…; n]` at line 1294 — and nowhere in its scope is `size` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `size` against the bytes actually remaining and a maximum the format allows before allocating.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×1
Recursive walk over a caller-supplied document has no depth cap apps/oxlint/src-js/plugins/json.ts:94— `deepCloneJsonObject` is exported and takes `obj: JsonObject` from its caller, and it calls itself at line 94 (`deepCloneJsonObject`) with a piece of `obj` — and nowhere in `deepCloneJsonObject` 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 `deepCloneJsonObject` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Interpolated log message defeats structured logging apps/oxfmt/src/api/text_to_doc_api.rs:156— `debug!` at line 156 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/api/text_to_doc_api.rs:210— `debug!` at line 210 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/core/embed/prettier_string.rs:76— `debug!` at line 76 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/core/embed/prettier_doc.rs:37— `debug!` at line 37 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/core/embed/prettier_doc.rs:73— `debug!` at line 73 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/core/embed/dispatcher.rs:328— `debug!` at line 328 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/core/embed/dispatcher.rs:338— `debug!` at line 338 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/core/embed/dispatcher.rs:354— `debug!` at line 354 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/lsp/server_formatter.rs:62— `debug!` at line 62 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/lsp/server_formatter.rs:76— `error!` at line 76 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/lsp/server_formatter.rs:383— `warn!` at line 383 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/lsp/server_formatter.rs:392— `debug!` at line 392 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/lsp/server_formatter.rs:397— `debug!` at line 397 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/lsp/server_formatter.rs:412— `debug!` at line 412 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/lsp/server_formatter.rs:420— `debug!` at line 420 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/lsp/server_formatter.rs:433— `debug!` at line 433 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxfmt/src/lsp/server_formatter.rs:448— `warn!` at line 448 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxlint/src/lsp/server_linter.rs:89— `warn!` at line 89 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxlint/src/lsp/server_linter.rs:337— `error!` at line 337 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxlint/src/lsp/server_linter.rs:452— `warn!` at line 452 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxlint/src/lsp/server_linter.rs:462— `warn!` at line 462 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxlint/src/lsp/server_linter.rs:500— `warn!` at line 500 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxlint/src/lsp/server_linter.rs:788— `debug!` at line 788 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxlint/src/lsp/server_linter.rs:793— `debug!` at line 793 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging apps/oxlint/src/lsp/server_linter.rs:802— `debug!` at line 802 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Duplicated predicate npm/runtime/src/helpers/esm/iterableToArrayLimit.js:20— `!f && null != t["return"] && (u = t["return"](), Object(u) !== u)` appears character-identically in 2 files — npm/runtime/src/helpers/esm/iterableToArrayLimit.js, npm/runtime/src/helpers/iterableToArrayLimit.js. 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 npm/runtime/src/helpers/esm/unsupportedIterableToArray.js:6— `"Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)` appears character-identically in 2 files — npm/runtime/src/helpers/esm/unsupportedIterableToArray.js, npm/runtime/src/helpers/unsupportedIterableToArray.js. 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 REDACTED:45— `"object" != _typeof(e[e.length - 1]) && (e = [].slice.call(e)).push(buildGroups(e, i))` appears character-identically in 2 files — REDACTED, 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 npm/runtime/src/helpers/esm/regeneratorRuntime.js:131— `"return" === n.method && n.abrupt("return", n.arg)` appears character-identically in 2 files — npm/runtime/src/helpers/esm/regeneratorRuntime.js, npm/runtime/src/helpers/regeneratorRuntime.js. 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 npm/runtime/src/helpers/esm/regeneratorRuntime.js:148— `"throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n…` appears character-identically in 2 files — npm/runtime/src/helpers/esm/regeneratorRuntime.js, npm/runtime/src/helpers/regeneratorRuntime.js. 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 npm/runtime/src/helpers/applyDecs2311.js:88— `("object" == _typeof(N) && N) (c = b(N.get, "accessor.get")) && (P.get = c)` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2311.js, npm/runtime/src/helpers/esm/applyDecs2311.js. 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 npm/runtime/src/helpers/applyDecs2305.js:73— `("object" == _typeof(P) && P) (y = s(P.get, "accessor.get")) && (w.get = y)` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2305.js, npm/runtime/src/helpers/esm/applyDecs2305.js. 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 npm/runtime/src/helpers/applyDecs2305.js:55— `(b) (y = s(D.call(E, P, O), "class decorators", "return")) && (P = y)` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2305.js, npm/runtime/src/helpers/esm/applyDecs2305.js. 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 npm/runtime/src/helpers/applyDecs2311.js:88— `(c = b(N.init, "accessor.init")) && k.unshift(c)` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2311.js, npm/runtime/src/helpers/esm/applyDecs2311.js. 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 npm/runtime/src/helpers/applyDecs2311.js:88— `(c = b(N.set, "accessor.set")) && (P.set = c)` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2311.js, npm/runtime/src/helpers/esm/applyDecs2311.js. 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 napi/minify/wasi-worker.mjs:48— `(workerData && typeof workerData.rootDir === 'string' && workerData.rootDir) || parse(__cwd).root` appears character-identically in 6 files — napi/minify/wasi-worker.mjs, napi/parser/src-js/wasi-worker.mjs, napi/playground/wasi-worker.mjs, napi/transform-react/wasi-worker.mjs. 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 npm/runtime/src/helpers/applyDecs2305.js:73— `(y = s(P.init, "accessor.init")) && S.push(y)` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2305.js, npm/runtime/src/helpers/esm/applyDecs2305.js. 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 npm/runtime/src/helpers/applyDecs2305.js:73— `(y = s(P.set, "accessor.set")) && (w.set = y)` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2305.js, npm/runtime/src/helpers/esm/applyDecs2305.js. 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 npm/runtime/src/helpers/applyDecs2203R.js:93— `0 !== a && (1 === a && setFunctionName(r[4], "#" + n, "set"), setFunctionName(r[3], "#" + n, u))` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2203R.js, npm/runtime/src/helpers/esm/applyDecs2203R.js. 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 npm/runtime/src/helpers/applyDecs2301.js:121— `0 !== a && (1 === a && setFunctionName(u.set, "#" + n, "set"), setFunctionName(u[f || "value"], "#" + n, f))` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2301.js, npm/runtime/src/helpers/esm/applyDecs2301.js. 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 npm/runtime/src/helpers/applyDecs.js:141— `0 !== o && (1 === o && setFunctionName(a[4], "#" + r, "set"), setFunctionName(a[3], "#" + r, u))` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs.js, npm/runtime/src/helpers/esm/applyDecs.js. 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 npm/runtime/src/helpers/createForOfIteratorHelper.js:5— `Array.isArray(r) || (t = unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length` appears character-identically in 4 files — npm/runtime/src/helpers/createForOfIteratorHelper.js, npm/runtime/src/helpers/createForOfIteratorHelperLoose.js, npm/runtime/src/helpers/esm/createForOfIteratorHelper.js, npm/runtime/src/helpers/esm/createForOfIteratorHelperLoose.js. 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 npm/runtime/src/helpers/esm/maybeArrayLike.js:3— `a && !Array.isArray(a) && "number" == typeof a.length` appears character-identically in 2 files — npm/runtime/src/helpers/esm/maybeArrayLike.js, npm/runtime/src/helpers/maybeArrayLike.js. 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 npm/runtime/src/helpers/applyDecs2311.js:74— `b(c, "class decorators", "return") && (N = c)` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs2311.js, npm/runtime/src/helpers/esm/applyDecs2311.js. 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 npm/runtime/src/helpers/esm/possibleConstructorReturn.js:4— `e && ("object" == _typeof(e) || "function" == typeof e)` appears character-identically in 2 files — npm/runtime/src/helpers/esm/possibleConstructorReturn.js, npm/runtime/src/helpers/possibleConstructorReturn.js. 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 npm/runtime/src/helpers/esm/regeneratorRuntime.js:84— `h && "object" == _typeof(h) && n.call(h, "__await")` appears character-identically in 2 files — npm/runtime/src/helpers/esm/regeneratorRuntime.js, npm/runtime/src/helpers/regeneratorRuntime.js. 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 npm/runtime/src/helpers/applyDecs.js:121— `null == (t = e.init) && (t = e.initializer) && void 0 !== console && console.warn(".initializer has been renamed to .init as of March 2022")` appears character-identically in 2 files — npm/runtime/src/helpers/applyDecs.js, npm/runtime/src/helpers/esm/applyDecs.js. 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 npm/runtime/src/helpers/esm/interopRequireWildcard.js:12— `null === e || "object" != _typeof(e) && "function" != typeof e` appears character-identically in 2 files — npm/runtime/src/helpers/esm/interopRequireWildcard.js, npm/runtime/src/helpers/interopRequireWildcard.js. 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 npm/runtime/src/helpers/esm/regeneratorRuntime.js:262— `o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc` appears character-identically in 2 files — npm/runtime/src/helpers/esm/regeneratorRuntime.js, npm/runtime/src/helpers/regeneratorRuntime.js. 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 apps/oxlint/src-js/js_config.ts:9— `typeof v === "object" && v !== null && !Array.isArray(v)` appears character-identically in 2 files — apps/oxlint/src-js/js_config.ts, apps/shared/src-js/utils.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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 100 significant file(s) lose their only recent owner: crates/oxc_data_structures/src/non_null.rs, tasks/ast_tools/src/generators/raw_transfer_lazy.rs, crates/oxc_allocator/src/arena/fixed_size/windows.rs, packages/codegen/src-js/print/write.ts, crates/oxc_allocator/src/arena/alloc_impl.rs, crates/oxc_lexer/src/pipeline/carve/jsx/mod.rs, crates/oxc_lexer/src/pipeline/keywords.rs, crates/oxc_allocator/src/arena/bumpalo_alloc.rs (+92 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 95 significant file(s) lose their only recent owner: crates/oxc_formatter_css/src/print/value.rs, crates/oxc_formatter_css/src/print/at_rule.rs, crates/oxc_formatter/src/formatter/jsdoc/serialize.rs, crates/oxc_formatter_css/src/print/scss.rs, apps/oxfmt/src/prettier_compat/to_prettier_doc.rs, crates/oxc_formatter_core/src/write/builders.rs, apps/oxfmt/src/core/oxfmtrc.rs, crates/oxc_formatter_tests/src/conformance.rs (+87 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 34 significant file(s) lose their only recent owner: crates/oxc_react_compiler/src/react_compiler_lowering/build_hir.rs, crates/oxc_react_compiler/src/diagnostics.rs, crates/oxc_react_compiler/src/react_compiler_hir/mod.rs, crates/oxc_react_compiler/src/react_compiler_validation/validate_exhaustive_dependencies.rs, crates/oxc_react_compiler/src/react_compiler_typeinference/infer_types.rs, crates/oxc_react_compiler/src/react_compiler_validation/validate_no_ref_access_in_render.rs, crates/oxc_react_compiler/src/react_compiler_lowering/hir_builder.rs, crates/oxc_diagnostics/src/source_impls.rs (+26 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 8 significant file(s) lose their only recent owner: crates/oxc_minifier/src/symbol_liveness/mod.rs, crates/oxc_minifier/src/compression_pass.rs, crates/oxc_formatter/src/utils/member_chain/simple_argument.rs, crates/oxc_formatter/src/print/jsx/opening_element.rs, crates/oxc_codegen/src/cjs_module_lexer.rs, crates/oxc_minifier/src/symbol_value.rs, crates/oxc_minifier/src/symbol_state.rs, crates/oxc_minifier/src/traverse_context/dropped_subtree_collector.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 6 significant file(s) lose their only recent owner: crates/oxc_linter/src/rules/unicorn/consistent_assert.rs, crates/oxc_linter/src/rules/react/no_react_children.rs, apps/oxlint/conformance/src/groups/storybook.ts, crates/oxc_linter/src/rules/shared/jest_vitest/prefer_to_contain.rs, apps/oxlint/conformance/src/groups/playwright.ts, crates/oxc_linter/src/rules/shared/jest_vitest/require_to_throw_message.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 5 significant file(s) lose their only recent owner: crates/oxc_linter/src/rules/eslint/no_useless_assignment.rs, crates/oxc_syntax/src/xml_entities.rs, crates/oxc_linter/src/rules/oxc/double_comparisons.rs, crates/oxc_linter/src/rules/eslint/no_unused_vars/fixers/fix_conflicts.rs, crates/oxc_ecmascript/src/string_index_of.rs. Pair on, review, or document these before any departure.
Silent fallback default in catch crates/oxc_react_compiler/fixtures/repro-nested-try-catch-in-usememo.js:14— `useFoo` 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 crates/oxc_react_compiler/fixtures/repro-preds-undefined-try-catch-return-primitive.js:12— `useSupportsTouchEvent` 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 crates/oxc_react_compiler/fixtures/try-catch-retry-after-throw.js:9— `Component` 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 on Err apps/oxlint/src/lint.rs:157— `run` turns every `Err` into `false` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
Silent fallback default on Err tasks/coverage/src/typescript/meta.rs:480— `parse` turns every `Err` into `Self::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. 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 arm or in the doc comment, and the row stops firing.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 6 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 (257 single-owned of 1822 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 1822 of the 2220 production source files in this repository met that bar). They are anonymized user #7 (2 file(s)), anonymized user #8 (2 file(s)), anonymized user #9 (2 file(s)), anonymized user #10 (1 file(s)), anonymized user #11 (1 file(s)), anonymized user #12 (1 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: crates/oxc_language_server/src/worker.rs, crates/oxc_language_server/src/worker_manager.rs, crates/oxc_minifier/src/peephole/minimize_switch_statements.rs, crates/oxc_minifier/src/is_terminated.rs, crates/oxc_linter/src/rules/vitest/no_alias_methods.rs, crates/oxc_linter/src/rules/vitest/no_test_return_statement.rs, crates/oxc_formatter/src/formatter/jsdoc/normalize.rs, crates/oxc_linter/src/rules/unicorn/no_useless_iterator_to_array.rs (+1 more).
No ADRs found — No ADRs found. The recognised ADR directories in this tree were read — `crates/oxc_transformer/src/proposals` — and none of their files is a decision record (a README, index or template page does not count). What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 11 of 72 project(s) overshoot their size bounds, lowering Project Cohesion to 6.9/10. The most over is `crates/oxc_linter` (396495 LoC, 2089 module-visible types across 38 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 12 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: crates/oxc_linter/src/suppression/mod.rs, crates/oxc_linter/src/rules/import/group_exports.rs, crates/oxc_cfg/src/dot.rs, crates/oxc_linter/src/suppression/tracking.rs, crates/oxc_linter/src/rules/jsx_a11y/no_aria_hidden_on_focusable.rs, crates/oxc_linter/src/rules/promise/prefer_catch.rs, crates/oxc_ecmascript/src/constant_evaluation/url_encoding/dec.rs, tasks/rulegen/src/util.rs (and 4 more) (14 orphaned of 1822 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 1822 of the 2220 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
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.
Logging is not universal — Only 3/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `crates/oxc_linter/fixtures/import/no-unused-modules`, `crates/oxc_linter/fixtures/import/no-unused-modules/binObject`, `tasks/ast_tools`, `tasks/compat_data`, `tasks/coverage` and 9 more.
R7 · Dead Code· Unused export 'eslintCompatPlugin' · ×1
Unused export 'eslintCompatPlugin' apps/oxlint/src-js/package/compat.ts:39— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/oxlint/src-js/plugins.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in apps/oxlint/src-js/plugins.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'defineConfig' apps/oxlint/src-js/package/config.ts:50— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/oxlint/src-js/index.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in apps/oxlint/src-js/index.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'definePlugin' apps/oxlint/src-js/package/define.ts:15— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/oxlint/src-js/plugins.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in apps/oxlint/src-js/plugins.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'defineRule' apps/oxlint/src-js/package/define.ts:27— Nothing ultimately consumes this binding: its only referrer is the re-export in apps/oxlint/src-js/plugins.ts, whose re-exported name has no consumer either. Removing it is therefore not a one-file change — drop the re-export line in apps/oxlint/src-js/plugins.ts in the same commit, or the barrel will import a name that no longer exists.
Unused export 'parse' napi/parser/src-js/raw-transfer/eager.js:37— Nothing imports this binding — it is safe to review for removal.
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 0/2 async functions that make a cancellable request (fetch, axios, ky, ofetch) 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 — 31/48 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.
Hand-rolled JSON/XML parsing via regex apps/oxlint/src/tester.rs:140— 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 Rust code already uses a real parser in the same package; use it here too.
Skipped (documented): foo apps/oxlint/fixtures/cli/eslintrc_vitest_replace/foo.test.js:1— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): (unnamed test) apps/oxlint/test/lsp/init/init.test.ts:134— Skipped with a documented reason — a deferral, not lazy debt: switched off by it.skipIf
Skipped (documented): async_identifiers napi/minify/test/terser.test.ts:183— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): async_identifiers napi/minify/test/terser.test.ts:263— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): async_shorthand_property napi/minify/test/terser.test.ts:270— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): issue_2858 napi/minify/test/terser.test.ts:770— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): try_catch_finally napi/minify/test/terser.test.ts:1082— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): throw_assignment napi/minify/test/terser.test.ts:1133— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): issue_3146_1 napi/minify/test/terser.test.ts:1715— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): issue_3146_2 napi/minify/test/terser.test.ts:1722— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): issue_3192 napi/minify/test/terser.test.ts:1743— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): hoist_funs napi/minify/test/terser.test.ts:2086— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): hoist_class napi/minify/test/terser.test.ts:2966— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): hoist_class_with_new napi/minify/test/terser.test.ts:2973— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): hoist_function_with_call napi/minify/test/terser.test.ts:2980— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): window_access_is_impure napi/minify/test/terser.test.ts:4397— Skipped with a documented reason — a deferral, not lazy debt: switched off by test.skip
Skipped (documented): %s packages/codegen/test/typescript.test.ts:48— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): %s packages/codegen/test/test262.test.ts:18— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): $name packages/codegen/test/leftmost.test.ts:383— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Skipped (documented): %s packages/codegen/test/jsx.test.ts:19— Skipped with a documented reason — a deferral, not lazy debt: skipped at run time by a this.skip()/t.skip() call
Outdated: bitflags — `bitflags` is locked at 2.13.1 but 2.13.2 is the current stable release on crates.io, and it already satisfies the `"2.13.0"` requirement declared in crates/oxc_ast/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bitflags` and commit the updated Cargo.lock.
Outdated: bpaf — `bpaf` is locked at 0.9.27 but 0.9.28 is the current stable release on crates.io, and it already satisfies the `"0.9.26"` requirement declared in apps/oxfmt/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bpaf` and commit the updated Cargo.lock.
Outdated: console — `console` is locked at 0.16.4 but 0.16.6 is the current stable release on crates.io, and it already satisfies the `"0.16.4"` requirement declared in tasks/common/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p console` and commit the updated Cargo.lock.
Outdated: encoding_rs — `encoding_rs` is locked at 0.8.35 but 0.8.42 is the current stable release on crates.io, and it already satisfies the `"0.8.35"` requirement declared in tasks/coverage/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p encoding_rs` and commit the updated Cargo.lock.
Outdated: fast-glob — `fast-glob` is locked at 1.1.1 but 1.1.2 is the current stable release on crates.io, and it already satisfies the `"1.1.1"` requirement declared in apps/oxfmt/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p fast-glob` and commit the updated Cargo.lock.
Outdated: hmac-sha1-compact — `hmac-sha1-compact` is locked at 1.1.7 but 1.1.8 is the current stable release on crates.io, and it already satisfies the `"1.1.7"` requirement declared in crates/oxc_transformer/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p hmac-sha1-compact` and commit the updated Cargo.lock.
Outdated: lazy-regex — `lazy-regex` is locked at 3.6.1 but 3.6.2 is the current stable release on crates.io, and it already satisfies the `"3.6.0"` requirement declared in crates/oxc_linter/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p lazy-regex` and commit the updated Cargo.lock.
Outdated: mimalloc-safe — `mimalloc-safe` is locked at 0.1.66 but 0.1.67 is the current stable release on crates.io, and it already satisfies the `"0.1.64"` requirement declared in apps/oxfmt/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p mimalloc-safe` and commit the updated Cargo.lock.
Outdated: serde_json — `serde_json` is locked at 1.0.151 but 1.0.154 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in apps/oxfmt/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p serde_json` and commit the updated Cargo.lock.
Outdated: smallvec — `smallvec` is locked at 1.16.0 but 1.16.3 is the current stable release on crates.io, and it already satisfies the `"1.15.2"` requirement declared in crates/oxc_codegen/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p smallvec` and commit the updated Cargo.lock.
Outdated: syn — `syn` is locked at 3.0.5 but 3.0.8 is the current stable release on crates.io, and it already satisfies the `"3"` requirement declared in crates/oxc_ast_macros/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p syn` and commit the updated Cargo.lock.
Outdated: textwrap — `textwrap` is locked at 0.16.2 but 0.16.4 is the current stable release on crates.io, and it already satisfies the `"0.16.2"` requirement declared in crates/oxc_diagnostics/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p textwrap` and commit the updated Cargo.lock.
Outdated: tokio — `tokio` is locked at 1.53.1 but 1.53.2 is the current stable release on crates.io, and it already satisfies the `"1.52.3"` requirement declared in apps/oxfmt/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated Cargo.lock.
Outdated: toml — `toml` is locked at 1.1.5+spec-1.1.0 but 1.1.8+spec-1.1.0 is the current stable release on crates.io, and it already satisfies the `"1.1.2"` requirement declared in tasks/ast_tools/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p toml` and commit the updated Cargo.lock.
Outdated: unicode-id-start — `unicode-id-start` is locked at 1.4.0 but 1.5.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in crates/oxc_regular_expression/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p unicode-id-start` and commit the updated Cargo.lock.
Outdated: ureq — `ureq` is locked at 3.4.1 but 3.4.2 is the current stable release on crates.io, and it already satisfies the `"3.3.0"` requirement declared in tasks/common/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p ureq` and commit the updated Cargo.lock.
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.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 199 file(s) — `apps/oxfmt/src-js/cli/worker-proxy.ts`, `apps/oxfmt/src-js/index.ts`, `apps/oxlint/conformance/src/groups/cypress.ts`, `apps/oxlint/conformance/src/groups/e18e.ts`, `apps/oxlint/conformance/src/groups/eslint.ts`, … (+194 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
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.
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.
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.
Run 01a12e60-8349-7d00-9cc6-6639e53e0692 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 88 · Warnings: 3300 · Recommendations: 98 · Info: 36 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 12-10-2026 @ 04:30 UTC.
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.