Repository Analysis

tornadoweb/tornado

Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

13.5 Low AI signal View on GitHub
13.5
Adjusted Score
13.5
Raw Score
100%
Time Factor
2026-05-29
Last Push
22,179
Stars
Python
Language
48,675
Lines of Code
172
Files
642
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 0HIGH 4MEDIUM 35LOW 603

Pattern Findings

642 matches across 12 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers371 hits · 341 pts
SeverityFileLineSnippet
LOWdocs/conf.py139def missing_reference_handler(app, env, node, contnode):
LOWtornado/auth.py216 def _on_authentication_verified(
LOWtornado/auth.py509 def _oauth_request_parameters(
LOWtornado/auth.py879 def get_google_oauth_settings(self) -> dict[str, str]:
LOWtornado/concurrent.py117 def run_on_executor_decorator(fn: Callable) -> Callable[..., Future]:
LOWtornado/concurrent.py178def future_set_result_unless_cancelled(
LOWtornado/concurrent.py192def future_set_exception_unless_cancelled(
LOWtornado/web.py163class RequestHandler:
LOWtornado/web.py915 def get_signed_cookie_key_version(
LOWtornado/web.py1903 def _handle_request_exception(self, e: BaseException) -> None:
LOWtornado/web.py1968 def _clear_representation_headers(self) -> None:
LOWtornado/web.py3776def get_signature_key_version(value: str | bytes) -> int | None:
LOWtornado/gen.py126def _value_from_stopiteration(e: Union[StopIteration, "Return"]) -> Any:
LOWtornado/iostream.py991 def _maybe_add_error_listener(self) -> None:
LOWtornado/httputil.py1031def parse_multipart_form_data(
LOWtornado/httputil.py1153def parse_response_start_line(line: str) -> ResponseStartLine:
LOWtornado/locale.py178def load_gettext_translations(directory: str, domain: str) -> None:
LOWtornado/curl_httpclient.py286 def handle_callback_exception(self, callback: Any) -> None:
LOWtornado/testing.py753def setup_with_context_manager(testcase: unittest.TestCase, cm: Any) -> Any:
LOWtornado/http1connection.py871def is_transfer_encoding_chunked(headers: httputil.HTTPHeaders) -> bool:
LOWtornado/websocket.py635def _raise_not_supported_for_websockets(*args: Any, **kwargs: Any) -> None:
LOWtornado/websocket.py895 def _handle_websocket_headers(self, handler: WebSocketHandler) -> None:
LOWtornado/test/httpclient_test.py109 def _clear_representation_headers(self):
LOWtornado/test/httpclient_test.py204 def test_patch_receives_payload(self):
LOWtornado/test/httpclient_test.py285 def test_basic_auth_explicit_mode(self):
LOWtornado/test/httpclient_test.py311 def test_unsupported_auth_mode(self):
LOWtornado/test/httpclient_test.py335 def test_redirect_without_location(self):
LOWtornado/test/httpclient_test.py343 def test_redirect_put_with_body(self):
LOWtornado/test/httpclient_test.py349 def test_redirect_put_without_body(self):
LOWtornado/test/httpclient_test.py358 def test_method_after_redirect(self):
LOWtornado/test/httpclient_test.py497 def test_header_callback_to_parse_line(self):
LOWtornado/test/httpclient_test.py604 def test_future_http_error_no_raise(self):
LOWtornado/test/httpclient_test.py611 def test_reuse_request_from_response(self):
LOWtornado/test/httpclient_test.py773 def test_strip_headers_on_redirect(self):
LOWtornado/test/httpclient_test.py982 def test_if_modified_since_naive_deprecated(self):
LOWtornado/test/queues_test.py88 def test_nonblocking_get_exception(self):
LOWtornado/test/queues_test.py121 def test_get_timeout_preempted(self):
LOWtornado/test/queues_test.py129 def test_get_clears_timed_out_putters(self):
LOWtornado/test/queues_test.py145 def test_get_clears_timed_out_getters(self):
LOWtornado/test/queues_test.py184 def test_nonblocking_put_exception(self):
LOWtornado/test/queues_test.py200 def test_nonblocking_put_with_getters(self):
LOWtornado/test/queues_test.py243 def test_put_timeout_preempted(self):
LOWtornado/test/queues_test.py252 def test_put_clears_timed_out_putters(self):
LOWtornado/test/queues_test.py267 def test_put_clears_timed_out_getters(self):
LOWtornado/test/auth_test.py481 def test_twitter_redirect_gen_coroutine(self):
LOWtornado/test/auth_test.py484 def test_twitter_authenticate_redirect(self):
LOWtornado/test/auth_test.py528 def test_twitter_show_user_error(self):
LOWtornado/test/httpserver_test.py85class HelloWorldRequestHandler(RequestHandler):
LOWtornado/test/httpserver_test.py360 def test_query_string_encoding(self):
LOWtornado/test/httpserver_test.py370 def test_empty_post_parameters(self):
LOWtornado/test/httpserver_test.py433 def test_malformed_first_line_response(self):
LOWtornado/test/httpserver_test.py443 def test_malformed_first_line_log(self):
LOWtornado/test/httpserver_test.py461 def test_invalid_host_header_with_whitespace(self):
LOWtornado/test/httpserver_test.py473 def test_chunked_request_body(self):
LOWtornado/test/httpserver_test.py1399 def test_large_body_buffered_chunked(self):
LOWtornado/test/httpserver_test.py1409 def test_large_body_streaming(self):
LOWtornado/test/httpserver_test.py1415 def test_large_body_streaming_chunked(self):
LOWtornado/test/httpserver_test.py1424 def test_large_body_streaming_override(self):
LOWtornado/test/httpserver_test.py1430 def test_large_body_streaming_chunked_override(self):
LOWtornado/test/httpserver_test.py494 def test_chunked_request_uppercase(self):
311 more matches not shown…
Over-Commented Block83 hits · 82 pts
SeverityFileLineSnippet
LOWrequirements.txt1#
LOWrequirements.txt21click==8.3.1
LOWrequirements.txt41 # via requests
LOWrequirements.txt61 # build
LOWrequirements.txt81 # via flake8
LOWrequirements.txt101 # via sphinx
LOWrequirements.txt121sphinxcontrib-serializinghtml==2.0.0
LOWruntests.sh1#!/bin/sh
LOWsetup.py1#
LOWtox.ini1# Tox (https://tox.readthedocs.io) is a tool for running tests
LOWtox.ini21 py310,py311,py312,py313,py314,pypy3
LOWtox.ini61 # cog.outl(f"{{{",".join(versions)}}}: TORNADO_EXTENSION=1")
LOWtox.ini81
LOWtox.ini121commands =
LOWtornado/options.py1#
LOWtornado/auth.py1#
LOWtornado/concurrent.py1#
LOWtornado/escape.py1#
LOWtornado/web.py1#
LOWtornado/web.py681 # in the next feature release.
LOWtornado/web.py2801 and (start >= size or (end is not None and start >= end))
LOWtornado/web.py2961 # abspath always removes a trailing slash, except when
LOWtornado/web.py3581 # The v2 format consists of a version number and a series of
LOWtornado/queues.py1# Copyright 2015 The Tornado Authors
LOWtornado/_locale_data.py1# Copyright 2012 Facebook
LOWtornado/iostream.py1#
LOWtornado/iostream.py781 # StreamClosedError instead of AssertionError. In particular, this
LOWtornado/iostream.py1421 self._server_hostname = server_hostname
LOWtornado/log.py1#
LOWtornado/locks.py1# Copyright 2015 The Tornado Authors
LOWtornado/httpserver.py1#
LOWtornado/__init__.py1#
LOWtornado/netutil.py1#
LOWtornado/netutil.py161 try:
LOWtornado/netutil.py261 # entered this method, but this information is not available
LOWtornado/httputil.py1#
LOWtornado/httputil.py521 # We test for the presence of a comma instead of the number of
LOWtornado/httputil.py1161 match = _ABNF.status_line.fullmatch(line)
LOWtornado/ioloop.py1#
LOWtornado/ioloop.py781 # We accept both raw file descriptors and file-like objects as
LOWtornado/ioloop.py961 math.floor((current_time - self._next_timeout) / callback_time_sec) + 1
LOWtornado/routing.py1# Copyright 2015 The Tornado Authors
LOWtornado/tcpserver.py1#
LOWtornado/template.py1#
LOWtornado/locale.py1# Copyright 2009 Facebook
LOWtornado/curl_httpclient.py1#
LOWtornado/curl_httpclient.py161 # call _set_timeout whenever the timeout changes. However,
LOWtornado/process.py1#
LOWtornado/autoreload.py1#
LOWtornado/autoreload.py41Additionally, modifying these variables will cause reloading to behave
LOWtornado/autoreload.py61#
LOWtornado/testing.py161 def tearDown(self) -> None:
LOWtornado/http1connection.py1#
LOWtornado/http1connection.py141 self._body_timeout = self.params.body_timeout
LOWtornado/tcpclient.py1#
LOWtornado/wsgi.py1#
LOWtornado/test/httpclient_test.py681 )
LOWtornado/test/queues_test.py1# Licensed under the Apache License, Version 2.0 (the "License"); you may
LOWtornado/test/twisted_test.py1# Author: Ovidiu Predescu
LOWtornado/test/concurrent_test.py1#
23 more matches not shown…
Excessive Try-Catch Wrapping76 hits · 80 pts
SeverityFileLineSnippet
LOWtornado/options.py657 except Exception:
LOWtornado/concurrent.py63 except Exception:
LOWtornado/web.py1348 except Exception:
LOWtornado/web.py1362 except Exception:
LOWtornado/web.py1633 except Exception:
LOWtornado/web.py1864 except Exception as e:
LOWtornado/web.py1867 except Exception:
LOWtornado/web.py1911 except Exception:
LOWtornado/web.py2908 except Exception:
LOWtornado/web.py3206 except Exception:
LOWtornado/web.py3712 except Exception:
LOWtornado/web.py3772 except Exception:
MEDIUMtornado/httpclient.py75 print("Error: " + str(e))
LOWtornado/httpclient.py76 except Exception as e:
MEDIUMtornado/httpclient.py78 print("Error: " + str(e))
LOWtornado/httpclient.py149 except Exception as e:
MEDIUMtornado/httpclient.py150 print("Error: %s" % e)
LOWtornado/gen.py208 except Exception:
LOWtornado/gen.py228 except Exception:
LOWtornado/gen.py317 except Exception as e:
MEDIUMtornado/gen.py318 print("Error {} from {}".format(e, wait_iterator.current_future))
LOWtornado/gen.py531 except Exception as e:
LOWtornado/gen.py628 except Exception as e:
LOWtornado/gen.py768 except Exception as e:
LOWtornado/gen.py796 except Exception:
LOWtornado/iostream.py716 except Exception as e:
LOWtornado/iostream.py769 except Exception as e:
LOWtornado/iostream.py1367 except Exception:
MEDIUMtornado/iostream.py762def _handle_read(self) -> None:
LOWtornado/log.py68 except Exception:
LOWtornado/log.py190 except Exception as e:
MEDIUMtornado/log.py56def _stderr_supports_color() -> bool:
LOWtornado/httputil.py555 except Exception:
LOWtornado/httputil.py561 except Exception:
LOWtornado/httputil.py1003 except Exception as e:
LOWtornado/httputil.py1027 except Exception as e:
LOWtornado/ioloop.py501 except Exception:
LOWtornado/ioloop.py771 except Exception:
LOWtornado/ioloop.py940 except Exception:
MEDIUMtornado/ioloop.py494def run() -> None:
LOWtornado/tcpserver.py382 except Exception:
LOWtornado/template.py329 except Exception:
LOWtornado/locale.py212 except Exception as e:
LOWtornado/curl_httpclient.py215 except Exception as e:
LOWtornado/curl_httpclient.py283 except Exception:
LOWtornado/autoreload.py190 except Exception:
LOWtornado/autoreload.py315 except Exception as e:
LOWtornado/testing.py325 except Exception:
MEDIUMtornado/testing.py320def timeout_func() -> None:
LOWtornado/simple_httpclient.py440 except Exception:
MEDIUMtornado/simple_httpclient.py283def run(self) -> None:
LOWtornado/http1connection.py809 except Exception:
LOWtornado/http1connection.py842 except Exception:
LOWtornado/tcpclient.py136 except Exception as e:
LOWtornado/websocket.py658 except Exception:
LOWtornado/websocket.py964 except Exception:
LOWtornado/test/auth_test.py100 except Exception as e:
MEDIUMtornado/test/httpserver_test.py341def decode_argument(self, value, name=None):
LOWtornado/test/httpserver_test.py344 except Exception:
LOWtornado/test/process_test.py125 except Exception:
16 more matches not shown…
Deep Nesting45 hits · 40 pts
SeverityFileLineSnippet
LOWtornado/options.py361
LOWtornado/escape.py266
LOWtornado/web.py2015
LOWtornado/web.py3356
LOWtornado/web.py404
LOWtornado/web.py1427
LOWtornado/web.py2026
LOWtornado/web.py2312
LOWtornado/web.py2327
LOWtornado/web.py2995
LOWtornado/web.py3371
LOWtornado/gen.py492
LOWtornado/gen.py856
LOWtornado/gen.py524
LOWtornado/gen.py750
LOWtornado/iostream.py551
LOWtornado/iostream.py836
LOWtornado/iostream.py892
LOWtornado/iostream.py1349
LOWtornado/log.py56
LOWtornado/netutil.py56
LOWtornado/httputil.py976
LOWtornado/httputil.py548
LOWtornado/routing.py613
LOWtornado/template.py844
LOWtornado/locale.py91
LOWtornado/locale.py329
LOWtornado/simple_httpclient.py283
LOWtornado/simple_httpclient.py615
LOWtornado/http1connection.py187
LOWtornado/http1connection.py645
LOWtornado/http1connection.py659
LOWtornado/http1connection.py733
LOWtornado/websocket.py1216
LOWtornado/test/httpserver_test.py395
LOWtornado/test/httpserver_test.py1265
LOWtornado/test/circlerefs_test.py64
LOWtornado/test/gen_test.py795
LOWtornado/test/gen_test.py860
LOWtornado/test/autoreload_test.py103
LOWtornado/test/httputil_test.py388
LOWtornado/test/util_test.py316
LOWtornado/platform/asyncio.py570
LOWmaint/test/redbot/red_test.py76
LOWdemos/file_upload/file_uploader.py26
Self-Referential Comments14 hits · 38 pts
SeverityFileLineSnippet
MEDIUMdocs/conf.py151# Define the canonical URL if you are using a custom domain on Read the Docs
MEDIUMtornado/httpclient.py102 # Create the client while our IOLoop is "current", without
MEDIUMtornado/gen.py200 # This function is type-annotated with a comment to work around
MEDIUMtornado/iostream.py722 # This method is called from _handle_read and _try_inline_read.
MEDIUMtornado/iostream.py992 # This method is part of an optimization: to detect a connection that
MEDIUMtornado/httputil.py654 """This method is called by the server when a new request has started.
MEDIUMtornado/httputil.py666 """This method is called when a connection has been closed.
MEDIUMtornado/ioloop.py268 # Create a new asyncio event loop for this thread.
MEDIUMtornado/ioloop.py789 # This method is provided for use by `IOLoop` subclasses and should
MEDIUMtornado/ioloop.py804 # This method is provided for use by `IOLoop` subclasses (in
MEDIUMtornado/wsgi.py50# This function is like those in the tornado.escape module, but defined
MEDIUMtornado/platform/asyncio.py523 # Create a thread to run the select system call. We manage this thread
MEDIUMtornado/platform/asyncio.py703 # This class is a __getattribute__-based proxy. All attributes other than those
MEDIUMdemos/blog/blog.py300 # Create the global connection pool.
Unused Imports32 hits · 30 pts
SeverityFileLineSnippet
LOWtornado/web.py106
LOWtornado/web.py106
LOWtornado/queues.py28
LOWtornado/httpclient.py46
LOWtornado/httpclient.py46
LOWtornado/gen.py77
LOWtornado/gen.py77
LOWtornado/gen.py77
LOWtornado/gen.py77
LOWtornado/util.py13
LOWtornado/locks.py19
LOWtornado/locks.py19
LOWtornado/httputil.py22
LOWtornado/ioloop.py26
LOWtornado/template.py208
LOWtornado/locale.py40
LOWtornado/testing.py26
LOWtornado/testing.py26
LOWtornado/simple_httpclient.py14
LOWtornado/simple_httpclient.py14
LOWtornado/http1connection.py26
LOWtornado/http1connection.py26
LOWtornado/tcpclient.py24
LOWtornado/websocket.py27
LOWtornado/websocket.py27
LOWtornado/wsgi.py45
LOWtornado/test/twisted_test.py37
LOWtornado/test/ioloop_test.py12
LOWtornado/test/ioloop_test.py18
LOWtornado/test/websocket_test.py23
LOWtornado/platform/asyncio.py49
LOWtornado/platform/caresresolver.py3
AI Slop Vocabulary11 hits · 22 pts
SeverityFileLineSnippet
LOWtox.ini127 # here (must be completely unset, not just set to zero/empty). Remove this
LOWtornado/httpclient.py208 # It can't simply call _async_clients() because we may be in
LOWtornado/iostream.py1512 # simply return 0 bytes written.
MEDIUMtornado/template.py893 # This is especially useful in conjunction with jquery templates,
LOWtornado/curl_httpclient.py52 # Typeshed is incomplete for CurlMulti, so just use Any for now.
MEDIUMtornado/curl_httpclient.py313 # a bug in conjunction with the curl_multi_socket_action API
LOWtornado/test/httpserver_test.py831 # Unix sockets don't have remote addresses so they just return an
MEDIUMtornado/test/circlerefs_test.py106 # Construct a known leak scenario to make sure the test harness works.
MEDIUMtornado/test/web_test.py1540 # to disable Tornado's path validation (in conjunction with
MEDIUMtornado/test/tcpserver_test.py141 # harness too.
LOWtornado/platform/asyncio.py606 # polling the waker alone. If we are, just return to the
Cross-File Repetition3 hits · 15 pts
SeverityFileLineSnippet
HIGHtornado/test/httputil_test.py0\ --1234 content-disposition: form-data; name="files"; filename="ab.txt" foo --1234--
HIGHtornado/test/httputil_test.py0\ --1234 content-disposition: form-data; name="files"; filename="ab.txt" foo --1234--
HIGHtornado/test/httputil_test.py0\ --1234 content-disposition: form-data; name="files"; filename="ab.txt" foo --1234--
Decorative Section Separators1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMtornado/autoreload.py50# -----------------
Cross-Language Confusion1 hit · 2 pts
SeverityFileLineSnippet
HIGHtornado/web.py1987 * `.HTTPServerRequest.body` is undefined, and body arguments will not
Overly Generic Function Names4 hits · 2 pts
SeverityFileLineSnippet
LOWtornado/wsgi.py134 async def handle_request(self, request: httputil.HTTPServerRequest) -> None:
LOWtornado/test/httpserver_test.py1488 def handle_request(request):
LOWtornado/test/gen_test.py975 def do_something():
LOWtornado/test/gen_test.py1010 def do_something():
Slop Phrases1 hit · 1 pts
SeverityFileLineSnippet
MEDIUMtornado/routing.py64Here is a simple example of how we can we route to