Skip to content

Latest commit

 

History

History
190 lines (132 loc) · 5.23 KB

File metadata and controls

190 lines (132 loc) · 5.23 KB

xtcp2 code-quality report

Generated: 2026-09-26T09:15:13Z

Tool versions: go=go1.26.5; golangci-lint=2.12.2; gosec=2.28.0; nixfmt=1.4.0;

This report is generated by tools/quality-report and refreshed via nix run .#update-quality-report. Every section is regenerated end-to-end on each refresh; section anchors are stable so git diff docs/quality-report.md between commits reveals exactly what changed.


1. Executive summary

Metric Value
Total findings 10
Findings (Tier 0) 0
Findings (Tier 1) 0
Findings (Tier 2) 0
Findings (non-tiered) 10
Files with at least one finding 10
Test failures (new) 0
Test failures (pre-existing) 0
Config exclusions reviewed 4

2. Tool status

Tool Status Findings Runtime
golangci-lint (comprehensive) clean 0 39s
golangci-lint (standard) clean 0 60s
golangci-lint (quick) clean 0 80s
gosec clean 0 5s
go vet clean 0 40s
gofmt clean 0 2s
nixfmt clean 0 3s
netlink-audit clean 0 1s
iouring-audit clean 0 0s
metrics-audit clean 0 1s
proto-field-audit clean 0 1s
go test clean 0 41s
go test -cover findings 10 1s

3. Tier rollup

Tier Linters Findings Quick-fixable¹
0 (lint-quick) govet, errcheck, ineffassign, unused, staticcheck 0 0
1 (lint / CI) Tier 0 + gosec, gocritic, revive, noctx, contextcheck, durationcheck, forbidigo, misspell 0 0
2 (lint-comprehensive) Tier 1 + exhaustive, prealloc, gocyclo, funlen, goconst, dupl, unconvert, nakedret 0 0

¹ Quick-fixable = produced by a linter that supports golangci-lint run --fix (gofmt, goimports, misspell, unconvert, …).


4. Hotspot files (top 10)

File Findings Top rules
cmd/ipfeed-collector 1 below-90pct×1
cmd/nsTest 1 below-90pct×1
cmd/xtcp2 1 below-90pct×1
cmd/xtcp2_kafka_client 1 below-90pct×1
cmd/xtcp2client 1 below-90pct×1
cmd/xtcp2ctl 1 below-90pct×1
pkg/xtcp 1 below-90pct×1
tools/discovery-bench 1 below-90pct×1
tools/idiag-extprobe 1 below-90pct×1
tools/tcp_server 1 below-90pct×1

5. Findings by linter

go-test-cover / below-90pct — 10

  • tools/tcp_server: package coverage 87.8% < 90%
  • cmd/xtcp2_kafka_client: package coverage 88.6% < 90%
  • cmd/xtcp2ctl: package coverage 79.5% < 90%

6. Custom audits

No audit findings.


7. Security (gosec)

No security findings.


8. Test results

Status Count
Pass 2850
Fail (new) 0
Fail (pre-existing) 0
Skip 9

9. CLI -help smoke

Not run.


10. Format checks

gofmt: clean.

nixfmt: clean.


11. Configuration audit

Every linter exclusion in the repo, with the recovered justification from the adjacent YAML comment. Rows with no justification need review.

Source Rule Scope Justification
nix/checks/go-sec.nix G103 gosec unsafe pointers: required by pkg/io_uring (giouring wraps liburing SQE/CQE with unsafe.Pointer)
nix/checks/go-sec.nix G115 gosec integer overflow conversions: netlink length fields + io_uring batch indices, all bounds-checked
nix/checks/go-sec.nix G204 gosec subprocess with variable: cmd/ns + cmd/nsTest invoke ip netns exec ... by design
nix/checks/go-sec.nix G304 gosec file path from variable: register_schema reads .proto paths from CLI

12. Recommendations

  • Top contributor: go-test-cover/below-90pct with 10 findings (100% of total). Concentrate effort here for the biggest quality win.
  • Hotspot file: cmd/ipfeed-collector carries 1 findings (below-90pct×1). Refactor here before touching adjacent code.

13. Test coverage

Overall: 78.9% of statements (target: 90% per package).

Package Coverage Status
cmd/clickhouse_http_insert_protobuflist 92.6% 🟢 OK
cmd/clickhouse_protobuflist 93.2% 🟢 OK
cmd/clickhouse_protobuflist_db 93.3% 🟢 OK
cmd/ipfeed-collector 28.5% 🔴 below 90%
cmd/kafka_to_clickhouse 91.4% 🟢 OK
cmd/ns 93.9% 🟢 OK
cmd/nsTest 17.5% 🔴 below 90%
cmd/register_schema 91.4% 🟢 OK
cmd/xtcp2 83.8% 🔴 below 90%
cmd/xtcp2_kafka_client 88.6% 🔴 below 90%
cmd/xtcp2client 82.9% 🔴 below 90%
cmd/xtcp2ctl 79.5% 🔴 below 90%
pkg/io_uring 92.6% 🟢 OK
pkg/misc 94.3% 🟢 OK
pkg/xtcp 80.5% 🔴 below 90%
pkg/xtcpnl 93.7% 🟢 OK
tools/discovery-bench 33.5% 🔴 below 90%
tools/idiag-extprobe 0.0% 🔴 below 90%
tools/iouring-audit 95.2% 🟢 OK
tools/kafka_topic_reader 94.7% 🟢 OK
tools/metrics-audit 97.2% 🟢 OK
tools/netlink-audit 95.8% 🟢 OK
tools/proto-field-audit 96.2% 🟢 OK
tools/quality-report 92.7% 🟢 OK
tools/tcp_client 91.3% 🟢 OK
tools/tcp_server 87.8% 🔴 below 90%
tools/udp_receiver_server 98.0% 🟢 OK