Hotspots
Files that are both large and changed often are where bugs tend to cluster and where refactoring pays off first. Each file of code in the current tree, tests included, is placed by its size and by the number of commits that changed it, under this name or one it had before; its hotspot score is changes × √lines. Documentation, vendored and generated files, and files without counted lines, such as binary files, are left out.
- Files Analyzed
- 1,087
- of 3,279 in the current tree
- Top 10 Files
- 40.4%
- of the total hotspot score
- Median File Size
- 41 lines
- half of the files are at least this large
- Median Changes
- 4 commits
- half of the files changed at least this often
Change frequency by file size
Each dot is a file; a bigger dot is a higher score. The dashed lines mark the median file size and the median number of changes: the large files that change often, in the top right, are in color. The 5 highest scores are numbered as in the list. Both axes are logarithmic.
Chart not shown: it is drawn with JavaScript, which is turned off or blocked on this page, as it is on Jenkins by default. How to show the charts
Highest scores
- 1fastapi/routing.py6,963 lines · 195 changes
- 2fastapi/applications.py5,132 lines · 113 changes
- 3fastapi/dependencies/utils.py1,513 lines · 186 changes
- 4pyproject.toml434 lines · 254 changes
- 5fastapi/openapi/utils.py671 lines · 92 changes
- 6.github/workflows/test.yml343 lines · 112 changes
- 7fastapi/__init__.py25 lines · 382 changes
- 8scripts/docs.py760 lines · 67 changes
Top hotspots
The files ranked by hotspot score: the larger a file is and the more often it changes, the higher it ranks. Authors is how many people have changed the file, bots aside, as on the Code Ownership page: a hotspot only one person has changed is also a bus-factor risk.
| File | Lines | Changes | Authors | Score | Bar |
|---|---|---|---|---|---|
| fastapi/routing.py | 6,963 | 195 | 52 | 16,271.7 | |
| fastapi/applications.py | 5,132 | 113 | 42 | 8,095.1 | |
| fastapi/dependencies/utils.py | 1,513 | 186 | 50 | 7,234.9 | |
| pyproject.toml | 434 | 254 | 49 | 5,291.5 | |
| fastapi/openapi/utils.py | 671 | 92 | 33 | 2,383.1 | |
| .github/workflows/test.yml | 343 | 112 | 13 | 2,074.3 | |
| fastapi/__init__.py | 25 | 382 | 2 | 1,910.0 | |
| scripts/docs.py | 760 | 67 | 6 | 1,847.1 | |
| fastapi/param_functions.py | 2,605 | 29 | 10 | 1,480.1 | |
| fastapi/security/oauth2.py | 693 | 49 | 22 | 1,289.9 |
Table: the 100 highest-scoring of 1,087 files
| File | Lines | Changes | Authors | Score | Bar |
|---|---|---|---|---|---|
| fastapi/routing.py | 6,963 | 195 | 52 | 16,271.7 | |
| fastapi/applications.py | 5,132 | 113 | 42 | 8,095.1 | |
| fastapi/dependencies/utils.py | 1,513 | 186 | 50 | 7,234.9 | |
| pyproject.toml | 434 | 254 | 49 | 5,291.5 | |
| fastapi/openapi/utils.py | 671 | 92 | 33 | 2,383.1 | |
| .github/workflows/test.yml | 343 | 112 | 13 | 2,074.3 | |
| fastapi/__init__.py | 25 | 382 | 2 | 1,910.0 | |
| scripts/docs.py | 760 | 67 | 6 | 1,847.1 | |
| fastapi/param_functions.py | 2,605 | 29 | 10 | 1,480.1 | |
| fastapi/security/oauth2.py | 693 | 49 | 22 | 1,289.9 | |
| fastapi/params.py | 822 | 41 | 13 | 1,175.5 | |
| fastapi/encoders.py | 366 | 59 | 28 | 1,128.7 | |
| .github/workflows/build-docs.yml | 129 | 90 | 8 | 1,022.2 | |
| fastapi/openapi/models.py | 435 | 47 | 13 | 980.3 | |
| .pre-commit-config.yaml | 114 | 85 | 5 | 907.6 | |
| tests/test_application.py | 1,285 | 25 | 14 | 896.2 | |
| fastapi/utils.py | 136 | 67 | 27 | 781.3 | |
| .github/workflows/deploy-docs.yml | 84 | 79 | 5 | 724.0 | |
| fastapi/_compat/v2.py | 522 | 31 | 5 | 708.3 | |
| tests/test_include_router_defaults_overrides.py | 7,304 | 8 | 3 | 683.7 | |
| scripts/translate.py | 489 | 30 | 2 | 663.4 | |
| fastapi/security/http.py | 423 | 32 | 15 | 658.1 | |
| fastapi/openapi/docs.py | 389 | 31 | 18 | 611.4 | |
| tests/test_tutorial/test_bigger_applications/test_main.py | 606 | 24 | 8 | 590.8 | |
| tests/test_jsonable_encoder.py | 345 | 31 | 17 | 575.8 | |
| fastapi/dependencies/models.py | 245 | 36 | 9 | 563.5 | |
| tests/test_tutorial/test_security/test_tutorial005.py | 432 | 27 | 12 | 561.2 | |
| tests/test_tutorial/test_body/test_tutorial001.py | 346 | 29 | 11 | 539.4 | |
| tests/test_response_model_as_return_annotation.py | 1,121 | 15 | 4 | 502.2 | |
| fastapi/security/api_key.py | 320 | 28 | 11 | 500.9 | |
| fastapi/exceptions.py | 256 | 28 | 11 | 448.0 | |
| tests/test_schema_extra_examples.py | 857 | 15 | 6 | 439.1 | |
| docs_src/security/tutorial005.py | 182 | 30 | 11 | 404.7 | |
| tests/test_tutorial/test_request_files/test_tutorial001.py | 216 | 26 | 7 | 382.1 | |
| .github/workflows/translate.yml | 148 | 31 | 3 | 377.1 | |
| .github/workflows/smokeshow.yml | 59 | 48 | 3 | 368.7 | |
| tests/test_tutorial/test_security/test_tutorial003.py | 215 | 25 | 11 | 366.6 | |
| tests/test_extra_routes.py | 370 | 19 | 8 | 365.5 | |
| tests/test_tutorial/test_request_forms_and_files/test_tutorial001.py | 245 | 23 | 7 | 360.0 | |
| .github/workflows/publish.yml | 37 | 58 | 4 | 352.8 | |
| tests/test_security_oauth2.py | 280 | 21 | 10 | 351.4 | |
| tests/test_frontend.py | 1,415 | 9 | 2 | 338.5 | |
| tests/test_security_oauth2_optional.py | 281 | 20 | 9 | 335.3 | |
| tests/test_path.py | 780 | 12 | 5 | 335.1 | |
| tests/test_tutorial/test_request_files/test_tutorial002.py | 254 | 21 | 7 | 334.7 | |
| tests/test_tutorial/test_body_fields/test_tutorial001.py | 189 | 24 | 8 | 329.9 | |
| tests/test_openapi_separate_input_output_schemas.py | 883 | 11 | 4 | 326.9 | |
| tests/main.py | 208 | 21 | 8 | 302.9 | |
| tests/test_tutorial/test_body_multiple_params/test_tutorial003.py | 225 | 20 | 7 | 300.0 | |
| tests/test_tutorial/test_request_forms/test_tutorial001.py | 186 | 22 | 6 | 300.0 | |
| tests/test_generate_unique_id_function.py | 1,699 | 7 | 3 | 288.5 | |
| tests/test_tutorial/test_body_updates/test_tutorial001.py | 192 | 20 | 7 | 277.1 | |
| tests/test_tutorial/test_query_params_str_validations/test_tutorial010.py | 158 | 22 | 8 | 276.5 | |
| tests/test_multi_body_errors.py | 191 | 20 | 7 | 276.4 | |
| tests/test_tutorial/test_sql_databases/test_tutorial002.py | 441 | 13 | 6 | 273.0 | |
| tests/test_tutorial/test_body_multiple_params/test_tutorial001.py | 185 | 20 | 6 | 272.0 | |
| tests/test_tutorial/test_dependencies/test_tutorial001_tutorial001_02.py | 192 | 19 | 7 | 263.3 | |
| tests/test_sub_callbacks.py | 306 | 15 | 5 | 262.4 | |
| tests/test_tutorial/test_extra_data_types/test_tutorial001.py | 163 | 20 | 8 | 255.3 | |
| tests/test_tutorial/test_additional_responses/test_tutorial002.py | 140 | 21 | 7 | 248.5 | |
| tests/test_tutorial/test_dataclasses/test_tutorial003.py | 210 | 17 | 5 | 246.4 | |
| fastapi/datastructures.py | 186 | 18 | 5 | 245.5 | |
| tests/test_tutorial/test_path_params/test_tutorial005.py | 123 | 22 | 7 | 244.0 | |
| tests/test_tutorial/test_additional_responses/test_tutorial004.py | 143 | 20 | 7 | 239.2 | |
| tests/test_tutorial/test_path_operation_advanced_configurations/test_tutorial004.py | 142 | 20 | 8 | 238.3 | |
| tests/test_tutorial/test_response_model/test_tutorial003.py | 157 | 19 | 7 | 238.1 | |
| tests/test_tutorial/test_path_operation_configurations/test_tutorial005.py | 141 | 20 | 6 | 237.5 | |
| tests/test_request_body_parameters_media_type.py | 321 | 13 | 5 | 232.9 | |
| tests/test_tutorial/test_body_nested_models/test_tutorial009.py | 123 | 21 | 8 | 232.9 | |
| tests/test_tutorial/test_openapi_callbacks/test_tutorial001.py | 208 | 16 | 7 | 230.8 | |
| .github/workflows/pre-commit.yml | 108 | 22 | 3 | 228.6 | |
| tests/test_tutorial/test_query_params/test_tutorial006.py | 161 | 18 | 6 | 228.4 | |
| tests/test_tutorial/test_dependencies/test_tutorial002_tutorial003_tutorial004.py | 180 | 17 | 7 | 228.1 | |
| tests/test_tutorial/test_extra_models/test_tutorial003.py | 158 | 18 | 7 | 226.3 | |
| tests/test_tutorial/test_cookie_params/test_tutorial001.py | 124 | 20 | 7 | 222.7 | |
| tests/test_tutorial/test_response_model/test_tutorial004.py | 148 | 18 | 8 | 219.0 | |
| tests/test_tutorial/test_response_model/test_tutorial005.py | 166 | 17 | 7 | 219.0 | |
| tests/test_tutorial/test_response_model/test_tutorial006.py | 166 | 17 | 7 | 219.0 | |
| tests/test_starlette_exception.py | 209 | 15 | 8 | 216.9 | |
| tests/test_router_events.py | 378 | 11 | 5 | 213.9 | |
| fastapi/security/open_id_connect_url.py | 94 | 22 | 9 | 213.3 | |
| tests/test_request_params/test_form/test_nullable_and_defaults.py | 1,261 | 6 | 2 | 213.1 | |
| tests/test_tutorial/test_sql_databases/test_tutorial001.py | 360 | 11 | 5 | 208.7 | |
| tests/test_tutorial/test_dependencies/test_tutorial006.py | 150 | 17 | 6 | 208.2 | |
| tests/test_tutorial/test_handling_errors/test_tutorial005.py | 116 | 19 | 8 | 204.6 | |
| tests/test_dependency_contextmanager.py | 399 | 10 | 3 | 199.7 | |
| tests/test_query.py | 277 | 12 | 3 | 199.7 | |
| tests/test_tutorial/test_dependencies/test_tutorial012.py | 233 | 13 | 4 | 198.4 | |
| tests/test_tutorial/test_query_params_str_validations/test_tutorial011.py | 121 | 18 | 6 | 198.0 | |
| tests/test_annotated.py | 298 | 11 | 4 | 189.9 | |
| tests/test_security_oauth2_optional_description.py | 283 | 11 | 5 | 185.0 | |
| tests/test_infer_param_optionality.py | 337 | 10 | 5 | 183.6 | |
| tests/test_tutorial/test_additional_responses/test_tutorial003.py | 131 | 16 | 6 | 183.1 | |
| tests/test_tutorial/test_header_params/test_tutorial001.py | 116 | 17 | 5 | 183.1 | |
| tests/test_tuples.py | 276 | 11 | 4 | 182.7 | |
| tests/test_tutorial/test_additional_responses/test_tutorial001.py | 127 | 16 | 7 | 180.3 | |
| tests/test_tutorial/test_query_params/test_tutorial005.py | 111 | 17 | 5 | 179.1 | |
| fastapi/_compat/shared.py | 222 | 12 | 3 | 178.8 | |
| tests/test_union_inherited_body.py | 142 | 15 | 6 | 178.7 | |
| .github/workflows/sponsors.yml | 60 | 23 | 3 | 178.2 |
How FastAPI compares with other Python open source projects →
How FastAPI ranks among Python open source projects by AI-assisted commits →
Generate this report for your own repository with gitstats-action · All Gallery reports
The smallest workflow
Publishes the report to GitHub Pages on every push to main: turn on Pages for the gh-pages branch.
# .github/workflows/gitstats.yml
name: GitStats Report
on:
push:
branches: [main]
permissions:
contents: write
jobs:
gitstats:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: shenxianpeng/gitstats-action@v1
with:
deploy-to-pages: true