Description: send_files() and send_files_multithreaded() are both ~150+ lines and mix multiple responsibilities: argument handling, connection setup, directory scanning, manifest tracking, progress reporting, and cleanup. In addition, the dry-run logic is duplicated almost verbatim in both functions (src/client/client_send.c:307-328 and src/client/client_send.c:429-449).
Suggested fix:
Extract a shared dry_run_scan() helper that takes a Config* and prints the dry-run report.
Split send_files_multithreaded() similarly and reuse the connection/finish helpers.
Keep each function under 80 lines and with a single responsibility.
Labels: quality, refactoring
**Severity:** low
**Category:** quality
**Location:** `src/client/client_send.c:307-427`, `src/client/client_send.c:429-485`
**Description:**
`send_files()` and `send_files_multithreaded()` are both ~150+ lines and mix multiple responsibilities: argument handling, connection setup, directory scanning, manifest tracking, progress reporting, and cleanup. In addition, the dry-run logic is duplicated almost verbatim in both functions (`src/client/client_send.c:307-328` and `src/client/client_send.c:429-449`).
**Suggested fix:**
1. Extract a shared `dry_run_scan()` helper that takes a `Config*` and prints the dry-run report.
2. Split `send_files()` into smaller functions:
- `connect_client(config)`
- `send_files_loop(client, config, scanner, manifest)`
- `send_manifest_and_finish(client, manifest)`
3. Split `send_files_multithreaded()` similarly and reuse the connection/finish helpers.
4. Keep each function under 80 lines and with a single responsibility.
**Labels:** quality, refactoring
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Severity: low
Category: quality
Location:
src/client/client_send.c:307-427,src/client/client_send.c:429-485Description:
send_files()andsend_files_multithreaded()are both ~150+ lines and mix multiple responsibilities: argument handling, connection setup, directory scanning, manifest tracking, progress reporting, and cleanup. In addition, the dry-run logic is duplicated almost verbatim in both functions (src/client/client_send.c:307-328andsrc/client/client_send.c:429-449).Suggested fix:
dry_run_scan()helper that takes aConfig*and prints the dry-run report.send_files()into smaller functions:connect_client(config)send_files_loop(client, config, scanner, manifest)send_manifest_and_finish(client, manifest)send_files_multithreaded()similarly and reuse the connection/finish helpers.Labels: quality, refactoring