The Problem
The OnionShare deployment contains a Python-based desktop application with 500 files and a CLI (56 files). The static analysis covered 90 of 90 code files (7 Shell, 75 Python, 8 JavaScript) and identified 79 findings, 23 of which are high severity. The analysis revealed 83 internal modules, 111 import edges, 23 modules in circular dependencies, and 861 named functions and 118 classes.
What This Does
The repository contains three logical sub-projects (desktop, cli, flatpak) with overlapping dependency files and duplicated code blocks. Analysis found 79 findings (30 high, 49 medium, 0 low) including 23 modules in circular import cycles affecting desktop/onionshare/__init__.py, gui_common.py, widgets.py. The asset scope includes 83 internal modules, 111 import edges, 3 modules in circular dependencies, and 861 named functions. The asset scope includes 111 import edges, 23 modules in circular dependencies, 861 named functions, and 118 classes.
What It Is
The OnionShare tool enables secure file sharing, website hosting, and chat over the Tor network. The repo contains 1252 files total across desktop/, cli/, flatpak/, docs/ directories. Primary package manager is poetry with GitHub Actions CI/CD. Notable structure: docs/ (655 files), desktop/ (500 files), cli/ (56 files), flatpak/ (13 files). Contains 20 test files and 670 doc files.
Code Health & Issues
- MEDIUM - Declare least-privilege permissions for GITHUB_TOKEN in
.github/workflows/build.yml(3 workflows have no permissions) - MEDIUM - Enable Dependabot or Renovate (3 manifests, no update bot configured)
- MEDIUM - Gate pull requests on dependency vulnerability scan (no dependency scan in CI)
- MEDIUM - Set
persist-credentials: falseon checkout in.github/workflows/build.yml - LOW - Set timeout-minutes on workflow jobs (3 jobs have no timeout)
The analysis confirmed 23 modules in circular dependencies affecting desktop/onionshare/__init__.py, gui_common.py, and widgets.py. 18 files show deep nesting making control flow hard to follow. 14 files have broad exception handling that swallows errors indiscriminately. One file desktop/onionshare/tab/mode/history.py contains 677 code lines making it hard to hold in one head. 193 repeated 6-line blocks exist across 55 files.
The Bottom Line
The repository has measurable structural issues: circular imports in core desktop modules, oversized files, duplicated code blocks, and insufficient CI gates. The codebase functions but requires refactoring to reduce coupling and improve error handling. Suitable for immediate use but needs engineering investment for long-term maintainability.