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

cloudflare/pingora

Measured 14 November 2026, 05:11 UTC, at code version 3f87e92

Test reliability is not measured: The suite could not be re-run, but the repository declares tests of its own unreliable.

Supply-chain provenance & signing is not measured: Supply-chain provenance is not scored (this pipeline releases no artifact), but its build steps or GitHub Actions workflows have integrity defects, or nothing watches its dependency set for published advisories.

CAI score 63out of 100 Adequate
CriticalWeakAdequateStrongExemplary
Up 3 since the last survey

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

A large codebase: 101,932 lines of product code in 24 projects, tests not counted · Estimated rebuild effort: about 1.0 person-years · Weakest lens: Security and Compliance, 50

Findings by how serious they are

19 critical 636 serious 51 minor

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

This survey was produced by

Assert small markCanine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 05:11 UTC

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

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

42of 42 dimensions measured by tools.
691of 706 findings point to an exact file and line, so you can open each one in the code. The other 15 concern the repository as a whole, such as missing documentation.
42dimensions across 6 lenses, read from 101,932 lines of product code in 24 projects.
Chapters

Executive summary

cloudflare/pingora falls short of our standard for a preview release, held back most by its Security and Compliance lens, the code's security and compliance. It scores 63 out of 100 and is rated Adequate, and 14 of its 19 critical findings are security problems.

Security and Compliance, at 50, is the weakest lens and counts most in the score. The best first step is restoring certificate checks, worth about 12 points. Recording design decisions comes next, worth about 4 points. Raising Security and Compliance to 68 would lift the score to about 71.

Nine pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Three settings leave the servers or containers unsafe, and three parts of the code are no longer understood by anyone working on it. Pinning each tool to an exact version, correcting the unsafe settings and having someone learn the forgotten files would close these risks. Limiting each secret to its own step would fix the secret exposed to more of the pipeline than needed, and switching the validation back on would deal with the security check on connections or logins switched off. The two tests the project itself marks as unreliable need fixing or deleting.

The product code is 101,932 lines, about €140,000 to rebuild.

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

How the score is built: what each lens counts for The lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Security and Compliance 50 · counts for 46%Maturity 67 · counts for 25%Production Readiness 74 · counts for 14%Code Health 86 · counts for 8%Architecture 87 · counts for 4%Performance 97 · counts for 2%

If Security and Compliance rose from 50 to 68, the lowest score rated Strong, the score would rise from 63 to about 71.

Code composition: what the lines of code are
Product code 73%Tests 27%
New since the last survey: 94 findings

These 94 critical or serious findings weren't in the previous survey, on 26 October 2026.

  • Cyclomatic Complexity · HttpProxy::buffer_request_body_early_inner (cyclomatic 17) pingora-proxy/src/lib.rs
  • Cognitive Complexity · HttpProxy::buffer_request_body_early_inner (cognitive 29) pingora-proxy/src/lib.rs
  • Cognitive Complexity · EndpointLimits::admit (cognitive 20) pingora-core/src/listeners/accept_limits.rs
  • God Classes · MethodTooLong: HttpProxy.proxy_1to1 pingora-proxy/src/proxy_h1.rs
  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) pingora-core/src/protocols/http/subrequest/server.rs
  • Code Duplication · Edited copies of one member (3 members, 66+ corresponding lines) pingora-core/src/protocols/http/v1/body.rs
  • Code Duplication · Edited copy of a member (66 corresponding lines) pingora-lru/src/persistence.rs
  • Code Duplication · Edited copies of one member (3 members, 73+ corresponding lines) pingora-proxy/src/proxy_custom.rs
  • Code Duplication · Edited copy of a member (27 corresponding lines) pingora-core/src/listeners/tls/boringssl_openssl/mod.rs
  • Code Duplication · Edited copy of a member (28 corresponding lines) pingora-proxy/src/proxy_cache.rs
  • Code Duplication · Edited copy of a member (20 corresponding lines) pingora-load-balancing/src/health_check.rs
  • Code Duplication · Edited copy of a member (20 corresponding lines) pingora-lru/src/lib.rs
  • Code Duplication · Edited copy of a member (25 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) pingora-cache/src/eviction/async_lru.rs
  • Code Duplication · Edited copy of a member (23 corresponding lines) pingora-proxy/src/proxy_custom.rs
  • Code Duplication · Edited copy of a member (24 corresponding lines) pingora-core/src/protocols/http/v1/server.rs
  • Code Duplication · Edited copies of one member (3 members, 23+ corresponding lines) pingora-core/src/protocols/http/compression/brotli.rs
  • Code Duplication · Edited copy of a member (33 corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs
  • Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) pingora-core/src/protocols/l4/stream.rs
  • Code Duplication · Edited copy of a member (19 corresponding lines) pingora-cache/src/cache_control.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs
  • Code Duplication · Edited copy of a member (16 corresponding lines) pingora-core/src/protocols/http/v2/client.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) pingora-http-parser/src/backend.rs
  • Code Duplication · Edited copy of a member (19 corresponding lines) pingora-core/src/protocols/tls/s2n/client.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) pingora-core/src/protocols/windows.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs
  • Code Duplication · Edited copy of a member (9 corresponding lines) pingora-core/src/protocols/http/v1/body.rs
  • Code Duplication · Edited copy of a member (14 corresponding lines) pingora-core/src/protocols/http/server.rs
  • Code Duplication · Edited copies of one member (6 members, 11+ corresponding lines) pingora-core/src/protocols/l4/stream.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) tinyufo/src/lib.rs
  • Code Duplication · Edited copy of a member (17 corresponding lines) pingora-proxy/src/lib.rs
  • Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) pingora-core/src/protocols/l4/stream.rs
  • Code Duplication · Edited copy of a member (10 corresponding lines) pingora-limits/src/estimator.rs
  • Code Duplication · Edited copy of a member (9 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) pingora-proxy/src/lib.rs
  • Code Duplication · Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/tls/mod.rs
  • Code Duplication · Edited copy of a member (10 corresponding lines) pingora-core/src/protocols/http/error_resp.rs
  • Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) pingora-lru/src/lib.rs
  • Code Duplication · Edited copy of a member (14 corresponding lines) pingora-core/src/protocols/l4/stream.rs
  • Code Duplication · Edited copy of a member (15 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs
  • Code Duplication · Edited copy of a member (9 corresponding lines) pingora-core/src/protocols/l4/stream.rs
  • Code Duplication · Edited copy of a member (12 corresponding lines) pingora-core/src/utils/tls/rustls.rs
  • Code Duplication · Edited copy of a member (10 corresponding lines) pingora-load-balancing/src/lib.rs
  • Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs
  • Code Duplication · Edited copy of a member (10 corresponding lines) pingora-core/src/listeners/accept_limits.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) pingora-http/src/lib.rs
  • Code Duplication · Edited copy of a member (12 corresponding lines) pingora-http/src/lib.rs
  • Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) pingora-core/src/protocols/tls/boringssl_openssl/stream.rs
  • Code Duplication · Edited copy of a member (11 corresponding lines) pingora-core/src/protocols/http/v1/body.rs
  • Code Duplication · Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs
  • Code Duplication · Edited copy of a member (11 corresponding lines) pingora-lru/src/lib.rs
  • Code Duplication · Edited copy of a member (25 corresponding lines) pingora-core/src/protocols/http/v1/client.rs
  • Code Duplication · Edited copy of a member (10 corresponding lines) pingora-core/src/protocols/http/client.rs
  • Code Duplication · Edited copies of one member (6 members, 9+ corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs
  • Code Duplication · Edited copy of a member (12 corresponding lines) pingora-core/src/listeners/mod.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) pingora-boringssl/src/ext.rs
  • Code Duplication · Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/http/server.rs
  • Code Duplication · Edited copy of a member (13 corresponding lines) pingora-core/src/protocols/l4/socket.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/server.rs
  • Code Duplication · Edited copy of a member (10 corresponding lines) pingora-core/src/protocols/http/v1/client.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/server.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/server.rs
  • Code Duplication · Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs
  • Code Duplication · Edited copy of a member (11 corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs
  • Code Duplication · Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/tls/boringssl_openssl/server.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs
  • Code Duplication · Edited copy of a member (6 corresponding lines) pingora-cache/src/eviction/async_lru.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs
  • Code Duplication · Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs
  • Code Duplication · Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/http/compression/brotli.rs
  • Code Duplication · Edited copy of a member (3 corresponding lines) pingora-core/src/server/transfer_fd/mod.rs
  • Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) pingora-core/src/protocols/tls/boringssl_openssl/client.rs
  • Code Duplication · Duplicated block (27 lines × 2) pingora-proxy/src/proxy_h1.rs
  • Code Duplication · Duplicated block (15 lines × 3) pingora-core/src/protocols/l4/stream.rs
  • Code Duplication · Duplicated block (12–13 lines × 2) pingora-core/src/listeners/tls/boringssl_openssl/mod.rs
  • Code Duplication · Duplicated block (12 lines × 2) pingora-cache/src/lib.rs
  • Code Duplication · Duplicated block (12 lines × 2) pingora-core/src/utils/tls/rustls.rs
  • Code Duplication · Duplicated block (11 lines × 2) pingora-core/src/connectors/tls/rustls/mod.rs
  • Code Duplication · Duplicated block (9 lines × 2) pingora-proxy/src/proxy_custom.rs
  • Code Duplication · Duplicated block (8 lines × 3) pingora-core/src/utils/tls/boringssl_openssl.rs
  • Code Duplication · Duplicated block (10 lines × 2) pingora-load-balancing/src/health_check.rs
  • Code Duplication · Duplicated block (7 lines × 2) pingora-proxy/src/proxy_h1.rs
  • Code Duplication · Duplicated block (9 lines × 2) pingora-cache/src/eviction/lru.rs
  • Coupling · Unstable project pingora-proxy
  • Cohesion (LCOM4) · Low cohesion: SslStream (LCOM4 4) pingora-core/src/protocols/tls/boringssl_openssl/stream.rs
  • Churn × Complexity Hotspots · Hotspot: pingora-core/src/connectors/tls/boringssl_openssl/mod.rs pingora-core/src/connectors/tls/boringssl_openssl/mod.rs
  • Explicit Debt · TodoComment pingora-core/src/protocols/tls/boringssl_openssl/coalesce.rs
  • Explicit Debt · TodoComment pingora-core/src/protocols/tls/boringssl_openssl/stream.rs
  • Explicit Debt · TodoComment pingora-core/src/protocols/tls/boringssl_openssl/stream.rs
  • Knowledge Freshness · Orphaned knowledge pingora-ketama/src/lib.rs

We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.

Fixed since the last survey: 31 findings

These 31 critical or serious findings were in the previous survey, on 26 October 2026, and are gone from this one.

  • Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) pingora-core/src/protocols/http/subrequest/server.rs
  • Code Duplication · Duplicated block (27 lines × 2) pingora-proxy/src/proxy_h1.rs
  • Code Duplication · Duplicated block (14 lines × 3) pingora-core/src/protocols/l4/stream.rs
  • Code Duplication · Duplicated block (12 lines × 2) pingora-cache/src/lib.rs
  • Code Duplication · Duplicated block (12 lines × 2) pingora-core/src/listeners/tls/boringssl_openssl/mod.rs
  • Code Duplication · Duplicated block (11 lines × 2) pingora-core/src/protocols/http/v1/body.rs
  • Code Duplication · Duplicated block (8 lines × 3) pingora-core/src/utils/tls/boringssl_openssl.rs
  • Code Duplication · Duplicated block (7 lines × 2) pingora-load-balancing/src/health_check.rs
  • Code Duplication · Duplicated block (9 lines × 2) pingora-cache/src/eviction/lru.rs
  • Secret Scanning · Leaked secret: private-key pingora-core/examples/keys/client-ca/key.pem
  • Secret Scanning · Leaked secret: private-key pingora-core/examples/keys/clients/invalid-key.pem
  • Secret Scanning · Leaked secret: private-key pingora-core/examples/keys/clients/key-1.pem
  • Secret Scanning · Leaked secret: private-key pingora-core/examples/keys/clients/key-2.pem
  • Secret Scanning · Leaked secret: private-key pingora-core/examples/keys/server/key.pem
  • Churn × Complexity Hotspots · Hotspot: pingora-core/src/protocols/http/v1/client.rs pingora-core/src/protocols/http/v1/client.rs
  • Churn × Complexity Hotspots · Hotspot: pingora-core/src/protocols/http/v1/server.rs pingora-core/src/protocols/http/v1/server.rs
  • Churn × Complexity Hotspots · Hotspot: pingora-core/src/protocols/http/v1/body.rs pingora-core/src/protocols/http/v1/body.rs
  • Churn × Complexity Hotspots · Hotspot: pingora-load-balancing/src/lib.rs pingora-load-balancing/src/lib.rs
  • Explicit Debt · TodoComment pingora-core/src/upstreams/peer.rs
  • Explicit Debt · TodoComment pingora-core/src/protocols/tls/boringssl_openssl/stream.rs
  • Explicit Debt · TodoComment pingora-core/src/protocols/http/body_buffer.rs
  • Explicit Debt · TodoComment pingora-core/src/protocols/http/body_buffer.rs
  • Explicit Debt · TodoComment pingora-core/src/protocols/http/v1/body.rs
  • Explicit Debt · TodoComment pingora-core/src/protocols/http/v1/body.rs
  • Secrets (history) · Secret: private-key pingora-core/examples/keys/client-ca/key.pem
  • Secrets (history) · Secret: private-key pingora-core/examples/keys/clients/invalid-key.pem
  • Secrets (history) · Secret: private-key pingora-core/examples/keys/clients/key-1.pem
  • Secrets (history) · Secret: private-key pingora-core/examples/keys/clients/key-2.pem
  • Secrets (history) · Secret: private-key pingora-core/examples/keys/server/key.pem
  • Web-Security Posture · TLS certificate validation disabled pingora-core/src/connectors/tls/boringssl_openssl/mod.rs
  • Web-Security Posture · TLS certificate validation disabled pingora-core/src/connectors/tls/boringssl_openssl/mod.rs
Rebuild cost: about €140,000 · Estimate
Cost to rebuild€47,000 to €240,000, for 790 to 2,505 hours of work, about 1.0 person-years for 1 to 2 engineers
Difficulty of the problemLow, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor×0.9 at a score of 63. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
SizeLarge: 101,932 lines of product code
What it is notNot a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.

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

Top priorities

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

1
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
Raises the score by about 12 points · Medium effort · Web-Security Posture
2
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Cargo.toml.
Raises the score by about 4 points · Low effort · ADR Quality
3
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.
Raises the score by about 2 points · Low effort · Static Analysis (SAST)

Diagnosis: what the measurements show together

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

Where the investment is most exposed · Value at risk
This code would cost about €140,000 to build again, about 1.0 person-years of work. Its weakest lens is Security and Compliance, at 50 (Adequate). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off. Of all the actions in this report, it raises the score most for the work it takes: about 12 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.4 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 60,099 lines over the last 90 days, which is about 243,735 lines a year. At that pace, the extra work comes to an estimated 12.2 to 81.2 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of our own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.

Architecture — module dependency graph

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

arch TinyUFO TinyUFO pingora pingora pingora-cache pingora-cache pingora->pingora-cache pingora-core pingora-core pingora->pingora-core pingora-http pingora-http pingora->pingora-http pingora-load-balancing pingora-load-balancing pingora->pingora-load-balancing pingora-proxy pingora-proxy pingora->pingora-proxy pingora-timeout pingora-timeout pingora->pingora-timeout pingora-boringssl pingora-boringssl pingora-cache->pingora-core pingora-error pingora-error pingora-cache->pingora-error pingora-header-serde pingora-header-serde pingora-cache->pingora-header-serde pingora-cache->pingora-http pingora-http-parser pingora-http-parser pingora-cache->pingora-http-parser pingora-lru pingora-lru pingora-cache->pingora-lru pingora-cache->pingora-timeout pingora-core->pingora-boringssl pingora-core->pingora-error pingora-core->pingora-http pingora-core->pingora-http-parser pingora-pool pingora-pool pingora-core->pingora-pool pingora-runtime pingora-runtime pingora-core->pingora-runtime pingora-rustls pingora-rustls pingora-core->pingora-rustls pingora-s2n pingora-s2n pingora-core->pingora-s2n pingora-core->pingora-timeout pingora-foundations pingora-foundations pingora-foundations->pingora-core pingora-header-serde->pingora-error pingora-header-serde->pingora-http pingora-header-serde->pingora-http-parser pingora-http->pingora-error pingora-http->pingora-http-parser pingora-ketama pingora-ketama pingora-load-balancing->pingora-core pingora-load-balancing->pingora-error pingora-load-balancing->pingora-http pingora-load-balancing->pingora-ketama pingora-load-balancing->pingora-runtime pingora-memory-cache pingora-memory-cache pingora-memory-cache->TinyUFO pingora-memory-cache->pingora-error pingora-memory-cache->pingora-timeout pingora-pool->pingora-timeout pingora-proxy->pingora-cache pingora-proxy->pingora-core pingora-proxy->pingora-error pingora-proxy->pingora-http pingora-proxy->pingora-timeout pingora-rustls->pingora-error pingora-s2n->pingora-error __more__ +4 more projects

Architecture: which parts of the code depend on which

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

