repowiserepowise
Sign in
prefecthq/prefect
OverviewDocsArchitectureKnowledge GraphFilesCode HealthSecurityRefactoring

People & History

CommitsContributorsDecisions
Chat
Stats
repowiserepowise
ExplorePricingDocs
Sign in
repowiseprefecthq/prefect
PR
PR

prefecthq / prefect

pythontypescriptmainb749a67814.2K linessynced 2mo ago

Code health

7.6out of 10Good

This codebase scores 7.6 out of 10 for code health, which we rate good. It also scores maintainability 7.9 and static performance 9.8 out of 10. The three are scored separately and never blended into one number. Risk is concentrated, as it usually is: 73 of 4,839 files are git hotspots, and they average 3.9 — which is where the fixes pay off most.

Full health report →
Documentation2,450pages901 with model-written prose, 1,549 built from the indexScore validation14/206.0× baselineTop-ranked files that did go on to need a bug fixDead code219exportsUnused exports that nothing in the graph reaches

Do next

4 things worth doing this quarter.

Worth planning

  • Break up safe_load_namespace (CCN 32, 118 lines)

    src/prefect/utilities/importtools.py:441

    safe_load_namespace nests its control flow deeply, and part of it is duplicated, so splitting it also removes a copy; 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
    critical
    Medium effort, worth a check
  • Flatten the nesting in bulk_create_flow_runs_from_deployment

    src/prefect/server/api/deployments.py:1038

    bulk_create_flow_runs_from_deployment nests its control flow deeply, and part of it is duplicated, so splitting it also removes a copy; changed 1 time in 90 days.

    gain
    up to +1.4 health on this file(inferred)
    finding
    Nested complexity
    size
    CCN 25, 160 lines, nests 5 deep
    severity
    high
    Medium effort, worth a check
  • Delete 173 unused symbols and files (7,506 lines)

    Nothing in the graph reaches them, across 77 files; every reader and agent pays to skip them.

    symbols
    173
    lines
    7,506
    safe to delete
    Yes(inferred)
    Medium effort
  • Break up run (CCN 19, 78 lines)

    src/integrations/prefect-redis/prefect_redis/messaging.py:520

    run nests its control flow deeply, and part of it is duplicated, so splitting it also removes a copy; 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
    critical
    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
Lines of code
814.2K
Files
4,839
Symbols
36,096
Modules
14
Languages
5

Recent activity

All commits →

Commits

  • b749a673fix(prefect-aws): bump aws-cdk CLI to 2.1131.0 (#22520)2mo ago
  • 84c00e50docs: Add release notes for 6 integration packages (#22518)2mo ago
  • 2f81f63cdocs: document new "IfPossible" Docker image pull policy option (#22515)2mo ago
  • 0926dad3Add docker image pull policy "always if possible" (#22154)2mo ago
  • e2c05798docs: Add release notes for `prefect-databricks==0.4.2` (#22514)2mo ago
  • 1abd74e3Preserve empty `pull: []` in `prefect deploy` instead of forcing `set_working_directory` (#22490)2mo ago

Decisions

  • Add JSONSerializer and PickleSerializer to prefect.serializersproposed
  • Add capabilities to BlockSchemas and remove type field; create Postgres migration and bump API versionproposed
  • Add cloud to prefect version server type displayproposed
  • Add context manager to disable run loggerproposed
  • Adopt Radix Select primitivesproposed
  • Adopt Radix dropdown primitives with design-system wrappersproposed
▸

Everything we found

7,886 open

Every detector's open count by area, each with its worst example. An inventory, not a to-do list: the actions above are the part worth doing.

  • worst item is critical severity. Code health4,210Untested hotspot · src/prefect/testing/cli.py14 findings · 9.7 deducted→
  • worst item is medium severity. Refactoring591upgrade+1.5 health, M effort · src/prefect/server/database/_migrations/versions/postgresql/2022_05_10_145956_1c9390e2f9c6_replace_version_with_checksum_and_.py→
  • worst item is medium severity. Decisions365tests/workers/test_base_worker.py292 awaiting review · 73 hotspots ungoverned→
  • worst item is medium severity. Ownership2,478src/prefect/workers/_worker_channel/_sync.py96% single-owner concentration, 5 commits in 90d→
  • worst item is low severity. Dead code242src/integrations/prefect-aws/prefect_aws/utilities.pyUnreachable symbol (30 lines)→

Composition

Open the graph →
python 54%typescript 45%
shell 0%dockerfile 0%javascript 0%

Explore this codebase

  • Docs2,450 pages across 14 modules→
  • ChatAsk this codebase a question and get an answer with its sources.→
  • Files4,839 files with per-file docs, health and history→
  • ArchitectureDependency graph, layers, and 306 entry points→
  • Code healthPer-file scores, 5,958 open findings, coverage and refactoring targets→
  • Knowledge graphEntities, communities, and the paths between them→
  • Change couplingFiles that keep changing together, mined from commit history→
  • CommitsChange-risk ranked history with agent provenance→
  • ContributorsBus factor, per-file maintainers, and the human/agent split→
  • StatsSize class, origin, lifetime churn, rhythm and records→
  • CostsWhat indexing this snapshot cost, by model and by run.→