prefecthq / prefect
Code health
Hotspots average 3.9, the place fixes pay off most.
Explore this codebase
- Code health map73hotspots across 4,839 files
- Ownership2,190sole-owned files: one author, no second reader
- Architecture14modules, 306 entry points
- Decisions292recorded, of which 0 accepted and 292 awaiting review
- Refactoring289open opportunities, one per file
- TestsNo coverage report yet. Run your tests with coverage on, then add the report:
AlsoDocsChatFilesKnowledge graphChange couplingCommitsStatsCosts
Do next · 3
3 things worth doing in the week to Jul 15, the last indexed commit.
Worth planning
Start breaking up safe_load_namespace (CCN 32, 118 lines): first lift lines 441-463
src/prefect/utilities/importtools.py:441
safe_load_namespace nests deeply; easier to read and change once split, which also removes a duplicate; function changed in 5 commits; changed 1 time in 90 days.
- gain
- up to +1.6 health on this file(inferred)
- finding
- Nested complexity
- size
- CCN 32, 118 lines, nests 9 deep
- severity
- high
Medium effort, worth a checkStart breaking up run (CCN 19, 78 lines): first lift lines 520-530
src/integrations/prefect-redis/prefect_redis/messaging.py:520
run nests deeply; easier to read and change once split, which also removes a duplicate; changed 2 times in 90 days.
- gain
- up to +1.1 health on this file(inferred)
- finding
- Nested complexity
- size
- CCN 19, 78 lines, nests 8 deep
- severity
- high
Medium effort, worth a checkStart breaking up _run_single_deploy (CCN 77, 338 lines): first lift lines 265-285
src/prefect/cli/deploy/_core.py:265
_run_single_deploy nests deeply; easier to read and change once split, which also removes a duplicate; changed 2 times in 90 days.
- gain
- up to +0.7 health on this file(inferred)
- finding
- Nested complexity
- size
- CCN 77, 338 lines, nests 4 deep
- severity
- medium
Medium effort, worth a check
Improve what Repowise can see
Add a test coverage report
Without one, Repowise cannot tell tested code from untested code, so every test-related action says “unknown”.
- line coverage
- Unknown, no report
Small effort
Everything we found
5 areas
Every detector's open count by area. The actions above are the part worth doing.
- Code health5,379 open findingsCriticalUntested hotspot · src/prefect/testing/cli.py14 findings · 9.7 deducted
- Refactoring289 open opportunitiesMediumupgrade+1.5 health, M effort · src/prefect/server/database/_migrations/versions/postgresql/2022_05_10_145956_1c9390e2f9c6_replace_version_with_checksum_and_.py
- Decisions292 to reviewMediumtests/workers/test_base_worker.py292 awaiting review, 0 drifting from the code
- Ownership2,190 sole-owned filesMediumsrc/prefect/workers/_worker_channel/_sync.pyOne author, no second reader
- Dead code242Lowsrc/integrations/prefect-aws/prefect_aws/utilities.pyUnreachable symbol (30 lines)