177 modules, with 402 dependencies between them. 7 loops run through 20 of the modules, marked above the diagonal.

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

Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
uses →1 pingora_cache.key2 pingora_core.protocols.http3 pingora_core.protocols.tls4 pingora_core.server.configuration5 pingora_error6 pingora_http7 pingora_http_parser8 pingora_cache.lock9 pingora_cache.meta10 pingora_core.connectors.tls.rustls11 pingora_core.listeners.tls.boringssl_openssl12 pingora_core.protocols.http.compression13 pingora_core.protocols.l4.ext14 pingora_cache.storage15 pingora_core.upstreams.peer16 pingora_cache17 pingora_core.protocols.l4.stream18 pingora_cache.put19 pingora_core.protocols.raw_connect20 pingora_proxy.proxy_common21 pingora_core.protocols.digest22 pingora_core.protocols23 pingora_core.protocols.l4.socket24 pingora_core.protocols.tls.boringssl_openssl.stream25 pingora_core.protocols.tls.rustls.stream26 pingora_core.connectors27 pingora_core.listeners28 pingora_core.protocols.http.subrequest.server29 pingora_core.protocols.http.v1.client30 pingora_core.protocols.http.v2.client31 pingora_core.protocols.tls.s2n.stream32 pingora_load_balancing33 pingora_core.connectors.http.v234 pingora_core.protocols.http.client35 pingora_core.protocols.http.v1.server36 pingora_core.services.listening37 pingora_core.protocols.http.v2.server38 pingora_proxy39 pingora_core.protocols.http.server40 pingora_proxy.proxy_trait
1 pingora_cache.key
2 pingora_core.protocols.http
3 pingora_core.protocols.tls
4 pingora_core.server.configuration
5 pingora_error
6 pingora_http
7 pingora_http_parser
8 pingora_cache.lock2
9 pingora_cache.meta31
10 pingora_core.connectors.tls.rustls12
11 pingora_core.listeners.tls.boringssl_openssl11
12 pingora_core.protocols.http.compression13
13 pingora_core.protocols.l4.ext23
14 pingora_cache.storage31
15 pingora_core.upstreams.peer223
16 pingora_cache31631
17 pingora_core.protocols.l4.stream411154
18 pingora_cache.put12221
19 pingora_core.protocols.raw_connect131
20 pingora_proxy.proxy_common11212
21 pingora_core.protocols.digest121
22 pingora_core.protocols13
23 pingora_core.protocols.l4.socket2
24 pingora_core.protocols.tls.boringssl_openssl.stream11154
25 pingora_core.protocols.tls.rustls.stream11222104
26 pingora_core.connectors211122
27 pingora_core.listeners15343
28 pingora_core.protocols.http.subrequest.server11311
29 pingora_core.protocols.http.v1.client321111
30 pingora_core.protocols.http.v2.client33111
31 pingora_core.protocols.tls.s2n.stream121541
32 pingora_load_balancing1
33 pingora_core.connectors.http.v211221
34 pingora_core.protocols.http.client221111
35 pingora_core.protocols.http.v1.server1311111
36 pingora_core.services.listening113
37 pingora_core.protocols.http.v2.server1231211
38 pingora_proxy23241112232152
39 pingora_core.protocols.http.server11212111
40 pingora_proxy.proxy_trait1211111
Uses a module listed above itPart of a loopThe module itself
1 pingora_cache.key2 pingora_core.protocols.http3 pingora_core.protocols.tls4 pingora_core.server.configuration5 pingora_error6 pingora_http7 pingora_http_parser8 pingora_cache.lock9 pingora_cache.meta10 pingora_core.connectors.tls.rustls11 pingora_core.listeners.tls.boringssl_openssl12 pingora_core.protocols.http.compression13 pingora_core.protocols.l4.ext14 pingora_cache.storage15 pingora_core.upstreams.peer16 pingora_cache17 pingora_core.protocols.l4.stream18 pingora_cache.put19 pingora_core.protocols.raw_connect20 pingora_proxy.proxy_common21 pingora_core.protocols.digest22 pingora_core.protocols23 pingora_core.protocols.l4.socket24 pingora_core.protocols.tls.boringssl_openssl.stream25 pingora_core.protocols.tls.rustls.stream26 pingora_core.connectors27 pingora_core.listeners28 pingora_core.protocols.http.subrequest.server29 pingora_core.protocols.http.v1.client30 pingora_core.protocols.http.v2.client31 pingora_core.protocols.tls.s2n.stream32 pingora_load_balancing33 pingora_core.connectors.http.v234 pingora_core.protocols.http.client35 pingora_core.protocols.http.v1.server36 pingora_core.services.listening37 pingora_core.protocols.http.v2.server38 pingora_proxy39 pingora_core.protocols.http.server40 pingora_proxy.proxy_traitpingora_cache.key1pingora_core.protocols.http2pingora_core.protocols.tls3pingora_core.server.configuration4pingora_error5pingora_http6pingora_http_parser7pingora_cache.lock8pingora_cache.meta9pingora_core.connectors.tls.rustls10pingora_core.listeners.tls.boringssl_openssl11pingora_core.protocols.http.compression12pingora_core.protocols.l4.ext13pingora_cache.storage14pingora_core.upstreams.peer15pingora_cache16pingora_core.protocols.l4.stream17pingora_cache.put18pingora_core.protocols.raw_connect19pingora_proxy.proxy_common20pingora_core.protocols.digest21pingora_core.protocols22pingora_core.protocols.l4.socket23pingora_core.protocols.tls.boringssl_openssl.stream24pingora_core.protocols.tls.rustls.stream25pingora_core.connectors26pingora_core.listeners27pingora_core.protocols.http.subrequest.server28pingora_core.protocols.http.v1.client29pingora_core.protocols.http.v2.client30pingora_core.protocols.tls.s2n.stream31pingora_load_balancing32pingora_core.connectors.http.v233pingora_core.protocols.http.client34pingora_core.protocols.http.v1.server35pingora_core.services.listening36pingora_core.protocols.http.v2.server37pingora_proxy38pingora_core.protocols.http.server39pingora_proxy.proxy_trait40231121113233122331631411154122211311121212113211154112221042111221534311311321111331111215411112212211111311111113123121123241112232152112121111211111+137 more modules (most-connected shown)

At a glance — Code Health · 86% · Strong ·

At a glance — Architecture · 87% · Strong ·

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

At a glance — Readiness · 74% · Strong ·

At a glance — Security · 50% · Adequate · gated by S1 ·

At a glance — Performance · 97% · Exemplary ·

Security & Compliance — OWASP Top-10 mapping

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

OWASP categoryFindingsSeverity
A05:2025 — Injection10High / Critical
A02:2025 — Security Misconfiguration6High / Critical
A01:2025 — Broken Access Control1Medium

Roadmap

Top priorities: Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Cargo.toml; Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.

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

Do thisHelpsEffortDimension
Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.+11.7 ptsMediumWeb-Security Posture
Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Cargo.toml.+3.9 ptsLowADR Quality
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED.+2.3 ptsLowStatic Analysis (SAST)
Resolve the 3 High IaC finding(s) in IaC & Container Security — start with REDACTED (3).+2.3 ptsLowIaC & Container Security
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.+3.4 ptsMediumArchitecture documentation
Resolve the 3 Orphaned knowledge finding(s) in Knowledge Freshness — start with lib.rs (2), read_through.rs.+1.7 ptsLowKnowledge Freshness
Resolve the 1 REDACTED finding(s) in Data Compliance (PII/GDPR) — start with REDACTED.+1.1 ptsLowData Compliance (PII/GDPR)
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.+1.8 ptsMediumDocumentation (README)

File quality

Per-file score 0–10 — a quality signature. Of 115 files carrying findings, judged against the Preview bar: 1% slop · 50% mixed · 49% near-clean.

FileScoreBandWorst signal
REDACTED1.3SlopIaC & Container Security: High IaC: REDACTED
REDACTED3.7MixedStatic Analysis (SAST): High: REDACTED
REDACTED3.7MixedStatic Analysis (SAST): High: REDACTED
REDACTED5.1MixedStatic Analysis (SAST): High: REDACTED
pingora-proxy/tests/test_upstream.rs5.2MixedTest Reliability: Test declared unreliable: test_caching_when_downstream_stalls
REDACTED5.8MixedStatic Analysis (SAST): High: REDACTED
pingora-proxy/src/proxy_custom.rs6.0MixedExplicit Debt: TodoComment
pingora-proxy/src/proxy_h2.rs6.0MixedExplicit Debt: TodoComment
pingora-proxy/src/proxy_h1.rs6.0MixedExplicit Debt: TodoComment
pingora-proxy/src/proxy_cache.rs6.0MixedExplicit Debt: TodoComment
pingora-proxy/src/subrequest/pipe.rs6.0MixedExplicit Debt: TodoComment
pingora-core/src/protocols/http/subrequest/server.rs6.0MixedExplicit Debt: TodoComment
pingora-proxy/src/lib.rs6.0MixedExplicit Debt: TodoComment
pingora-core/src/protocols/http/v1/client.rs6.0MixedExplicit Debt: TodoComment
pingora-core/src/protocols/http/v1/server.rs6.0MixedExplicit Debt: TodoComment
pingora-core/src/connectors/tls/rustls/mod.rs6.0MixedExplicit Debt: TodoComment
pingora-core/src/server/mod.rs6.0MixedExplicit Debt: TodoComment
pingora-core/src/connectors/tls/boringssl_openssl/mod.rs6.0MixedExplicit Debt: TodoComment
pingora-core/src/connectors/l4.rs6.0MixedExplicit Debt: TodoComment
pingora-load-balancing/src/background.rs6.0MixedExplicit Debt: TodoComment

How the grades work

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

Critical — 19

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

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

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

Could not be resolved — 23

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

Methodology & how to trust this report

This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 42 evaluated dimensions are computed by tools and static analysis; no language model sets or judges any of them. Overall confidence is 0.8, the weighted average across measured dimensions.

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

What we checked — 42 dimensions across the health lenses
D1D2D3D4D5D6D13D14D15D16D17D19D20D26D28D29D31D32D34D35AX10AX3AX5AX9M1M2M3M4P1P10P2P3P4P6PF1PF3S1X1X14X21X28X30

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

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

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

Tools & methods

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

MethodBacksVersionEvaluator
Roslyn static analysisComplexity, cohesion, coupling, dead code, API surface, layering5.3.0✓ deterministic
Native secret scannerHardcoded secrets / credentials1.0.0✓ deterministic
Canine Code Analyzer duplication detector (in-process)Code duplication1.0.0✓ deterministic
Coverage (coverlet / dotnet-coverage)Line & branch coverage10.0.400✓ deterministic
NuGet / dotnetOutdated, vulnerable & deprecated dependencies10.0.400✓ deterministic
git / LibGit2SharpChurn hotspots, knowledge concentration, history2.43.0 · 0.31.0✓ deterministic
gitleaks · semgrep · trivy · checkovSecrets in history, SAST, CVEs, IaC & container, PII / GDPR1.86.0 · 0.69.3 · 3.2.533✓ deterministic

Every finding is locatable in findings.md. Run 01a1d878-306f-72e0-b24f-7f05dd2984c2.

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

Run transparency — what happened this run

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

  • D8 Code Coverage — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in repository root did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo.
  • D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This repository declares 2 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.rs), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • D12 Dependency Hygiene — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Not scored — 100 direct Cargo declaration(s) were read, but the outdated signal needs crates.io, and no committed Cargo.lock resolves them to versions, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
  • D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
  • D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
  • D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
  • D24 Comment Value — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
  • D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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.
  • D44 Platform End-of-Life — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a REDACTED) is simply not read here yet.
  • AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — openresty.org/package/arm64/debian\"; else URL=\"http://openresty.org/package/debian\"; fi && echo \"deb [arch=$BUILDARCH signed-by=/usr/share/keyrings/openresty.gpg] ${URL} $(lsb_release -sc) openresty\" | tee /etc/apt/sources.list.d/openresty.list > /dev/null && apt-get -qq update && apt-get -qq install -y openresty --no-install-recommends" did not complete successfully: exit code: 2; runtime evidence skipped.
  • GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and no C#, F#, JavaScript/TypeScript, Dart, Ruby or Scala was found, and this repository's Rust 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 — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and no C#, JavaScript/TypeScript, Java, Dart, Ruby or Scala was found, and this repository's Rust 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.
  • M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
  • 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.
  • X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin 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.
  • X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin 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.
  • X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Java, PHP, Dart, Ruby, Scala or Kotlin 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.
  • X17 Uncapped recursion over a caller-supplied document — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Python, Dart, Ruby, Scala and Kotlin source only, and no C# was loaded and no JavaScript/TypeScript, Python, Dart, Ruby, Scala or Kotlin 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.
  • X18 Disposal-pattern correctness — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Dart, Ruby, Scala or PHP 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.
  • X19 Unrestored process-global state — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Python, Dart, Ruby, Scala and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Python, Dart, Ruby, Scala or PHP 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.
  • X22 Contradicted release guard — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and Java, TypeScript/JavaScript, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded, and this repository's Rust 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.
  • X23 Unguarded diagnostic materialisation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin and PHP source only, and no C# was loaded and no JavaScript/TypeScript, Java, F#, Python, Dart, Ruby, Scala, Kotlin or PHP 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.
  • X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Scala, Ruby and Python source only, and no C# was loaded and no JavaScript/TypeScript, Java, Scala, Ruby or Python 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.
  • X25 Inert configuration knob — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart and Ruby source only, and no C# was loaded and no JavaScript/TypeScript, Java, Kotlin, Scala, PHP, Erlang, Python, Dart or Ruby was found in this repository, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
  • X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, and PHP, Java, Kotlin, Python, Ruby, Scala, Dart, Swift, Erlang, Go and JavaScript/TypeScript source only, and no C# was loaded and no PHP, Java, Kotlin, Python, Ruby, Scala, Dart, Swift, Erlang, Go, JavaScript or TypeScript 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.
  • X5 Nullable reference types — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax and MSBuild project configuration, TypeScript source and its tsconfig files, Java source and its package and module declarations, PHP source and its PHPStan and Psalm configuration, Dart source and its pubspec language version, Ruby source and its Sorbet and Steep configuration, Scala source and its build's explicit-nulls, WartRemover and Scalafix settings, and Kotlin source only, and no C# was loaded, no TypeScript was found, and this repository's Rust 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.

Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.

Limitations & what we did not check

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

Per-dimension blind spots

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

  • D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
  • D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
  • D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
  • D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
  • D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
  • D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
  • D13 Secret Scanning: Secret detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
  • D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
  • D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
  • D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
  • D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
  • D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
  • D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
  • 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").
  • D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
  • D32 Data Compliance (PII/GDPR): PII/GDPR signals are heuristic pattern matches in code — they flag likely handling concerns, not legal compliance, and cannot trace where data actually flows at runtime.
  • D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
  • D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
  • 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: Documentation accuracy checks links, versions and artefact counts against the tree: other claims (paths, commands, settings, routes) are read but not checked, and it cannot run the onboarding or measure how long a real new joiner takes.
  • P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
  • 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.

Dimensions

D1 · Cyclomatic Complexity6.3 / 10Adequate✓ Tool-verified

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

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

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

32 function(s) exceeded the cyclomatic complexity threshold of 15; the worst was HttpProxy::custom_bidirection_down_to_up at 77. A further 1 function(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 ErrorType::as_str at 32 — they are counted neither in the figure above nor in this dimension's score. 1 file carries no cyclomatic complexity row at all for this reason — every one of its over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: pingora-error/src/lib.rs (ErrorType::as_str at 32). 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.

HttpProxy::custom_bidirection_down_to_up (cyclomatic 77) · ×15pingora-proxy/src/proxy_custom.rs:539
HttpSession::write_proxy_tasks (cyclomatic 40) · ×5pingora-core/src/protocols/http/subrequest/server.rs:920
pingora_proxy::subrequest::pipe::pipe_subrequest (cyclomatic 41) · ×4pingora-proxy/src/subrequest/pipe.rs:205
pingora_core::connectors::tls::rustls::connect (cyclomatic 21) · ×3pingora-core/src/connectors/tls/rustls/mod.rs:129
Server::run (cyclomatic 20)pingora-core/src/server/mod.rs:692

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

What to do

  1. Bring the 32 bodies over 15 down to 15 or less in Cyclomatic Complexity — start with HttpProxy::custom_bidirection_down_to_up (cyclomatic 77), HttpProxy::bidirection_down_to_up (cyclomatic 67), HttpProxy::proxy_handle_downstream (cyclomatic 64). — 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 32 together lifts Cyclomatic Complexity from 6.3 to about 10.0/10, projected with the scoring formula itself and assuming each lands exactly at 15.

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

D2 · Cognitive Complexity5.3 / 10Adequate✓ Tool-verified

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

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

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

75 function(s) exceeded the cognitive complexity threshold of 15; the worst was HttpProxy::custom_bidirection_down_to_up at 187.

HttpProxy::custom_bidirection_down_to_up (cognitive 187) · ×20pingora-proxy/src/proxy_custom.rs:539
pingora_core::connectors::l4::connect (cognitive 46) · ×10pingora-core/src/connectors/l4.rs:108
HttpSession::write_proxy_tasks (cognitive 81) · ×9pingora-core/src/protocols/http/subrequest/server.rs:920
pingora_proxy::subrequest::pipe::pipe_subrequest (cognitive 74) · ×5pingora-proxy/src/subrequest/pipe.rs:205
BodyReader::do_read_chunked_body (cognitive 50) · ×4pingora-core/src/protocols/http/v1/body.rs:515

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

What to do

  1. Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with HttpProxy::custom_bidirection_down_to_up (cognitive 187), HttpProxy::bidirection_down_to_up (cognitive 174), HttpProxy::proxy_handle_downstream (cognitive 158). — 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 3 together lifts Cognitive Complexity from 5.4 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.

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

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

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

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

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

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

FileTooLong: src/lib.rs · ×19pingora-proxy/src/lib.rs
MethodTooLong: HttpProxy.custom_bidirection_down_to_up · ×18pingora-proxy/src/proxy_custom.rs:539
TooManyMethods: HttpSession · ×12pingora-core/src/protocols/http/v1/server.rs:80
ClassTooLong: HttpCache · ×9pingora-cache/src/lib.rs:71
FunctionTooLong: pingora_proxy::subrequest::pipe::pipe_subrequest · ×4pingora-proxy/src/subrequest/pipe.rs:205

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

What to do

  1. Resolve the 19 FileTooLong finding(s) in God Classes — start with lib.rs (5), server.rs (3), proxy_cache.rs. — One of this dimension's main actionable groups (19 warning-level).
  2. Resolve the 18 MethodTooLong finding(s) in God Classes — start with proxy_custom.rs (3), proxy_h2.rs (3), proxy_h1.rs (3). — One of this dimension's main actionable groups (18 warning-level).
  3. Resolve the 12 TooManyMethods finding(s) in God Classes — start with lib.rs (5), server.rs (4), client.rs. — One of this dimension's main actionable groups (12 warning-level).

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

D4 · Code Duplication8.3 / 10Strong✓ Tool-verified

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

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

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

89 duplicated block group(s) detected. 4.3 % of the production lines (4,378 of 101,932) are in a reported copy. A further 74 rows report members as variants of one another; the share counts each copied line once, however many rows cite it.

Edited copy of a member (7 corresponding lines) · ×10pingora-core/src/protocols/http/server.rs:598
Duplicated block (7 lines × 2) · ×10pingora-proxy/src/proxy_h1.rs:93
Edited copy of a member (10 corresponding lines) · ×6pingora-limits/src/estimator.rs:45
Edited copy of a member (8 corresponding lines) · ×6pingora-core/src/protocols/tls/mod.rs:185
Duplicated block (12 lines × 2) · ×6pingora-cache/src/lib.rs:613

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

What to do

  1. Resolve the 10 Edited copy of a member (7 corresponding lines) finding(s) in Code Duplication — start with client.rs (7), server.rs (3). — One of this dimension's main actionable groups (10 warning-level).
  2. Resolve the 10 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with stream.rs (5), proxy_h1.rs, mod.rs. — One of this dimension's main actionable groups (10 warning-level).
  3. Resolve the 6 Edited copy of a member (10 corresponding lines) finding(s) in Code Duplication — start with client.rs (2), estimator.rs, error_resp.rs. — One of this dimension's main actionable groups (6 warning-level).

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

D5 · Coupling6.8 / 10Adequate✓ Tool-verified

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

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

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

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

24 production modules (Cargo), 0 dependency cycle(s), 2 unstable depended-on module(s). Read from the build's own module declarations; 7 module(s) off the main sequence, with abstractness counted on 21 of the 24 (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: TinyUFO · ×7
Unstable project pingora-load-balancing
Unstable project pingora-proxy

What to do

  1. Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 warning-level).
  2. Resolve the 1 Unstable project pingora-load-balancing finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
  3. Resolve the 1 Unstable project pingora-proxy finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).

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

D6 · Cohesion (LCOM4)9.8 / 10Stronggated by 3 serious findings✓ Tool-verified

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

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

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

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

3 of 166 classes have LCOM4 above 3.

Low cohesion: RawStreamWrapper (LCOM4 7) · ×3pingora-core/src/protocols/l4/stream.rs:163

What to do

  1. Resolve the 3 Low cohesion finding(s) in Cohesion (LCOM4) — start with stream.rs (2), health_check.rs. — One of this dimension's main actionable groups (3 warning-level).

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

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

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

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

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

Secret scan ran and found no leaked secrets.

✓ On the Gold path — maintain.

Detailed fixes: d13_recommendation.md.

D14 · License Compliance10.0 / 10Exemplary○ Nothing flagged

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

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

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

0 of 582 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository commits no Cargo.lock, so its graph was resolved here: its manifests' `[dependencies]` and `[build-dependencies]` closed over the crates.io index, each crate at the newest release its requirement admits (what a fresh `cargo generate-lockfile` picks, not a graph the repository has pinned). Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository.

✓ On the Gold path — maintain.

Detailed fixes: d14_recommendation.md.

D15 · Churn × Complexity Hotspots9.2 / 10Stronggated by 9 serious findings✓ Tool-verified

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

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

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

Top hotspots: pingora-proxy/src/proxy_custom.rs (11×77=847); pingora-proxy/src/proxy_h2.rs (9×67=603); pingora-proxy/src/proxy_h1.rs (9×64=576)

