Public report of shadowsocks/shadowsocks-rust, 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 reportMeasured 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, 16:18 UTC · Survey ID cd_f2229b727e754e5c967466bd693133e4
shadowsocks/shadowsocks-rust
Measured 14 November 2026, 16:16 UTC, at code version e697eb2
Knowledge freshness is not measured: Freshness signal contradicted by repo activity.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Up 1 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 medium codebase: 95,445 lines of product code in 3 projects, tests not counted · Estimated rebuild effort: about 0.6 person-years · Weakest lens: Security and Compliance, 31
Findings by how serious they are
61 critical432 serious42 minor
17 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
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 16:16 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.
506of 535 findings point to an exact file and line, so you can open each one in the code. The other 29 concern the repository as a whole, such as missing documentation.
42dimensions across 6 lenses, read from 95,445 lines of product code in 3 projects.
shadowsocks/shadowsocks-rust falls short of our standard for production, in part because we found no access checks on the code's endpoints or handlers. It scores 51 out of 100 and is rated Adequate, and all 61 of its critical findings are security problems.
Security and Compliance, at 31, is the weakest lens and counts most in the score. The best first step is adding access checks, worth about 15 points. Recording design decisions comes next, worth about 4 points. Raising Security and Compliance to 70 would lift the score to about 67.
Forty-five pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Five secrets can leak from the build pipeline, and five settings leave the servers or containers unsafe. Pinning each tool to an exact version, limiting each secret to its own step and correcting the unsafe settings would close these risks. Setting a waiting period for automatic updates would fix the automatic dependency update that takes a new release at once, and the two pipeline steps that install packages without pinning their versions need the packages they install pinned to exact versions.
The product code is 95,445 lines, about €92,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 forThe 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.
If Security and Compliance rose from 31 to 70, the lowest score rated Strong, the score would rise from 51 to about 67.
Code composition: what the lines of code are
Product code 99%Tests 1%
New since the last survey: 168 findings
These 168 critical or serious findings weren't in the previous survey, on 27 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Code Duplication · Near-duplicate member family (3 members, 141 shared lines) src/service/local.rs
Code Duplication · Near-duplicate member pair (49 shared lines) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs
Code Duplication · Edited copy of a member (63 corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs
Code Duplication · Edited copy of a member (46 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs
Code Duplication · Edited copy of a member (53 corresponding lines) crates/shadowsocks/src/relay/udprelay/aead_2022.rs
Code Duplication · Edited copy of a member (62 corresponding lines) crates/shadowsocks-service/src/local/socks/server/socks4/tcprelay.rs
Code Duplication · Edited copy of a member (49 corresponding lines) crates/shadowsocks-service/src/net/http_stream.rs
Code Duplication · Edited copies of one member (3 members, 38+ corresponding lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs
Code Duplication · Edited copy of a member (31 corresponding lines) crates/shadowsocks/src/relay/udprelay/crypto_io.rs
Code Duplication · Edited copy of a member (39 corresponding lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs
Code Duplication · Edited copy of a member (47 corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs
Code Duplication · Edited copy of a member (37 corresponding lines) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs
Code Duplication · Edited copy of a member (72 corresponding lines) crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs
Code Duplication · Edited copy of a member (41 corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/macos.rs
Code Duplication · Edited copy of a member (39 corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs
Code Duplication · Edited copy of a member (26 corresponding lines) crates/shadowsocks-service/src/local/http/config.rs
Code Duplication · Edited copy of a member (24 corresponding lines) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs
Code Duplication · Edited copy of a member (33 corresponding lines) crates/shadowsocks-service/src/acl/mod.rs
Code Duplication · Edited copies of one member (3 members, 36+ corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs
Code Duplication · Edited copies of one member (4 members, 27+ corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs
Code Duplication · Edited copies of one member (3 members, 24+ corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs
Code Duplication · Edited copy of a member (11 corresponding lines) crates/shadowsocks/src/relay/tcprelay/crypto_io.rs
Code Duplication · Edited copy of a member (20 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs
Code Duplication · Edited copy of a member (23 corresponding lines) crates/shadowsocks/src/relay/udprelay/aead.rs
Code Duplication · Edited copies of one member (3 members, 19+ corresponding lines) crates/shadowsocks/src/relay/tcprelay/crypto_io.rs
Code Duplication · Edited copy of a member (21 corresponding lines) crates/shadowsocks/src/net/udp.rs
Code Duplication · Edited copy of a member (21 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs
Code Duplication · Edited copy of a member (19 corresponding lines) crates/shadowsocks/src/config.rs
Code Duplication · Edited copies of one member (3 members, 22+ corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs
Code Duplication · Edited copy of a member (25 corresponding lines) crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs
Code Duplication · Edited copy of a member (23 corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs
Code Duplication · Edited copy of a member (9 corresponding lines) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs
Code Duplication · Edited copies of one member (3 members, 26+ corresponding lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs
Code Duplication · Edited copy of a member (23 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs
Code Duplication · Edited copy of a member (21 corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs
Code Duplication · Edited copy of a member (16 corresponding lines) crates/shadowsocks/src/net/udp.rs
Code Duplication · Edited copy of a member (12 corresponding lines) crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs
Code Duplication · Edited copy of a member (9 corresponding lines) crates/shadowsocks-service/src/local/net/tcp/listener.rs
Code Duplication · Edited copy of a member (11 corresponding lines) crates/shadowsocks-service/src/net/mon_stream.rs
Code Duplication · Edited copy of a member (23 corresponding lines) crates/shadowsocks-service/src/local/net/udp/association.rs
Code Duplication · Edited copy of a member (11 corresponding lines) crates/shadowsocks-service/src/local/net/udp/association.rs
Code Duplication · Edited copy of a member (12 corresponding lines) crates/shadowsocks-service/src/local/redir/tcprelay/mod.rs
Code Duplication · Edited copy of a member (13 corresponding lines) crates/shadowsocks/src/net/tcp.rs
Code Duplication · Edited copy of a member (12 corresponding lines) src/daemonize/daemonize/mod.rs
Code Duplication · Edited copies of one member (5 members, 9+ corresponding lines) crates/shadowsocks-service/src/net/outbound/stream.rs
Code Duplication · Edited copies of one member (4 members, 15+ corresponding lines) crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs
Code Duplication · Edited copy of a member (20 corresponding lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs
Code Duplication · Edited copy of a member (9 corresponding lines) crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs
Code Duplication · Edited copy of a member (11 corresponding lines) crates/shadowsocks/src/net/udp.rs
Code Duplication · Edited copy of a member (12 corresponding lines) crates/shadowsocks/src/net/sys/unix/uds.rs
Code Duplication · Edited copy of a member (12 corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/macos.rs
Code Duplication · Edited copies of one member (3 members, 16+ corresponding lines) crates/shadowsocks-service/src/local/socks/socks4.rs
Code Duplication · Edited copies of one member (5 members, 11+ corresponding lines) crates/shadowsocks/src/relay/tcprelay/crypto_io.rs
Code Duplication · Edited copy of a member (16 corresponding lines) crates/shadowsocks-service/src/local/http/http_service.rs
Code Duplication · Edited copy of a member (12 corresponding lines) src/service/local.rs
Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) crates/shadowsocks-service/src/local/dns/dns_resolver.rs
Code Duplication · Edited copies of one member (3 members, 9+ corresponding lines) crates/shadowsocks/src/config.rs
Code Duplication · Edited copy of a member (9 corresponding lines) crates/shadowsocks-service/src/net/outbound/stream.rs
Code Duplication · Edited copy of a member (12 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs
Code Duplication · Edited copy of a member (6 corresponding lines) src/logging/tracing.rs
Code Duplication · Edited copy of a member (11 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs
Code Duplication · Edited copy of a member (15 corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs
Code Duplication · Edited copies of one member (3 members, 12+ corresponding lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs
Code Duplication · Edited copy of a member (4 corresponding lines) crates/shadowsocks-service/src/local/context.rs
Code Duplication · Edited copy of a member (5 corresponding lines) crates/shadowsocks-service/src/local/net/udp/association.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: 139 findings
These 139 critical or serious findings were in the previous survey, on 27 October 2026, and are gone from this one. The first 100 are listed here.
€30,000 to €150,000, for 507 to 1,609 hours of work, about 0.6 person-years for 1 to 2 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 51. 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.
Size
Medium: 95,445 lines of product code
What it is not
Not 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
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.
Raises the score by about 15 points · Medium effort · Access Controls
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 7 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED.
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 €92,000 to build again, about 0.6 person-years of work. Its weakest lens is Security and Compliance, at 31 (Weak). 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
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do. Of all the actions in this report, it raises the score most for the work it takes: about 15 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
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.
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.
169 modules, with 451 dependencies between them. 5 loops run through 23 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 129 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.
shadowsocks.relay.socks5 uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks.relay.socks5, while a change to shadowsocks.relay.socks5 can't break shadowsocks.config.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
shadowsocks.config uses shadowsocks.relay.socks5, so a change to shadowsocks.relay.socks5 can break shadowsocks.config, while a change to shadowsocks.config can't break shadowsocks.relay.socks5.
Position
Below the diagonal: shadowsocks.config uses a module listed above it, which is the healthy direction.
shadowsocks.context uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks.context, while a change to shadowsocks.context can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks.context uses a module listed above it, which is the healthy direction.
shadowsocks.relay.udprelay.options uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks.relay.udprelay.options, while a change to shadowsocks.relay.udprelay.options can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks.relay.udprelay.options uses a module listed above it, which is the healthy direction.
shadowsocks_service.config uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.config, while a change to shadowsocks_service.config can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.config uses a module listed above it, which is the healthy direction.
6→12 shadowsocks_service.config uses shadowsocks_service.local.socks.socks4part of a loop✕
Connections
2 pairs of types, where a type in shadowsocks_service.config uses a type in shadowsocks_service.local.socks.socks4.
shadowsocks_service.config uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.config, while a change to shadowsocks_service.config can't break shadowsocks_service.local.socks.socks4.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
6→14 shadowsocks_service.config uses shadowsocks_service.aclpart of a loop✕
Connections
5 pairs of types, where a type in shadowsocks_service.config uses a type in shadowsocks_service.acl.
shadowsocks_service.config uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.config, while a change to shadowsocks_service.config can't break shadowsocks_service.acl.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
shadowsocks.net.tcp uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks.net.tcp, while a change to shadowsocks.net.tcp can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks.net.tcp uses a module listed above it, which is the healthy direction.
shadowsocks.net.tcp uses shadowsocks.relay.socks5, so a change to shadowsocks.relay.socks5 can break shadowsocks.net.tcp, while a change to shadowsocks.net.tcp can't break shadowsocks.relay.socks5.
Position
Below the diagonal: shadowsocks.net.tcp uses a module listed above it, which is the healthy direction.
shadowsocks.net.tcp uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks.net.tcp, while a change to shadowsocks.net.tcp can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks.net.tcp uses a module listed above it, which is the healthy direction.
shadowsocks.net.tcp uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks.net.tcp, while a change to shadowsocks.net.tcp can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks.net.tcp uses a module listed above it, which is the healthy direction.
shadowsocks.net.udp uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks.net.udp, while a change to shadowsocks.net.udp can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks.net.udp uses a module listed above it, which is the healthy direction.
shadowsocks.net.udp uses shadowsocks.relay.socks5, so a change to shadowsocks.relay.socks5 can break shadowsocks.net.udp, while a change to shadowsocks.net.udp can't break shadowsocks.relay.socks5.
Position
Below the diagonal: shadowsocks.net.udp uses a module listed above it, which is the healthy direction.
shadowsocks.net.udp uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks.net.udp, while a change to shadowsocks.net.udp can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks.net.udp uses a module listed above it, which is the healthy direction.
shadowsocks.net.udp uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks.net.udp, while a change to shadowsocks.net.udp can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks.net.udp uses a module listed above it, which is the healthy direction.
shadowsocks.relay.udprelay.proxy_socket uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks.relay.udprelay.proxy_socket, while a change to shadowsocks.relay.udprelay.proxy_socket can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks.relay.udprelay.proxy_socket uses a module listed above it, which is the healthy direction.
shadowsocks.relay.udprelay.proxy_socket uses shadowsocks.relay.socks5, so a change to shadowsocks.relay.socks5 can break shadowsocks.relay.udprelay.proxy_socket, while a change to shadowsocks.relay.udprelay.proxy_socket can't break shadowsocks.relay.socks5.
Position
Below the diagonal: shadowsocks.relay.udprelay.proxy_socket uses a module listed above it, which is the healthy direction.
shadowsocks.relay.udprelay.proxy_socket uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks.relay.udprelay.proxy_socket, while a change to shadowsocks.relay.udprelay.proxy_socket can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks.relay.udprelay.proxy_socket uses a module listed above it, which is the healthy direction.
shadowsocks.relay.udprelay.proxy_socket uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks.relay.udprelay.proxy_socket, while a change to shadowsocks.relay.udprelay.proxy_socket can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks.relay.udprelay.proxy_socket uses a module listed above it, which is the healthy direction.
shadowsocks.relay.udprelay.proxy_socket uses shadowsocks.relay.udprelay.options, so a change to shadowsocks.relay.udprelay.options can break shadowsocks.relay.udprelay.proxy_socket, while a change to shadowsocks.relay.udprelay.proxy_socket can't break shadowsocks.relay.udprelay.options.
Position
Below the diagonal: shadowsocks.relay.udprelay.proxy_socket uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.loadbalancing.server_data uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.local.loadbalancing.server_data, while a change to shadowsocks_service.local.loadbalancing.server_data can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.local.loadbalancing.server_data uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.loadbalancing.server_data uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.loadbalancing.server_data, while a change to shadowsocks_service.local.loadbalancing.server_data can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.loadbalancing.server_data uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.loadbalancing.server_data uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.local.loadbalancing.server_data, while a change to shadowsocks_service.local.loadbalancing.server_data can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.local.loadbalancing.server_data uses a module listed above it, which is the healthy direction.
10→20 shadowsocks_service.local.loadbalancing.server_data uses shadowsocks_service.local.contextpart of a loop✕
Connections
1 pair of types, where a type in shadowsocks_service.local.loadbalancing.server_data uses a type in shadowsocks_service.local.context.
shadowsocks_service.local.loadbalancing.server_data uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.loadbalancing.server_data, while a change to shadowsocks_service.local.loadbalancing.server_data can't break shadowsocks_service.local.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
shadowsocks_service.local.redir.redir_ext uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.local.redir.redir_ext, while a change to shadowsocks_service.local.redir.redir_ext can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.local.redir.redir_ext uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.redir_ext uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks_service.local.redir.redir_ext, while a change to shadowsocks_service.local.redir.redir_ext can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks_service.local.redir.redir_ext uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.redir_ext uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.local.redir.redir_ext, while a change to shadowsocks_service.local.redir.redir_ext can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.local.redir.redir_ext uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.socks4 uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.local.socks.socks4, while a change to shadowsocks_service.local.socks.socks4 can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.local.socks.socks4 uses a module listed above it, which is the healthy direction.
shadowsocks.net.sys.unix.bsd.freebsd uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks.net.sys.unix.bsd.freebsd, while a change to shadowsocks.net.sys.unix.bsd.freebsd can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks.net.sys.unix.bsd.freebsd uses a module listed above it, which is the healthy direction.
shadowsocks.net.sys.unix.bsd.freebsd uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks.net.sys.unix.bsd.freebsd, while a change to shadowsocks.net.sys.unix.bsd.freebsd can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks.net.sys.unix.bsd.freebsd uses a module listed above it, which is the healthy direction.
shadowsocks.net.sys.unix.bsd.freebsd uses shadowsocks.net.udp, so a change to shadowsocks.net.udp can break shadowsocks.net.sys.unix.bsd.freebsd, while a change to shadowsocks.net.sys.unix.bsd.freebsd can't break shadowsocks.net.udp.
Position
Below the diagonal: shadowsocks.net.sys.unix.bsd.freebsd uses a module listed above it, which is the healthy direction.
shadowsocks_service.acl uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks_service.acl, while a change to shadowsocks_service.acl can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks_service.acl uses a module listed above it, which is the healthy direction.
shadowsocks_service.acl uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.acl, while a change to shadowsocks_service.acl can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.acl uses a module listed above it, which is the healthy direction.
shadowsocks_service.net.outbound uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.net.outbound, while a change to shadowsocks_service.net.outbound can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.net.outbound uses a module listed above it, which is the healthy direction.
shadowsocks_service.net.outbound uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.net.outbound, while a change to shadowsocks_service.net.outbound can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.net.outbound uses a module listed above it, which is the healthy direction.
shadowsocks_service.net.outbound uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.net.outbound, while a change to shadowsocks_service.net.outbound can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.net.outbound uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.loadbalancing.ping_balancer uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.loadbalancing.ping_balancer, while a change to shadowsocks_service.local.loadbalancing.ping_balancer can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.loadbalancing.ping_balancer uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.loadbalancing.ping_balancer uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.local.loadbalancing.ping_balancer, while a change to shadowsocks_service.local.loadbalancing.ping_balancer can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.local.loadbalancing.ping_balancer uses a module listed above it, which is the healthy direction.
4 pairs of types, where a type in shadowsocks_service.local.loadbalancing.ping_balancer uses a type in shadowsocks_service.local.loadbalancing.server_data.
shadowsocks_service.local.loadbalancing.ping_balancer uses shadowsocks_service.local.loadbalancing.server_data, so a change to shadowsocks_service.local.loadbalancing.server_data can break shadowsocks_service.local.loadbalancing.ping_balancer, while a change to shadowsocks_service.local.loadbalancing.ping_balancer can't break shadowsocks_service.local.loadbalancing.server_data.
Position
Below the diagonal: shadowsocks_service.local.loadbalancing.ping_balancer uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.loadbalancing.ping_balancer uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.loadbalancing.ping_balancer, while a change to shadowsocks_service.local.loadbalancing.ping_balancer can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.loadbalancing.ping_balancer uses a module listed above it, which is the healthy direction.
16→20 shadowsocks_service.local.loadbalancing.ping_balancer uses shadowsocks_service.local.contextpart of a loop✕
Connections
4 pairs of types, where a type in shadowsocks_service.local.loadbalancing.ping_balancer uses a type in shadowsocks_service.local.context.
shadowsocks_service.local.loadbalancing.ping_balancer uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.loadbalancing.ping_balancer, while a change to shadowsocks_service.local.loadbalancing.ping_balancer can't break shadowsocks_service.local.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
shadowsocks_service.local.dns.server uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.dns.server, while a change to shadowsocks_service.local.dns.server can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.dns.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.server uses shadowsocks.net.tcp, so a change to shadowsocks.net.tcp can break shadowsocks_service.local.dns.server, while a change to shadowsocks_service.local.dns.server can't break shadowsocks.net.tcp.
Position
Below the diagonal: shadowsocks_service.local.dns.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.server uses shadowsocks.net.udp, so a change to shadowsocks.net.udp can break shadowsocks_service.local.dns.server, while a change to shadowsocks_service.local.dns.server can't break shadowsocks.net.udp.
Position
Below the diagonal: shadowsocks_service.local.dns.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.server uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.dns.server, while a change to shadowsocks_service.local.dns.server can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.dns.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.server uses shadowsocks.net.sys.unix.bsd.freebsd, so a change to shadowsocks.net.sys.unix.bsd.freebsd can break shadowsocks_service.local.dns.server, while a change to shadowsocks_service.local.dns.server can't break shadowsocks.net.sys.unix.bsd.freebsd.
Position
Below the diagonal: shadowsocks_service.local.dns.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.server uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.dns.server, while a change to shadowsocks_service.local.dns.server can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.dns.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.server uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.dns.server, while a change to shadowsocks_service.local.dns.server can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.dns.server uses a module listed above it, which is the healthy direction.
17→18 shadowsocks_service.local.dns.server uses shadowsocks_service.local.dns.client_cachepart of a loop✕
Connections
1 pair of types, where a type in shadowsocks_service.local.dns.server uses a type in shadowsocks_service.local.dns.client_cache.
shadowsocks_service.local.dns.server uses shadowsocks_service.local.dns.client_cache, so a change to shadowsocks_service.local.dns.client_cache can break shadowsocks_service.local.dns.server, while a change to shadowsocks_service.local.dns.server can't break shadowsocks_service.local.dns.client_cache.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→20 shadowsocks_service.local.dns.server uses shadowsocks_service.local.contextpart of a loop✕
Connections
5 pairs of types, where a type in shadowsocks_service.local.dns.server uses a type in shadowsocks_service.local.context.
shadowsocks_service.local.dns.server uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.dns.server, while a change to shadowsocks_service.local.dns.server can't break shadowsocks_service.local.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
shadowsocks_service.local.dns.client_cache uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.local.dns.client_cache, while a change to shadowsocks_service.local.dns.client_cache can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.local.dns.client_cache uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.client_cache uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.dns.client_cache, while a change to shadowsocks_service.local.dns.client_cache can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.dns.client_cache uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.client_cache uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.dns.client_cache, while a change to shadowsocks_service.local.dns.client_cache can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.dns.client_cache uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.client_cache uses shadowsocks_service.local.dns.server, so a change to shadowsocks_service.local.dns.server can break shadowsocks_service.local.dns.client_cache, while a change to shadowsocks_service.local.dns.client_cache can't break shadowsocks_service.local.dns.server.
Position
Below the diagonal: shadowsocks_service.local.dns.client_cache uses a module listed above it, which is the healthy direction.
18→20 shadowsocks_service.local.dns.client_cache uses shadowsocks_service.local.contextpart of a loop✕
Connections
1 pair of types, where a type in shadowsocks_service.local.dns.client_cache uses a type in shadowsocks_service.local.context.
shadowsocks_service.local.dns.client_cache uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.dns.client_cache, while a change to shadowsocks_service.local.dns.client_cache can't break shadowsocks_service.local.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
shadowsocks_service.local.dns.dns_resolver uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.local.dns.dns_resolver, while a change to shadowsocks_service.local.dns.dns_resolver can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.local.dns.dns_resolver uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.dns_resolver uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.dns.dns_resolver, while a change to shadowsocks_service.local.dns.dns_resolver can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.dns.dns_resolver uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.dns.dns_resolver uses shadowsocks_service.local.dns.client_cache, so a change to shadowsocks_service.local.dns.client_cache can break shadowsocks_service.local.dns.dns_resolver, while a change to shadowsocks_service.local.dns.dns_resolver can't break shadowsocks_service.local.dns.client_cache.
Position
Below the diagonal: shadowsocks_service.local.dns.dns_resolver uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.context uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.local.context, while a change to shadowsocks_service.local.context can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.local.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.context uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks_service.local.context, while a change to shadowsocks_service.local.context can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks_service.local.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.context uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.local.context, while a change to shadowsocks_service.local.context can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.local.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.context uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.context, while a change to shadowsocks_service.local.context can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.context uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.context, while a change to shadowsocks_service.local.context can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.context uses shadowsocks_service.net.outbound, so a change to shadowsocks_service.net.outbound can break shadowsocks_service.local.context, while a change to shadowsocks_service.local.context can't break shadowsocks_service.net.outbound.
Position
Below the diagonal: shadowsocks_service.local.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.context uses shadowsocks_service.local.dns.dns_resolver, so a change to shadowsocks_service.local.dns.dns_resolver can break shadowsocks_service.local.context, while a change to shadowsocks_service.local.context can't break shadowsocks_service.local.dns.dns_resolver.
Position
Below the diagonal: shadowsocks_service.local.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.context uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.server.context, while a change to shadowsocks_service.server.context can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.server.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.context uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks_service.server.context, while a change to shadowsocks_service.server.context can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks_service.server.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.context uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.server.context, while a change to shadowsocks_service.server.context can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.server.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.context uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.server.context, while a change to shadowsocks_service.server.context can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.server.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.context uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.server.context, while a change to shadowsocks_service.server.context can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.server.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.context uses shadowsocks_service.net.outbound, so a change to shadowsocks_service.net.outbound can break shadowsocks_service.server.context, while a change to shadowsocks_service.server.context can't break shadowsocks_service.net.outbound.
Position
Below the diagonal: shadowsocks_service.server.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.context uses shadowsocks_service.local.dns.dns_resolver, so a change to shadowsocks_service.local.dns.dns_resolver can break shadowsocks_service.server.context, while a change to shadowsocks_service.server.context can't break shadowsocks_service.local.dns.dns_resolver.
Position
Below the diagonal: shadowsocks_service.server.context uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.fake_dns.server uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.fake_dns.server, while a change to shadowsocks_service.local.fake_dns.server can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.fake_dns.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.fake_dns.server uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.fake_dns.server, while a change to shadowsocks_service.local.fake_dns.server can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.fake_dns.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.fake_dns.server uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.fake_dns.server, while a change to shadowsocks_service.local.fake_dns.server can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.fake_dns.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.tcp.auto_proxy_stream uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.local.net.tcp.auto_proxy_stream, while a change to shadowsocks_service.local.net.tcp.auto_proxy_stream can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.local.net.tcp.auto_proxy_stream uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.tcp.auto_proxy_stream uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks_service.local.net.tcp.auto_proxy_stream, while a change to shadowsocks_service.local.net.tcp.auto_proxy_stream can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks_service.local.net.tcp.auto_proxy_stream uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in shadowsocks_service.local.net.tcp.auto_proxy_stream uses a type in shadowsocks_service.local.loadbalancing.server_data.
shadowsocks_service.local.net.tcp.auto_proxy_stream uses shadowsocks_service.local.loadbalancing.server_data, so a change to shadowsocks_service.local.loadbalancing.server_data can break shadowsocks_service.local.net.tcp.auto_proxy_stream, while a change to shadowsocks_service.local.net.tcp.auto_proxy_stream can't break shadowsocks_service.local.loadbalancing.server_data.
Position
Below the diagonal: shadowsocks_service.local.net.tcp.auto_proxy_stream uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.tcp.auto_proxy_stream uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.net.tcp.auto_proxy_stream, while a change to shadowsocks_service.local.net.tcp.auto_proxy_stream can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.net.tcp.auto_proxy_stream uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.tcp.auto_proxy_stream uses shadowsocks_service.net.outbound, so a change to shadowsocks_service.net.outbound can break shadowsocks_service.local.net.tcp.auto_proxy_stream, while a change to shadowsocks_service.local.net.tcp.auto_proxy_stream can't break shadowsocks_service.net.outbound.
Position
Below the diagonal: shadowsocks_service.local.net.tcp.auto_proxy_stream uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.tcp.auto_proxy_stream uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.net.tcp.auto_proxy_stream, while a change to shadowsocks_service.local.net.tcp.auto_proxy_stream can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.net.tcp.auto_proxy_stream uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.udp.association uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.local.net.udp.association, while a change to shadowsocks_service.local.net.udp.association can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.local.net.udp.association uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.udp.association uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.net.udp.association, while a change to shadowsocks_service.local.net.udp.association can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.net.udp.association uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.udp.association uses shadowsocks.relay.udprelay.options, so a change to shadowsocks.relay.udprelay.options can break shadowsocks_service.local.net.udp.association, while a change to shadowsocks_service.local.net.udp.association can't break shadowsocks.relay.udprelay.options.
Position
Below the diagonal: shadowsocks_service.local.net.udp.association uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.udp.association uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.net.udp.association, while a change to shadowsocks_service.local.net.udp.association can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.net.udp.association uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.udp.association uses shadowsocks_service.net.outbound, so a change to shadowsocks_service.net.outbound can break shadowsocks_service.local.net.udp.association, while a change to shadowsocks_service.local.net.udp.association can't break shadowsocks_service.net.outbound.
Position
Below the diagonal: shadowsocks_service.local.net.udp.association uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.udp.association uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.net.udp.association, while a change to shadowsocks_service.local.net.udp.association can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.net.udp.association uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.net.udp.association uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.net.udp.association, while a change to shadowsocks_service.local.net.udp.association can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.net.udp.association uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.tcprelay uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.redir.tcprelay, while a change to shadowsocks_service.local.redir.tcprelay can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.redir.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.tcprelay uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.local.redir.tcprelay, while a change to shadowsocks_service.local.redir.tcprelay can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.local.redir.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.tcprelay uses shadowsocks.net.tcp, so a change to shadowsocks.net.tcp can break shadowsocks_service.local.redir.tcprelay, while a change to shadowsocks_service.local.redir.tcprelay can't break shadowsocks.net.tcp.
Position
Below the diagonal: shadowsocks_service.local.redir.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.tcprelay uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.redir.tcprelay, while a change to shadowsocks_service.local.redir.tcprelay can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.redir.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.tcprelay uses shadowsocks.net.sys.unix.bsd.freebsd, so a change to shadowsocks.net.sys.unix.bsd.freebsd can break shadowsocks_service.local.redir.tcprelay, while a change to shadowsocks_service.local.redir.tcprelay can't break shadowsocks.net.sys.unix.bsd.freebsd.
Position
Below the diagonal: shadowsocks_service.local.redir.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.tcprelay uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.redir.tcprelay, while a change to shadowsocks_service.local.redir.tcprelay can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.redir.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.tcprelay uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.redir.tcprelay, while a change to shadowsocks_service.local.redir.tcprelay can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.redir.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.socks5.tcprelay uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.socks.server.socks5.tcprelay, while a change to shadowsocks_service.local.socks.server.socks5.tcprelay can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.socks.server.socks5.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.socks5.tcprelay uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.socks.server.socks5.tcprelay, while a change to shadowsocks_service.local.socks.server.socks5.tcprelay can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.socks.server.socks5.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.socks5.tcprelay uses shadowsocks.net.sys.unix.bsd.freebsd, so a change to shadowsocks.net.sys.unix.bsd.freebsd can break shadowsocks_service.local.socks.server.socks5.tcprelay, while a change to shadowsocks_service.local.socks.server.socks5.tcprelay can't break shadowsocks.net.sys.unix.bsd.freebsd.
Position
Below the diagonal: shadowsocks_service.local.socks.server.socks5.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.socks5.tcprelay uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.socks.server.socks5.tcprelay, while a change to shadowsocks_service.local.socks.server.socks5.tcprelay can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.socks.server.socks5.tcprelay uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in shadowsocks_service.local.socks.server.socks5.tcprelay uses a type in shadowsocks_service.local.loadbalancing.ping_balancer.
shadowsocks_service.local.socks.server.socks5.tcprelay uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.socks.server.socks5.tcprelay, while a change to shadowsocks_service.local.socks.server.socks5.tcprelay can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.socks.server.socks5.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.socks5.tcprelay uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.socks.server.socks5.tcprelay, while a change to shadowsocks_service.local.socks.server.socks5.tcprelay can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.socks.server.socks5.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tun.tcp uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.local.tun.tcp, while a change to shadowsocks_service.local.tun.tcp can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.local.tun.tcp uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tun.tcp uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks_service.local.tun.tcp, while a change to shadowsocks_service.local.tun.tcp can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks_service.local.tun.tcp uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tun.tcp uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.tun.tcp, while a change to shadowsocks_service.local.tun.tcp can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.tun.tcp uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tun.tcp uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.tun.tcp, while a change to shadowsocks_service.local.tun.tcp can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.tun.tcp uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tun.tcp uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.tun.tcp, while a change to shadowsocks_service.local.tun.tcp can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.tun.tcp uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.tcprelay uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.server.tcprelay, while a change to shadowsocks_service.server.tcprelay can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.server.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.tcprelay uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.server.tcprelay, while a change to shadowsocks_service.server.tcprelay can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.server.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.tcprelay uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks_service.server.tcprelay, while a change to shadowsocks_service.server.tcprelay can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks_service.server.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.tcprelay uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.server.tcprelay, while a change to shadowsocks_service.server.tcprelay can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.server.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.tcprelay uses shadowsocks_service.net.outbound, so a change to shadowsocks_service.net.outbound can break shadowsocks_service.server.tcprelay, while a change to shadowsocks_service.server.tcprelay can't break shadowsocks_service.net.outbound.
Position
Below the diagonal: shadowsocks_service.server.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.tcprelay uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.server.tcprelay, while a change to shadowsocks_service.server.tcprelay can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.server.tcprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.udprelay uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.server.udprelay, while a change to shadowsocks_service.server.udprelay can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.server.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.udprelay uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.server.udprelay, while a change to shadowsocks_service.server.udprelay can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.server.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.udprelay uses shadowsocks.relay.udprelay.options, so a change to shadowsocks.relay.udprelay.options can break shadowsocks_service.server.udprelay, while a change to shadowsocks_service.server.udprelay can't break shadowsocks.relay.udprelay.options.
Position
Below the diagonal: shadowsocks_service.server.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.udprelay uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.server.udprelay, while a change to shadowsocks_service.server.udprelay can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.server.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.udprelay uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.server.udprelay, while a change to shadowsocks_service.server.udprelay can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.server.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.http_client uses shadowsocks.context, so a change to shadowsocks.context can break shadowsocks_service.local.http.http_client, while a change to shadowsocks_service.local.http.http_client can't break shadowsocks.context.
Position
Below the diagonal: shadowsocks_service.local.http.http_client uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.http_client uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.http.http_client, while a change to shadowsocks_service.local.http.http_client can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.http.http_client uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.http_client uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.http.http_client, while a change to shadowsocks_service.local.http.http_client can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.http.http_client uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.http_client uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.http.http_client, while a change to shadowsocks_service.local.http.http_client can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.http.http_client uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.http_client uses shadowsocks_service.local.net.tcp.auto_proxy_stream, so a change to shadowsocks_service.local.net.tcp.auto_proxy_stream can break shadowsocks_service.local.http.http_client, while a change to shadowsocks_service.local.http.http_client can't break shadowsocks_service.local.net.tcp.auto_proxy_stream.
Position
Below the diagonal: shadowsocks_service.local.http.http_client uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.udprelay uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.local.redir.udprelay, while a change to shadowsocks_service.local.redir.udprelay can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.local.redir.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.udprelay uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.redir.udprelay, while a change to shadowsocks_service.local.redir.udprelay can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.redir.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.udprelay uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.local.redir.udprelay, while a change to shadowsocks_service.local.redir.udprelay can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.local.redir.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.udprelay uses shadowsocks_service.local.redir.redir_ext, so a change to shadowsocks_service.local.redir.redir_ext can break shadowsocks_service.local.redir.udprelay, while a change to shadowsocks_service.local.redir.udprelay can't break shadowsocks_service.local.redir.redir_ext.
Position
Below the diagonal: shadowsocks_service.local.redir.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.udprelay uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.redir.udprelay, while a change to shadowsocks_service.local.redir.udprelay can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.redir.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.udprelay uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.redir.udprelay, while a change to shadowsocks_service.local.redir.udprelay can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.redir.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.udprelay uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.redir.udprelay, while a change to shadowsocks_service.local.redir.udprelay can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.redir.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.udprelay uses shadowsocks_service.local.net.udp.association, so a change to shadowsocks_service.local.net.udp.association can break shadowsocks_service.local.redir.udprelay, while a change to shadowsocks_service.local.redir.udprelay can't break shadowsocks_service.local.net.udp.association.
Position
Below the diagonal: shadowsocks_service.local.redir.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tun uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.tun, while a change to shadowsocks_service.local.tun can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.tun uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tun uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.tun, while a change to shadowsocks_service.local.tun can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.tun uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tun uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.tun, while a change to shadowsocks_service.local.tun can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.tun uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tun uses shadowsocks_service.local.tun.tcp, so a change to shadowsocks_service.local.tun.tcp can break shadowsocks_service.local.tun, while a change to shadowsocks_service.local.tun can't break shadowsocks_service.local.tun.tcp.
Position
Below the diagonal: shadowsocks_service.local.tun uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.udprelay uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.tunnel.udprelay, while a change to shadowsocks_service.local.tunnel.udprelay can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.tunnel.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.udprelay uses shadowsocks.net.udp, so a change to shadowsocks.net.udp can break shadowsocks_service.local.tunnel.udprelay, while a change to shadowsocks_service.local.tunnel.udprelay can't break shadowsocks.net.udp.
Position
Below the diagonal: shadowsocks_service.local.tunnel.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.udprelay uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.tunnel.udprelay, while a change to shadowsocks_service.local.tunnel.udprelay can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.tunnel.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.udprelay uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.tunnel.udprelay, while a change to shadowsocks_service.local.tunnel.udprelay can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.tunnel.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.udprelay uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.tunnel.udprelay, while a change to shadowsocks_service.local.tunnel.udprelay can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.tunnel.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.udprelay uses shadowsocks_service.local.net.udp.association, so a change to shadowsocks_service.local.net.udp.association can break shadowsocks_service.local.tunnel.udprelay, while a change to shadowsocks_service.local.tunnel.udprelay can't break shadowsocks_service.local.net.udp.association.
Position
Below the diagonal: shadowsocks_service.local.tunnel.udprelay uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.server uses shadowsocks.net.option, so a change to shadowsocks.net.option can break shadowsocks_service.server.server, while a change to shadowsocks_service.server.server can't break shadowsocks.net.option.
Position
Below the diagonal: shadowsocks_service.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.server uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.server.server, while a change to shadowsocks_service.server.server can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.server uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.server.server, while a change to shadowsocks_service.server.server can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.server uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.server.server, while a change to shadowsocks_service.server.server can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.server uses shadowsocks_service.local.dns.dns_resolver, so a change to shadowsocks_service.local.dns.dns_resolver can break shadowsocks_service.server.server, while a change to shadowsocks_service.server.server can't break shadowsocks_service.local.dns.dns_resolver.
Position
Below the diagonal: shadowsocks_service.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.server uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.server.server, while a change to shadowsocks_service.server.server can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.server uses shadowsocks_service.server.tcprelay, so a change to shadowsocks_service.server.tcprelay can break shadowsocks_service.server.server, while a change to shadowsocks_service.server.server can't break shadowsocks_service.server.tcprelay.
Position
Below the diagonal: shadowsocks_service.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.server.server uses shadowsocks_service.server.udprelay, so a change to shadowsocks_service.server.udprelay can break shadowsocks_service.server.server, while a change to shadowsocks_service.server.server can't break shadowsocks_service.server.udprelay.
Position
Below the diagonal: shadowsocks_service.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.server uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.http.server, while a change to shadowsocks_service.local.http.server can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.http.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.server uses shadowsocks.net.tcp, so a change to shadowsocks.net.tcp can break shadowsocks_service.local.http.server, while a change to shadowsocks_service.local.http.server can't break shadowsocks.net.tcp.
Position
Below the diagonal: shadowsocks_service.local.http.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.server uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.http.server, while a change to shadowsocks_service.local.http.server can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.http.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.server uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.http.server, while a change to shadowsocks_service.local.http.server can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.http.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.http.server uses shadowsocks_service.local.http.http_client, so a change to shadowsocks_service.local.http.http_client can break shadowsocks_service.local.http.server, while a change to shadowsocks_service.local.http.server can't break shadowsocks_service.local.http.http_client.
Position
Below the diagonal: shadowsocks_service.local.http.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.server uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.redir.server, while a change to shadowsocks_service.local.redir.server can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.redir.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.server uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.local.redir.server, while a change to shadowsocks_service.local.redir.server can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.local.redir.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.server uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.redir.server, while a change to shadowsocks_service.local.redir.server can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.redir.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.server uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.redir.server, while a change to shadowsocks_service.local.redir.server can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.redir.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.server uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.redir.server, while a change to shadowsocks_service.local.redir.server can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.redir.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.server uses shadowsocks_service.local.redir.tcprelay, so a change to shadowsocks_service.local.redir.tcprelay can break shadowsocks_service.local.redir.server, while a change to shadowsocks_service.local.redir.server can't break shadowsocks_service.local.redir.tcprelay.
Position
Below the diagonal: shadowsocks_service.local.redir.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.redir.server uses shadowsocks_service.local.redir.udprelay, so a change to shadowsocks_service.local.redir.udprelay can break shadowsocks_service.local.redir.server, while a change to shadowsocks_service.local.redir.server can't break shadowsocks_service.local.redir.udprelay.
Position
Below the diagonal: shadowsocks_service.local.redir.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.server uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.tunnel.server, while a change to shadowsocks_service.local.tunnel.server can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.tunnel.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.server uses shadowsocks_service.local.socks.socks4, so a change to shadowsocks_service.local.socks.socks4 can break shadowsocks_service.local.tunnel.server, while a change to shadowsocks_service.local.tunnel.server can't break shadowsocks_service.local.socks.socks4.
Position
Below the diagonal: shadowsocks_service.local.tunnel.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.server uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.tunnel.server, while a change to shadowsocks_service.local.tunnel.server can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.tunnel.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.server uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.tunnel.server, while a change to shadowsocks_service.local.tunnel.server can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.tunnel.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.server uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.tunnel.server, while a change to shadowsocks_service.local.tunnel.server can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.tunnel.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.tunnel.server uses shadowsocks_service.local.tunnel.udprelay, so a change to shadowsocks_service.local.tunnel.udprelay can break shadowsocks_service.local.tunnel.server, while a change to shadowsocks_service.local.tunnel.server can't break shadowsocks_service.local.tunnel.udprelay.
Position
Below the diagonal: shadowsocks_service.local.tunnel.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.server uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.socks.server.server, while a change to shadowsocks_service.local.socks.server.server can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.socks.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.server uses shadowsocks.net.sys.unix.bsd.freebsd, so a change to shadowsocks.net.sys.unix.bsd.freebsd can break shadowsocks_service.local.socks.server.server, while a change to shadowsocks_service.local.socks.server.server can't break shadowsocks.net.sys.unix.bsd.freebsd.
Position
Below the diagonal: shadowsocks_service.local.socks.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.server uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.socks.server.server, while a change to shadowsocks_service.local.socks.server.server can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.socks.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.server uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.socks.server.server, while a change to shadowsocks_service.local.socks.server.server can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.socks.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.server uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.socks.server.server, while a change to shadowsocks_service.local.socks.server.server can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.socks.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server.server uses shadowsocks_service.local.http.server, so a change to shadowsocks_service.local.http.server can break shadowsocks_service.local.socks.server.server, while a change to shadowsocks_service.local.socks.server.server can't break shadowsocks_service.local.http.server.
Position
Below the diagonal: shadowsocks_service.local.socks.server.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server uses shadowsocks.config, so a change to shadowsocks.config can break shadowsocks_service.local.socks.server, while a change to shadowsocks_service.local.socks.server can't break shadowsocks.config.
Position
Below the diagonal: shadowsocks_service.local.socks.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server uses shadowsocks_service.acl, so a change to shadowsocks_service.acl can break shadowsocks_service.local.socks.server, while a change to shadowsocks_service.local.socks.server can't break shadowsocks_service.acl.
Position
Below the diagonal: shadowsocks_service.local.socks.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local.socks.server, while a change to shadowsocks_service.local.socks.server can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local.socks.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local.socks.server, while a change to shadowsocks_service.local.socks.server can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local.socks.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local.socks.server uses shadowsocks_service.local.socks.server.server, so a change to shadowsocks_service.local.socks.server.server can break shadowsocks_service.local.socks.server, while a change to shadowsocks_service.local.socks.server can't break shadowsocks_service.local.socks.server.server.
Position
Below the diagonal: shadowsocks_service.local.socks.server uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.config, so a change to shadowsocks_service.config can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.config.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.local.loadbalancing.ping_balancer, so a change to shadowsocks_service.local.loadbalancing.ping_balancer can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.local.loadbalancing.ping_balancer.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.local.dns.server, so a change to shadowsocks_service.local.dns.server can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.local.dns.server.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.local.context, so a change to shadowsocks_service.local.context can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.local.context.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.local.fake_dns.server, so a change to shadowsocks_service.local.fake_dns.server can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.local.fake_dns.server.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.local.tun, so a change to shadowsocks_service.local.tun can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.local.tun.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.local.http.server, so a change to shadowsocks_service.local.http.server can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.local.http.server.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.local.redir.server, so a change to shadowsocks_service.local.redir.server can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.local.redir.server.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.local.tunnel.server, so a change to shadowsocks_service.local.tunnel.server can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.local.tunnel.server.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
shadowsocks_service.local uses shadowsocks_service.local.socks.server, so a change to shadowsocks_service.local.socks.server can break shadowsocks_service.local, while a change to shadowsocks_service.local can't break shadowsocks_service.local.socks.server.
Position
Below the diagonal: shadowsocks_service.local uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 67% · Adequate · gated by X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A02:2025 — Security Misconfiguration
71
High / Critical
A05:2025 — Injection
58
High / Critical
A03:2025 — Software Supply Chain Failures
37
Medium
A07:2025 — Authentication Failures
3
High / Critical
Roadmap
Top priorities: Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do; Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only; Resolve the 1 No ADRs found finding(s) in ADR Quality — start with Cargo.toml.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
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.
Code Duplication: Edited copy of a member (26 corresponding lines)
crates/shadowsocks/src/config.rs
5.9
Mixed
Code Duplication: Edited copy of a member (19 corresponding lines)
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 — 61
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 — 432
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 — 42
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 17
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
Each chip is a dimension scored from real signals across architecture, testing, dependencies, security & compliance, documentation, git-history and code quality — in one coherent pass. A surface report typically covers a handful.
How to trust any code-health report — three questions
Can you open the finding? Real findings cite a repo-relative file and line you can open at the cited line — never an absolute scratch path. Here, 506 of 535 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it: Roslyn, git or a scanner, not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D1 Cyclomatic Complexity — 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. Most of this repository's production source (.rs) had no cyclomatic complexity computed for it: no function bodies were exposed for those file kinds by any language model this pass could load.
D2 Cognitive Complexity — 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. Most of this repository's production source (.rs) had no cognitive complexity computed for it: no function bodies were exposed for those file kinds by any language model this pass could load.
D4 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 171 duplicated block group(s) on this row were found in the languages this pass could tokenize, and they do NOT cover all of this repository's production source: .rs (95,257 lines, 100% of production source) went unread, because no language model this pass could load exposed a clone-unit token stream for those file kinds. Duplication in that source is UNMEASURED — its absence from the count above is a gap in this analyzer's language coverage, not a finding that the code is free of duplication.
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. Test source is present (.rs, .rb) and this repository declares a Cargo test suite (repository root, 28 test files), but it was not re-run: its build outgrew the 6 GB scratch ceiling (6.567 GB measured) and was stopped; its suite was not run. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D15 Churn × Complexity Hotspots — 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. A hotspot is churn × complexity. Churn was measured (1371 line(s) across the 90-day window), but no complexity could be computed for .rs, which is most of this repository's production code — so every churned file would score as complexity 0 and the hotspot list would be empty no matter how tangled the code is. Not scored — this is a gap in the analysis run, not a finding about this repository.
D16 Bus Factor — 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. Single-maintainer repository — bus factor is not applicable (129 contributor(s) across 3467 commit(s) sampled, automation and bot accounts excluded). One of them holds 86% of the history; the other 128 hold 0.1% each on average, below the 5% at which there is somebody to hand the work to. That is a single maintainer with drive-by contributors, not a team whose knowledge has concentrated — so the bus factor is not applicable and there is nothing here for the owner to act on.
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.
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.
D34 Knowledge Freshness — 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. File-level freshness contradicts repo activity: 47 commits in the last 90 days, yet 79 of 122 significant files carry no living knowledge. Those two readings cannot both be true, so the per-file recency signal is treated as unreliable here and freshness is not scored for this run.
D41 Kernel & Syscall Confinement — 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. K8s/chart/templates/deployment.yaml:2 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
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) — gcc\"; echo \"WARN: downloaded cross toolchain is not executable on this builder, fallback to native gcc\"; fi && echo \"CC=$CC\" && rustup target add \"$RUST_TARGET\" && RUSTFLAGS=\"-C linker=$CC\" CC=$CC cargo build --target \"$RUST_TARGET\" --release --features \"full\" && mv target/$RUST_TARGET/release/ss* target/release/" did not complete successfully: exit code: 1; runtime evidence skipped.
C1 Data Protection — 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. 'rocksdb' is imported (crates/shadowsocks-service/src/local/fake_dns/manager.rs:14), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C3 Audit Trail — 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. 'rocksdb' is imported (crates/shadowsocks-service/src/local/fake_dns/manager.rs:14), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C4 Data Retention — 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. 'rocksdb' is imported (crates/shadowsocks-service/src/local/fake_dns/manager.rs:14), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
C5 Data-Subject Rights — 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. 'rocksdb' is imported (crates/shadowsocks-service/src/local/fake_dns/manager.rs:14), but no entity, schema, table or model declaration this check reads was found beside it, so whether personal data is stored could not be decided.
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 this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — 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 this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
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.
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.
D8 Code Coverage: Coverage is measured by building and running the test suite inside our isolated image — the target repo is never modified, and nothing on your systems runs. So coverage exists only when the suite builds and runs within the inline time budget; one that needs external services, can't build, or exceeds the budget yields no coverage (D8 then degrades to not-measured, not a low score). Line coverage also says nothing about assertion quality.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 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.
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").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
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.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
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.
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.
171 duplicated block group(s) detected. 6.7 % of the production lines (6,390 of 95,445) 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. Measured on part of this repository only: .rs (100% of production source) was not exposed to the token comparison, so duplication there is unmeasured and is not in this count.
+ 119 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with ping_balancer.rs (2), mod.rs (2), bsd_pf.rs (2). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 11 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with config.rs (3), freebsd.rs (2), udp.rs (2). — One of this dimension's main actionable groups (11 warning-level).
Resolve the 7 Edited copy of a member (12 corresponding lines) finding(s) in Code Duplication — start with mod.rs (2), proxy_listener.rs, uds.rs. — One of this dimension's main actionable groups (7 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.3 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
3 production modules (Cargo), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 1 module(s) off the main sequence.
Off the main sequence: shadowsocks
What to do
Resolve the 1 Off the main sequence 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.
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.
What it measures: How much of the code is actually exercised by tests.
Method: Coverage from the analyzer's own run of the suite, computed per-file with structured exclusions for generated, trivial, and glue code. A coverage report found in the repository is never read. When the suite can't be built/run in-image, coverage is reported NOT-MEASURED (excluded from the score) with the precondition to make it measurable — never a LoC-ratio proxy folded in as if measured. Deterministic.
Line coverage 41.1% — 75 file(s) below 50%. Measured from the Rust suite (repository root: `cargo test --workspace` instrumented over 138 production file(s), 18 test binaries and 1 doc-test binaries).
Resolve the 75 Low coverage finding(s) in Code Coverage — start with mod.rs (16), config.rs (6), server.rs (3). — One of this dimension's main actionable groups (75 warning-level).
Detailed fixes: d8_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether dependencies are current, not deprecated, and not bloated. Known vulnerabilities are D30's.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (capped-linear for deprecation, prerelease and outdated) per KLoC. Known-vulnerable packages are D30's and are not charged here (rubric-2026.11.2). Exhaustive.
14 outdated, 0 yanked direct Cargo dependencies. Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Outdated: aes · ×14
✓ On the Gold path — maintain.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
1 secret(s) detected. 1 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.
REDACTED
What to do
Resolve the 1 Leaked secret finding(s) in Secret Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 448 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. This repository publishes itself under MIT, which is its own choice and is not judged here.
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.
14 deducted task-comment markers across 95445 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 9 FixmeComment finding(s) in Explicit Debt — start with mod.rs (2), other.rs, udprelay.rs. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 3 XxxComment finding(s) in Explicit Debt — start with mod.rs (2), context.rs. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 2 TodoComment finding(s) in Explicit Debt — start with server.rs, mod.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: 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.
1 of 1 documentation facets pass in full. 4 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: 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.
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.
2 of 3 build units (Cargo) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: 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.
1 finding(s): 0 critical, 1 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 1 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
58 finding(s): 0 critical, 54 high, 3 medium, 1 low. 43 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 7 file(s) — `crates/shadowsocks-service/src/local/tun/tcp.rs` (line 121, lines 148–151, line 151), `docker/docker-entrypoint.sh` (line 14, line 16), `k8s/chart/templates/config.yaml`, `REDACTED`, `k8s/chart/templates/hpa.yaml`, … (+2 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 2 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 5 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED, REDACTED. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 43 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 (43 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 12 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (12). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 7 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (7). — One of this dimension's main actionable groups (7 warning-level).
Resolve the 4 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4). — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 56 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (44), REDACTED (5), REDACTED (5). — One of this dimension's main actionable groups (56 warning-level).
Resolve the 5 High IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (5 issue-level).
Resolve the 10 Low IaC finding(s) in IaC & Container Security — start with REDACTED (7), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (10 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 4 Change coupling finding(s) in Change Coupling — start with proxy_listener.rs (2), bsd.rs, client.rs. — One of this dimension's main actionable groups (4 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
0/2 workload(s) run every container under a seccomp profile; 0/2 declare an AppArmor/SELinux profile.
No seccomp profile · ×2REDACTED:66
What to do
Resolve the 2 No seccomp profile finding(s) in Kernel & Syscall Confinement — start with REDACTED (2). — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether 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.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
This repository serves requests — a server (.serve_connection) (crates/shadowsocks-service/src/local/socks/server/server.rs:218) — and no route guard, auth-gate middleware, global guard or imperative check that refuses a caller (401/403, an Unauthorized/Forbidden error) was found: its endpoints may be unprotected. — crates/shadowsocks-service/src/local/socks/server/server.rs:218
What to do
Protect endpoints by default-deny: a global authentication guard or middleware with explicit public opt-outs, or a guard on every route, plus named role/permission rules for what an authenticated caller may do.
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.
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.
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.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language'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.
Do you agree with this assessment?
P2 · Observability7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
What to do
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
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.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`.serve_connection(` (crates/shadowsocks-service/src/local/socks/server/server.rs:218)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.
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.
This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `.serve_connection(` (crates/shadowsocks-service/src/local/socks/server/server.rs:218).
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 set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `.serve_connection(` (crates/shadowsocks-service/src/local/socks/server/server.rs:218).
What to do
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · 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.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
Other · Code Health — Whether Ruby's type checker checks nil and is not undermined by assertions — a file Sorbet reads at `# typed: true` or above, or a Steep target `check`s under its default or strict diagnostics, is one where a method call on a `T.nilable(String)` / `String?` is an error, and each `T.must`, `#: as !nil` or `# steep:ignore NoMethod` is the author telling the checker a value cannot be nil.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
What to do
Adopt a checker and raise it file by file: with Sorbet, `srb init` (or `bundle exec tapioca init`) commits `sorbet/config`, then move each file's sigil from `# typed: false` to `# typed: true` and on to `strict` as its methods get `sig`s — `spoom bump` does the moving; with Steep, write RBS signatures and `check` the product directories in the `Steepfile` under `D::Ruby.default` or `strict`, not `lenient`. Then pay down the assertions rather than adding to them: each `T.must` is a nil the checker could not rule out — narrow it (`return unless x`, `x&.`, `if (y = x)`), make the attribute non-nilable and set it in `initialize`, or change the method so the nil cannot arrive.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 1 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Not assessed: this repository stores data through 'rocksdb' (crates/shadowsocks-service/src/local/fake_dns/manager.rs:14) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether its changes need an audit trail could not be established, and the trail's absence is not scored.
C4 Data Retention — Not assessed: this repository stores data through 'rocksdb' (crates/shadowsocks-service/src/local/fake_dns/manager.rs:14) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether a retention limit applies here could not be established, and its absence is not scored.
C5 Data-Subject Rights — Not assessed: this repository stores data through 'rocksdb' (crates/shadowsocks-service/src/local/fake_dns/manager.rs:14) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so whether data-subject rights apply here could not be established, and their absence is not scored.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 70 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: this repository's Python imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; this repository's Ruby imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; 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 — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. No class in this Ruby code is a Rails controller, a Sinatra, Grape or Roda app, a Hanami action or a Rack app (an instance `call(env)`), so no request handler shares state between request threads. 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.
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — no class or module declares an abstract method
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) — gcc\"; echo \"WARN: downloaded cross toolchain is not executable on this builder, fallback to native gcc\"; fi && echo \"CC=$CC\" && rustup target add \"$RUST_TARGET\" && RUSTFLAGS=\"-C linker=$CC\" CC=$CC cargo build --target \"$RUST_TARGET\" --release --features \"full\" && mv target/$RUST_TARGET/release/ss* target/release/" did not complete successfully: exit code: 1; 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 — Not assessed: this repository stores data through 'rocksdb' (crates/shadowsocks-service/src/local/fake_dns/manager.rs:14) but declares no persisted model this check reads (Diesel table! columns, SeaORM entity / Diesel model / sqlx FromRow struct fields, CREATE TABLE and ALTER TABLE … ADD columns in SQL migrations and SQL string literals). Personal data may be written through raw SQL or a hosted backend, so the absence of a personal-data field here is not evidence that none is stored, and encryption at rest is not scored over a subject that could not be established.
D1 Cyclomatic Complexity — cyclomatic complexity not measured — .rs exposed no member bodies
D10 Test Quality — ~1163 lines of test source are present (.rs, .rb) 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.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D15 Churn × Complexity Hotspots — complexity unreadable for .rs — churn × complexity hotspots could not be measured
D16 Bus Factor — single-maintainer repository — bus factor is not applicable
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.
D2 Cognitive Complexity — cognitive complexity not measured — .rs exposed no member bodies
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 .py, .rb, .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.
D3 God Classes — Most of this repository's production source (.rs) was not read by god-class detection, so type and module size was not assessed for the languages that are the product — whatever else this pass did read is not this repository's type and module size. Not scored — this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D34 Knowledge Freshness — knowledge concentrated in recent work — freshness signal contradicted by repo activity
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.
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
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
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (10 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
M4 Documentation accuracy — Not applicable: the 5 current-state document(s) make no claim of a kind M4 checks. 6 claim(s) of kinds M4 does not check were not checked (path 2, environment variable 4); M4 checks only links and versions and artefact counts.
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 Python, Ruby, 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 data present for 138 file(s), but no domain-layer files were identified: no covered file's path contains any of the markers this check keys on (/domain/, /aggregates/, /valueobjects/, /domainmodel/, .domain/, /entities/), which are matched case-insensitively anywhere in the path. With no domain partition there is nothing to compare the web/controller layer against — if this repository keeps its business rules under a folder named none of those, that naming is what the check cannot see, not the domain logic.
PF1 Benchmark discipline — Not applicable: no benchmark suite was found. This check searched for `#[bench]`, criterion's `bench_function`/`bench_with_input`, `#[divan::bench]` or `#[library_benchmark]` in any `.rs` file, or criterion, divan, iai or a `[[bench]]` target in a Cargo.toml, and for a `*benchmark*` script that this repository's CI runs. Benchmarks are credited as a bonus, so their absence is neither scored nor deducted.
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
X12 Unreachable branch — X12 reached only 0% of this repository's production lines — rust (95,257 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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 applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X17 Uncapped recursion over a caller-supplied document — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X2 Cancellation propagation — no C# was loaded; this repository's Ruby, Python and Rust were read, and no request in it can be cancelled by a caller — a Ruby request takes no token: Net::HTTP, Faraday and async-http are stopped from outside the call (Async::Task#stop, Thread#raise, Timeout), not through a parameter; a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; 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 applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X27 Collection changed while being enumerated — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X28 Index access outside its own emptiness guard — 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 — X3 reached only 0% of this repository's production lines — rust (95,257 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X30 Support guard that admits what it rejects — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
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.
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.
Duplicated block (8 lines × 2) crates/shadowsocks-service/src/local/dns/server.rs:215— crates/shadowsocks-service/src/local/dns/server.rs:215-222 | crates/shadowsocks-service/src/local/http/server.rs:64-71 — 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 `crates/shadowsocks-service/src/local/dns/server.rs:215` 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 (8 lines × 2) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:398— crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:398-405 | crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:524-531 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:398` 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 (8 lines × 2) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:408— crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:408-415 | crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:535-542 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:408` 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 (8 lines × 2) crates/shadowsocks-service/src/local/mod.rs:128— crates/shadowsocks-service/src/local/mod.rs:128-135 | crates/shadowsocks-service/src/manager/mod.rs:36-43 — `crates/shadowsocks-service/src/local/mod.rs` and `crates/shadowsocks-service/src/manager/mod.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 4 separate duplicated blocks between them, totalling at least 30 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 `crates/shadowsocks-service/src/local/mod.rs:128` 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 (8 lines × 2) crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:80— crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:80-87 | crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:99-106 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:80` 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 (8 lines × 2) crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:123— crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:123-130 | crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:144-151 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:123` 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 (8 lines × 2) crates/shadowsocks-service/src/local/redir/tcprelay/mod.rs:66— crates/shadowsocks-service/src/local/redir/tcprelay/mod.rs:66-73 | crates/shadowsocks-service/src/local/tun/tcp.rs:606-613 — 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. 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 (8 lines × 2) crates/shadowsocks-service/src/local/socks/server/socks4/tcprelay.rs:145— crates/shadowsocks-service/src/local/socks/server/socks4/tcprelay.rs:145-152 | crates/shadowsocks-service/src/local/socks/server/socks5/tcprelay.rs:280-287 — 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 `crates/shadowsocks-service/src/local/socks/server/socks4/tcprelay.rs:145` 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 (8 lines × 2) crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:459— crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:459-466 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:534-541 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:459` 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 (8 lines × 2) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:241— crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:241-248 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:392-399 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:241` 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 (8 lines × 2) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:448— crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:448-455 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:493-500 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:448` 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 (8 lines × 2) crates/shadowsocks-service/src/local/net/udp/association.rs:329— crates/shadowsocks-service/src/local/net/udp/association.rs:329-336 | crates/shadowsocks-service/src/server/udprelay.rs:463-470 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/shadowsocks-service/src/config.rs:3079— crates/shadowsocks-service/src/config.rs:3079-3084 | crates/shadowsocks-service/src/config.rs:3115-3120 — both copies are in the same file, so extract the 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 (6 lines × 2) crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs:181— crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs:181-186 | crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs:221-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:269— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:269-274 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:275-280 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:269` 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 (6 lines × 2) crates/shadowsocks-service/src/local/tun/udp.rs:134— crates/shadowsocks-service/src/local/tun/udp.rs:134-139 | crates/shadowsocks-service/src/local/tun/udp.rs:144-149 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/tun/udp.rs:134` 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 (6 lines × 2) crates/shadowsocks/src/net/udp.rs:329— crates/shadowsocks/src/net/udp.rs:329-334 | crates/shadowsocks/src/net/udp.rs:374-379 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/net/udp.rs:329` 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 (6 lines × 2) crates/shadowsocks/src/relay/tcprelay/aead.rs:195— crates/shadowsocks/src/relay/tcprelay/aead.rs:195-200 | crates/shadowsocks/src/relay/tcprelay/stream.rs:141-146 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/stream.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 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) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:105— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:105-110 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:162-167 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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) crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:74— crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:74-79 | crates/shadowsocks/src/relay/udprelay/aead_2022.rs:150-155 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/shadowsocks-service/src/local/http/config.rs:155— crates/shadowsocks-service/src/local/http/config.rs:155-160 | crates/shadowsocks-service/src/local/socks/config.rs:124-129 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/shadowsocks-service/src/config.rs:1936— crates/shadowsocks-service/src/config.rs:1936-1941 | crates/shadowsocks-service/src/config.rs:1994-1999 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/config.rs:1936` 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 (6 lines × 2) crates/shadowsocks-service/src/local/socks/socks4.rs:226— crates/shadowsocks-service/src/local/socks/socks4.rs:226-231 | crates/shadowsocks-service/src/local/socks/socks4.rs:235-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
FixmeComment src/monitor/other.rs:8— // FIXME: What can I do ... — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/shadowsocks-service/src/server/udprelay.rs:771— // FIXME: server_packet_id overflowed. There is no way to recover from 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.
FixmeComment crates/shadowsocks-service/src/local/tun/tcp.rs:521— // FIXME: It should follow system's setting. 7200 is Linux's default. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/shadowsocks-service/src/local/socks/client/socks5/udp_client.rs:57— // FIXME: domain-name relay address would require resolving via — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/shadowsocks-service/src/local/net/udp/association.rs:629— // FIXME: client_packet_id overflowed. What's the proper way to handle this? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/shadowsocks-service/src/local/http/http_service.rs:120— // FIXME: What STATUS should I return for connection error? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/shadowsocks-service/src/acl/mod.rs:228— // FIXME: If this line is not a valid regex, how can we know without actually compile it? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/shadowsocks/src/plugin/obfs_proxy.rs:35— // FIXME: Not compatible in Windows — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
FixmeComment crates/shadowsocks/src/net/sys/unix/mod.rs:81— // FIXME: Linux Kernel doesn't support setting TCP Keep Alive. (MPTCP) — 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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×7
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×7
Edited copy of a member (12 corresponding lines) crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs:45— crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs:45-56 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:124-136 — 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) crates/shadowsocks-service/src/local/redir/tcprelay/mod.rs:62— crates/shadowsocks-service/src/local/redir/tcprelay/mod.rs:62-73 | crates/shadowsocks-service/src/local/tun/tcp.rs:602-613 — 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) src/daemonize/daemonize/mod.rs:482— src/daemonize/daemonize/mod.rs:482-493 | src/daemonize/daemonize/mod.rs:500-511 — 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) crates/shadowsocks/src/net/sys/unix/uds.rs:32— crates/shadowsocks/src/net/sys/unix/uds.rs:32-43 | crates/shadowsocks/src/net/sys/unix/uds.rs:55-68 — 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) crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:38— crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:38-49 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:35-46 — 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) src/service/local.rs:1126— src/service/local.rs:1126-1137 | src/service/local.rs:1156-1167 — 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) crates/shadowsocks/src/relay/tcprelay/aead.rs:347— crates/shadowsocks/src/relay/tcprelay/aead.rs:347-358 | crates/shadowsocks/src/relay/tcprelay/stream.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.
Duplicated block (9 lines × 2) crates/shadowsocks-service/src/manager/mod.rs:49— crates/shadowsocks-service/src/manager/mod.rs:49-57 | crates/shadowsocks-service/src/server/mod.rs:83-91 — `crates/shadowsocks-service/src/manager/mod.rs` and `crates/shadowsocks-service/src/server/mod.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 4 separate duplicated blocks between them, totalling at least 31 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 `crates/shadowsocks-service/src/manager/mod.rs:49` 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 (9 lines × 2) crates/shadowsocks/src/net/sys/unix/mod.rs:136— crates/shadowsocks/src/net/sys/unix/mod.rs:136-144 | crates/shadowsocks/src/net/sys/windows/mod.rs:557-565 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/shadowsocks/src/relay/socks5.rs:611— crates/shadowsocks/src/relay/socks5.rs:611-619 | crates/shadowsocks/src/relay/socks5.rs:678-686 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) crates/shadowsocks/src/relay/udprelay/aead.rs:125— crates/shadowsocks/src/relay/udprelay/aead.rs:125-133 | crates/shadowsocks/src/relay/udprelay/stream.rs:101-109 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. 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 (9 lines × 2) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:454— crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:454-462 | crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:487-495 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:454` 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 (9 lines × 2) crates/shadowsocks-service/src/local/tun/mod.rs:230— crates/shadowsocks-service/src/local/tun/mod.rs:230-238 | crates/shadowsocks-service/src/local/tun/mod.rs:257-265 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/tun/mod.rs:230` 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 (9 lines × 2) crates/shadowsocks/src/relay/udprelay/aead.rs:61— crates/shadowsocks/src/relay/udprelay/aead.rs:61-69 | crates/shadowsocks/src/relay/udprelay/stream.rs:55-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/shadowsocks/src/relay/udprelay/aead.rs:72` calls `advance_mut`, `tag_len` and `crates/shadowsocks/src/relay/udprelay/stream.rs:64` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 4) crates/shadowsocks-service/src/local/socks/socks4.rs:127— crates/shadowsocks-service/src/local/socks/socks4.rs:127-132 | crates/shadowsocks-service/src/local/socks/socks4.rs:137-142 | crates/shadowsocks/src/relay/socks5.rs:373-378 | crates/shadowsocks/src/relay/socks5.rs:383-388 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Note first that the copies are not typed on the same thing: the declarations holding them bind `f` to `&mut fmt::Formatter` in one and `&mut Formatter` 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 × 4) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:114— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:114-119 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:171-176 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:140-145 | crates/shadowsocks/src/net/sys/windows/mod.rs:122-127 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 × 4) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:123— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:123-128 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:180-185 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:149-154 | crates/shadowsocks/src/net/sys/windows/mod.rs:131-136 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 × 4) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:130— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:130-135 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:187-192 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:156-161 | crates/shadowsocks/src/net/sys/windows/mod.rs:138-143 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 × 4) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:137— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:137-142 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:194-199 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:163-168 | crates/shadowsocks/src/net/sys/windows/mod.rs:145-150 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 × 4) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:173— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:173-178 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:229-234 | crates/shadowsocks/src/net/sys/unix/others.rs:122-127 | crates/shadowsocks/src/net/sys/windows/mod.rs:185-190 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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· Edited copy of a member (11 corresponding lines) · ×5
Edited copy of a member (11 corresponding lines) crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:135— crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:135-148 | crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:280-290 — 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) crates/shadowsocks-service/src/net/mon_stream.rs:50— crates/shadowsocks-service/src/net/mon_stream.rs:50-61 | crates/shadowsocks-service/src/net/mon_stream.rs:69-79 — 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) crates/shadowsocks-service/src/local/net/udp/association.rs:548— crates/shadowsocks-service/src/local/net/udp/association.rs:548-558 | crates/shadowsocks-service/src/server/udprelay.rs:652-662 — 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) crates/shadowsocks/src/net/udp.rs:251— crates/shadowsocks/src/net/udp.rs:251-261 | crates/shadowsocks/src/net/udp.rs:279-289 — 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) crates/shadowsocks/src/relay/tcprelay/aead.rs:301— crates/shadowsocks/src/relay/tcprelay/aead.rs:301-318 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:488-498 — 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.
Duplicated block (20 lines × 2) crates/shadowsocks-service/src/config.rs:2196— crates/shadowsocks-service/src/config.rs:2196-2215 | crates/shadowsocks-service/src/config.rs:2343-2362 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/config.rs:2196` 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 (20 lines × 2) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:287— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:287-306 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:293-312 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:287` 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 (20 lines × 2) crates/shadowsocks/src/net/sys/unix/linux/mod.rs:64— crates/shadowsocks/src/net/sys/unix/linux/mod.rs:64-83 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:327-346 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/net/sys/unix/linux/mod.rs:64` 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 (20 lines × 2) crates/shadowsocks/src/net/sys/unix/mod.rs:38— crates/shadowsocks/src/net/sys/unix/mod.rs:38-57 | crates/shadowsocks/src/net/sys/windows/mod.rs:439-458 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/shadowsocks/src/net/sys/windows/mod.rs:459` calls `disable_connection_reset` and `crates/shadowsocks/src/net/sys/unix/mod.rs:59` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 2) src/service/local.rs:661— src/service/local.rs:661-680 | src/service/server.rs:364-383 — before extracting anything, compare `src/service/local.rs` and `src/service/server.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 349 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `src/service/local.rs:660` calls `set_source` and `src/service/server.rs:363` 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 (16 lines × 2) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:854— crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:854-869 | crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:893-908 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/shadowsocks-service/src/local/socks/server/server.rs:64— crates/shadowsocks-service/src/local/socks/server/server.rs:64-79 | crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:51-66 — before extracting anything, compare `crates/shadowsocks-service/src/local/socks/server/server.rs` and `crates/shadowsocks-service/src/local/tunnel/tcprelay.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/socks/server/server.rs:64` 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 (16 lines × 2) crates/shadowsocks/src/manager/protocol.rs:204— crates/shadowsocks/src/manager/protocol.rs:204-219 | crates/shadowsocks/src/manager/protocol.rs:238-253 — both copies are in the same file, so extract the 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 (16 lines × 2) src/service/manager.rs:344— src/service/manager.rs:344-359 | src/service/server.rs:439-454 — before extracting anything, compare `src/service/manager.rs` and `src/service/server.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 334 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 `src/service/manager.rs:344` 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 (16 lines × 2) src/service/manager.rs:495— src/service/manager.rs:495-510 | src/service/server.rs:537-552 — before extracting anything, compare `src/service/manager.rs` and `src/service/server.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 334 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 `src/service/manager.rs:495` 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 (14 lines × 2) crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs:70— crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs:70-83 | crates/shadowsocks-service/src/local/tunnel/udprelay.rs:60-73 — before extracting anything, compare `crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs` and `crates/shadowsocks-service/src/local/tunnel/udprelay.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs:70` 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 (14 lines × 2) crates/shadowsocks/src/relay/tcprelay/aead.rs:219— crates/shadowsocks/src/relay/tcprelay/aead.rs:219-232 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:418-431 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 170 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 (14 lines × 2) crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:218— crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:218-231 | crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:246-259 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:218` 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 (14 lines × 2) crates/shadowsocks/src/relay/udprelay/aead_2022.rs:581— crates/shadowsocks/src/relay/udprelay/aead_2022.rs:581-594 | crates/shadowsocks/src/relay/udprelay/aead_2022.rs:687-700 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/udprelay/aead_2022.rs:581` 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 (14 lines × 2) crates/shadowsocks/src/dns_resolver/hickory_dns_resolver.rs:149— crates/shadowsocks/src/dns_resolver/hickory_dns_resolver.rs:149-162 | crates/shadowsocks/src/dns_resolver/hickory_dns_resolver.rs:174-187 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/dns_resolver/hickory_dns_resolver.rs:149` 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 (13 lines × 2) crates/shadowsocks-service/src/config.rs:1812— crates/shadowsocks-service/src/config.rs:1812-1824 | crates/shadowsocks-service/src/config.rs:1852-1864 — both copies are in the same file, so extract the 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 (13 lines × 2) crates/shadowsocks-service/src/local/dns/server.rs:147— crates/shadowsocks-service/src/local/dns/server.rs:147-159 | crates/shadowsocks-service/src/local/tunnel/server.rs:101-113 — 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 `crates/shadowsocks-service/src/local/dns/server.rs:147` 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, `crates/shadowsocks-service/src/local/dns/server.rs:144` calls `clone` and `crates/shadowsocks-service/src/local/tunnel/server.rs:100` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/shadowsocks-service/src/local/loadbalancing/server_data.rs:99— crates/shadowsocks-service/src/local/loadbalancing/server_data.rs:99-111 | crates/shadowsocks-service/src/server/mod.rs:124-136 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) crates/shadowsocks/src/net/udp.rs:115— crates/shadowsocks/src/net/udp.rs:115-127 | crates/shadowsocks/src/net/udp.rs:138-150 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/net/udp.rs:115` 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 (13 lines × 2) crates/shadowsocks/src/relay/tcprelay/aead.rs:244— crates/shadowsocks/src/relay/tcprelay/aead.rs:244-256 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:437-449 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 170 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) crates/shadowsocks-service/src/local/dns/server.rs:212— crates/shadowsocks-service/src/local/dns/server.rs:212-220 | crates/shadowsocks-service/src/local/socks/server/server.rs:62-70 | crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:49-57 — before extracting anything, compare `crates/shadowsocks-service/src/local/dns/server.rs` and `crates/shadowsocks-service/src/local/socks/server/server.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/dns/server.rs:212` 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 (9 lines × 3) crates/shadowsocks-service/src/local/http/http_client.rs:347— crates/shadowsocks-service/src/local/http/http_client.rs:347-355 | crates/shadowsocks-service/src/local/http/http_client.rs:379-387 | crates/shadowsocks-service/src/local/http/http_client.rs:398-406 — 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 `crates/shadowsocks-service/src/local/http/http_client.rs:347` 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 (9 lines × 3) src/service/local.rs:882— src/service/local.rs:882-890 | src/service/manager.rs:355-363 | src/service/server.rs:450-458 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/shadowsocks/src/relay/tcprelay/aead.rs:405— crates/shadowsocks/src/relay/tcprelay/aead.rs:405-413 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:733-741 | crates/shadowsocks/src/relay/tcprelay/stream.rs:251-259 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 170 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 `crates/shadowsocks/src/relay/tcprelay/aead.rs:405` 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) src/service/local.rs:1066— src/service/local.rs:1066-1074 | src/service/manager.rs:533-541 | src/service/server.rs:575-583 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:165— crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:165-171 | crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:178-184 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:165` 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) crates/shadowsocks-service/src/local/context.rs:154— crates/shadowsocks-service/src/local/context.rs:154-160 | crates/shadowsocks-service/src/server/context.rs:75-81 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/shadowsocks-service/src/local/net/udp/association.rs:268— crates/shadowsocks-service/src/local/net/udp/association.rs:268-274 | crates/shadowsocks-service/src/server/udprelay.rs:413-419 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `data` to `(Address, Bytes)` in one and `UdpAssociationSendMessage` 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 (7 lines × 2) crates/shadowsocks-service/src/local/dns/server.rs:441— crates/shadowsocks-service/src/local/dns/server.rs:441-447 | crates/shadowsocks-service/src/local/fake_dns/udp_server.rs:51-57 — 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. 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) crates/shadowsocks-service/src/config.rs:2135— crates/shadowsocks-service/src/config.rs:2135-2141 | crates/shadowsocks-service/src/config.rs:2244-2250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 3) crates/shadowsocks-service/src/local/mod.rs:140— crates/shadowsocks-service/src/local/mod.rs:140-145 | crates/shadowsocks-service/src/manager/mod.rs:48-54 | crates/shadowsocks-service/src/server/mod.rs:82-88 — `crates/shadowsocks-service/src/local/mod.rs` and `crates/shadowsocks-service/src/manager/mod.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 4 separate duplicated blocks between them, totalling at least 30 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 `crates/shadowsocks-service/src/local/mod.rs:140` 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 (6 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:75— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:75-80 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:132-137 | crates/shadowsocks/src/net/sys/windows/mod.rs:83-88 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:82— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:82-87 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:139-144 | crates/shadowsocks/src/net/sys/windows/mod.rs:90-95 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:89— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:89-94 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:146-151 | crates/shadowsocks/src/net/sys/windows/mod.rs:97-102 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:96— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:96-101 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:153-158 | crates/shadowsocks/src/net/sys/windows/mod.rs:104-109 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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.
Change coupling: bsd.rs ↔ freebsd.rs crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs:1— `crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/bsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `e691853f` add support for OpenBSD/pf (#1567); `4006cdec` feat(local): redir *bsd pfvar.h bindgen (at that commit the file was still `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/bsd.rs`); `8817e04d` enable dual-stack for redir sockets (at that commit the file was still `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/bsd.rs`) — run `git show` on any of them.
Change coupling: proxy_listener.rs ↔ client.rs crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs:1— `crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs` and `crates/shadowsocks/src/relay/tcprelay/proxy_stream/client.rs` change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `85cf58ab` chore: replace once_cell::sync::Lazy with std::sync::LazyLock (#1963); `a04e92c1` feat(shadowsocks): add more Debug implementations (#1656); `c9c59f96` feat(plugin): Support SIP003u, Plugin UDP mode — run `git show` on any of them.
Change coupling: client.rs ↔ server.rs crates/shadowsocks/src/relay/tcprelay/proxy_stream/client.rs:1— `crates/shadowsocks/src/relay/tcprelay/proxy_stream/client.rs` and `crates/shadowsocks/src/relay/tcprelay/proxy_stream/server.rs` change together 53% of the time (8 of the 15 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `12c4ff25` feat: add MakeSocketProtect and docs, reformatted; `a04e92c1` feat(shadowsocks): add more Debug implementations (#1656); `2048cb1d` AEAD-2022 TCP protocol breaking changes — run `git show` on any of them.
Change coupling: proxy_listener.rs ↔ proxy_socket.rs crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs:1— `crates/shadowsocks/src/relay/tcprelay/proxy_listener.rs` and `crates/shadowsocks/src/relay/udprelay/proxy_socket.rs` change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `85cf58ab` chore: replace once_cell::sync::Lazy with std::sync::LazyLock (#1963); `a04e92c1` feat(shadowsocks): add more Debug implementations (#1656); `c9c59f96` feat(plugin): Support SIP003u, Plugin UDP mode — run `git show` on any of them.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×4
Edited copy of a member (23 corresponding lines) crates/shadowsocks/src/relay/udprelay/aead.rs:50— crates/shadowsocks/src/relay/udprelay/aead.rs:50-77 | crates/shadowsocks/src/relay/udprelay/stream.rs:44-66 — 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.
Edited copy of a member (23 corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs:255— crates/shadowsocks-service/src/local/dns/server.rs:255-281 | crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:92-114 — 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.
Edited copy of a member (23 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs:104— crates/shadowsocks/src/relay/tcprelay/aead.rs:104-126 | crates/shadowsocks/src/relay/tcprelay/stream.rs:58-80 — 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.
Edited copy of a member (23 corresponding lines) crates/shadowsocks-service/src/local/net/udp/association.rs:349— crates/shadowsocks-service/src/local/net/udp/association.rs:349-375 | crates/shadowsocks-service/src/server/udprelay.rs:479-501 — 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 (9 corresponding lines) · ×4
Edited copy of a member (9 corresponding lines) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:530— crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:530-539 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:558-566 — 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) crates/shadowsocks-service/src/local/net/tcp/listener.rs:13— crates/shadowsocks-service/src/local/net/tcp/listener.rs:13-21 | crates/shadowsocks-service/src/local/net/udp/listener.rs:13-21 — 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) crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs:180— crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs:180-188 | crates/shadowsocks-service/src/local/net/tcp/auto_proxy_stream.rs:220-228 — 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) crates/shadowsocks-service/src/net/outbound/stream.rs:91— crates/shadowsocks-service/src/net/outbound/stream.rs:91-99 | crates/shadowsocks-service/src/net/outbound/stream.rs:198-207 — 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.
Duplicated block (15 lines × 2) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:435— crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:435-449 | crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:546-560 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:435` 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 lines × 2) crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:241— crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:241-255 | crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:259-273 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:241` 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 lines × 2) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:59— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:59-73 | crates/shadowsocks/src/net/sys/windows/mod.rs:67-81 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/windows/mod.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:59` 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) crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:237— crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:237-251 | crates/shadowsocks/src/net/sys/windows/mod.rs:262-276 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` and `crates/shadowsocks/src/net/sys/windows/mod.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/shadowsocks-service/src/local/http/http_client.rs:344— crates/shadowsocks-service/src/local/http/http_client.rs:344-355 | crates/shadowsocks-service/src/local/http/http_client.rs:395-406 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/http/http_client.rs:344` 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 (12 lines × 2) crates/shadowsocks-service/src/local/net/udp/association.rs:485— crates/shadowsocks-service/src/local/net/udp/association.rs:485-496 | crates/shadowsocks-service/src/server/udprelay.rs:575-586 — 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 `crates/shadowsocks-service/src/local/net/udp/association.rs:485` 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `socket` to `&Option<ShadowUdpSocket>` in one and `&Option<OutboundUdpSocket>` 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 (12 lines × 2) crates/shadowsocks/src/relay/socks5.rs:886— crates/shadowsocks/src/relay/socks5.rs:886-897 | crates/shadowsocks/src/relay/socks5.rs:899-910 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:574— crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:574-585 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:590-601 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:574` 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) crates/shadowsocks-service/src/local/http/config.rs:66— crates/shadowsocks-service/src/local/http/config.rs:66-75 | crates/shadowsocks-service/src/local/socks/config.rs:58-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/shadowsocks/src/relay/udprelay/crypto_io.rs:78— crates/shadowsocks/src/relay/udprelay/crypto_io.rs:78-87 | crates/shadowsocks/src/relay/udprelay/crypto_io.rs:116-125 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/udprelay/crypto_io.rs:78` 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 (10 lines × 2) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:294— crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:294-303 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:346-355 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:294` 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) src/service/local.rs:86— src/service/local.rs:86-95 | src/service/server.rs:34-44 — before extracting anything, compare `src/service/local.rs` and `src/service/server.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 349 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/shadowsocks-service/src/local/mod.rs:144— crates/shadowsocks-service/src/local/mod.rs:144-148 | crates/shadowsocks-service/src/local/mod.rs:158-162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/shadowsocks-service/src/manager/mod.rs:53— crates/shadowsocks-service/src/manager/mod.rs:53-57 | crates/shadowsocks-service/src/manager/mod.rs:66-70 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:72— crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:72-76 | crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:115-119 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:91— crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:91-95 | crates/shadowsocks-service/src/local/redir/sys/unix/bsd_pf.rs:136-140 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
XxxComment crates/shadowsocks-service/src/local/context.rs:75— // XXX: It should be enough for a normal user. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment crates/shadowsocks-service/src/local/tun/mod.rs:110— // XXX: tun2 set IFF_NO_PI by default. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
XxxComment crates/shadowsocks/src/plugin/mod.rs:135— // XXX: Is there an easy way to test if UDP port was listening? (no ICMP!) — 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.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×3
Edited copy of a member (21 corresponding lines) crates/shadowsocks/src/net/udp.rs:107— crates/shadowsocks/src/net/udp.rs:107-127 | crates/shadowsocks/src/net/udp.rs:130-150 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs:192— crates/shadowsocks/src/relay/tcprelay/aead.rs:192-213 | crates/shadowsocks/src/relay/tcprelay/stream.rs:138-158 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:150— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:150-170 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:174-202 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (19 lines × 3) crates/shadowsocks-service/src/local/redir/udprelay/mod.rs:247— crates/shadowsocks-service/src/local/redir/udprelay/mod.rs:247-265 | crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs:154-172 | crates/shadowsocks-service/src/local/tunnel/udprelay.rs:121-139 — before extracting anything, compare `crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs` and `crates/shadowsocks-service/src/local/tunnel/udprelay.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/redir/udprelay/mod.rs:247` 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 (19 lines × 3) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:327— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:327-345 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:339-357 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:334-352 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:327` 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 (19 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:364— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:364-382 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:507-525 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:526-544 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 (16 lines × 3) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:309— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:309-324 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:315-330 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:316-331 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:309` 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 (16 lines × 3) src/service/local.rs:963— src/service/local.rs:963-978 | src/service/manager.rs:472-487 | src/service/server.rs:514-529 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 (16 lines × 3) crates/shadowsocks/src/manager/protocol.rs:96— crates/shadowsocks/src/manager/protocol.rs:96-111 | crates/shadowsocks/src/manager/protocol.rs:204-219 | crates/shadowsocks/src/manager/protocol.rs:238-253 — 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. 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 (14 lines × 3) crates/shadowsocks-service/src/config.rs:2077— crates/shadowsocks-service/src/config.rs:2077-2090 | crates/shadowsocks-service/src/config.rs:2391-2404 | crates/shadowsocks-service/src/config.rs:2639-2652 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) crates/shadowsocks-service/src/config.rs:2194— crates/shadowsocks-service/src/config.rs:2194-2207 | crates/shadowsocks-service/src/config.rs:2341-2354 | crates/shadowsocks-service/src/config.rs:2500-2513 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) src/service/local.rs:982— src/service/local.rs:982-995 | src/service/manager.rs:491-504 | src/service/server.rs:533-546 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:302— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:302-314 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:453-465 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:464-476 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:302` 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 (13 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:344— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:344-356 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:487-499 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:506-518 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:344` 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 (13 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:385— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:385-397 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:528-540 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:547-559 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:385` 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 × 3) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:141— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:141-151 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:157-167 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:143-153 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 (11 lines × 3) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:43— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:43-53 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:63-73 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:326-336 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:43` 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 × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:418— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:418-428 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:561-571 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:580-590 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:418` 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 (11 lines × 2) crates/shadowsocks-service/src/local/tun/mod.rs:318— crates/shadowsocks-service/src/local/tun/mod.rs:318-328 | crates/shadowsocks-service/src/local/tun/mod.rs:359-369 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/tun/mod.rs:318` 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 (11 lines × 2) crates/shadowsocks/src/relay/tcprelay/aead.rs:154— crates/shadowsocks/src/relay/tcprelay/aead.rs:154-164 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:224-234 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 170 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 `crates/shadowsocks/src/relay/tcprelay/aead.rs:154` 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) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:228— crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:228-238 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:379-389 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:228` 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 (8 lines × 3) crates/shadowsocks-service/src/local/http/server.rs:71— crates/shadowsocks-service/src/local/http/server.rs:71-78 | crates/shadowsocks-service/src/local/socks/server/server.rs:72-79 | crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:59-66 — before extracting anything, compare `crates/shadowsocks-service/src/local/socks/server/server.rs` and `crates/shadowsocks-service/src/local/tunnel/tcprelay.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/http/server.rs:71` 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 (8 lines × 3) crates/shadowsocks-service/src/local/mod.rs:152— crates/shadowsocks-service/src/local/mod.rs:152-159 | crates/shadowsocks-service/src/manager/mod.rs:60-67 | crates/shadowsocks-service/src/server/mod.rs:93-100 — `crates/shadowsocks-service/src/local/mod.rs` and `crates/shadowsocks-service/src/manager/mod.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 4 separate duplicated blocks between them, totalling at least 30 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/shadowsocks-service/src/local/mod.rs:150` calls `set_connect_opts` and `crates/shadowsocks-service/src/manager/mod.rs:58` 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 (8 lines × 3) crates/shadowsocks/src/config.rs:170— crates/shadowsocks/src/config.rs:170-177 | crates/shadowsocks/src/config.rs:1158-1165 | crates/shadowsocks/src/config.rs:1339-1346 — 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. 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 × 3) crates/shadowsocks-service/src/local/mod.rs:116— crates/shadowsocks-service/src/local/mod.rs:116-122 | crates/shadowsocks-service/src/manager/mod.rs:26-32 | crates/shadowsocks-service/src/server/mod.rs:54-60 — `crates/shadowsocks-service/src/local/mod.rs` and `crates/shadowsocks-service/src/manager/mod.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 4 separate duplicated blocks between them, totalling at least 30 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 × 3) crates/shadowsocks/src/relay/tcprelay/aead.rs:155— crates/shadowsocks/src/relay/tcprelay/aead.rs:155-161 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:213-219 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:225-231 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 170 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 `crates/shadowsocks/src/relay/tcprelay/aead.rs:155` 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 × 3) src/service/local.rs:668— src/service/local.rs:668-674 | src/service/manager.rs:381-387 | src/service/server.rs:371-377 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 `src/service/local.rs:668` 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.
TodoComment crates/shadowsocks-service/src/manager/server.rs:492— // TODO: Complete this after discussion. — 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 crates/shadowsocks/src/dns_resolver/mod.rs:102— // TODO: Try another address after FIXED_DELAY if one of the IPs is unreachable. — 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.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:162— crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:162-188 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:154-180 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:182-209 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:176-202 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:204-230 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:178-221 — These 6 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 6 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 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:301— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:301-361 | crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:384-433 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:452-504 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:527-576 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:463-523 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:546-595 — These 6 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 6 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 6 times.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:116— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:116-127 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:132-143 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:108-119 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:118-129 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:226— crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:226-256 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:377-407 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:444-465 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:488-510 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×2
Edited copy of a member (39 corresponding lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:264— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:264-306 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:274-312 — These two members are one piece of code written twice and then edited apart: 39 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 (39 corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:35— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:35-73 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:53-99 — These two members are one piece of code written twice and then edited apart: 39 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 (20 corresponding lines) · ×2
Edited copy of a member (20 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs:243— crates/shadowsocks/src/relay/tcprelay/aead.rs:243-268 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:436-455 — 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) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:40— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:40-59 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:156-176 — 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 (16 corresponding lines) · ×2
Edited copy of a member (16 corresponding lines) crates/shadowsocks/src/net/udp.rs:319— crates/shadowsocks/src/net/udp.rs:319-334 | crates/shadowsocks/src/net/udp.rs:364-379 — 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.
Edited copy of a member (16 corresponding lines) crates/shadowsocks-service/src/local/http/http_service.rs:257— crates/shadowsocks-service/src/local/http/http_service.rs:257-272 | crates/shadowsocks-service/src/local/http/utils.rs:72-90 — 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 (3 members, 12+ corresponding lines) · ×2
Edited copies of one member (3 members, 12+ corresponding lines) crates/shadowsocks-service/src/local/dns/dns_resolver.rs:52— crates/shadowsocks-service/src/local/dns/dns_resolver.rs:52-63 | crates/shadowsocks-service/src/local/dns/server.rs:852-865 | crates/shadowsocks-service/src/local/dns/server.rs:930-943 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 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.
Edited copies of one member (3 members, 12+ corresponding lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:245— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:245-262 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:187-198 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:223-237 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 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.
Duplicated block (34 lines × 3) src/service/local.rs:238— src/service/local.rs:238-271 | src/service/manager.rs:126-159 | src/service/server.rs:163-196 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 `src/service/local.rs:238` 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, `src/service/local.rs:236` calls `arg`, `num_args`, `alias` and `src/service/manager.rs:125` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (34 lines × 3) src/service/local.rs:521— src/service/local.rs:521-554 | src/service/manager.rs:234-267 | src/service/server.rs:253-286 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 `src/service/local.rs:521` 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, `src/service/local.rs:519` calls `value_hint` and `src/service/manager.rs:232` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (33 lines × 2) crates/shadowsocks-service/src/net/http_stream.rs:67— crates/shadowsocks-service/src/net/http_stream.rs:67-99 | crates/shadowsocks-service/src/net/outbound/tls.rs:108-140 — 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 (33 lines × 2) src/service/local.rs:627— src/service/local.rs:627-659 | src/service/server.rs:331-363 — before extracting anything, compare `src/service/local.rs` and `src/service/server.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 349 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 `src/service/local.rs:627` 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, `src/service/local.rs:660` calls `set_source` and `src/service/server.rs:364` 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 (24 lines × 2) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:220— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:220-243 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:162-185 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 77 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:208` calls `Ok` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:150` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (24 lines × 2) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:338— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:338-361 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:500-523 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/linux/mod.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:338` 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 × 3) crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:169— crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:169-185 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:183-199 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:211-227 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:169` 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 × 3) src/service/local.rs:500— src/service/local.rs:500-516 | src/service/manager.rs:158-174 | src/service/server.rs:195-211 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 `src/service/local.rs:500` 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, `src/service/manager.rs:155` calls `value_parser` and `src/service/local.rs:497` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) crates/shadowsocks/src/relay/udprelay/aead_2022.rs:259— crates/shadowsocks/src/relay/udprelay/aead_2022.rs:259-275 | crates/shadowsocks/src/relay/udprelay/aead_2022.rs:281-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks/src/relay/udprelay/aead_2022.rs:259` 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) src/service/manager.rs:513— src/service/manager.rs:513-529 | src/service/server.rs:555-571 — before extracting anything, compare `src/service/manager.rs` and `src/service/server.rs` as WHOLE FILES: this scan already matched 16 separate duplicated blocks between them, totalling at least 334 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 `src/service/manager.rs:513` 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 × 4) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:45— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:45-55 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:63-73 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:44-54 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:47-57 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:45` 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 (11 lines × 4) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:117— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:117-127 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:133-143 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:109-119 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:119-129 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 (10 lines × 3) crates/shadowsocks-service/src/local/mod.rs:321— crates/shadowsocks-service/src/local/mod.rs:321-330 | crates/shadowsocks-service/src/local/mod.rs:356-365 | crates/shadowsocks-service/src/local/mod.rs:434-443 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) src/service/local.rs:86— src/service/local.rs:86-95 | src/service/manager.rs:36-46 | src/service/server.rs:34-44 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 × 4) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:308— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:308-315 | crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:391-398 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:470-477 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:553-560 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/linux/mod.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:308` 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 (8 lines × 4) crates/shadowsocks-service/src/local/dns/server.rs:261— crates/shadowsocks-service/src/local/dns/server.rs:261-270 | crates/shadowsocks-service/src/local/http/server.rs:117-124 | crates/shadowsocks-service/src/local/socks/server/server.rs:122-129 | crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:96-103 — before extracting anything, compare `crates/shadowsocks-service/src/local/dns/server.rs` and `crates/shadowsocks-service/src/local/socks/server/server.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/dns/server.rs:261` 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, `crates/shadowsocks-service/src/local/socks/server/server.rs:120` calls `clone` and `crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:95` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 5) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:236— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:236-240 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:363-367 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:283-287 | crates/shadowsocks/src/net/sys/unix/others.rs:89-93 | crates/shadowsocks/src/net/sys/windows/mod.rs:473-477 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:236` 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 × 5) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:230— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:230-234 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:357-361 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:277-281 | crates/shadowsocks/src/net/sys/unix/others.rs:83-87 | crates/shadowsocks/src/net/sys/windows/mod.rs:467-471 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:230` 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.
No authorization crates/shadowsocks-service/src/local/socks/server/server.rs:218— This repository serves requests — a server (.serve_connection) (crates/shadowsocks-service/src/local/socks/server/server.rs:218) — and no route guard, auth-gate middleware, global guard or imperative check that refuses a caller (401/403, an Unauthorized/Forbidden error) was found: its endpoints may be unprotected.
D4 · Code Duplication· Near-duplicate member family (5 members, 16 shared lines) · ×1
Near-duplicate member family (5 members, 16 shared lines) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:229— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:229-249 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:356-376 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:276-296 | crates/shadowsocks/src/net/sys/unix/others.rs:82-103 | crates/shadowsocks/src/net/sys/windows/mod.rs:466-486 — These 5 members are variants of one another: a block of 16 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 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 42 shared lines) · ×1
Near-duplicate member family (4 members, 42 shared lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:43— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:43-109 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:61-125 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:42-101 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:45-111 — These 4 members are variants of one another: a block of 42 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 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· Near-duplicate member family (3 members, 141 shared lines) · ×1
Near-duplicate member family (3 members, 141 shared lines) src/service/local.rs:587— src/service/local.rs:587-1062 | src/service/manager.rs:273-529 | src/service/server.rs:292-571 — These 3 members are variants of one another: a block of 141 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, 131 shared lines) · ×1
Near-duplicate member family (3 members, 131 shared lines) src/service/local.rs:85— src/service/local.rs:85-584 | src/service/manager.rs:35-270 | src/service/server.rs:33-289 — These 3 members are variants of one another: a block of 131 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.
Near-duplicate member pair (49 shared lines) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:386— crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:386-502 | crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:505-603 — These two members are variants of one another: 49 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) crates/shadowsocks/src/relay/udprelay/crypto_io.rs:74— crates/shadowsocks/src/relay/udprelay/crypto_io.rs:74-102 | crates/shadowsocks/src/relay/udprelay/crypto_io.rs:113-136 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/shadowsocks-service/src/local/dns/server.rs:514— crates/shadowsocks-service/src/local/dns/server.rs:514-529 | crates/shadowsocks-service/src/local/fake_dns/server.rs:124-137 | crates/shadowsocks-service/src/local/redir/server.rs:131-144 | crates/shadowsocks-service/src/local/socks/server/mod.rs:194-209 | crates/shadowsocks-service/src/local/tunnel/server.rs:157-170 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
D4 · Code Duplication· Edited copy of a member (63 corresponding lines) · ×1
Edited copy of a member (63 corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs:289— crates/shadowsocks-service/src/local/dns/server.rs:289-351 | crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs:97-161 — These two members are one piece of code written twice and then edited apart: 63 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 (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) crates/shadowsocks/src/relay/tcprelay/aead.rs:142— crates/shadowsocks/src/relay/tcprelay/aead.rs:142-187 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:207-258 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) crates/shadowsocks/src/relay/udprelay/aead_2022.rs:537— crates/shadowsocks/src/relay/udprelay/aead_2022.rs:537-594 | crates/shadowsocks/src/relay/udprelay/aead_2022.rs:648-700 — These two members are one piece of code written twice and then edited apart: 53 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 (62 corresponding lines) · ×1
Edited copy of a member (62 corresponding lines) crates/shadowsocks-service/src/local/socks/server/socks4/tcprelay.rs:83— crates/shadowsocks-service/src/local/socks/server/socks4/tcprelay.rs:83-152 | crates/shadowsocks-service/src/local/socks/server/socks5/tcprelay.rs:226-287 — These two members are one piece of code written twice and then edited apart: 62 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 (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) crates/shadowsocks-service/src/net/http_stream.rs:63— crates/shadowsocks-service/src/net/http_stream.rs:63-117 | crates/shadowsocks-service/src/net/outbound/tls.rs:103-151 — These two members are one piece of code written twice and then edited apart: 49 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, 38+ corresponding lines) · ×1
Edited copies of one member (3 members, 38+ corresponding lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:308— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:308-345 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:314-357 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:315-352 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 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 (31 corresponding lines) · ×1
Edited copy of a member (31 corresponding lines) crates/shadowsocks/src/relay/udprelay/crypto_io.rs:145— crates/shadowsocks/src/relay/udprelay/crypto_io.rs:145-181 | crates/shadowsocks/src/relay/udprelay/crypto_io.rs:189-219 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (47 corresponding lines) · ×1
Edited copy of a member (47 corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs:127— crates/shadowsocks-service/src/local/dns/server.rs:127-173 | crates/shadowsocks-service/src/local/socks/server/mod.rs:120-173 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:846— crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:846-882 | crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:885-921 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (72 corresponding lines) · ×1
Edited copy of a member (72 corresponding lines) crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:22— crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:22-95 | crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:190-261 — These two members are one piece of code written twice and then edited apart: 72 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 (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:236— crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:236-276 | crates/shadowsocks/src/net/sys/windows/mod.rs:261-302 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) crates/shadowsocks-service/src/local/http/config.rs:65— crates/shadowsocks-service/src/local/http/config.rs:65-90 | crates/shadowsocks-service/src/local/socks/config.rs:57-82 — These two members are one piece of code written twice and then edited apart: 26 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) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:278— crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:278-303 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:332-355 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×1
Edited copy of a member (33 corresponding lines) crates/shadowsocks-service/src/acl/mod.rs:570— crates/shadowsocks-service/src/acl/mod.rs:570-602 | crates/shadowsocks-service/src/acl/mod.rs:622-661 — 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, 36+ corresponding lines) · ×1
Edited copies of one member (3 members, 36+ corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:182— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:182-225 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:317-352 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:237-272 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 36 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, 27+ corresponding lines) · ×1
Edited copies of one member (4 members, 27+ corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs:211— crates/shadowsocks-service/src/local/dns/server.rs:211-237 | crates/shadowsocks-service/src/local/http/server.rs:60-88 | crates/shadowsocks-service/src/local/socks/server/server.rs:61-91 | crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:48-74 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 27 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, 24+ corresponding lines) · ×1
Edited copies of one member (3 members, 24+ corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs:389— crates/shadowsocks-service/src/local/dns/server.rs:389-412 | crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs:66-92 | crates/shadowsocks-service/src/local/tunnel/udprelay.rs:56-83 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 24 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 (3 members, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:98— crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:98-122 | crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:216-234 | crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:243-268 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 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 (19 corresponding lines) · ×1
Edited copy of a member (19 corresponding lines) crates/shadowsocks/src/config.rs:1087— crates/shadowsocks/src/config.rs:1087-1106 | crates/shadowsocks/src/relay/socks5.rs:435-453 — 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 copies of one member (3 members, 22+ corresponding lines) · ×1
Edited copies of one member (3 members, 22+ corresponding lines) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:252— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:252-273 | crates/shadowsocks/src/net/sys/unix/mod.rs:37-60 | crates/shadowsocks/src/net/sys/windows/mod.rs:438-462 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 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 (25 corresponding lines) · ×1
Edited copy of a member (25 corresponding lines) crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs:66— crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs:66-90 | crates/shadowsocks-service/src/local/http/server.rs:106-135 — 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 copies of one member (3 members, 26+ corresponding lines) · ×1
Edited copies of one member (3 members, 26+ corresponding lines) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:211— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:211-243 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:232-257 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:153-185 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 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 (13 corresponding lines) · ×1
Edited copy of a member (13 corresponding lines) crates/shadowsocks/src/net/tcp.rs:48— crates/shadowsocks/src/net/tcp.rs:48-60 | crates/shadowsocks/src/net/tcp.rs:63-75 — 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 copies of one member (5 members, 9+ corresponding lines) · ×1
Edited copies of one member (5 members, 9+ corresponding lines) crates/shadowsocks-service/src/net/outbound/stream.rs:142— crates/shadowsocks-service/src/net/outbound/stream.rs:142-150 | crates/shadowsocks-service/src/net/outbound/stream.rs:154-162 | crates/shadowsocks-service/src/net/outbound/stream.rs:164-172 | crates/shadowsocks-service/src/net/outbound/stream.rs:174-182 | crates/shadowsocks-service/src/net/outbound/stream.rs:188-196 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×1
Edited copies of one member (4 members, 15+ corresponding lines) crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs:40— crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs:40-58 | crates/shadowsocks-service/src/local/fake_dns/udp_server.rs:25-39 | crates/shadowsocks-service/src/local/redir/tcprelay/mod.rs:89-108 | crates/shadowsocks-service/src/local/redir/udprelay/mod.rs:215-234 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 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, 16+ corresponding lines) · ×1
Edited copies of one member (3 members, 16+ corresponding lines) crates/shadowsocks-service/src/local/socks/socks4.rs:338— crates/shadowsocks-service/src/local/socks/socks4.rs:338-353 | crates/shadowsocks/src/relay/socks5.rs:610-627 | crates/shadowsocks/src/relay/socks5.rs:677-692 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 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 (5 members, 11+ corresponding lines) · ×1
Edited copies of one member (5 members, 11+ corresponding lines) crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:151— crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:151-161 | crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:164-174 | crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:177-187 | crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:189-199 | crates/shadowsocks/src/relay/tcprelay/crypto_io.rs:293-303 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×1
Edited copies of one member (3 members, 9+ corresponding lines) crates/shadowsocks/src/config.rs:169— crates/shadowsocks/src/config.rs:169-177 | crates/shadowsocks/src/config.rs:1157-1165 | crates/shadowsocks/src/config.rs:1338-1346 — These 3 members are one piece of code written 3 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 3 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) src/logging/tracing.rs:51— src/logging/tracing.rs:51-56 | src/logging/tracing.rs:60-68 — 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 (15 corresponding lines) · ×1
Edited copy of a member (15 corresponding lines) crates/shadowsocks-service/src/local/dns/server.rs:93— crates/shadowsocks-service/src/local/dns/server.rs:93-107 | crates/shadowsocks-service/src/local/tunnel/server.rs:43-58 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) crates/shadowsocks-service/src/local/context.rs:244— crates/shadowsocks-service/src/local/context.rs:244-247 | crates/shadowsocks-service/src/server/context.rs:142-145 — These two members are one piece of code written twice and then edited apart: 4 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×1
Edited copy of a member (5 corresponding lines) crates/shadowsocks-service/src/local/net/udp/association.rs:252— crates/shadowsocks-service/src/local/net/udp/association.rs:252-266 | crates/shadowsocks-service/src/server/udprelay.rs:407-411 — These two members are one piece of code written twice and then edited apart: 5 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (42 lines × 3) src/service/local.rs:892— src/service/local.rs:892-933 | src/service/manager.rs:419-460 | src/service/server.rs:460-501 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 (41 lines × 2) crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:45— crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:45-85 | crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:221-261 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:45` 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, `crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:218` calls `set_ip_transparent` and `crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:43` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (40 lines × 2) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:394— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:394-433 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:556-595 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/linux/mod.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:394` 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 (39 lines × 3) src/service/local.rs:285— src/service/local.rs:285-323 | src/service/manager.rs:197-235 | src/service/server.rs:216-254 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 `src/service/local.rs:285` 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 (36 lines × 2) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:48— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:48-83 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:50-85 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 166 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 `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:48` 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 (34–35 lines × 2) crates/shadowsocks-service/src/local/dns/server.rs:290— crates/shadowsocks-service/src/local/dns/server.rs:290-323 | crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs:98-132 — 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 `crates/shadowsocks-service/src/local/dns/server.rs:290` 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 (31 lines × 4) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:77— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:77-107 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:93-123 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:69-99 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:79-109 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:77` 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, `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:89` calls `set_ip_transparent`, `set_ip_recvorigdstaddr`, `set_ip_mtu_discover` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:69` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (31 lines × 2) crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs:152— crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs:152-182 | crates/shadowsocks-service/src/local/tunnel/udprelay.rs:119-149 — before extracting anything, compare `crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs` and `crates/shadowsocks-service/src/local/tunnel/udprelay.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs:152` 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 (29 lines × 3) src/service/local.rs:852— src/service/local.rs:852-880 | src/service/manager.rs:314-342 | src/service/server.rs:399-427 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 (27 lines × 2) crates/shadowsocks-service/src/config.rs:2157— crates/shadowsocks-service/src/config.rs:2157-2183 | crates/shadowsocks-service/src/config.rs:2266-2292 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/config.rs:2157` 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 (24 lines × 3) src/service/local.rs:593— src/service/local.rs:593-616 | src/service/manager.rs:278-301 | src/service/server.rs:297-320 — before extracting anything, compare `src/service/local.rs` and `src/service/manager.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 285 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 `src/service/local.rs:593` 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 (22–23 lines × 2) crates/shadowsocks-service/src/local/mod.rs:98— crates/shadowsocks-service/src/local/mod.rs:98-120 | crates/shadowsocks-service/src/server/mod.rs:37-58 — `crates/shadowsocks-service/src/local/mod.rs` and `crates/shadowsocks-service/src/server/mod.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 4 separate duplicated blocks between them, totalling at least 45 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 `crates/shadowsocks-service/src/local/mod.rs:98` 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 (21–23 lines × 2) crates/shadowsocks-service/src/local/redir/udprelay/mod.rs:100— crates/shadowsocks-service/src/local/redir/udprelay/mod.rs:100-122 | crates/shadowsocks-service/src/server/udprelay.rs:668-688 — 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 (22 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:278— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:278-299 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:429-450 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:440-461 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 (21 lines × 3) crates/shadowsocks/src/relay/tcprelay/aead.rs:389— crates/shadowsocks/src/relay/tcprelay/aead.rs:389-409 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:687-707 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:717-737 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 170 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 `crates/shadowsocks/src/relay/tcprelay/aead.rs:389` 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 (21 lines × 2) crates/shadowsocks-service/src/local/mod.rs:692— crates/shadowsocks-service/src/local/mod.rs:692-712 | crates/shadowsocks-service/src/local/mod.rs:717-737 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/mod.rs:692` 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 (20–21 lines × 2) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:66— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:66-86 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:47-66 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 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 `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:89` calls `set_ip_transparent`, `set_ip_recvorigdstaddr`, `set_ip_mtu_discover` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/macos.rs:69` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:151— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:151-170 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:207-226 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:183-202 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 (17–19 lines × 2) crates/shadowsocks-service/src/local/socks/server/socks4/tcprelay.rs:97— crates/shadowsocks-service/src/local/socks/server/socks4/tcprelay.rs:97-113 | crates/shadowsocks-service/src/local/socks/server/socks5/tcprelay.rs:239-257 — 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 `crates/shadowsocks-service/src/local/socks/server/socks4/tcprelay.rs:97` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (19 lines × 2) crates/shadowsocks/src/relay/tcprelay/aead.rs:169— crates/shadowsocks/src/relay/tcprelay/aead.rs:169-187 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:240-258 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 170 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 `crates/shadowsocks/src/relay/tcprelay/aead.rs:169` 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 (50 lines × 2) crates/shadowsocks/src/relay/tcprelay/aead.rs:381— crates/shadowsocks/src/relay/tcprelay/aead.rs:381-430 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:709-758 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 170 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 `crates/shadowsocks/src/relay/tcprelay/aead.rs:381` 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 (12–19 lines × 2) crates/shadowsocks/src/relay/udprelay/aead_2022.rs:430— crates/shadowsocks/src/relay/udprelay/aead_2022.rs:430-448 | crates/shadowsocks/src/relay/udprelay/aead_2022.rs:611-622 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/udprelay/aead_2022.rs:430` 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 (26 lines × 3) crates/shadowsocks/src/relay/tcprelay/aead.rs:274— crates/shadowsocks/src/relay/tcprelay/aead.rs:274-299 | crates/shadowsocks/src/relay/tcprelay/aead_2022.rs:461-486 | crates/shadowsocks/src/relay/tcprelay/stream.rs:164-189 — before extracting anything, compare `crates/shadowsocks/src/relay/tcprelay/aead.rs` and `crates/shadowsocks/src/relay/tcprelay/aead_2022.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 170 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 (18 lines × 2) crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:465— crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:465-482 | crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:571-588 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/local/loadbalancing/ping_balancer.rs:465` 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 (14–16 lines × 6) crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:173— crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:173-188 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:166-180 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:195-209 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:187-202 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs:215-230 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:208-221 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/linux.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 141 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 `crates/shadowsocks-service/src/local/redir/tcprelay/sys/unix/linux.rs:173` 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 (13–15 lines × 5) crates/shadowsocks-service/src/local/dns/server.rs:515— crates/shadowsocks-service/src/local/dns/server.rs:515-529 | crates/shadowsocks-service/src/local/fake_dns/server.rs:125-137 | crates/shadowsocks-service/src/local/redir/server.rs:132-144 | crates/shadowsocks-service/src/local/socks/server/mod.rs:195-209 | crates/shadowsocks-service/src/local/tunnel/server.rs:158-170 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. 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 (14–15 lines × 4) crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:163— crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:163-177 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:192-206 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:187-201 | crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs:206-219 — before extracting anything, compare `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs` and `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/openbsd.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 166 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 `crates/shadowsocks-service/src/local/redir/udprelay/sys/unix/freebsd.rs:163` 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 (14–15 lines × 2) crates/shadowsocks/src/relay/udprelay/crypto_io.rs:149— crates/shadowsocks/src/relay/udprelay/crypto_io.rs:149-162 | crates/shadowsocks/src/relay/udprelay/crypto_io.rs:192-206 — both copies are in the same file, so extract the 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 `crates/shadowsocks/src/relay/udprelay/crypto_io.rs:149` 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 (12–14 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:253— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:253-264 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:380-393 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:300-313 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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. 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 (13–14 lines × 2) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:198— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:198-211 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:326-338 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:198` 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 (25 lines × 2) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:312— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:312-336 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:474-498 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/linux/mod.rs` as WHOLE FILES: this scan already matched 21 separate duplicated blocks between them, totalling at least 274 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:312` 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–13 lines × 2) crates/shadowsocks-service/src/config.rs:2406— crates/shadowsocks-service/src/config.rs:2406-2416 | crates/shadowsocks-service/src/config.rs:2578-2590 — both copies are in the same file, so extract the 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 `crates/shadowsocks-service/src/config.rs:2406` 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 (12–13 lines × 2) crates/shadowsocks-service/src/local/redir/tcprelay/mod.rs:42— crates/shadowsocks-service/src/local/redir/tcprelay/mod.rs:42-54 | crates/shadowsocks-service/src/local/tun/tcp.rs:583-594 — 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. 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 (9–11 lines × 3) crates/shadowsocks-service/src/local/dns/server.rs:261— crates/shadowsocks-service/src/local/dns/server.rs:261-271 | crates/shadowsocks-service/src/local/socks/server/server.rs:122-130 | crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:96-104 — before extracting anything, compare `crates/shadowsocks-service/src/local/dns/server.rs` and `crates/shadowsocks-service/src/local/socks/server/server.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/dns/server.rs:261` 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, `crates/shadowsocks-service/src/local/socks/server/server.rs:120` calls `clone` and `crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:95` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–10 lines × 3) crates/shadowsocks-service/src/local/dns/server.rs:390— crates/shadowsocks-service/src/local/dns/server.rs:390-398 | crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs:67-76 | crates/shadowsocks-service/src/local/tunnel/udprelay.rs:57-66 — before extracting anything, compare `crates/shadowsocks-service/src/local/socks/server/socks5/udprelay.rs` and `crates/shadowsocks-service/src/local/tunnel/udprelay.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 74 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/dns/server.rs:390` 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 (9–10 lines × 2) crates/shadowsocks-service/src/config.rs:1461— crates/shadowsocks-service/src/config.rs:1461-1470 | crates/shadowsocks-service/src/manager/server.rs:388-396 — 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 `crates/shadowsocks-service/src/config.rs:1461` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 6) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:308— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:308-314 | crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:391-397 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:459-465 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:534-540 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:470-476 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:553-559 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:308` 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 (6 lines × 5) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:244— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:244-249 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:371-376 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:291-296 | crates/shadowsocks/src/net/sys/unix/others.rs:98-103 | crates/shadowsocks/src/net/sys/windows/mod.rs:481-486 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 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 `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:244` 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 (5 lines × 4) crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:241— crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:241-245 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:392-396 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:448-452 | crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:493-497 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks/src/relay/udprelay/proxy_socket.rs:241` 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 (5 lines × 3) crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:317— crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs:317-321 | crates/shadowsocks/src/net/sys/unix/bsd/macos.rs:468-472 | crates/shadowsocks/src/net/sys/unix/linux/mod.rs:479-483 — before extracting anything, compare `crates/shadowsocks/src/net/sys/unix/bsd/freebsd.rs` and `crates/shadowsocks/src/net/sys/unix/bsd/macos.rs` as WHOLE FILES: this scan already matched 24 separate duplicated blocks between them, totalling at least 227 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 10) crates/shadowsocks-service/src/local/socks/socks4.rs:264— crates/shadowsocks-service/src/local/socks/socks4.rs:264-268 | crates/shadowsocks-service/src/local/socks/socks4.rs:359-363 | crates/shadowsocks/src/relay/socks5.rs:327-331 | crates/shadowsocks/src/relay/socks5.rs:559-563 | crates/shadowsocks/src/relay/socks5.rs:633-637 | crates/shadowsocks/src/relay/socks5.rs:698-702 | crates/shadowsocks/src/relay/socks5.rs:759-763 | crates/shadowsocks/src/relay/socks5.rs:818-822 | crates/shadowsocks/src/relay/socks5.rs:919-923 | crates/shadowsocks/src/relay/socks5.rs:969-973 — there are 10 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 10 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 5) crates/shadowsocks-service/src/local/dns/server.rs:263— crates/shadowsocks-service/src/local/dns/server.rs:263-271 | crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs:67-75 | crates/shadowsocks-service/src/local/http/server.rs:117-125 | crates/shadowsocks-service/src/local/socks/server/server.rs:122-130 | crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:96-104 — before extracting anything, compare `crates/shadowsocks-service/src/local/dns/server.rs` and `crates/shadowsocks-service/src/local/socks/server/server.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/shadowsocks-service/src/local/dns/server.rs:263` 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 before the matched lines, `crates/shadowsocks-service/src/local/tunnel/tcprelay.rs:93` calls `local_addr` and `crates/shadowsocks-service/src/local/fake_dns/tcp_server.rs:66` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Off the main sequence: shadowsocks — shadowsocks: abstractness 0.12, instability 0.00, distance 0.88 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
No seccomp profile REDACTED:66— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No seccomp profile REDACTED:132— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
Duplicated predicate crates/shadowsocks-service/src/local/redir/udprelay/mod.rs:113— `!ip_stack_caps.support_ipv6 || !ip_stack_caps.support_ipv4_mapped_ipv6` appears character-identically in 2 files — crates/shadowsocks-service/src/local/redir/udprelay/mod.rs, crates/shadowsocks-service/src/server/udprelay.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 src/service/local.rs:968— `matches.get_flag("DAEMONIZE") || matches.get_raw("DAEMONIZE_PID_PATH").is_some()` appears character-identically in 3 files — src/service/local.rs, src/service/manager.rs, src/service/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.
No ADRs found Cargo.toml:17— 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 `Cargo.toml` makes this repository a deployable product (line 17).
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 2 of 3 project(s) overshoot their size bounds, lowering Project Cohesion to 0.0/10. The most over is `crates/shadowsocks-service` (78892 LoC, 200 module-visible types across 32 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
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.
No release approval gate — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `.serve_connection(` (crates/shadowsocks-service/src/local/socks/server/server.rs:218).
No security response headers detected — 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 set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `.serve_connection(` (crates/shadowsocks-service/src/local/socks/server/server.rs:218).
X5 · Nullable reference types· Ruby's type checker does not check nil everywhere · ×1
Ruby's type checker does not check nil everywhere — This repository commits no Sorbet configuration (`sorbet/config`) and no `Steepfile`, so nothing type-checks its 1 Ruby product file(s): a nilable value reaches a method call silently and raises `NoMethodError: undefined method … for nil` the first time it is nil. A `# typed:` sigil does nothing without a `sorbet/config` beside the code; a Steep run configured only on a command line is not something this check can read.
Outdated: aes — `aes` is locked at 0.9.3 but 0.9.4 is the current stable release on crates.io, and it already satisfies the `"0.9"` requirement declared in crates/shadowsocks/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p aes` and commit the updated REDACTED.
Outdated: arc-swap — `arc-swap` is locked at 1.9.2 but 1.9.5 is the current stable release on crates.io, and it already satisfies the `"1.7"` requirement declared in crates/shadowsocks-service/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arc-swap` and commit the updated REDACTED.
Outdated: brotli — `brotli` is locked at 9.0.0 but 9.1.1 is the current stable release on crates.io, and it already satisfies the `"9.0"` requirement declared in crates/shadowsocks-service/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p brotli` and commit the updated REDACTED.
Outdated: flate2 — `flate2` is locked at 1.1.10 but 1.1.11 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/shadowsocks-service/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
Outdated: json5 — `json5` is locked at 1.3.1 but 1.3.7 is the current stable release on crates.io, and it already satisfies the `"1.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p json5` and commit the updated REDACTED.
Outdated: libc — `libc` is locked at 0.2.190 but 0.2.191 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libc` and commit the updated REDACTED.
Outdated: log — `log` is locked at 0.4.34 but 0.4.35 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p log` and commit the updated REDACTED.
Outdated: mime — `mime` is locked at 0.3.17 but 0.3.18 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in crates/shadowsocks-service/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p mime` and commit the updated REDACTED.
Outdated: notify — `notify` is locked at 8.2.0 but 8.2.2 is the current stable release on crates.io, and it already satisfies the `"8.0"` requirement declared in crates/shadowsocks/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p notify` and commit the updated REDACTED.
Outdated: rpassword — `rpassword` is locked at 7.5.4 but 7.5.5 is the current stable release on crates.io, and it already satisfies the `"7.3"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rpassword` and commit the updated REDACTED.
Outdated: rustls-native-certs — `rustls-native-certs` is locked at 0.8.4 but 0.8.5 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in crates/shadowsocks-service/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p rustls-native-certs` and commit the updated REDACTED.
Outdated: tokio — `tokio` is locked at 1.53.2 but 1.54.1 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p tokio` and commit the updated REDACTED.
Outdated: webpki-roots — `webpki-roots` is locked at 1.0.9 but 1.0.12 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in crates/shadowsocks-service/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p webpki-roots` and commit the updated REDACTED.
Outdated: zstd — `zstd` is locked at 0.14.2 but 0.14.4 is the current stable release on crates.io, and it already satisfies the `"0.14"` requirement declared in crates/shadowsocks-service/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p zstd` and commit the updated REDACTED.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
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.
runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
Run 01a1dad8-7ce8-73e2-a50b-fbb5085c3ac0 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 61 · Warnings: 432 · Recommendations: 28 · Info: 14 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 16:16 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.