Repo X-Ray · 05 December 2026, 05:37 · read in 0.6s · nothing was executed

requests

/srv/xela/workspace/.xray-oss/requests

How to run itWhat the code isWhere the risk isWhat the tests cannot seeDead weightDependenciesSecretsMethod and limits
12,032
lines of code
22
source files
15
test files
95%
modules a test can reach
910
commits read
1 days ago
last commit

How to run it

make targets

and 21 more.

CI step

runnable scripts

What the code is

LanguageFilesLines
Python3712,032
HTML133
CSS112

What to read first

The fewest files that are the only import route into 95% of the code — 19 of 20 files. This is not a ranking, it is a cover: nothing in those 19 files can be reached by an import without passing through one of the entrances below. Each row also names the files the rest of that region depends on most, which is the vocabulary you will be reading it in.

Read this, then what it leads toFiles it opensLines in that regionA test reaches it
1. src/requests/help.py
where the program starts
  src/requests/models.py ← 10 files, 1,184 lines
  src/requests/compat.py ← 10 files, 115 lines
  src/requests/cookies.py ← 7 files, 625 lines
196,394yes

The modules everything else leans on

Imported by the most files: the load-bearing walls, where a change reaches furthest.

ModuleImported byLinesA test reaches it
src/requests/__init__.py14219yes
src/requests/compat.py14115yes
src/requests/models.py111,184yes
src/requests/cookies.py9625yes
src/requests/structures.py9130yes
src/requests/_types.py7188yes
src/requests/exceptions.py7162yes
src/requests/_internal_utils.py651yes
src/requests/utils.py61,155yes
src/requests/auth.py5354yes
src/requests/__version__.py414yes
src/requests/adapters.py4748yes

Where the risk is

Churn multiplied by size. A big file that never changes is usually fine; a big file that changes constantly is where the bugs and the arguments live.

FileCommitsLinesMostly written byTested
src/requests/utils.py181,155Author B 61%yes
src/requests/models.py171,184Author B 41%yes
src/requests/adapters.py17748Author B 47%yes
src/requests/sessions.py10920Author B 50%yes
docs/conf.py14385Author A 36%no
setup.py539Author B 40%no
src/requests/__init__.py8219Author B 38%yes
src/requests/_types.py7188Author B 86%yes
src/requests/auth.py4354Author B 75%yes
src/requests/compat.py6115Author B 67%yes
src/requests/cookies.py2625Author W 50%yes
src/requests/__version__.py1314Author B 92%yes

The busiest test file is tests/test_requests.py (67 commits) - kept out of the table above so the code that ships comes first.

Bus factor. 2 of the files above were written almost entirely by one person (80% or more of the commits that touched them). If that person is not available, these are the files that will hurt.

Active in the last 90 days: Author C (3)

History read: 910 commits, 9 years ago to 1 days ago. Top committer overall: Author A 31%.

What the tests cannot see

19 of 20 shipped modules are reachable from a test file by import (95%).

2 further files under examples, docs, scripts or benchmarks are not test-reachable either. They are counted apart from the number above, because demo code dragging a healthy repository down tells you nothing.

Reachable means a test imports it, directly or through another module. It is the floor, not coverage: a module can be reachable and still have none of its behaviour exercised. The modules below are the other case - nothing a test loads can even see them, so a green suite says nothing about them.

Dead weight

Read this list with care. This repository loads code at runtime in 26 places where the target is a variable, so a reader like this one cannot know what they load. 0 files were rescued from the list below by resolving the literal globs and module paths that could be resolved.

Nothing unreachable found.

Longest functions

FunctionFileLines
resolve_redirectssrc/requests/sessions.py:186122
sendsrc/requests/adapters.py:634115
build_digest_headersrc/requests/auth.py:157110
requestsrc/requests/sessions.py:55797
prepare_urlsrc/requests/models.py:48381
sendsrc/requests/sessions.py:75278
prepare_bodysrc/requests/models.py:57677
_encode_filessrc/requests/models.py:18369

52 TODO / FIXME / HACK markers

FileCount
HISTORY.md18
.github/CONTRIBUTING.md6
docs/dev/contributing.rst5
docs/community/release-process.rst3
src/requests/auth.py3
src/requests/help.py3

Dependencies

Read from pyproject.toml, docs/requirements.txt.

Declared but never imported

Dead weight in the install, or a tool that is run rather than imported (formatters, type stubs, test plugins). Check before removing.

pysocks pytest-httpbin httpbin pytest-cov pytest-mock pytest-xdist pyright pyopenssl wheel sphinx

Missing, but only for tests, docs or examples

Nothing in the shipped code imports these, so an install will not break - but a fresh contributor running the tests or building the docs will hit them.

pygments

Optional by design

Imported only inside try: or a TYPE_CHECKING guard, so the code already handles their absence. Not counted as missing.

BaseHTTPServer OpenSSL SimpleHTTPServer StringIO _typeshed cStringIO chardet charset_normalizer cryptography http io json netrc simplejson ssl typing typing_extensions urllib3 winreg

Secrets

4 more in test or fixture folders

Test certificates and sample keys are committed on purpose, so these are listed rather than raised. Worth a glance only if one of these folders holds something real.

WhatWhere
private key blocktests/certs/expired/ca/ca-private.key:1
private key blocktests/certs/expired/server/server.key:1
private key blocktests/certs/mtls/client/client.key:1
private key blocktests/certs/valid/server/server.key:1

Nothing that looks like a live credential.

Method and limits

More measured notes on coding agents: alexenabled.github.io