Hotspot: pingora-proxy/src/proxy_custom.rs · ×9pingora-proxy/src/proxy_custom.rs:539

What to do

  1. Resolve the 9 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (2), proxy_custom.rs, proxy_h2.rs. — One of this dimension's main actionable groups (9 warning-level).

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

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

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

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

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

9 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is pingora-foundations/src/lib.rs. Counted over 158 of the 185 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

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

✓ On the Gold path — maintain.

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

D17 · Explicit Debt9.5 / 10Stronggated by 274 serious findings✓ Tool-verified

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

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

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

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

TodoComment · ×251tinyufo/src/lib.rs:190
XxxComment · ×12pingora-proxy/src/proxy_h2.rs:1260
FixmeComment · ×11pingora-proxy/tests/utils/server_utils.rs:2743

What to do

  1. Resolve the 251 TodoComment finding(s) in Explicit Debt — start with mod.rs (39), lib.rs (36), server.rs (33). — One of this dimension's main actionable groups (251 warning-level).
  2. Resolve the 12 XxxComment finding(s) in Explicit Debt — start with conditional_filter.rs (3), server.rs (3), proxy_h2.rs. — One of this dimension's main actionable groups (12 warning-level).
  3. Resolve the 11 FixmeComment finding(s) in Explicit Debt — start with memory.rs (3), server.rs (2), server_utils.rs. — One of this dimension's main actionable groups (11 warning-level).

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

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

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

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

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

1 of 1 documentation facets pass in full. 25 document(s) read across 1 unit(s).

✓ On the Gold path — maintain.

Detailed fixes: d19_recommendation.md.

D20 · ADR Quality0.0 / 10Critical✓ Tool-verified

What it measures: Whether architecture decisions are recorded well (context, decision, consequences).

Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.

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

No architecture decision records were found.

No ADRs foundpingora-header-serde/Cargo.toml:20

What to do

  1. Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Cargo.toml. — One of this dimension's main actionable groups (1 recommendation-level).

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

D26 · Project Cohesion9.1 / 10Exemplary✓ Tool-verified

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

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

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

1 of 23 build units (Cargo) flagged as possibly oversized/incoherent.

Projects may be oversized for their cohesion

✓ On the Gold path — maintain.

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

D28 · Secrets (history)10.0 / 10Exemplary○ Nothing flagged

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

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

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

gitleaks scanned the full history AND the current working tree and found no secrets.

✓ On the Gold path — maintain.

Detailed fixes: d28_recommendation.md.

D29 · Static Analysis (SAST)8.4 / 10Adequategated by 10 critical findings✓ Tool-verified

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

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

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

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

10 finding(s): 0 critical, 10 high, 0 medium, 0 low. 9 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 2 file(s) — `pingora-foundations/src/lib.rs` (line 170, lines 171–172, lines 173–174), `pingora-runtime/src/lib.rs` (lines 623–626, line 627, line 632, …) — 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 1 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.

REDACTED
REDACTED

What to do

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

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

D31 · IaC & Container Security8.8 / 10Adequategated by 3 critical findings✓ Tool-verified

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

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

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

6 finding(s): 0 critical, 3 high, 2 medium, 1 low.

REDACTED
REDACTED
REDACTED

What to do

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

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

D32 · Data Compliance (PII/GDPR)9.0 / 10Stronggated by 1 serious finding✓ Tool-verified

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

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

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

1 finding(s): 0 critical, 0 high, 1 medium, 0 low.

REDACTED

What to do

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

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

D34 · Knowledge Freshness8.4 / 10Adequategated by 3 critical findings✓ Tool-verified

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

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

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

25 of 158 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pingora-memory-cache/src/read_through.rs. Counted over 158 of the 185 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.

Orphaned knowledge · ×3pingora-memory-cache/src/read_through.rs:1
Orphaned file · ×22pingora-core/src/connectors/tls/s2n/mod.rs:1
Further orphaned files (smaller)

What to do

  1. Resolve the 3 Orphaned knowledge finding(s) in Knowledge Freshness — start with lib.rs (2), read_through.rs. — One of this dimension's main actionable groups (3 issue-level).
  2. Resolve the 22 Orphaned file finding(s) in Knowledge Freshness — start with mod.rs (6), lib.rs (2), rate.rs. — One of this dimension's main actionable groups (22 recommendation-level).
  3. 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.

D35 · Change Coupling10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

No strong hidden change-coupling between production files.

✓ On the Gold path — maintain.

Detailed fixes: d35_recommendation.md.

Frontend & cross-cutting dimensions

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

AX10 · Code composition7.1 / 10Strong✓ Tool-verified

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

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

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

AX3 · Project dependency cycles10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

AX9 · CQS / query purity10.0 / 10Exemplary✓ Tool-verified

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.

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

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

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

What to do

  • Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
M2 · Architecture documentation3.0 / 10Weak✓ Tool-verified

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

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

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

What to do

  • Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
M3 · Folder & project structure10.0 / 10Exemplary✓ Tool-verified

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

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

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

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

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

P1 · CI/CD gates10.0 / 10Exemplary○ Nothing flagged

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

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

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's code 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.

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

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

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

  • Only 10/12 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `pingora-header-serde`, `pingora-test-utils`.

What to do

  • Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
P3 · Security & performance tooling5.0 / 10Adequate✓ Tool-verified

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

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

What to do

  • Enable Dependabot/Renovate or a dependency-review gate.
  • Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
P4 · Deployment & Rollback5.0 / 10Adequate✓ Tool-verified

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

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

What to do

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

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

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

PF1 · Benchmark discipline9.5 / 10Exemplary✓ Tool-verified

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.

PF3 · Async & latency hygiene10.0 / 10Exemplary✓ Tool-verified

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

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

S1 · Web-Security Posture2.0 / 10Critical✓ Tool-verified

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 commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. The server controls — HTTPS enforcement, HSTS, cookie flags, input validation — are read from a Rust server this repository starts itself, and its production Rust starts none. What serves its HTTP is outside the Rust source, and only what this card names about it was assessed.

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.

  • `set_verify_hostname(false)` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on. — pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:243
  • `set_min_proto_version(SslVersion::TLS1)` explicitly admits a protocol version that is broken (SSL 3.0) or withdrawn (TLS 1.0/1.1, RFC 8996). Offering an obsolete version does not merely permit it — it is what a downgrade attack negotiates, so the weakest version on the list is the one that decides the connection's strength. Remove the pin: reqwest, native-tls and openssl negotiate the highest version both sides support, and rustls implements only TLS 1.2 and 1.3 — so naming no older version is the strongest setting. Where a floor must be named, use `min_tls_version(tls::Version::TLS_1_2)` / `set_min_proto_version(Some(SslVersion::TLS1_2))`. — pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:107
  • None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — pingora-ketama/test-data/nginx.conf:19

What to do

  • Stop accepting every TLS certificate: delete `danger_accept_invalid_certs(true)` / `SslVerifyMode::NONE` / the rustls verifier that returns `ServerCertVerified::assertion()` unconditionally, and trust a self-signed or private server by adding its CA as a root (`add_root_certificate`, a rustls `RootCertStore`) — never by switching verification off.
  • Drop SSL 3.0 and TLS 1.0/1.1: remove the `min_tls_version`/`set_min_proto_version` pin naming them, or set TLS 1.2 explicitly — or move the client to rustls, which offers nothing older.
  • Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
X1 · Async correctness10.0 / 10Exemplary○ Nothing flagged

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

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

X14 · Bypassable address classification10.0 / 10Exemplary○ Nothing flagged

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.

X21 · Side-effecting pattern guard10.0 / 10Exemplary○ Nothing flagged

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

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

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.

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.

Reference — by lens

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

LensScoreRatingImpact
Code Health86%StrongSolid.
Architecture87%StrongSolid.
Maturity67%Adequate — gated by M2Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Readiness74%StrongSolid.
Security50%Adequate — gated by S1Capped at Fair by a Critical contributor — resolve it before relying on this lens.
Performance97%ExemplaryStrongest area.
Unscored — 3 check(s) recorded observations but carry no score

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

  • D11 Test Reliability — 2 observation(s) recorded · This repository declares 2 of its own test(s) unreliable. The built-in reliability runner does not support this repository's ecosystem (.rs), so the suite was not re-run and no reliability score is given — these are the repository's own declarations, not our measurement.
  • D36 Supply-chain Provenance & Signing — 2 observation(s) recorded · The CI pipeline publishes no artifact — no package publish, container push or release with files to download. Supply-chain provenance, signing and an SBOM describe a PUBLISHED artifact for the people who obtain it, so there is nothing to attest here; a deployment of the service itself publishes nothing for anyone else to verify. Add them to the release pipeline when this repo starts publishing artifacts (a package, a container image, or a release with downloadable files). Build integrity and workflow-token hygiene are reported below: they describe what the CI runs and the token it runs with, neither of which is affected by whether the pipeline ships an artifact.
  • X10 Duplicated predicate — 20 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 — 71 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.
  • AX1 Captive dependencies — Not applicable: Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one.
  • 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.
  • AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
  • AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • AX7 Slice cohesion — not applicable — not a vertical-slice architecture
  • AX8 Test isolation — no test/production split to check
  • AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • AXR1 Runtime accessibility — docker build failed (exit 1) — openresty.org/package/arm64/debian\"; else URL=\"http://openresty.org/package/debian\"; fi && echo \"deb [arch=$BUILDARCH signed-by=/usr/share/keyrings/openresty.gpg] ${URL} $(lsb_release -sc) openresty\" | tee /etc/apt/sources.list.d/openresty.list > /dev/null && apt-get -qq update && apt-get -qq install -y openresty --no-install-recommends" did not complete successfully: exit code: 2; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
  • 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.
  • D10 Test Quality — ~37271 lines of test source are present (.rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
  • D12 Dependency Hygiene — Not scored — 100 direct Cargo declaration(s) were read, but the outdated signal needs crates.io, and no committed Cargo.lock resolves them to versions, so this dimension's own question is only partly answered. NOT a finding that these dependencies are current or healthy.
  • 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.
  • D21 Naming Consistency — D21 withholds its case and prefix conventions rows: 1 candidate(s) found and not reported.
  • D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
  • D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
  • D24 Comment Value — D24 reads C#, Visual Basic, TypeScript and JavaScript comments only — this repository's production source is .rs, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
  • 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.
  • D30 Dependency Vulnerabilities — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).
  • D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
  • D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
  • D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
  • D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
  • D43 Malicious Dependencies — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).
  • D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
  • 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 — Rust suite
  • DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (41 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
  • P12 CI test-gate honesty — Reported, not scored — and nothing was matched here. The coverage check applies to any stack, and the automatic-re-run check to any GitHub-Actions workflow, but the checks for excluded tests, skipped tests and sleep-based synchronisation currently recognise only some ecosystems' test-runner idioms, so on a repository built with another stack the zeros below mean 'not checked', not 'clean'.
  • P7 Outbound HTTP resilience — not applicable — no HTTP server, API framework or worker entry point was found in the 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 — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
  • PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
  • X12 Unreachable branch — 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
  • X13 Undrained process stream — 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
  • X15 Unvalidated length from an untrusted reader — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X16 Unfloored truncation loop — 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
  • X17 Uncapped recursion over a caller-supplied document — 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
  • X18 Disposal-pattern correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X19 Unrestored process-global state — 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
  • X2 Cancellation propagation — no C# was loaded; this repository's Rust was read, and no request in it can be cancelled by a caller — a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
  • X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
  • X22 Contradicted release guard — not 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
  • X23 Unguarded diagnostic materialisation — 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
  • X24 Document value interpolated into markup unescaped — 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
  • X25 Inert configuration knob — 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
  • 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. Not a gap in the analyzer and not a finding about your code.
  • X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • X29 Per-element action decided by a fixed element — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
  • 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.
  • X4 Structured logging — This check asks whether log calls keep a message's values apart from its text, which needs a logger that can carry them as fields. This repository's Rust was read, and it logs through none: the `log` crate's macros take one finished message (as log4net does in C#; its `kv` values are an opt-in its backends mostly drop), `println!`/`eprintln!` are not loggers, or it makes no log call outside its tests and examples at all. Calls through `tracing` (`tracing::info!`, or `info!` imported from it) would be judged.
  • X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
  • X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
  • X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.

Appendix A — Findings (grouped)

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

Critical — 19 finding(s)
D29 · Static Analysis (SAST) · REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
  • REDACTED
D31 · IaC & Container Security · High IaC · ×3
  • REDACTED
  • REDACTED
  • REDACTED
D34 · Knowledge Freshness · Orphaned knowledge · ×3
  • Orphaned knowledge pingora-memory-cache/src/read_through.rs:1 — 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 tinyufo/src/lib.rs:1 — 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 pingora-ketama/src/lib.rs:1 — 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.
D11 · Test Reliability · Test declared unreliable · ×2
  • Test declared unreliable: test_caching_when_downstream_stalls pingora-proxy/tests/test_upstream.rs:4916 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "flaky in CI due to timing/resource contention". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
  • Test declared unreliable: test_caching_h2_upstream_when_downstream_stalls pingora-proxy/tests/test_upstream.rs:5000 — This test is disabled or skipped with a reason naming unreliability — the repository's own words: "flaky in CI due to timing/resource contention". A test that is skipped for flakiness is neither passing nor protecting the code it covers; either stabilise it or delete it, but do not leave it disabled indefinitely. (Found by reading the repository's own test source — the suite itself was not re-run, since the reliability runner does not support this ecosystem.)
D29 · Static Analysis (SAST) · REDACTED · ×1
  • REDACTED
S1 · Web-Security Posture · TLS certificate validation disabled · ×1
  • TLS certificate validation disabled pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:243 — `set_verify_hostname(false)` is set on a TLS client, so every peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Remove the override so the TLS stack verifies the peer — reqwest, native-tls, rustls and openssl's `SslConnector` all check the chain and hostname when nothing is set. If the server presents a self-signed or privately-issued certificate, trust THAT issuer rather than every certificate: `reqwest::ClientBuilder::add_root_certificate(Certificate::from_pem(…))`, a rustls `RootCertStore` holding its CA, or `SslConnectorBuilder::set_ca_file`, which keeps the chain and hostname checks on.
Serious — 636 finding(s)
D17 · Explicit Debt · TodoComment · ×251
  • TodoComment tinyufo/src/lib.rs:190 — // TODO: figure out the right way to compare frequencies of different weights across — 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 tinyufo/src/lib.rs:224 — // TODO: compare old.weight and update accordingly — 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 tinyufo/src/lib.rs:406 — // TODO: with_capacity() — 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 pingora-timeout/src/timer.rs:110 — // TODO: make sure this value is larger than RESOLUTION_DURATION — 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 pingora-timeout/src/timer.rs:200 — // TODO: buffer these register calls instead (without a lock) — 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 pingora-runtime/src/lib.rs:750 — // TODO: use a mutex to avoid creating a lot threads only to drop them — 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 pingora-runtime/src/lib.rs:785 — // TODO: runtime metrics — 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 pingora-proxy/tests/test_upstream.rs:5481 — // TODO: this can currently break with 500 when body arrives alongside header — 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 pingora-proxy/tests/utils/mock_origin.rs:65 — // TODO: figure out a way to kill openresty when exiting — 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 pingora-proxy/tests/utils/server_utils.rs:1848 — // TODO: only allow GET & HEAD — 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 pingora-proxy/tests/utils/server_utils.rs:2155 — // TODO to simulate an actual http1.0 origin — 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 pingora-proxy/src/lib.rs:196 — // TODO: name it better than inner — 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 pingora-proxy/src/lib.rs:389 — // TODO: check n==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.
  • TodoComment pingora-proxy/src/lib.rs:393 — // TODO: close connection? — 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 pingora-proxy/src/lib.rs:615 — // TODO: log 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.
  • TodoComment pingora-proxy/src/lib.rs:1544 — // TODO: log 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.
  • TodoComment pingora-proxy/src/lib.rs:673 — /// TODO: move this into an upstream session digest for future fields. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment pingora-proxy/src/lib.rs:2074 — // TODO: allow configuring the subrequest session before use — 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 pingora-proxy/src/lib.rs:2101 — // TODO: allow configuring the subrequest session before use — 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 pingora-proxy/src/lib.rs:2145 — // TODO: keepalive pool, use stack — 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 pingora-proxy/src/lib.rs:2201 — // TODO implement h2_options — 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 pingora-proxy/src/proxy_cache.rs:89 — // TODO: handle this 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.
  • TodoComment pingora-proxy/src/proxy_cache.rs:103 — // TODO: handle this 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.
  • TodoComment pingora-proxy/src/proxy_cache.rs:164 — // TODO: maybe round and/or cache now() — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • TodoComment pingora-proxy/src/proxy_cache.rs:329 — // TODO: check error types — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
  • + 226 more in this group — see findings.md.
