You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The duplication is a real POSIX/Windows paired-implementation signal, not unresolved Sonar line findings. It will be handled after this review-finding fix is committed and re-vendored.
671
671
672
+
### 2026-06-07 - SonarCloud Duplication Reduction
673
+
674
+
Live Netdata PR #22649 recheck before this increment:
675
+
676
+
- GitHub review threads: eight total, eight resolved, zero open.
677
+
- SonarCloud issue API: zero unresolved issues on the PR.
678
+
- SonarCloud hotspot API: zero unresolved hotspots on the PR.
679
+
- SonarCloud quality gate status: failed only because new-code duplication is 10.5%, above the configured 3% threshold.
680
+
- Latest SonarCloud duplication component tree still reports 1,826 duplicated new lines across 29 files.
681
+
682
+
Selected low-risk production-source refactors:
683
+
684
+
- Extract Go POSIX/Windows transport receive framing from `uds_receive.go` and `pipe_receive.go` into a shared internal framing receiver. This targets the top two SonarCloud contributors, 189 duplicated lines each.
685
+
- Extract the Go raw-service per-session request/dispatch/response loop from `server_unix.go` and `server_windows.go` into shared raw-service helpers while leaving OS-specific accept, readiness, receive, send, and SHM cleanup code local. This targets the next two contributors, 160 and 159 duplicated lines.
686
+
- Extract Go POSIX/Windows transport send chunking and HELLO/HELLO_ACK protocol helpers into shared internal framing helpers while keeping socket/pipe I/O and session construction platform-local. This targets the next Go transport contributors: handshake and send pairs.
687
+
- Extract C client refresh, raw-call envelope validation, and retry/reconnect policy into common service helpers with platform callbacks. This targets the POSIX/Windows C client-call and client lifecycle duplication without changing transport send/receive functions.
688
+
689
+
Risk controls:
690
+
691
+
- Do not merge POSIX and Windows accept loops; they differ in readiness, listener shutdown, and SHM setup behavior.
692
+
- Keep transport-specific receive/send as callbacks so OS-specific error and timeout semantics remain local.
693
+
- Validate POSIX Go packages locally and Windows Go packages on Win11 after the refactor.
694
+
- Validate C common helper changes on POSIX and Win11 because both platform service client paths now call common retry/raw-call helpers.
695
+
696
+
Validation completed for this duplication-reduction increment:
697
+
698
+
-`git diff --check`: passed.
699
+
-`cd src/go && go test -count=1 ./pkg/netipc/transport/internal/framing ./pkg/netipc/transport/posix ./pkg/netipc/service/raw`: passed.
700
+
-`cd src/go && go test -count=1 ./pkg/netipc/...`: passed.
- Win11 temp-copy Go validation: `cd src/go && go test -count=1 ./pkg/netipc/transport/windows ./pkg/netipc/service/raw`: passed.
704
+
- Win11 temp-copy C validation: MSYS CMake build of `test_win_service`, `test_win_service_extra`, and `test_win_service_payload_limits` passed; CTest for those three tests passed.
0 commit comments