psf/requests
47 findings in 20 Python files · 6,403 lines · scanned in 17.5 s on 2026-11-12
Every number here comes from the same analyzer that runs on your upload, on the tree as it is in the repository. A finding is listed with the function or module it sits in; nothing is matched from text. Tests, examples and benchmarks are excluded from the scan, so "never referenced inside the project" means exactly that.
wide_signature 6
functions that take so many arguments the call sites are unreadable
src.requests.adapters.BaseAdapter.send6 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 4 call sites (src/requests/auth.py:312, src/requests/sessions.py:292, src/requests/sessions.py:651)src.requests.adapters.HTTPAdapter.send6 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 4 call sites (src/requests/auth.py:312, src/requests/sessions.py:292, src/requests/sessions.py:651)src.requests.models.Request.__init__10 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 6 call sites (src/requests/adapters.py:126, src/requests/adapters.py:215, src/requests/exceptions.py:35)src.requests.models.PreparedRequest.prepare10 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 2 call sites (src/requests/models.py:363, src/requests/sessions.py:541)src.requests.sessions.SessionRedirectMixin.resolve_redirects9 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 2 call sites (src/requests/sessions.py:804, src/requests/sessions.py:821)src.requests.sessions.Session.request16 parameters — a call site says nothing about them; group them into one object or split the function - reachable from 15 call sites (src/requests/api.py:71, src/requests/api.py:87, src/requests/api.py:99)
complex 8
branchy functions, counted from the AST
src.requests.adapters.HTTPAdapter.sendcyclomatic complexity 20src.requests.auth.HTTPDigestAuth.build_digest_headercyclomatic complexity 19src.requests.models.RequestEncodingMixin._encode_filescyclomatic complexity 21src.requests.models.PreparedRequest.prepare_urlcyclomatic complexity 18src.requests.models.PreparedRequest.prepare_bodycyclomatic complexity 19src.requests.utils.super_lencyclomatic complexity 16
and 2 more of the same check.
duplicate 2
the same block in two places
src.requests.auth.HTTPBasicAuth.__eq__Identical code in 2 functions (src.requests.auth.HTTPBasicAuth.__eq__, src.requests.auth.HTTPDigestAuth.__eq__) — extract it into one function and call it from eachsrc.requests.models.Response.__bool__Identical code in 2 functions (src.requests.models.Response.__bool__, src.requests.models.Response.__nonzero__) — extract it into one function and call it from each
suspicious_host 1
a hard-coded host or address
src.requests.__version__sends data to requests.readthedocs.io - not a host this project's manifest would explain; review what it uploads
unused 23
never called, never imported, never read
src.requests.adapters.HTTPAdapter.get_connectionnever referenced inside the project (dead code or public API)src.requests.cookies.MockRequest.get_typenever referenced inside the project (dead code or public API)src.requests.cookies.MockRequest.get_full_urlnever referenced inside the project (dead code or public API)src.requests.cookies.MockRequest.has_headernever referenced inside the project (dead code or public API)src.requests.cookies.MockRequest.get_headernever referenced inside the project (dead code or public API)src.requests.cookies.MockRequest.add_headernever referenced inside the project (dead code or public API)
and 17 more of the same check.
bad_name 7
a name that does not say what the thing holds
src.requests.auth.HTTPDigestAuth.build_digest_headernames say nothing (A1, A2, s) — rename to what they holdsrc.requests.auth.HTTPDigestAuth.build_digest_header.<locals>.KDnames say nothing (KD, d, s) — rename to what they holdsrc.requests.auth.HTTPDigestAuth.handle_401names say nothing (_r, r) — rename to what they holdsrc.requests.models.RequestEncodingMixin._encode_filesnames say nothing (fh, fn, fp, ft, rf, v, val) — rename to what they holdsrc.requests.models.Response.oknames say nothing (ok) — rename to what they holdsrc.requests.utils.stream_decode_response_unicodenames say nothing (r, rv) — rename to what they hold
and 1 more of the same check.
Five projects free. A .zip or a public GitHub URL.
Other repositories, same treatment
- Textualize/rich 97 findings
- celery/celery 1052 findings
- encode/django-rest-framework 337 findings
- encode/httpx 26 findings
- fastapi/fastapi 163 findings
- pallets/click 85 findings
- pallets/flask 45 findings
- pydantic/pydantic 164 findings
- scrapy/scrapy 186 findings