D2 · Cognitive Complexity · HttpProxy · ×20
  • HttpProxy::custom_bidirection_down_to_up (cognitive 187) pingora-proxy/src/proxy_custom.rs:539 — HttpProxy::custom_bidirection_down_to_up has cognitive complexity 187 (threshold 15). Drivers by points: if/else 49 (142 pts), boolean chains 23, match/switch 7 (21 pts), loops 1 (nesting depth added 107). 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.
  • HttpProxy::bidirection_down_to_up (cognitive 174) pingora-proxy/src/proxy_h2.rs:526 — HttpProxy::bidirection_down_to_up has cognitive complexity 174 (threshold 15). Drivers by points: if/else 42 (129 pts), match/switch 9 (27 pts), boolean chains 17, loops 1 (nesting depth added 105). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HttpProxy::proxy_handle_downstream (cognitive 158) pingora-proxy/src/proxy_h1.rs:471 — HttpProxy::proxy_handle_downstream has cognitive complexity 158 (threshold 15). Drivers by points: if/else 37 (114 pts), match/switch 8 (24 pts), boolean chains 19, loops 1 (nesting depth added 93). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HttpProxy::proxy_cache (cognitive 120) pingora-proxy/src/proxy_cache.rs:77 — HttpProxy::proxy_cache has cognitive complexity 120 (threshold 15). Drivers by points: if/else 34 (107 pts), match/switch 3 (8 pts), boolean chains 4, loops 1 (nesting depth added 78). 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.
  • HttpProxy::proxy_cache_hit (cognitive 112) pingora-proxy/src/proxy_cache.rs:342 — HttpProxy::proxy_cache_hit has cognitive complexity 112 (threshold 15). Drivers by points: if/else 24 (64 pts), match/switch 10 (33 pts), boolean chains 9, loops 2 (6 pts) (nesting depth added 67). Of this number, 110 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
  • HttpProxy::cache_http_task (cognitive 88) pingora-proxy/src/proxy_cache.rs:723 — HttpProxy::cache_http_task has cognitive complexity 88 (threshold 15). Drivers by points: if/else 21 (74 pts), match/switch 4 (9 pts), boolean chains 5 (nesting depth added 58). 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.
  • HttpProxy::process_request (cognitive 56) pingora-proxy/src/lib.rs:1485 — HttpProxy::process_request has cognitive complexity 56 (threshold 15). Drivers by points: if/else 24 (44 pts), match/switch 4 (8 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.
  • HttpProxy::proxy_down_to_up (cognitive 50) pingora-proxy/src/proxy_h2.rs:139 — HttpProxy::proxy_down_to_up has cognitive complexity 50 (threshold 15). Drivers by points: if/else 22 (31 pts), match/switch 7 (12 pts), boolean chains 7 (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.
  • HttpProxy::custom_response_filter (cognitive 48) pingora-proxy/src/proxy_custom.rs:1037 — HttpProxy::custom_response_filter has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (38 pts), match/switch 3 (6 pts), boolean chains 4 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HttpProxy::h1_response_filter (cognitive 42) pingora-proxy/src/proxy_h1.rs:924 — HttpProxy::h1_response_filter has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (37 pts), boolean chains 4, match/switch 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.
  • HttpProxy::h2_response_filter (cognitive 42) pingora-proxy/src/proxy_h2.rs:991 — HttpProxy::h2_response_filter has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (32 pts), match/switch 3 (6 pts), boolean chains 4 (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.
  • HttpProxy::proxy_handle_upstream (cognitive 41) pingora-proxy/src/proxy_h1.rs:263 — HttpProxy::proxy_handle_upstream has cognitive complexity 41 (threshold 15). Drivers by points: if/else 6 (28 pts), match/switch 3 (8 pts), boolean chains 4, loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HttpProxy::proxy_1to1 (cognitive 37) pingora-proxy/src/proxy_h1.rs:33 — HttpProxy::proxy_1to1 has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 7 (12 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.
  • HttpProxy::revalidate_or_stale (cognitive 36) pingora-proxy/src/proxy_cache.rs:915 — HttpProxy::revalidate_or_stale has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (30 pts), match/switch 2 (5 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.
  • HttpProxy::buffer_request_body_early_inner (cognitive 29) pingora-proxy/src/lib.rs:1820 — HttpProxy::buffer_request_body_early_inner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (25 pts), match/switch 1 (2 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.
  • HttpProxy::custom_proxy_down_to_up (cognitive 27) pingora-proxy/src/proxy_custom.rs:209 — HttpProxy::custom_proxy_down_to_up has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (24 pts), match/switch 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.
  • HttpProxy::proxy_to_upstream (cognitive 25) pingora-proxy/src/lib.rs:448 — HttpProxy::proxy_to_upstream has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 3 (4 pts), boolean chains 2 (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.
  • HttpProxy::process_upstream_tasks (cognitive 25) pingora-proxy/src/proxy_h1.rs:378 — HttpProxy::process_upstream_tasks has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HttpProxy::process_upstream_tasks_h2 (cognitive 23) pingora-proxy/src/proxy_h2.rs:434 — HttpProxy::process_upstream_tasks_h2 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 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.
  • HttpProxy::process_upstream_tasks_custom (cognitive 20) pingora-proxy/src/proxy_custom.rs:449 — HttpProxy::process_upstream_tasks_custom has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D3 · God Classes · FileTooLong · ×19
  • FileTooLong: src/lib.rs pingora-proxy/src/lib.rs — FileTooLong — 1389 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 889 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: src/proxy_cache.rs pingora-proxy/src/proxy_cache.rs — FileTooLong — 1188 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 688 over it, 2.38× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: v1/body.rs pingora-core/src/protocols/http/v1/body.rs — FileTooLong — 1133 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 633 over it, 2.27× 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/lib.rs pingora-cache/src/lib.rs — FileTooLong — 1064 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 83% of them inside a single declaration: HttpCache (2 blocks, 71-2017). The bar is 500 significant lines; this is 564 over it, 2.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: src/proxy_custom.rs pingora-proxy/src/proxy_custom.rs — FileTooLong — 996 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 74% of them inside a single declaration: HttpProxy (164-1309). The bar is 500 significant lines; this is 496 over it, 1.99× 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: v1/server.rs pingora-core/src/protocols/http/v1/server.rs — FileTooLong — 921 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: HttpSession (2 blocks, 80-1784). The bar is 500 significant lines; this is 421 over it, 1.84× 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: src/lib.rs pingora-load-balancing/src/lib.rs — FileTooLong — 904 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 404 over it, 1.81× 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/proxy_h2.rs pingora-proxy/src/proxy_h2.rs — FileTooLong — 856 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 81% of them inside a single declaration: HttpProxy (134-1243). The bar is 500 significant lines; this is 356 over it, 1.71× 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: src/proxy_h1.rs pingora-proxy/src/proxy_h1.rs — FileTooLong — 732 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: HttpProxy (28-1155). The bar is 500 significant lines; this is 232 over it, 1.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: subrequest/server.rs pingora-core/src/protocols/http/subrequest/server.rs — FileTooLong — 726 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 82% of them inside a single declaration: HttpSession (2 blocks, 100-1208). The bar is 500 significant lines; this is 226 over it, 1.45× 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: l4/stream.rs pingora-core/src/protocols/l4/stream.rs — FileTooLong — 630 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 130 over it, 1.26× 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/lib.rs pingora-lru/src/lib.rs — FileTooLong — 567 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 66% of them inside a single declaration: Lru (2 blocks, 59-823). The bar is 500 significant lines; this is 67 over it, 1.13× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
  • FileTooLong: server/mod.rs pingora-core/src/server/mod.rs — FileTooLong — 526 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 80% of them inside a single declaration: Server (2 blocks, 212-977). The bar is 500 significant lines; this is 26 over it, 1.05× 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: src/async_lru.rs pingora-lru/src/async_lru.rs — FileTooLong — 522 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 22 over it, 1.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: http/server.rs pingora-core/src/protocols/http/server.rs — FileTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 95% of them inside a single declaration: Session (3 blocks, 56-1069). The bar is 500 significant lines; this is 19 over it, 1.04× 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: upstreams/peer.rs pingora-core/src/upstreams/peer.rs — FileTooLong — 519 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 19 over it, 1.04× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
  • FileTooLong: v1/client.rs pingora-core/src/protocols/http/v1/client.rs — FileTooLong — 517 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 91% of them inside a single declaration: HttpSession (3 blocks, 39-956). The bar is 500 significant lines; this is 17 over it, 1.03× 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: l4/ext.rs pingora-core/src/protocols/l4/ext.rs — FileTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 8 over it, 1.02× 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/lib.rs pingora-http/src/lib.rs — FileTooLong — 504 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 4 over it, 1.01× 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.
D3 · God Classes · MethodTooLong · ×18
  • MethodTooLong: HttpProxy.custom_bidirection_down_to_up pingora-proxy/src/proxy_custom.rs:539 — MethodTooLong — custom_bidirection_down_to_up runs 317 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 217 over it, 3.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HttpProxy.bidirection_down_to_up pingora-proxy/src/proxy_h2.rs:526 — MethodTooLong — bidirection_down_to_up runs 301 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 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HttpProxy.proxy_handle_downstream pingora-proxy/src/proxy_h1.rs:471 — MethodTooLong — proxy_handle_downstream runs 276 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 176 over it, 2.76× 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: HttpProxy.proxy_cache_hit pingora-proxy/src/proxy_cache.rs:342 — MethodTooLong — proxy_cache_hit runs 173 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 73 over it, 1.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: Server.run pingora-core/src/server/mod.rs:692 — MethodTooLong — run 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.
  • MethodTooLong: HttpProxy.custom_proxy_down_to_up pingora-proxy/src/proxy_custom.rs:209 — MethodTooLong — custom_proxy_down_to_up runs 153 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 53 over it, 1.53× 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: HttpProxy.process_request pingora-proxy/src/lib.rs:1485 — MethodTooLong — process_request 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.
  • MethodTooLong: HttpProxy.proxy_cache pingora-proxy/src/proxy_cache.rs:77 — MethodTooLong — proxy_cache 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: HttpSession.write_proxy_tasks pingora-core/src/protocols/http/subrequest/server.rs:920 — MethodTooLong — write_proxy_tasks runs 143 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 43 over it, 1.43× 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: HttpProxy.proxy_down_to_up pingora-proxy/src/proxy_h2.rs:139 — MethodTooLong — proxy_down_to_up runs 142 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 42 over it, 1.42× 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: HttpProxy.custom_response_filter pingora-proxy/src/proxy_custom.rs:1037 — MethodTooLong — custom_response_filter runs 116 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 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HttpSession.read_response pingora-core/src/protocols/http/v1/client.rs:254 — MethodTooLong — read_response runs 110 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 10 over it, 1.10× 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: HttpProxy.h1_response_filter pingora-proxy/src/proxy_h1.rs:924 — MethodTooLong — h1_response_filter runs 109 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 9 over it, 1.09× 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: BodyReader.do_read_chunked_body pingora-core/src/protocols/http/v1/body.rs:515 — MethodTooLong — do_read_chunked_body runs 107 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 7 over it, 1.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: HttpSession.read_request pingora-core/src/protocols/http/v1/server.rs:284 — MethodTooLong — read_request runs 107 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 7 over it, 1.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: HttpProxy.h2_response_filter pingora-proxy/src/proxy_h2.rs:991 — MethodTooLong — h2_response_filter runs 106 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 6 over it, 1.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HttpProxy.cache_http_task pingora-proxy/src/proxy_cache.rs:723 — MethodTooLong — cache_http_task runs 104 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 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • MethodTooLong: HttpProxy.proxy_1to1 pingora-proxy/src/proxy_h1.rs:33 — MethodTooLong — proxy_1to1 runs 104 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 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D1 · Cyclomatic Complexity · HttpProxy · ×15
  • HttpProxy::custom_bidirection_down_to_up (cyclomatic 77) pingora-proxy/src/proxy_custom.rs:539 — HttpProxy::custom_bidirection_down_to_up has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • HttpProxy::bidirection_down_to_up (cyclomatic 67) pingora-proxy/src/proxy_h2.rs:526 — HttpProxy::bidirection_down_to_up has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • HttpProxy::proxy_handle_downstream (cyclomatic 64) pingora-proxy/src/proxy_h1.rs:471 — HttpProxy::proxy_handle_downstream has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
  • HttpProxy::proxy_cache_hit (cyclomatic 46) pingora-proxy/src/proxy_cache.rs:342 — HttpProxy::proxy_cache_hit has cyclomatic complexity 46 (threshold 15). Of this number, 44 points are the body's own statements and 2 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.
  • HttpProxy::proxy_cache (cyclomatic 40) pingora-proxy/src/proxy_cache.rs:77 — HttpProxy::proxy_cache 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.
  • HttpProxy::proxy_down_to_up (cyclomatic 35) pingora-proxy/src/proxy_h2.rs:139 — HttpProxy::proxy_down_to_up 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.
  • HttpProxy::cache_http_task (cyclomatic 33) pingora-proxy/src/proxy_cache.rs:723 — HttpProxy::cache_http_task 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.
  • HttpProxy::process_request (cyclomatic 30) pingora-proxy/src/lib.rs:1485 — HttpProxy::process_request 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.
  • HttpProxy::custom_response_filter (cyclomatic 29) pingora-proxy/src/proxy_custom.rs:1037 — HttpProxy::custom_response_filter 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.
  • HttpProxy::h1_response_filter (cyclomatic 27) pingora-proxy/src/proxy_h1.rs:924 — HttpProxy::h1_response_filter 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.
  • HttpProxy::h2_response_filter (cyclomatic 26) pingora-proxy/src/proxy_h2.rs:991 — HttpProxy::h2_response_filter 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.
  • HttpProxy::proxy_1to1 (cyclomatic 24) pingora-proxy/src/proxy_h1.rs:33 — HttpProxy::proxy_1to1 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.
  • HttpProxy::custom_proxy_down_to_up (cyclomatic 20) pingora-proxy/src/proxy_custom.rs:209 — HttpProxy::custom_proxy_down_to_up 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.
  • HttpProxy::buffer_request_body_early_inner (cyclomatic 17) pingora-proxy/src/lib.rs:1820 — HttpProxy::buffer_request_body_early_inner 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.
  • HttpProxy::proxy_handle_upstream (cyclomatic 16) pingora-proxy/src/proxy_h1.rs:263 — HttpProxy::proxy_handle_upstream has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D17 · Explicit Debt · XxxComment · ×12
  • XxxComment pingora-proxy/src/proxy_h2.rs:1260 — // XXX: the h2 crate won't check for content-length underflow — 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 pingora-core/src/server/daemon.rs:80 — // XXX: this operation should have been done when the old service is exiting. — 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 pingora-core/src/protocols/http/conditional_filter.rs:43 — // XXX: In nginx, IMS is actually checked first, which may cause compatibility issues — 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 pingora-core/src/protocols/http/conditional_filter.rs:100 — // XXX: This nginx algorithm will handle matching against ETags with commas correctly, but only — 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 pingora-core/src/protocols/http/conditional_filter.rs:182 — // XXX: https://datatracker.ietf.org/doc/html/rfc9110#name-content-length
  • XxxComment pingora-core/src/protocols/http/v1/server.rs:1273 — // XXX: account for upgraded body reader change, if the read half split from the write half — 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 pingora-core/src/protocols/http/subrequest/server.rs:374 — // XXX: don't add additional downstream headers, unlike h1, subreq is mostly treated as a pipe — 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 pingora-core/src/protocols/http/subrequest/server.rs:456 — // XXX: this should only be valid if subrequest is standing in for — 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 pingora-core/src/connectors/l4.rs:439 — // XXX: some system will allow the socket to bind and connect without error, only to timeout — 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 pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:201 — // XXX: verify on empty string cause null string seg fault — 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 pingora-cache/src/lib.rs:520 — // XXX: compile type enforce? — 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 pingora-cache/src/meta.rs:728 — // XXX: return Error if `fresh_until` is much earlier than expected? — 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.
D3 · God Classes · TooManyMethods · ×12
  • TooManyMethods: HttpSession pingora-core/src/protocols/http/v1/server.rs:80 — TooManyMethods — 96 methods. The bar is 30 methods; this is 66 over it, 3.20× 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: Session pingora-core/src/protocols/http/server.rs:56 — TooManyMethods — 87 methods. The bar is 30 methods; this is 57 over it, 2.90× 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: HttpCache pingora-cache/src/lib.rs:71 — TooManyMethods — 78 methods. The bar is 30 methods; this is 48 over it, 2.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.
  • TooManyMethods: HttpSession pingora-core/src/protocols/http/subrequest/server.rs:100 — TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HttpSession pingora-core/src/protocols/http/v1/client.rs:39 — TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: HttpProxy pingora-proxy/src/lib.rs:191 — TooManyMethods — 46 methods, declared across 6 files: src/lib.rs (16), src/proxy_cache.rs (9), src/proxy_custom.rs (7), src/proxy_h1.rs (7), +2 more file(s). The bar is 30 methods; this is 16 over it, 1.53× 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: Session pingora-proxy/src/lib.rs:646 — TooManyMethods — 46 methods. The bar is 30 methods; this is 16 over it, 1.53× 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: Lru pingora-lru/src/lib.rs:59 — TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× 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: HttpSession pingora-core/src/protocols/http/v2/server.rs:270 — TooManyMethods — 40 methods. The bar is 30 methods; this is 10 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.
  • TooManyMethods: CacheMeta pingora-cache/src/meta.rs:618 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: Error pingora-error/src/lib.rs:33 — TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • TooManyMethods: BodyReader pingora-core/src/protocols/http/v1/body.rs:147 — TooManyMethods — 32 methods. The bar is 30 methods; this is 2 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.
D17 · Explicit Debt · FixmeComment · ×11
  • FixmeComment pingora-proxy/tests/utils/server_utils.rs:2743 — // FIXME: this still allows multiple servers to spawn across integration 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.
  • FixmeComment pingora-proxy/src/subrequest/pipe.rs:331 — // FIXME: if one of these tasks is Failed(e), the session will return that — 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 pingora-load-balancing/src/selection/consistent.rs:45 — // FIXME: ketama only supports Inet addr, UDS addrs are ignored here — 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 pingora-core/src/protocols/http/v1/client.rs:2961 — // FIXME: the order is not guaranteed — 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 pingora-core/src/protocols/http/v1/server.rs:3382 — // FIXME: the order is not guaranteed — 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 pingora-core/src/protocols/http/v1/server.rs:234 — // FIXME: this should only apply to reads between requests — 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 pingora-cache/src/lock.rs:550 — // FIXME: for now it is the awkward responsibility of the ReadLock to set the — 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 pingora-cache/src/memory.rs:193 — // FIXME: sender could drop because of an 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 pingora-cache/src/memory.rs:244 — // FIXME: just body size, also track meta size — 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 pingora-cache/src/memory.rs:304 — // FIXME: this just body size, also track meta size — 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 pingora-cache/src/put.rs:54 — // FIXME: cache put doesn't have cache lock but some storage cannot handle concurrent put — 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.
D2 · Cognitive Complexity · pingora_core · ×10
  • pingora_core::connectors::l4::connect (cognitive 46) pingora-core/src/connectors/l4.rs:108 — pingora_core::connectors::l4::connect has cognitive complexity 46 (threshold 15). Drivers by points: match/switch 9 (28 pts), if/else 10 (18 pts) (nesting depth added 27). 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.
  • pingora_core::connectors::tls::boringssl_openssl::connect (cognitive 37) pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:148 — pingora_core::connectors::tls::boringssl_openssl::connect has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 2 (5 pts), match/switch 3 (4 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.
  • pingora_core::connectors::tls::rustls::connect (cognitive 34) pingora-core/src/connectors/tls/rustls/mod.rs:129 — pingora_core::connectors::tls::rustls::connect has cognitive complexity 34 (threshold 15). Drivers by points: if/else 19 (26 pts), match/switch 3 (4 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.
  • pingora_core::server::transfer_fd::send_fds_to (cognitive 29) pingora-core/src/server/transfer_fd/mod.rs:302 — pingora_core::server::transfer_fd::send_fds_to has cognitive complexity 29 (threshold 15). Drivers by points: if/else 3 (13 pts), match/switch 5 (13 pts), loops 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.
  • pingora_core::protocols::http::compression::parse_accept_encoding (cognitive 24) pingora-core/src/protocols/http/compression/mod.rs:583 — pingora_core::protocols::http::compression::parse_accept_encoding has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 1 (3 pts), match/switch 1 (2 pts) (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.
  • pingora_core::server::runtime_group::resolve_group (cognitive 22) pingora-core/src/server/runtime_group.rs:214 — pingora_core::server::runtime_group::resolve_group has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (7 pts), match/switch 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.
  • pingora_core::protocols::http::conditional_filter::not_modified_filter (cognitive 21) pingora-core/src/protocols/http/conditional_filter.rs:25 — pingora_core::protocols::http::conditional_filter::not_modified_filter has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 1 (3 pts) (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.
  • pingora_core::protocols::http::authority::validate_connect_authority (cognitive 20) REDACTED:122 — pingora_core::protocols::http::authority::validate_connect_authority has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (3 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.
  • pingora_core::protocols::http::v1::common::parse_connection_header (cognitive 18) pingora-core/src/protocols/http/v1/common.rs:74 — pingora_core::protocols::http::v1::common::parse_connection_header has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 1 (2 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.
  • pingora_core::protocols::tls::boringssl_openssl::client::handshake (cognitive 18) pingora-core/src/protocols/tls/boringssl_openssl/client.rs:30 — pingora_core::protocols::tls::boringssl_openssl::client::handshake has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 4 (9 pts) (nesting depth added 11). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. 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.
D4 · Code Duplication · Edited copy of a member (7 corresponding lines) · ×10
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/server.rs:598 — pingora-core/src/protocols/http/server.rs:598-605 | pingora-core/src/protocols/http/client.rs:184-190 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/server.rs:914 — pingora-core/src/protocols/http/server.rs:914-921 | pingora-core/src/protocols/http/client.rs:207-213 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/server.rs:926 — pingora-core/src/protocols/http/server.rs:926-933 | pingora-core/src/protocols/http/client.rs:218-224 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs:227 — pingora-core/src/protocols/http/client.rs:227-233 | pingora-core/src/protocols/http/server.rs:946-953 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs:236 — pingora-core/src/protocols/http/client.rs:236-242 | pingora-core/src/protocols/http/server.rs:936-943 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs:246 — pingora-core/src/protocols/http/client.rs:246-252 | pingora-core/src/protocols/http/server.rs:957-964 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs:32 — pingora-core/src/protocols/http/client.rs:32-38 | pingora-core/src/protocols/http/server.rs:782-789 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs:40 — pingora-core/src/protocols/http/client.rs:40-46 | pingora-core/src/protocols/http/server.rs:791-798 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs:48 — pingora-core/src/protocols/http/client.rs:48-54 | pingora-core/src/protocols/http/server.rs:818-825 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (7 corresponding lines) pingora-core/src/protocols/http/client.rs:56 — pingora-core/src/protocols/http/client.rs:56-62 | pingora-core/src/protocols/http/server.rs:827-834 — These two members are one piece of code written twice and then edited apart: 7 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (7 lines × 2) · ×10
  • Duplicated block (7 lines × 2) pingora-proxy/src/proxy_h1.rs:93 — pingora-proxy/src/proxy_h1.rs:93-100 | pingora-proxy/src/proxy_h2.rs:203-209 — before extracting anything, compare `pingora-proxy/src/proxy_h1.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 388 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_h1.rs:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pingora-core/src/protocols/l4/stream.rs:68 — pingora-core/src/protocols/l4/stream.rs:68-74 | pingora-core/src/protocols/l4/stream.rs:217-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/l4/stream.rs:68` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pingora-core/src/protocols/l4/stream.rs:82 — pingora-core/src/protocols/l4/stream.rs:82-88 | pingora-core/src/protocols/l4/stream.rs:305-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/l4/stream.rs:82` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pingora-core/src/protocols/l4/stream.rs:94 — pingora-core/src/protocols/l4/stream.rs:94-100 | pingora-core/src/protocols/l4/stream.rs:317-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/l4/stream.rs:94` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pingora-core/src/protocols/l4/stream.rs:106 — pingora-core/src/protocols/l4/stream.rs:106-112 | pingora-core/src/protocols/l4/stream.rs:329-335 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/l4/stream.rs:106` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pingora-core/src/protocols/l4/stream.rs:122 — pingora-core/src/protocols/l4/stream.rs:122-128 | pingora-core/src/protocols/l4/stream.rs:345-351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/l4/stream.rs:122` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (7 lines × 2) pingora-core/src/protocols/tls/mod.rs:186 — pingora-core/src/protocols/tls/mod.rs:186-192 | pingora-core/src/protocols/tls/mod.rs:196-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (7 lines × 2) pingora-core/src/protocols/http/subrequest/body.rs:256 — pingora-core/src/protocols/http/subrequest/body.rs:256-262 | pingora-core/src/protocols/http/v1/body.rs:1355-1361 — 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) pingora-core/src/protocols/http/subrequest/server.rs:437 — pingora-core/src/protocols/http/subrequest/server.rs:437-443 | pingora-core/src/protocols/http/v1/server.rs:701-707 — `pingora-core/src/protocols/http/subrequest/server.rs` and `pingora-core/src/protocols/http/v1/server.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 8 separate duplicated blocks between them, totalling at least 81 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) pingora-core/src/utils/tls/boringssl_openssl.rs:107 — pingora-core/src/utils/tls/boringssl_openssl.rs:107-113 | pingora-core/src/utils/tls/rustls.rs:229-235 — 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.
D15 · Churn × Complexity Hotspots · Hotspot · ×9
  • Hotspot: pingora-proxy/src/proxy_custom.rs pingora-proxy/src/proxy_custom.rs:539 — pingora-proxy/src/proxy_custom.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 77 in HttpProxy::custom_bidirection_down_to_up at line 539. 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-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 08:45:47 -08:00' --until='2026-11-09 08:45:47 -08:00' --full-history --no-merges -- pingora-proxy/src/proxy_custom.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: pingora-proxy/src/proxy_h2.rs pingora-proxy/src/proxy_h2.rs:526 — pingora-proxy/src/proxy_h2.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in HttpProxy::bidirection_down_to_up at line 526. 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-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 08:45:47 -08:00' --until='2026-11-09 08:45:47 -08:00' --full-history --no-merges -- pingora-proxy/src/proxy_h2.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: pingora-proxy/src/proxy_h1.rs pingora-proxy/src/proxy_h1.rs:471 — pingora-proxy/src/proxy_h1.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in HttpProxy::proxy_handle_downstream at line 471. 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-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 08:45:47 -08:00' --until='2026-11-09 08:45:47 -08:00' --full-history --no-merges -- pingora-proxy/src/proxy_h1.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: pingora-proxy/src/lib.rs pingora-proxy/src/lib.rs:1485 — pingora-proxy/src/lib.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in HttpProxy::process_request at line 1485. 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-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 08:45:47 -08:00' --until='2026-11-09 08:45:47 -08:00' --full-history --no-merges -- pingora-proxy/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.
  • Hotspot: pingora-proxy/src/proxy_cache.rs pingora-proxy/src/proxy_cache.rs:342 — pingora-proxy/src/proxy_cache.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in HttpProxy::proxy_cache_hit at line 342. 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-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 08:45:47 -08:00' --until='2026-11-09 08:45:47 -08:00' --full-history --no-merges -- pingora-proxy/src/proxy_cache.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: pingora-proxy/src/subrequest/pipe.rs pingora-proxy/src/subrequest/pipe.rs:205 — pingora-proxy/src/subrequest/pipe.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in pingora_proxy::subrequest::pipe::pipe_subrequest at line 205. 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-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 08:45:47 -08:00' --until='2026-11-09 08:45:47 -08:00' --full-history --no-merges -- pingora-proxy/src/subrequest/pipe.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: pingora-core/src/server/mod.rs pingora-core/src/server/mod.rs:692 — pingora-core/src/server/mod.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in Server::run at line 692. 1 of those changes was a fix/bug commit, and the other 4 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-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 08:45:47 -08:00' --until='2026-11-09 08:45:47 -08:00' --full-history --no-merges -- pingora-core/src/server/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: pingora-core/src/connectors/tls/boringssl_openssl/mod.rs pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:148 — pingora-core/src/connectors/tls/boringssl_openssl/mod.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in pingora_core::connectors::tls::boringssl_openssl::connect at line 148. 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-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 08:45:47 -08:00' --until='2026-11-09 08:45:47 -08:00' --full-history --no-merges -- pingora-core/src/connectors/tls/boringssl_openssl/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: pingora-load-balancing/src/background.rs pingora-load-balancing/src/background.rs:388 — pingora-load-balancing/src/background.rs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in HealthCheckService::run at line 388. 1 of those changes was a fix/bug commit, and the other 1 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-11..2026-11-09, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-11 08:45:47 -08:00' --until='2026-11-09 08:45:47 -08:00' --full-history --no-merges -- pingora-load-balancing/src/background.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.
D2 · Cognitive Complexity · HttpSession · ×9
  • HttpSession::write_proxy_tasks (cognitive 81) pingora-core/src/protocols/http/subrequest/server.rs:920 — HttpSession::write_proxy_tasks has cognitive complexity 81 (threshold 15). Drivers by points: if/else 24 (60 pts), match/switch 7 (17 pts), boolean chains 3, loops 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • HttpSession::read_request (cognitive 61) pingora-core/src/protocols/http/v1/server.rs:284 — HttpSession::read_request has cognitive complexity 61 (threshold 15). Drivers by points: if/else 14 (42 pts), match/switch 3 (11 pts), loops 3 (7 pts), boolean chains 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.
  • HttpSession::read_response (cognitive 54) pingora-core/src/protocols/http/v1/client.rs:254 — HttpSession::read_response has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (30 pts), match/switch 6 (18 pts), loops 2 (5 pts), boolean chains 1 (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.
  • HttpSession::write_proxy_tasks (cognitive 45) pingora-core/src/protocols/http/v1/server.rs:1648 — HttpSession::write_proxy_tasks has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (34 pts), match/switch 3 (8 pts), boolean chains 2, 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.
  • HttpSession::prepare_response_header (cognitive 30) pingora-core/src/protocols/http/v1/server.rs:844 — HttpSession::prepare_response_header has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 7 (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.
  • HttpSession::read_body_or_idle (cognitive 29) pingora-core/src/protocols/http/v1/server.rs:1246 — HttpSession::read_body_or_idle has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (27 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.
  • HttpSession::read_request_buf (cognitive 19) pingora-core/src/protocols/http/v1/server.rs:218 — HttpSession::read_request_buf has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 5 (9 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.
  • HttpSession::init_body_reader (cognitive 17) pingora-core/src/protocols/http/v1/client.rs:699 — HttpSession::init_body_reader has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), 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.
  • HttpSession::respect_keepalive (cognitive 16) pingora-core/src/protocols/http/v1/client.rs:576 — HttpSession::respect_keepalive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 3, match/switch 1 (3 pts) (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.
D3 · God Classes · ClassTooLong · ×9
  • ClassTooLong: HttpCache pingora-cache/src/lib.rs:71 — ClassTooLong — 882 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 78 methods, 2 blocks, lines 71-2017. The bar is 400 significant lines; this is 482 over it, 2.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: HttpSession pingora-core/src/protocols/http/v1/server.rs:80 — ClassTooLong — 842 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 96 methods, 2 blocks, lines 80-1784. The bar is 400 significant lines; this is 442 over it, 2.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: HttpProxy pingora-proxy/src/lib.rs:191 — ClassTooLong — 647 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 46 methods, 6 blocks, lines 191-2202. The bar is 400 significant lines; this is 247 over it, 1.62× 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: HttpSession pingora-core/src/protocols/http/subrequest/server.rs:100 — ClassTooLong — 598 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 68 methods, 2 blocks, lines 100-1208. The bar is 400 significant lines; this is 198 over it, 1.50× 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: BodyReader pingora-core/src/protocols/http/v1/body.rs:147 — ClassTooLong — 552 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 2 blocks, lines 147-1095. The bar is 400 significant lines; this is 152 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: Session pingora-core/src/protocols/http/server.rs:56 — ClassTooLong — 493 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 87 methods, 3 blocks, lines 56-1069. The bar is 400 significant lines; this is 93 over it, 1.23× 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: HttpSession pingora-core/src/protocols/http/v1/client.rs:39 — ClassTooLong — 473 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 51 methods, 3 blocks, lines 39-956. The bar is 400 significant lines; this is 73 over it, 1.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
  • ClassTooLong: Server pingora-core/src/server/mod.rs:212 — ClassTooLong — 421 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 2 blocks, lines 212-977. The bar is 400 significant lines; this is 21 over it, 1.05× 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: BodyWriter pingora-core/src/protocols/http/v1/body.rs:1289 — 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), 27 methods, 3 blocks, lines 1289-2065. 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.
D5 · Coupling · Off the main sequence · ×7
  • Off the main sequence: TinyUFO — TinyUFO: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: pingora-boringssl — pingora-boringssl: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: pingora-http-parser — pingora-http-parser: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
  • Off the main sequence: pingora-ketama — pingora-ketama: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: pingora-runtime — pingora-runtime: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
  • Off the main sequence: pingora-lru — pingora-lru: abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
  • Off the main sequence: pingora-timeout — pingora-timeout: abstractness 0.10, instability 0.00, distance 0.90 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
D4 · Code Duplication · Edited copy of a member (10 corresponding lines) · ×6
  • Edited copy of a member (10 corresponding lines) pingora-limits/src/estimator.rs:45 — pingora-limits/src/estimator.rs:45-55 | pingora-limits/src/estimator.rs:67-76 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pingora-core/src/protocols/http/error_resp.rs:26 — pingora-core/src/protocols/http/error_resp.rs:26-36 | pingora-proxy/src/proxy_purge.rs:45-54 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pingora-load-balancing/src/lib.rs:1065 — pingora-load-balancing/src/lib.rs:1065-1074 | pingora-load-balancing/src/lib.rs:1824-1842 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pingora-core/src/listeners/accept_limits.rs:309 — pingora-core/src/listeners/accept_limits.rs:309-318 | pingora-core/src/listeners/accept_limits.rs:333-342 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pingora-core/src/protocols/http/client.rs:67 — pingora-core/src/protocols/http/client.rs:67-76 | pingora-core/src/protocols/http/client.rs:79-89 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (10 corresponding lines) pingora-core/src/protocols/http/v1/client.rs:200 — pingora-core/src/protocols/http/v1/client.rs:200-209 | pingora-core/src/protocols/http/v1/server.rs:1114-1127 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (8 corresponding lines) · ×6
  • Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/tls/mod.rs:185 — pingora-core/src/protocols/tls/mod.rs:185-192 | pingora-core/src/protocols/tls/mod.rs:195-202 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs:314 — pingora-core/src/protocols/http/subrequest/body.rs:314-321 | pingora-core/src/protocols/http/v1/body.rs:1461-1469 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/http/server.rs:1032 — pingora-core/src/protocols/http/server.rs:1032-1039 | pingora-core/src/protocols/http/server.rs:1061-1068 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs:265 — pingora-core/src/protocols/http/subrequest/server.rs:265-272 | pingora-core/src/protocols/http/v1/server.rs:567-574 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/tls/boringssl_openssl/server.rs:39 — pingora-core/src/protocols/tls/boringssl_openssl/server.rs:39-46 | pingora-core/src/protocols/tls/rustls/server.rs:57-64 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (8 corresponding lines) pingora-core/src/protocols/http/compression/brotli.rs:32 — pingora-core/src/protocols/http/compression/brotli.rs:32-40 | pingora-core/src/protocols/http/compression/gzip.rs:31-38 — These two members are one piece of code written twice and then edited apart: 8 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (12 lines × 2) · ×6
  • Duplicated block (12 lines × 2) pingora-cache/src/lib.rs:613 — pingora-cache/src/lib.rs:613-624 | pingora-cache/src/lib.rs:672-683 — 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) pingora-core/src/connectors/l4.rs:178 — pingora-core/src/connectors/l4.rs:178-189 | pingora-core/src/connectors/l4.rs:206-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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/connectors/l4.rs:178` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pingora-core/src/connectors/l4.rs:177` calls `local_addr` and `pingora-core/src/connectors/l4.rs:205` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
  • Duplicated block (12 lines × 2) pingora-core/src/utils/tls/rustls.rs:186 — pingora-core/src/utils/tls/rustls.rs:186-197 | pingora-core/src/utils/tls/s2n.rs:189-200 — before extracting anything, compare `pingora-core/src/utils/tls/rustls.rs` and `pingora-core/src/utils/tls/s2n.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
  • Duplicated block (12 lines × 2) pingora-lru/src/persistence.rs:161 — pingora-lru/src/persistence.rs:161-172 | pingora-lru/src/persistence.rs:243-254 — 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) pingora-proxy/src/proxy_custom.rs:1476 — pingora-proxy/src/proxy_custom.rs:1476-1487 | pingora-proxy/src/proxy_h2.rs:1390-1401 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1476` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
  • Duplicated block (12 lines × 2) pingora-core/src/protocols/http/v1/client.rs:165 — pingora-core/src/protocols/http/v1/client.rs:165-176 | pingora-core/src/protocols/http/v1/server.rs:981-992 — before extracting anything, compare `pingora-core/src/protocols/http/v1/client.rs` and `pingora-core/src/protocols/http/v1/server.rs` as WHOLE FILES: this scan already matched 5 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.
D4 · Code Duplication · Duplicated block (10 lines × 2) · ×6
  • Duplicated block (10 lines × 2) pingora-core/src/protocols/http/subrequest/server.rs:1024 — pingora-core/src/protocols/http/subrequest/server.rs:1024-1033 | pingora-core/src/protocols/http/subrequest/server.rs:1169-1178 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/subrequest/server.rs:1024` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pingora-core/src/utils/tls/rustls.rs:216 — pingora-core/src/utils/tls/rustls.rs:216-225 | pingora-core/src/utils/tls/s2n.rs:219-228 — before extracting anything, compare `pingora-core/src/utils/tls/rustls.rs` and `pingora-core/src/utils/tls/s2n.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/utils/tls/rustls.rs:216` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pingora-proxy/src/proxy_h1.rs:688 — pingora-proxy/src/proxy_h1.rs:688-697 | pingora-proxy/src/proxy_h2.rs:765-774 — before extracting anything, compare `pingora-proxy/src/proxy_h1.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 388 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_h1.rs:688` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pingora-load-balancing/src/health_check.rs:206 — pingora-load-balancing/src/health_check.rs:206-215 | pingora-load-balancing/src/health_check.rs:240-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-load-balancing/src/health_check.rs:206` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (10 lines × 2) pingora-core/src/protocols/http/subrequest/server.rs:776 — pingora-core/src/protocols/http/subrequest/server.rs:776-785 | pingora-core/src/protocols/http/v1/server.rs:1504-1513 — `pingora-core/src/protocols/http/subrequest/server.rs` and `pingora-core/src/protocols/http/v1/server.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 8 separate duplicated blocks between them, totalling at least 81 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) pingora-core/src/protocols/tls/s2n/client.rs:38 — pingora-core/src/protocols/tls/s2n/client.rs:38-47 | pingora-core/src/protocols/tls/s2n/server.rs:34-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/tls/s2n/client.rs:38` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (9 lines × 2) · ×6
  • Duplicated block (9 lines × 2) pingora-proxy/src/lib.rs:2080 — pingora-proxy/src/lib.rs:2080-2088 | pingora-proxy/src/lib.rs:2107-2115 — 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) pingora-proxy/src/proxy_custom.rs:252 — pingora-proxy/src/proxy_custom.rs:252-260 | pingora-proxy/src/proxy_h2.rs:252-260 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 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 × 2) pingora-cache/src/eviction/lru.rs:138 — pingora-cache/src/eviction/lru.rs:138-147 | pingora-cache/src/eviction/simple_lru.rs:175-183 — 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) pingora-core/src/utils/tls/rustls.rs:69 — pingora-core/src/utils/tls/rustls.rs:69-77 | pingora-core/src/utils/tls/s2n.rs:64-72 — before extracting anything, compare `pingora-core/src/utils/tls/rustls.rs` and `pingora-core/src/utils/tls/s2n.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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 × 2) pingora-core/src/utils/tls/rustls.rs:81 — pingora-core/src/utils/tls/rustls.rs:81-89 | pingora-core/src/utils/tls/s2n.rs:76-84 — before extracting anything, compare `pingora-core/src/utils/tls/rustls.rs` and `pingora-core/src/utils/tls/s2n.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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 × 2) pingora-proxy/src/proxy_custom.rs:1403 — pingora-proxy/src/proxy_custom.rs:1403-1411 | pingora-proxy/src/proxy_h2.rs:1285-1293 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1403` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D1 · Cyclomatic Complexity · HttpSession · ×5
  • HttpSession::write_proxy_tasks (cyclomatic 40) pingora-core/src/protocols/http/subrequest/server.rs:920 — HttpSession::write_proxy_tasks 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.
  • HttpSession::read_response (cyclomatic 23) pingora-core/src/protocols/http/v1/client.rs:254 — HttpSession::read_response 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.
  • HttpSession::write_proxy_tasks (cyclomatic 23) pingora-core/src/protocols/http/v1/server.rs:1648 — HttpSession::write_proxy_tasks 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.
  • HttpSession::read_request (cyclomatic 21) pingora-core/src/protocols/http/v1/server.rs:284 — HttpSession::read_request 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.
  • HttpSession::prepare_response_header (cyclomatic 20) pingora-core/src/protocols/http/v1/server.rs:844 — HttpSession::prepare_response_header 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.
D2 · Cognitive Complexity · pingora_proxy · ×5
  • pingora_proxy::subrequest::pipe::pipe_subrequest (cognitive 74) pingora-proxy/src/subrequest/pipe.rs:205 — pingora_proxy::subrequest::pipe::pipe_subrequest has cognitive complexity 74 (threshold 15). Drivers by points: if/else 20 (52 pts), boolean chains 14, loops 2 (5 pts), match/switch 2 (3 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.
  • pingora_proxy::proxy_cache::range_filter::parse_range_header (cognitive 36) pingora-proxy/src/proxy_cache.rs:1220 — pingora_proxy::proxy_cache::range_filter::parse_range_header has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (31 pts), match/switch 2 (3 pts), loops 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
  • pingora_proxy::proxy_h2::pipe_up_to_down_response (cognitive 35) pingora-proxy/src/proxy_h2.rs:1246 — pingora_proxy::proxy_h2::pipe_up_to_down_response has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 6 (10 pts), boolean chains 5, 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.
  • pingora_proxy::proxy_custom::read_custom_response (cognitive 32) pingora-proxy/src/proxy_custom.rs:1379 — pingora_proxy::proxy_custom::read_custom_response has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 4 (7 pts), boolean chains 4, loops 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.
  • pingora_proxy::proxy_h1::send_body_to1 (cognitive 28) pingora-proxy/src/proxy_h1.rs:1157 — pingora_proxy::proxy_h1::send_body_to1 has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 6 (18 pts), if/else 6 (10 pts) (nesting depth added 16). 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.
D4 · Code Duplication · Edited copy of a member (17 corresponding lines) · ×5
  • Edited copy of a member (17 corresponding lines) pingora-cache/src/eviction/async_lru.rs:199 — pingora-cache/src/eviction/async_lru.rs:199-215 | pingora-cache/src/eviction/lru.rs:106-133 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pingora-core/src/protocols/windows.rs:29 — pingora-core/src/protocols/windows.rs:29-45 | pingora-core/src/protocols/windows.rs:46-62 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs:787 — pingora-core/src/protocols/http/subrequest/server.rs:787-803 | pingora-core/src/protocols/http/v1/server.rs:1515-1535 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) tinyufo/src/lib.rs:366 — tinyufo/src/lib.rs:366-382 | tinyufo/src/lib.rs:388-404 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (17 corresponding lines) pingora-proxy/src/lib.rs:2079 — pingora-proxy/src/lib.rs:2079-2095 | pingora-proxy/src/lib.rs:2106-2124 — 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 · Duplicated block (11 lines × 2) · ×5
  • Duplicated block (11 lines × 2) pingora-core/src/connectors/tls/rustls/mod.rs:284 — pingora-core/src/connectors/tls/rustls/mod.rs:284-294 | pingora-core/src/connectors/tls/s2n/mod.rs:161-171 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/connectors/tls/rustls/mod.rs:284` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pingora-core/src/protocols/http/v1/client.rs:607 — pingora-core/src/protocols/http/v1/client.rs:607-617 | pingora-core/src/protocols/http/v1/server.rs:823-833 — before extracting anything, compare `pingora-core/src/protocols/http/v1/client.rs` and `pingora-core/src/protocols/http/v1/server.rs` as WHOLE FILES: this scan already matched 5 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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/v1/client.rs:607` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pingora-core/src/protocols/http/v1/server.rs:1735 — pingora-core/src/protocols/http/v1/server.rs:1735-1745 | pingora-core/src/protocols/http/v1/server.rs:1750-1760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/v1/server.rs:1735` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pingora-proxy/src/proxy_custom.rs:1456 — pingora-proxy/src/proxy_custom.rs:1456-1466 | pingora-proxy/src/proxy_h2.rs:1344-1354 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1456` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (11 lines × 2) pingora-core/src/protocols/http/subrequest/body.rs:270 — pingora-core/src/protocols/http/subrequest/body.rs:270-280 | pingora-core/src/protocols/http/v1/body.rs:1372-1382 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/subrequest/body.rs:270` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (6 lines × 2) · ×5
  • Duplicated block (6 lines × 2) pingora-core/src/protocols/http/subrequest/server.rs:328 — pingora-core/src/protocols/http/subrequest/server.rs:328-335 | pingora-core/src/protocols/http/v1/server.rs:634-639 — `pingora-core/src/protocols/http/subrequest/server.rs` and `pingora-core/src/protocols/http/v1/server.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 8 separate duplicated blocks between them, totalling at least 81 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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/subrequest/server.rs:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
  • Duplicated block (6 lines × 2) pingora-core/src/protocols/tls/rustls/stream.rs:170 — pingora-core/src/protocols/tls/rustls/stream.rs:170-175 | pingora-core/src/protocols/tls/rustls/stream.rs:181-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/tls/rustls/stream.rs:170` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `self` to `crate) async fn connect(&mut` in one and `crate) async fn accept(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (6 lines × 2) pingora-boringssl/src/ext.rs:225 — pingora-boringssl/src/ext.rs:225-230 | pingora-openssl/src/ext.rs:49-54 — 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) pingora-core/src/utils/tls/rustls.rs:60 — pingora-core/src/utils/tls/rustls.rs:60-65 | pingora-core/src/utils/tls/s2n.rs:55-60 — before extracting anything, compare `pingora-core/src/utils/tls/rustls.rs` and `pingora-core/src/utils/tls/s2n.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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 × 2) pingora-core/src/protocols/http/compression/brotli.rs:66 — pingora-core/src/protocols/http/compression/brotli.rs:66-71 | pingora-core/src/protocols/http/compression/gzip.rs:63-68 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/compression/brotli.rs:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · pingora_proxy · ×4
  • pingora_proxy::subrequest::pipe::pipe_subrequest (cyclomatic 41) pingora-proxy/src/subrequest/pipe.rs:205 — pingora_proxy::subrequest::pipe::pipe_subrequest 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.
  • pingora_proxy::proxy_h2::pipe_up_to_down_response (cyclomatic 23) pingora-proxy/src/proxy_h2.rs:1246 — pingora_proxy::proxy_h2::pipe_up_to_down_response 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.
  • pingora_proxy::proxy_custom::read_custom_response (cyclomatic 19) pingora-proxy/src/proxy_custom.rs:1379 — pingora_proxy::proxy_custom::read_custom_response 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.
  • pingora_proxy::proxy_cache::range_filter::parse_range_header (cyclomatic 18) pingora-proxy/src/proxy_cache.rs:1220 — pingora_proxy::proxy_cache::range_filter::parse_range_header 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.
D2 · Cognitive Complexity · BodyReader · ×4
  • BodyReader::do_read_chunked_body (cognitive 50) pingora-core/src/protocols/http/v1/body.rs:515 — BodyReader::do_read_chunked_body has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (49 pts), match/switch 1 (nesting depth added 33). 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.
  • BodyReader::parse_chunked_buf (cognitive 41) pingora-core/src/protocols/http/v1/body.rs:686 — BodyReader::parse_chunked_buf has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (34 pts), match/switch 3 (6 pts), boolean chains 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.
  • BodyReader::do_read_chunked_body_final (cognitive 31) pingora-core/src/protocols/http/v1/body.rs:833 — BodyReader::do_read_chunked_body_final has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 3 (7 pts), loops 1 (2 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.
  • BodyReader::validate_crlf (cognitive 21) pingora-core/src/protocols/http/v1/body.rs:1029 — BodyReader::validate_crlf has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (19 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.
D2 · Cognitive Complexity · HttpCache · ×4
  • HttpCache::cache_lookup (cognitive 21) pingora-cache/src/lib.rs:1540 — HttpCache::cache_lookup has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 3, 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.
  • HttpCache::update_variance (cognitive 20) pingora-cache/src/lib.rs:1371 — HttpCache::update_variance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 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.
  • HttpCache::cache_lock_wait (cognitive 20) pingora-cache/src/lib.rs:1747 — HttpCache::cache_lock_wait has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 2 (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.
  • HttpCache::set_miss_handler (cognitive 16) pingora-cache/src/lib.rs:1028 — HttpCache::set_miss_handler has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 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.
D3 · God Classes · FunctionTooLong · ×4
  • FunctionTooLong: pingora_proxy::subrequest::pipe::pipe_subrequest pingora-proxy/src/subrequest/pipe.rs:205 — FunctionTooLong — pingora_proxy::subrequest::pipe::pipe_subrequest 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.
  • FunctionTooLong: pingora_core::connectors::l4::connect pingora-core/src/connectors/l4.rs:108 — FunctionTooLong — pingora_core::connectors::l4::connect runs 104 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 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: pingora_load_balancing::run_selector_rebuilds pingora-load-balancing/src/lib.rs:1489 — FunctionTooLong — pingora_load_balancing::run_selector_rebuilds runs 104 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 4 over it, 1.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
  • FunctionTooLong: pingora_core::connectors::tls::rustls::connect pingora-core/src/connectors/tls/rustls/mod.rs:129 — FunctionTooLong — pingora_core::connectors::tls::rustls::connect runs 101 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 1 over it, 1.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
D4 · Code Duplication · Edited copy of a member (15 corresponding lines) · ×4
  • Edited copy of a member (15 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs:298 — pingora-core/src/protocols/http/subrequest/body.rs:298-312 | pingora-core/src/protocols/http/v1/body.rs:1441-1456 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pingora-http-parser/src/backend.rs:231 — pingora-http-parser/src/backend.rs:231-245 | pingora-http-parser/src/backend.rs:277-291 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pingora-proxy/src/lib.rs:230 — pingora-proxy/src/lib.rs:230-244 | pingora-proxy/src/lib.rs:263-281 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (15 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs:323 — pingora-core/src/protocols/http/subrequest/body.rs:323-341 | pingora-core/src/protocols/http/v1/body.rs:1471-1485 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (14 lines × 2) · ×4
  • Duplicated block (14 lines × 2) pingora-cache/src/cache_control.rs:131 — pingora-cache/src/cache_control.rs:131-144 | pingora-cache/src/cache_control.rs:157-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `s` to `&str` in one and `String` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
  • Duplicated block (14 lines × 2) pingora-proxy/src/proxy_custom.rs:184 — pingora-proxy/src/proxy_custom.rs:184-197 | pingora-proxy/src/proxy_h2.rs:407-420 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 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 (14 lines × 2) pingora-proxy/src/proxy_h1.rs:1131 — pingora-proxy/src/proxy_h1.rs:1131-1144 | pingora-proxy/src/subrequest/pipe.rs:501-514 — 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) pingora-core/src/protocols/http/v1/client.rs:558 — pingora-core/src/protocols/http/v1/client.rs:558-571 | pingora-core/src/protocols/http/v1/server.rs:728-741 — before extracting anything, compare `pingora-core/src/protocols/http/v1/client.rs` and `pingora-core/src/protocols/http/v1/server.rs` as WHOLE FILES: this scan already matched 5 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.
D1 · Cyclomatic Complexity · pingora_core · ×3
  • pingora_core::connectors::tls::rustls::connect (cyclomatic 21) pingora-core/src/connectors/tls/rustls/mod.rs:129 — pingora_core::connectors::tls::rustls::connect 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.
  • pingora_core::connectors::tls::boringssl_openssl::connect (cyclomatic 20) pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:148 — pingora_core::connectors::tls::boringssl_openssl::connect 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.
  • pingora_core::connectors::l4::connect (cyclomatic 19) pingora-core/src/connectors/l4.rs:108 — pingora_core::connectors::l4::connect 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.
D3 · God Classes · TooManyFields · ×3
  • TooManyFields: ServerConf pingora-core/src/server/configuration/mod.rs:48 — TooManyFields — 36 stored fields beside 11 methods. The bar is 30 stored fields; this is 6 over it, 1.20× 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: PeerOptions pingora-core/src/upstreams/peer.rs:511 — TooManyFields — 35 stored fields beside 2 methods. The bar is 30 stored fields; this is 5 over it, 1.17× 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: HttpSession pingora-core/src/protocols/http/v1/server.rs:80 — TooManyFields — 32 stored fields beside 96 methods. The bar is 30 stored fields; this is 2 over it, 1.07× 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.
D4 · Code Duplication · Edited copy of a member (9 corresponding lines) · ×3
  • Edited copy of a member (9 corresponding lines) pingora-core/src/protocols/http/v1/body.rs:73 — pingora-core/src/protocols/http/v1/body.rs:73-81 | pingora-core/src/protocols/http/v1/body.rs:83-91 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs:246 — pingora-core/src/protocols/http/subrequest/body.rs:246-254 | pingora-core/src/protocols/http/v1/body.rs:1344-1353 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (9 corresponding lines) pingora-core/src/protocols/l4/stream.rs:956 — pingora-core/src/protocols/l4/stream.rs:956-964 | pingora-core/src/protocols/l4/stream.rs:980-991 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (12 corresponding lines) · ×3
  • Edited copy of a member (12 corresponding lines) pingora-core/src/utils/tls/rustls.rs:214 — pingora-core/src/utils/tls/rustls.rs:214-225 | pingora-core/src/utils/tls/s2n.rs:217-228 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pingora-http/src/lib.rs:821 — pingora-http/src/lib.rs:821-833 | pingora-http/src/lib.rs:835-846 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (12 corresponding lines) pingora-core/src/listeners/mod.rs:572 — pingora-core/src/listeners/mod.rs:572-589 | pingora-core/src/listeners/mod.rs:656-667 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (13 corresponding lines) · ×3
  • Edited copy of a member (13 corresponding lines) pingora-http/src/lib.rs:877 — pingora-http/src/lib.rs:877-898 | pingora-http/src/lib.rs:906-918 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pingora-boringssl/src/ext.rs:40 — pingora-boringssl/src/ext.rs:40-52 | pingora-openssl/src/ext.rs:106-118 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (13 corresponding lines) pingora-core/src/protocols/l4/socket.rs:118 — pingora-core/src/protocols/l4/socket.rs:118-130 | pingora-core/src/protocols/l4/socket.rs:134-150 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (11 corresponding lines) · ×3
  • Edited copy of a member (11 corresponding lines) pingora-core/src/protocols/http/v1/body.rs:1260 — pingora-core/src/protocols/http/v1/body.rs:1260-1270 | pingora-core/src/protocols/http/v1/header.rs:69-80 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pingora-lru/src/lib.rs:420 — pingora-lru/src/lib.rs:420-430 | pingora-lru/src/lib.rs:442-454 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (11 corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs:694 — pingora-core/src/protocols/http/subrequest/server.rs:694-704 | pingora-core/src/protocols/http/v2/server.rs:940-950 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (17 lines × 2) · ×3
  • Duplicated block (17 lines × 2) pingora-core/src/server/mod.rs:265 — pingora-core/src/server/mod.rs:265-281 | pingora-core/src/server/mod.rs:352-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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/server/mod.rs:265` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) pingora-proxy/src/proxy_custom.rs:1102 — pingora-proxy/src/proxy_custom.rs:1102-1118 | pingora-proxy/src/proxy_h2.rs:1061-1077 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1102` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (17 lines × 2) pingora-proxy/src/proxy_h1.rs:722 — pingora-proxy/src/proxy_h1.rs:722-738 | pingora-proxy/src/proxy_h2.rs:793-809 — before extracting anything, compare `pingora-proxy/src/proxy_h1.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 388 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_h1.rs:722` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pingora-proxy/src/proxy_h1.rs:721` calls `maybe_finished`, `is_body_done` and `pingora-proxy/src/proxy_h2.rs:792` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (15 lines × 2) · ×3
  • Duplicated block (15 lines × 2) pingora-core/src/protocols/http/subrequest/body.rs:118 — pingora-core/src/protocols/http/subrequest/body.rs:118-132 | pingora-core/src/protocols/http/subrequest/body.rs:178-192 — 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) pingora-proxy/src/lib.rs:616 — pingora-proxy/src/lib.rs:616-630 | pingora-proxy/src/lib.rs:1749-1763 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/lib.rs:616` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 2) pingora-proxy/src/proxy_custom.rs:607 — pingora-proxy/src/proxy_custom.rs:607-621 | pingora-proxy/src/proxy_h2.rs:605-619 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (9 lines × 3) · ×3
  • Duplicated block (9 lines × 3) pingora-proxy/src/proxy_custom.rs:808 — pingora-proxy/src/proxy_custom.rs:808-816 | pingora-proxy/src/proxy_h1.rs:730-738 | pingora-proxy/src/proxy_h2.rs:801-809 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:808` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (9 lines × 3) pingora-core/src/protocols/http/subrequest/server.rs:316 — pingora-core/src/protocols/http/subrequest/server.rs:316-324 | pingora-core/src/protocols/http/v1/server.rs:622-630 | pingora-core/src/protocols/http/v2/server.rs:562-570 — `pingora-core/src/protocols/http/subrequest/server.rs` and `pingora-core/src/protocols/http/v1/server.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 8 separate duplicated blocks between them, totalling at least 81 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 (9 lines × 3) pingora-core/src/protocols/http/subrequest/server.rs:614 — pingora-core/src/protocols/http/subrequest/server.rs:614-622 | pingora-core/src/protocols/http/v1/server.rs:1196-1204 | pingora-core/src/protocols/http/v2/server.rs:920-928 — `pingora-core/src/protocols/http/subrequest/server.rs` and `pingora-core/src/protocols/http/v1/server.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 8 separate duplicated blocks between them, totalling at least 81 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.
D4 · Code Duplication · Duplicated block (8 lines × 2) · ×3
  • Duplicated block (8 lines × 2) pingora-core/src/protocols/tls/boringssl_openssl/server.rs:86 — pingora-core/src/protocols/tls/boringssl_openssl/server.rs:86-93 | pingora-core/src/protocols/tls/rustls/server.rs:100-107 — 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) pingora-core/src/utils/tls/rustls.rs:49 — pingora-core/src/utils/tls/rustls.rs:49-56 | pingora-core/src/utils/tls/s2n.rs:44-51 — before extracting anything, compare `pingora-core/src/utils/tls/rustls.rs` and `pingora-core/src/utils/tls/s2n.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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) pingora-core/src/protocols/http/compression/zstd.rs:65 — pingora-core/src/protocols/http/compression/zstd.rs:65-72 | pingora-core/src/protocols/http/compression/zstd.rs:138-145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/compression/zstd.rs:65` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D6 · Cohesion (LCOM4) · Low cohesion · ×3
  • Low cohesion: RawStreamWrapper (LCOM4 7) pingora-core/src/protocols/l4/stream.rs:163 — RawStreamWrapper's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
  • Low cohesion: SslStream (LCOM4 4) pingora-core/src/protocols/tls/boringssl_openssl/stream.rs:46 — SslStream'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: HttpHealthCheck (LCOM4 4) pingora-load-balancing/src/health_check.rs:157 — HttpHealthCheck'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.
D31 · IaC & Container Security · Medium IaC · ×2
  • REDACTED
  • REDACTED
D4 · Code Duplication · Edited copy of a member (20 corresponding lines) · ×2
  • Edited copy of a member (20 corresponding lines) pingora-load-balancing/src/health_check.rs:205 — pingora-load-balancing/src/health_check.rs:205-224 | pingora-load-balancing/src/health_check.rs:239-258 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (20 corresponding lines) pingora-lru/src/lib.rs:899 — pingora-lru/src/lib.rs:899-918 | pingora-lru/src/lib.rs:933-952 — These two members are one piece of code written twice and then edited apart: 20 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 (25 corresponding lines) · ×2
  • Edited copy of a member (25 corresponding lines) pingora-core/src/protocols/http/subrequest/body.rs:268 — pingora-core/src/protocols/http/subrequest/body.rs:268-292 | pingora-core/src/protocols/http/v1/body.rs:1370-1397 — These two members are one piece of code written twice and then edited apart: 25 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (25 corresponding lines) pingora-core/src/protocols/http/v1/client.rs:797 — pingora-core/src/protocols/http/v1/client.rs:797-821 | pingora-core/src/protocols/http/v1/common.rs:118-145 — These two members are one piece of code written twice and then edited apart: 25 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 (19 corresponding lines) · ×2
  • Edited copy of a member (19 corresponding lines) pingora-cache/src/cache_control.rs:129 — pingora-cache/src/cache_control.rs:129-147 | pingora-cache/src/cache_control.rs:154-173 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (19 corresponding lines) pingora-core/src/protocols/tls/s2n/client.rs:29 — pingora-core/src/protocols/tls/s2n/client.rs:29-47 | pingora-core/src/protocols/tls/s2n/server.rs:24-44 — These two members are one piece of code written twice and then edited apart: 19 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (14 corresponding lines) · ×2
  • Edited copy of a member (14 corresponding lines) pingora-core/src/protocols/http/server.rs:229 — pingora-core/src/protocols/http/server.rs:229-242 | pingora-core/src/protocols/http/server.rs:245-258 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
  • Edited copy of a member (14 corresponding lines) pingora-core/src/protocols/l4/stream.rs:645 — pingora-core/src/protocols/l4/stream.rs:645-658 | pingora-core/src/protocols/l4/stream.rs:661-674 — These two members are one piece of code written twice and then edited apart: 14 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Duplicated block (15–16 lines × 2) · ×2
  • Duplicated block (15–16 lines × 2) pingora-core/src/protocols/http/subrequest/server.rs:838 — pingora-core/src/protocols/http/subrequest/server.rs:838-852 | pingora-core/src/protocols/http/v1/server.rs:1583-1598 — `pingora-core/src/protocols/http/subrequest/server.rs` and `pingora-core/src/protocols/http/v1/server.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 8 separate duplicated blocks between them, totalling at least 81 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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/subrequest/server.rs:838` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15–16 lines × 2) pingora-proxy/src/proxy_custom.rs:751 — pingora-proxy/src/proxy_custom.rs:751-765 | pingora-proxy/src/proxy_h1.rs:677-692 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:751` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–15 lines × 3) · ×2
  • Duplicated block (14–15 lines × 3) pingora-core/src/protocols/http/subrequest/server.rs:807 — pingora-core/src/protocols/http/subrequest/server.rs:807-820 | pingora-core/src/protocols/http/subrequest/server.rs:845-859 | pingora-core/src/protocols/http/v1/server.rs:1539-1552 — `pingora-core/src/protocols/http/subrequest/server.rs` and `pingora-core/src/protocols/http/v1/server.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 8 separate duplicated blocks between them, totalling at least 81 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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/subrequest/server.rs:845` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (14–15 lines × 3) pingora-proxy/src/proxy_custom.rs:1206 — pingora-proxy/src/proxy_custom.rs:1206-1219 | pingora-proxy/src/proxy_h1.rs:1085-1099 | pingora-proxy/src/proxy_h2.rs:1147-1161 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1206` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15 lines × 3) · ×2
  • Duplicated block (15 lines × 3) pingora-core/src/protocols/l4/stream.rs:731 — pingora-core/src/protocols/l4/stream.rs:731-745 | pingora-core/src/protocols/l4/stream.rs:755-769 | pingora-core/src/protocols/l4/stream.rs:780-794 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/l4/stream.rs:731` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
  • Duplicated block (15 lines × 3) pingora-proxy/src/proxy_custom.rs:226 — pingora-proxy/src/proxy_custom.rs:226-240 | pingora-proxy/src/proxy_h1.rs:74-88 | pingora-proxy/src/proxy_h2.rs:184-198 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:226` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (8 lines × 3) · ×2
  • Duplicated block (8 lines × 3) pingora-core/src/utils/tls/boringssl_openssl.rs:127 — pingora-core/src/utils/tls/boringssl_openssl.rs:127-134 | pingora-core/src/utils/tls/rustls.rs:215-222 | pingora-core/src/utils/tls/s2n.rs:218-225 — before extracting anything, compare `pingora-core/src/utils/tls/rustls.rs` and `pingora-core/src/utils/tls/s2n.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 62 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) pingora-core/src/listeners/tls/boringssl_openssl/mod.rs:126 — pingora-core/src/listeners/tls/boringssl_openssl/mod.rs:126-133 | pingora-core/src/listeners/tls/rustls/mod.rs:170-177 | pingora-core/src/listeners/tls/s2n/mod.rs:171-178 — 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.
D4 · Code Duplication · Duplicated block (5 lines × 2) · ×2
  • Duplicated block (5 lines × 2) pingora-core/src/protocols/http/v1/body.rs:1606 — pingora-core/src/protocols/http/v1/body.rs:1606-1610 | pingora-core/src/protocols/http/v1/header.rs:214-218 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/v1/body.rs:1606` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
  • Duplicated block (5 lines × 2) pingora-core/src/protocols/tls/boringssl_openssl/stream.rs:79 — pingora-core/src/protocols/tls/boringssl_openssl/stream.rs:79-83 | pingora-core/src/protocols/tls/boringssl_openssl/stream.rs:90-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/tls/boringssl_openssl/stream.rs:79` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D1 · Cyclomatic Complexity · Server · ×1
  • Server::run (cyclomatic 20) pingora-core/src/server/mod.rs:692 — Server::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.
D1 · Cyclomatic Complexity · HealthCheckService · ×1
  • HealthCheckService::run (cyclomatic 19) pingora-load-balancing/src/background.rs:388 — HealthCheckService::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.
D1 · Cyclomatic Complexity · ServeFromCache · ×1
  • ServeFromCache::next_http_task (cyclomatic 19) pingora-proxy/src/proxy_cache.rs:2629 — ServeFromCache::next_http_task has cyclomatic complexity 19 (threshold 15). 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · pingora_http · ×1
  • pingora_http::authority::raw_target_authority (cyclomatic 18) pingora-http/src/authority.rs:58 — pingora_http::authority::raw_target_authority has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D1 · Cyclomatic Complexity · RTCache · ×1
  • RTCache::get (cyclomatic 16) pingora-memory-cache/src/read_through.rs:150 — RTCache::get 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.
D2 · Cognitive Complexity · RTCache · ×1
  • RTCache::get (cognitive 38) pingora-memory-cache/src/read_through.rs:150 — RTCache::get has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 6 (15 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.
D2 · Cognitive Complexity · HealthCheckService · ×1
  • HealthCheckService::run (cognitive 34) pingora-load-balancing/src/background.rs:388 — HealthCheckService::run has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 4 (11 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pingora_load_balancing · ×1
  • pingora_load_balancing::run_selector_rebuilds (cognitive 34) pingora-load-balancing/src/lib.rs:1489 — pingora_load_balancing::run_selector_rebuilds has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 3 (8 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.
D2 · Cognitive Complexity · Service · ×1
  • Service::run_endpoint (cognitive 30) pingora-core/src/services/listening.rs:243 — Service::run_endpoint has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 4 (10 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · LoadBalancerGroup · ×1
  • LoadBalancerGroup::run (cognitive 29) pingora-load-balancing/src/background.rs:282 — LoadBalancerGroup::run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 4 (10 pts), boolean chains 1, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · ServeFromCache · ×1
  • ServeFromCache::next_http_task (cognitive 28) pingora-proxy/src/proxy_cache.rs:2629 — ServeFromCache::next_http_task has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 13). Of this number, 26 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · CustomMessageForwarder · ×1
  • CustomMessageForwarder::proxy (cognitive 28) pingora-proxy/src/proxy_custom.rs:1519 — CustomMessageForwarder::proxy has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 5 (11 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.
D2 · Cognitive Complexity · pingora_http · ×1
  • pingora_http::authority::raw_target_authority (cognitive 26) pingora-http/src/authority.rs:58 — pingora_http::authority::raw_target_authority has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 4, 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.
D2 · Cognitive Complexity · Server · ×1
  • Server::run (cognitive 25) pingora-core/src/server/mod.rs:692 — Server::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 5 (7 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.
D2 · Cognitive Complexity · CachePutCtx · ×1
  • CachePutCtx::do_cache_put (cognitive 24) pingora-cache/src/put.rs:181 — CachePutCtx::do_cache_put has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (18 pts), match/switch 2 (5 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.
D2 · Cognitive Complexity · ResponseCompressionCtx · ×1
  • ResponseCompressionCtx::response_header_filter (cognitive 22) pingora-core/src/protocols/http/compression/mod.rs:312 — ResponseCompressionCtx::response_header_filter has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 3 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · HealthRegistry · ×1
  • HealthRegistry::run_health_check (cognitive 22) pingora-load-balancing/src/lib.rs:459 — HealthRegistry::run_health_check has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 3 (6 pts) (nesting depth added 10). Of this number, 18 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · RangeBodyFilter · ×1
  • RangeBodyFilter::filter_multi_range_body (cognitive 22) pingora-proxy/src/proxy_cache.rs:2176 — RangeBodyFilter::filter_multi_range_body has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (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.
D2 · Cognitive Complexity · BodyWriter · ×1
  • BodyWriter::poll_write_content_length_body_task (cognitive 21) pingora-core/src/protocols/http/v1/body.rs:1798 — BodyWriter::poll_write_content_length_body_task has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Lru · ×1
  • Lru::evict_to_limit_with_rng (cognitive 21) pingora-lru/src/lib.rs:542 — Lru::evict_to_limit_with_rng has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, loops 2 (3 pts), 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.
D2 · Cognitive Complexity · EndpointLimits · ×1
  • EndpointLimits::admit (cognitive 20) pingora-core/src/listeners/accept_limits.rs:210 — EndpointLimits::admit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · Session · ×1
  • Session::downstream_response_task_filter (cognitive 20) pingora-proxy/src/lib.rs:980 — Session::downstream_response_task_filter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 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.
D2 · Cognitive Complexity · LoadBalancer · ×1
  • LoadBalancer::run (cognitive 19) pingora-load-balancing/src/background.rs:199 — LoadBalancer::run has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · TimerManager · ×1
  • TimerManager::clock_thread (cognitive 18) pingora-timeout/src/timer.rs:130 — TimerManager::clock_thread has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 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.
D2 · Cognitive Complexity · Connector · ×1
  • Connector::get_http_session (cognitive 17) pingora-core/src/connectors/http/mod.rs:65 — Connector::get_http_session has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D2 · Cognitive Complexity · pingora_lru · ×1
  • pingora_lru::async_lru::eviction_worker (cognitive 17) pingora-lru/src/async_lru.rs:1020 — pingora_lru::async_lru::eviction_worker has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), 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.
D2 · Cognitive Complexity · PeerOptions · ×1
  • PeerOptions::fmt (cognitive 16) pingora-core/src/upstreams/peer.rs:673 — PeerOptions::fmt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12, loops 2 (4 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.
D2 · Cognitive Complexity · FiFoQueues · ×1
  • FiFoQueues::admit (cognitive 16) tinyufo/src/lib.rs:149 — FiFoQueues::admit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1 (nesting depth added 4). Of this number, 13 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D32 · Data Compliance (PII/GDPR) · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D36 · Supply-chain Provenance & Signing · REDACTED · ×1
  • REDACTED
D4 · Code Duplication · Near-duplicate member family (3 members, 144 shared lines) · ×1
  • Near-duplicate member family (3 members, 144 shared lines) pingora-proxy/src/proxy_custom.rs:555 — pingora-proxy/src/proxy_custom.rs:555-1035 | pingora-proxy/src/proxy_h1.rs:486-922 | pingora-proxy/src/proxy_h2.rs:543-989 — These 3 members are variants of one another: a block of 144 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication · Near-duplicate member family (3 members, 67 shared lines) · ×1
  • Near-duplicate member family (3 members, 67 shared lines) pingora-proxy/src/proxy_custom.rs:1049 — pingora-proxy/src/proxy_custom.rs:1049-1219 | pingora-proxy/src/proxy_h1.rs:936-1099 | pingora-proxy/src/proxy_h2.rs:1003-1161 — These 3 members are variants of one another: a block of 67 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 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 3 times.
D4 · Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) · ×1
  • Members sharing a duplicated core (4 members, 50+ identical tokens) pingora-core/src/protocols/http/subrequest/server.rs:805 — pingora-core/src/protocols/http/subrequest/server.rs:805-833 | pingora-core/src/protocols/http/subrequest/server.rs:836-881 | pingora-core/src/protocols/http/v1/server.rs:1537-1562 | pingora-core/src/protocols/http/v1/server.rs:1582-1625 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication · Edited copies of one member (3 members, 66+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 66+ corresponding lines) pingora-core/src/protocols/http/v1/body.rs:1805 — pingora-core/src/protocols/http/v1/body.rs:1805-1895 | pingora-core/src/protocols/http/v1/body.rs:1905-1989 | pingora-core/src/protocols/http/v1/body.rs:1999-2064 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 66 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (66 corresponding lines) · ×1
  • Edited copy of a member (66 corresponding lines) pingora-lru/src/persistence.rs:160 — pingora-lru/src/persistence.rs:160-225 | pingora-lru/src/persistence.rs:242-307 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 73+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 73+ corresponding lines) pingora-proxy/src/proxy_custom.rs:463 — pingora-proxy/src/proxy_custom.rs:463-535 | pingora-proxy/src/proxy_h1.rs:391-466 | pingora-proxy/src/proxy_h2.rs:447-522 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 73 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (27 corresponding lines) · ×1
  • Edited copy of a member (27 corresponding lines) pingora-core/src/listeners/tls/boringssl_openssl/mod.rs:213 — pingora-core/src/listeners/tls/boringssl_openssl/mod.rs:213-239 | pingora-core/src/listeners/tls/rustls/mod.rs:259-286 — These two members are one piece of code written twice and then edited apart: 27 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 (28 corresponding lines) · ×1
  • Edited copy of a member (28 corresponding lines) pingora-proxy/src/proxy_cache.rs:2715 — pingora-proxy/src/proxy_cache.rs:2715-2748 | pingora-proxy/src/proxy_cache.rs:2754-2781 — These two members are one piece of code written twice and then edited apart: 28 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 (23 corresponding lines) · ×1
  • Edited copy of a member (23 corresponding lines) pingora-proxy/src/proxy_custom.rs:183 — pingora-proxy/src/proxy_custom.rs:183-205 | pingora-proxy/src/proxy_h2.rs:406-431 — These two members are one piece of code written twice and then edited apart: 23 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 (24 corresponding lines) · ×1
  • Edited copy of a member (24 corresponding lines) pingora-core/src/protocols/http/v1/server.rs:1829 — pingora-core/src/protocols/http/v1/server.rs:1829-1855 | pingora-header-serde/src/lib.rs:192-215 — 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 copies of one member (3 members, 23+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 23+ corresponding lines) pingora-core/src/protocols/http/compression/brotli.rs:44 — pingora-core/src/protocols/http/compression/brotli.rs:44-71 | pingora-core/src/protocols/http/compression/gzip.rs:42-68 | pingora-core/src/protocols/http/compression/zstd.rs:50-72 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (33 corresponding lines) · ×1
  • Edited copy of a member (33 corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs:568 — pingora-core/src/protocols/http/subrequest/server.rs:568-600 | pingora-core/src/protocols/http/v1/server.rs:1147-1182 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 21+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 21+ corresponding lines) pingora-core/src/protocols/l4/stream.rs:725 — pingora-core/src/protocols/l4/stream.rs:725-745 | pingora-core/src/protocols/l4/stream.rs:749-769 | pingora-core/src/protocols/l4/stream.rs:774-794 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (16 corresponding lines) · ×1
  • Edited copy of a member (16 corresponding lines) pingora-core/src/protocols/http/v2/client.rs:309 — pingora-core/src/protocols/http/v2/client.rs:309-327 | pingora-core/src/protocols/http/v2/server.rs:545-560 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 11+ corresponding lines) pingora-core/src/protocols/l4/stream.rs:64 — pingora-core/src/protocols/l4/stream.rs:64-74 | pingora-core/src/protocols/l4/stream.rs:78-88 | pingora-core/src/protocols/l4/stream.rs:118-128 | pingora-core/src/protocols/l4/stream.rs:212-223 | pingora-core/src/protocols/l4/stream.rs:301-311 | pingora-core/src/protocols/l4/stream.rs:341-351 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 11+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 11+ corresponding lines) pingora-core/src/protocols/l4/stream.rs:90 — pingora-core/src/protocols/l4/stream.rs:90-100 | pingora-core/src/protocols/l4/stream.rs:102-112 | pingora-core/src/protocols/l4/stream.rs:313-323 | pingora-core/src/protocols/l4/stream.rs:325-335 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 13+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 13+ corresponding lines) pingora-lru/src/lib.rs:164 — pingora-lru/src/lib.rs:164-183 | pingora-lru/src/lib.rs:205-217 | pingora-lru/src/lib.rs:236-252 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 10+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 10+ corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs:492 — pingora-core/src/protocols/http/subrequest/server.rs:492-501 | pingora-core/src/protocols/http/v1/client.rs:180-189 | pingora-core/src/protocols/http/v1/server.rs:996-1005 | pingora-core/src/protocols/http/v2/server.rs:684-695 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (4 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (4 members, 9+ corresponding lines) pingora-core/src/protocols/tls/boringssl_openssl/stream.rs:75 — pingora-core/src/protocols/tls/boringssl_openssl/stream.rs:75-83 | pingora-core/src/protocols/tls/boringssl_openssl/stream.rs:86-94 | pingora-core/src/protocols/tls/rustls/stream.rs:167-175 | pingora-core/src/protocols/tls/rustls/stream.rs:178-186 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication · Edited copies of one member (6 members, 9+ corresponding lines) · ×1
  • Edited copies of one member (6 members, 9+ corresponding lines) pingora-core/src/protocols/http/subrequest/server.rs:303 — pingora-core/src/protocols/http/subrequest/server.rs:303-314 | pingora-core/src/protocols/http/subrequest/server.rs:327-341 | pingora-core/src/protocols/http/v1/server.rs:612-620 | pingora-core/src/protocols/http/v1/server.rs:633-644 | pingora-core/src/protocols/http/v1/server.rs:1093-1101 | pingora-core/src/protocols/http/v2/server.rs:574-588 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication · Edited copy of a member (6 corresponding lines) · ×1
  • Edited copy of a member (6 corresponding lines) pingora-cache/src/eviction/async_lru.rs:336 — pingora-cache/src/eviction/async_lru.rs:336-341 | pingora-cache/src/eviction/lru.rs:255-260 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copy of a member (3 corresponding lines) · ×1
  • Edited copy of a member (3 corresponding lines) pingora-core/src/server/transfer_fd/mod.rs:59 — pingora-core/src/server/transfer_fd/mod.rs:59-61 | pingora-lru/src/async_lru.rs:250-252 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication · Edited copies of one member (3 members, 5+ corresponding lines) · ×1
  • Edited copies of one member (3 members, 5+ corresponding lines) pingora-core/src/protocols/tls/boringssl_openssl/client.rs:92 — pingora-core/src/protocols/tls/boringssl_openssl/client.rs:92-96 | pingora-core/src/protocols/tls/rustls/stream.rs:113-117 | pingora-core/src/protocols/tls/s2n/stream.rs:264-268 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication · Duplicated block (105–112 lines × 3) · ×1
  • Duplicated block (105–112 lines × 3) pingora-proxy/src/proxy_custom.rs:827 — pingora-proxy/src/proxy_custom.rs:827-931 | pingora-proxy/src/proxy_h1.rs:750-861 | pingora-proxy/src/proxy_h2.rs:821-928 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:827` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (43 lines × 2) · ×1
  • Duplicated block (43 lines × 2) pingora-lru/src/persistence.rs:183 — pingora-lru/src/persistence.rs:183-225 | pingora-lru/src/persistence.rs:265-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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-lru/src/persistence.rs:183` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (38–41 lines × 3) · ×1
  • Duplicated block (38–41 lines × 3) pingora-proxy/src/proxy_custom.rs:1060 — pingora-proxy/src/proxy_custom.rs:1060-1097 | pingora-proxy/src/proxy_h1.rs:956-996 | pingora-proxy/src/proxy_h2.rs:1017-1057 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1060` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (38–39 lines × 2) · ×1
  • Duplicated block (38–39 lines × 2) pingora-proxy/src/proxy_custom.rs:1175 — pingora-proxy/src/proxy_custom.rs:1175-1212 | pingora-proxy/src/proxy_h2.rs:1116-1154 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1175` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (38 lines × 3) · ×1
  • Duplicated block (38 lines × 3) pingora-core/src/protocols/http/v1/body.rs:1858 — pingora-core/src/protocols/http/v1/body.rs:1858-1895 | pingora-core/src/protocols/http/v1/body.rs:1952-1989 | pingora-core/src/protocols/http/v1/body.rs:2027-2064 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/v1/body.rs:1858` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (18–32 lines × 2) · ×1
  • Duplicated block (18–32 lines × 2) pingora-proxy/src/proxy_h1.rs:538 — pingora-proxy/src/proxy_h1.rs:538-569 | pingora-proxy/src/proxy_h2.rs:610-627 — before extracting anything, compare `pingora-proxy/src/proxy_h1.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 388 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_h1.rs:538` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pingora-proxy/src/proxy_h1.rs:573` calls `try_reserve`, `or_err` and `pingora-proxy/src/proxy_h2.rs:629` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (24–27 lines × 2) · ×1
  • Duplicated block (24–27 lines × 2) pingora-proxy/src/proxy_custom.rs:779 — pingora-proxy/src/proxy_custom.rs:779-802 | pingora-proxy/src/proxy_h1.rs:703-729 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:779` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
D4 · Code Duplication · Duplicated block (27 lines × 2) · ×1
  • Duplicated block (27 lines × 2) pingora-proxy/src/proxy_h1.rs:488 — pingora-proxy/src/proxy_h1.rs:488-514 | pingora-proxy/src/proxy_h2.rs:548-574 — before extracting anything, compare `pingora-proxy/src/proxy_h1.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 388 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D4 · Code Duplication · Duplicated block (26 lines × 3) · ×1
  • Duplicated block (26 lines × 3) pingora-proxy/src/proxy_custom.rs:664 — pingora-proxy/src/proxy_custom.rs:664-689 | pingora-proxy/src/proxy_h1.rs:601-626 | pingora-proxy/src/proxy_h2.rs:651-676 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:664` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (23–24 lines × 4) · ×1
  • Duplicated block (23–24 lines × 4) pingora-proxy/src/proxy_custom.rs:670 — pingora-proxy/src/proxy_custom.rs:670-693 | pingora-proxy/src/proxy_h1.rs:607-630 | pingora-proxy/src/proxy_h2.rs:657-680 | pingora-proxy/src/proxy_h2.rs:708-730 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:670` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `pingora-proxy/src/proxy_h1.rs:633` calls `on_proxy_failure` and `pingora-proxy/src/proxy_custom.rs:694` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (23 lines × 2) · ×1
  • Duplicated block (23 lines × 2) pingora-proxy/src/proxy_custom.rs:513 — pingora-proxy/src/proxy_custom.rs:513-535 | pingora-proxy/src/proxy_h2.rs:500-522 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:513` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (22 lines × 2) · ×1
  • Duplicated block (22 lines × 2) pingora-http/src/lib.rs:289 — pingora-http/src/lib.rs:289-310 | pingora-http/src/lib.rs:643-664 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
D4 · Code Duplication · Duplicated block (21 lines × 2) · ×1
  • Duplicated block (21 lines × 2) pingora-proxy/src/proxy_custom.rs:226 — pingora-proxy/src/proxy_custom.rs:226-246 | pingora-proxy/src/proxy_h2.rs:184-204 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:226` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19–21 lines × 2) · ×1
  • Duplicated block (19–21 lines × 2) pingora-proxy/src/proxy_h2.rs:748 — pingora-proxy/src/proxy_h2.rs:748-766 | pingora-proxy/src/proxy_h2.rs:774-794 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_h2.rs:748` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (19 lines × 2) · ×1
  • Duplicated block (19 lines × 2) pingora-proxy/src/proxy_custom.rs:1126 — pingora-proxy/src/proxy_custom.rs:1126-1144 | pingora-proxy/src/proxy_h2.rs:1080-1098 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 20 separate duplicated blocks between them, totalling at least 464 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1126` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (17–19 lines × 2) · ×1
  • Duplicated block (17–19 lines × 2) pingora-proxy/src/proxy_h1.rs:577 — pingora-proxy/src/proxy_h1.rs:577-595 | pingora-proxy/src/proxy_h2.rs:629-645 — before extracting anything, compare `pingora-proxy/src/proxy_h1.rs` and `pingora-proxy/src/proxy_h2.rs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 388 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_h1.rs:577` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `pingora-proxy/src/proxy_h1.rs:573` calls `try_reserve`, `or_err` and `pingora-proxy/src/proxy_h2.rs:627` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
D4 · Code Duplication · Duplicated block (17–18 lines × 2) · ×1
  • Duplicated block (17–18 lines × 2) pingora-proxy/src/proxy_custom.rs:1153 — pingora-proxy/src/proxy_custom.rs:1153-1169 | pingora-proxy/src/proxy_h1.rs:1060-1077 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1153` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (17 lines × 3) · ×1
  • Duplicated block (17 lines × 3) pingora-proxy/src/proxy_custom.rs:485 — pingora-proxy/src/proxy_custom.rs:485-501 | pingora-proxy/src/proxy_h1.rs:416-432 | pingora-proxy/src/proxy_h2.rs:472-488 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:485` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (14–16 lines × 3) · ×1
  • Duplicated block (14–16 lines × 3) pingora-core/src/protocols/http/v1/body.rs:1832 — pingora-core/src/protocols/http/v1/body.rs:1832-1845 | pingora-core/src/protocols/http/v1/body.rs:1929-1944 | pingora-core/src/protocols/http/v1/body.rs:2006-2019 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/v1/body.rs:1832` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication · Duplicated block (15–16 lines × 3) · ×1
  • Duplicated block (15–16 lines × 3) pingora-proxy/src/proxy_custom.rs:1137 — pingora-proxy/src/proxy_custom.rs:1137-1151 | pingora-proxy/src/proxy_h1.rs:1043-1058 | pingora-proxy/src/proxy_h2.rs:1091-1105 — before extracting anything, compare `pingora-proxy/src/proxy_custom.rs` and `pingora-proxy/src/proxy_h1.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 336 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-proxy/src/proxy_custom.rs:1137` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
D4 · Code Duplication · Duplicated block (14–15 lines × 2) · ×1
  • Duplicated block (14–15 lines × 2) pingora-core/src/protocols/http/compression/brotli.rs:45 — pingora-core/src/protocols/http/compression/brotli.rs:45-59 | pingora-core/src/protocols/http/compression/gzip.rs:43-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
D4 · Code Duplication · Duplicated block (12–13 lines × 2) · ×1
  • Duplicated block (12–13 lines × 2) pingora-core/src/listeners/tls/boringssl_openssl/mod.rs:217 — pingora-core/src/listeners/tls/boringssl_openssl/mod.rs:217-228 | pingora-core/src/listeners/tls/rustls/mod.rs:268-280 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (8–10 lines × 3) · ×1
  • Duplicated block (8–10 lines × 3) pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:257 — pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:257-264 | pingora-core/src/connectors/tls/rustls/mod.rs:284-293 | pingora-core/src/connectors/tls/s2n/mod.rs:161-170 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D4 · Code Duplication · Duplicated block (7 lines × 3) · ×1
  • Duplicated block (7 lines × 3) pingora-core/src/protocols/http/subrequest/server.rs:495 — pingora-core/src/protocols/http/subrequest/server.rs:495-501 | pingora-core/src/protocols/http/v1/client.rs:183-189 | pingora-core/src/protocols/http/v1/server.rs:999-1005 — `pingora-core/src/protocols/http/subrequest/server.rs` and `pingora-core/src/protocols/http/v1/server.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 8 separate duplicated blocks between them, totalling at least 81 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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/subrequest/server.rs:495` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `buf` to `Bytes` in one and `&[u8]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
D4 · Code Duplication · Duplicated block (5–6 lines × 2) · ×1
  • Duplicated block (5–6 lines × 2) pingora-core/src/protocols/http/v1/client.rs:491 — pingora-core/src/protocols/http/v1/client.rs:491-495 | pingora-core/src/protocols/http/v1/server.rs:614-619 — before extracting anything, compare `pingora-core/src/protocols/http/v1/client.rs` and `pingora-core/src/protocols/http/v1/server.rs` as WHOLE FILES: this scan already matched 5 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. Read the line range as the matched WINDOW rather than a finished unit: at `pingora-core/src/protocols/http/v1/server.rs:614` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
D5 · Coupling · Unstable project pingora-load-balancing · ×1
  • Unstable project pingora-load-balancing — pingora-load-balancing has instability 0.83 with 1 dependents.
D5 · Coupling · Unstable project pingora-proxy · ×1
  • Unstable project pingora-proxy — pingora-proxy has instability 0.83 with 1 dependents.
S1 · Web-Security Posture · Obsolete TLS/SSL protocol version enabled · ×1
  • Obsolete TLS/SSL protocol version enabled pingora-core/src/connectors/tls/boringssl_openssl/mod.rs:107 — `set_min_proto_version(SslVersion::TLS1)` explicitly admits a protocol version that is broken (SSL 3.0) or withdrawn (TLS 1.0/1.1, RFC 8996). Offering an obsolete version does not merely permit it — it is what a downgrade attack negotiates, so the weakest version on the list is the one that decides the connection's strength. Remove the pin: reqwest, native-tls and openssl negotiate the highest version both sides support, and rustls implements only TLS 1.2 and 1.3 — so naming no older version is the strongest setting. Where a floor must be named, use `min_tls_version(tls::Version::TLS_1_2)` / `set_min_proto_version(Some(SslVersion::TLS1_2))`.
Minor — 51 finding(s)
D34 · Knowledge Freshness · Orphaned file · ×22
  • Orphaned file pingora-core/src/connectors/tls/s2n/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-limits/src/rate.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/modules/http/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/protocols/http/compression/zstd.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/protocols/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-timeout/src/timer.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-load-balancing/src/selection/consistent.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-timeout/src/lib.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file tinyufo/src/buckets.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/listeners/connection_filter.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/protocols/l4/virt.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/protocols/windows.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/lib.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/protocols/l4/listener.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-header-serde/src/dict.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-limits/src/inflight.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/utils/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/modules/http/compression.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/connectors/tls/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/protocols/tls/s2n/mod.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/protocols/http/date.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
  • Orphaned file pingora-core/src/protocols/tls/digest.rs:1 — No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
X10 · Duplicated predicate · Duplicated predicate · ×20
  • Duplicated predicate pingora-proxy/src/proxy_custom.rs:876 — `!downstream_state.is_errored() && session.has_pending_downstream_tasks() && next_upstream_task.is_none()` appears character-identically in 3 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-proxy/src/proxy_cache.rs:1197 — `!no_body && !header.status.is_informational() && header.headers.get(http::header::CONTENT_LENGTH).is_none()` appears character-identically in 3 files — pingora-proxy/src/proxy_cache.rs, pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-core/src/protocols/http/subrequest/server.rs:368 — `!resp.status.is_informational() || self.upgraded` appears character-identically in 2 files — pingora-core/src/protocols/http/subrequest/server.rs, pingora-core/src/protocols/http/v1/server.rs. 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 pingora-proxy/src/proxy_custom.rs:813 — `!response_state.cached_done() && !downstream_state.is_errored() && serve_from_cache.is_on() && !session.has_pending_downstream_tasks()` appears character-identically in 3 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-proxy/src/proxy_custom.rs:922 — `!response_state.upstream_delivery_done() && serve_from_cache.is_on() && next_upstream_task.is_none()` appears character-identically in 3 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-proxy/src/proxy_custom.rs:787 — `!upgraded && session.was_upgraded() && downstream_state.can_poll()` appears character-identically in 2 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h1.rs. 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 pingora-proxy/src/proxy_custom.rs:665 — `(!serve_from_cache.is_on() && support_cache_partial_read) || serve_from_cache.is_miss()` appears character-identically in 3 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-proxy/src/proxy_custom.rs:701 — `body.is_none() && session.was_upgraded()` appears character-identically in 2 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h1.rs. 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 pingora-core/src/protocols/http/v1/client.rs:342 — `contains_content_length && contains_transfer_encoding` appears character-identically in 2 files — pingora-core/src/protocols/http/v1/client.rs, pingora-core/src/protocols/http/v1/server.rs. 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 pingora-proxy/src/proxy_h1.rs:863 — `downstream_custom_read && !downstream_state.is_errored()` appears character-identically in 2 files — pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-proxy/src/proxy_h1.rs:884 — `downstream_custom_write && !session.downstream_abandoned_during_cache_fill()` appears character-identically in 2 files — pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-proxy/src/proxy_h1.rs:658 — `downstream_state.is_reading() && send_permit.is_err()` appears character-identically in 2 files — pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/subrequest/pipe.rs. 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 pingora-core/src/protocols/http/subrequest/server.rs:832 — `end_stream || self.body_writer.finished()` appears character-identically in 2 files — pingora-core/src/protocols/http/subrequest/server.rs, pingora-core/src/protocols/http/v1/server.rs. 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 pingora-core/src/protocols/http/subrequest/server.rs:377 — `header.status == 101 || !header.status.is_informational()` appears character-identically in 2 files — pingora-core/src/protocols/http/subrequest/server.rs, pingora-core/src/protocols/http/v1/server.rs. 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 pingora-core/src/protocols/http/subrequest/server.rs:1216 — `header.status.is_informational() && header.status != StatusCode::SWITCHING_PROTOCOLS` appears character-identically in 3 files — pingora-core/src/protocols/http/subrequest/server.rs, pingora-core/src/protocols/http/v1/server.rs, pingora-proxy/src/proxy_cache.rs. 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 pingora-proxy/src/proxy_custom.rs:857 — `response_state.cached_done() && session.cache.enabled()` appears character-identically in 3 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-core/src/protocols/http/subrequest/server.rs:504 — `self.upgraded && !self.body_reader.body_done()` appears character-identically in 2 files — pingora-core/src/protocols/http/subrequest/server.rs, pingora-core/src/protocols/http/v1/server.rs. 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 pingora-proxy/src/proxy_custom.rs:1453 — `send_result.is_err() && PipeState::is_downstream_complete(pipe_state.load(Ordering::Acquire))` appears character-identically in 2 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-proxy/src/proxy_custom.rs:1060 — `session.cache.enabled() || session.cache.bypassing()` appears character-identically in 3 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/proxy_h2.rs. 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 pingora-proxy/src/proxy_custom.rs:1210 — `track_max_cache_size && task.is_end() && !matches!(task, HttpTask::Failed(_)) && !session.cache.exceeded_max_file_size()` appears character-identically in 3 files — pingora-proxy/src/proxy_custom.rs, pingora-proxy/src/proxy_h1.rs, pingora-proxy/src/proxy_h2.rs. 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.
D16 · Bus Factor · Off-boarding risk · ×1
  • Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 4 significant file(s) lose their only recent owner: pingora-foundations/src/lib.rs, pingora-core/src/protocols/tls/noop_tls/mod.rs, pingora-core/src/protocols/http/v1/mod.rs, pingora-cache/src/admission.rs. Pair on, review, or document these before any departure.
D16 · Bus Factor · Further sole-owners (lower concentration) · ×1
  • Further sole-owners (lower concentration) — 4 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 (9 single-owned of 158 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 158 of the 185 production source files in this repository met that bar). They are anonymized user #2 (2 file(s)), anonymized user #3 (1 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (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: pingora-pool/src/lru.rs, pingora-load-balancing/src/discovery.rs, pingora-limits/src/estimator.rs, pingora-core/src/utils/tls/boringssl_openssl.rs, pingora-core/src/protocols/http/compression/brotli.rs.
D20 · ADR Quality · No ADRs found · ×1
  • No ADRs found pingora-header-serde/Cargo.toml:20 — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. 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/`. ADRs are expected here because `pingora-header-serde/Cargo.toml` makes this repository a deployable product (line 20).
D26 · Project Cohesion · Projects may be oversized for their cohesion · ×1
  • Projects may be oversized for their cohesion — 1 of 23 project(s) overshoot their size bounds, lowering Project Cohesion to 9.1/10. The most over is `pingora-core` (48548 LoC, 220 module-visible types across 34 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.
D31 · IaC & Container Security · Low IaC · ×1
  • REDACTED
D34 · Knowledge Freshness · Further orphaned files (smaller) · ×1
  • Further orphaned files (smaller) — 22 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: pingora-core/src/connectors/tls/s2n/mod.rs, pingora-limits/src/rate.rs, pingora-core/src/protocols/mod.rs, pingora-timeout/src/timer.rs, pingora-core/src/modules/http/mod.rs, pingora-core/src/protocols/http/compression/zstd.rs, pingora-load-balancing/src/selection/consistent.rs, pingora-timeout/src/lib.rs (and 14 more) (25 orphaned of 158 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 158 of the 185 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.
M2 · Architecture documentation · No ADRs · ×1
  • No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
P2 · Observability · Logging is not universal · ×1
  • Logging is not universal — Only 10/12 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `pingora-header-serde`, `pingora-test-utils`.
S1 · Web-Security Posture · No security response headers detected · ×1
  • No security response headers detected pingora-ketama/test-data/nginx.conf:19 — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `nginx.conf` is committed to this repository and declares the server that serves it, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)

Appendix B — Reproduction & audit trail

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

DimensionToolVersionCommandFindingsRaw output
D28 · Secrets (history)gitleaks—gitleaks detect --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-16dafb4ae2ce4716a3e41d68c36d7538/history.json --exit-code 0 --source .0artifacts/raw/gitleaks-history.json
D28 · Secrets (history)gitleaks—gitleaks detect --no-git --no-banner --config /opt/gitleaks-rules/canine-gitleaks.toml --report-format json --report-path /tmp/watchdog-gitleaks-16dafb4ae2ce4716a3e41d68c36d7538/tree.json --exit-code 0 --source .0artifacts/raw/gitleaks-tree.json
D29 · Static Analysis (SAST)semgrep—semgrep --config /opt/semgrep-rules/security-audit.yml --config /opt/semgrep-rules/owasp-top-ten.yml --config /opt/semgrep-rules/canine-sast.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .10artifacts/raw/semgrep.json
D30 · Dependency Vulnerabilitiesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).0—
D31 · IaC & Container Securitytrivy—trivy config --format json --quiet .6artifacts/raw/trivy-config.json
D32 · Data Compliance (PII/GDPR)semgrep—semgrep --config /opt/semgrep-rules/gdpr.yml --json --quiet --timeout 10 --timeout-threshold 3 --metrics off --exclude *.arrow --exclude *.avro --exclude *.csv --exclude *.dat --exclude *.db --exclude *.feather --exclude *.geojson --exclude *.h5 --exclude *.hdf5 --exclude *.jsonl --exclude *.log --exclude *.ndjson --exclude *.npy --exclude *.npz --exclude *.orc --exclude *.parquet --exclude *.pickle --exclude *.pkl --exclude *.psv --exclude *.sqlite --exclude *.sqlite3 --exclude *.tfrecord --exclude *.tsv --exclude *.txt .1artifacts/raw/semgrep-gdpr.json
D37 · Vulnerability-disclosure Policydisclosure—disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.0—
D40 · Network Egress Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.0—
D41 · Kernel & Syscall Confinementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.0—
D42 · Runtime Threat Enforcementruntime-hardening—runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.0—
D43 · Malicious Dependenciesnone (dependency manifest found, not scanned for vulnerabilities here)—none (dependency manifest found, not scanned for vulnerabilities here): not applicable — Not scored — no dependency manifest in a supported ecosystem was read for this repository. A gap in the analyzer's language coverage, NOT a finding that the repository is free of vulnerable dependencies (a Cargo manifest — not scanned yet).0—

Run 01a1d878-306f-72e0-b24f-7f05dd2984c2 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.

Downloadable artifacts

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

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