Python Cheat Sheet
This report summarizes scanner evidence for crazyguitar/pysheeet, a Python project with 8,159 GitHub stars. SynthScan examined 14,928 lines of code across 84 source files, recording 142 pattern matches distributed across 12 syntactic categories. The legacy adjusted pattern signal is 18.5 (Elevated pattern signal); it is not an authorship estimate.
Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.
Use each vector to guide manual verification of the underlying findings.
Can maintainers explain intent, assumptions, and trade-offs? 73 finding(s).
Are imports declared and package/API names verified? 59 finding(s).
Are wrappers, guards, and repeated structures necessary? 62 finding(s).
Which changes need focused human review? 142 finding(s).
This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.
Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.
This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.
The scanner identified 142 distinct pattern matches across 12 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. Expand any category row to inspect the individual file paths, line numbers, code snippets, and the lexical context (CODE, COMMENT, or STRING) in which each match was detected.
Reading the findings table: The Severity column indicates the configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH⚡ | src/basic/heap.py | 258 | h.push("a", 3) | CODE |
| HIGH⚡ | src/basic/heap.py | 259 | h.push("b", 1) | CODE |
| HIGH⚡ | src/basic/heap.py | 260 | h.push("c", 2) | CODE |
| HIGH⚡ | src/basic/heap.py | 265 | h.push("task1", 3) | CODE |
| HIGH⚡ | src/basic/heap.py | 266 | h.push("task2", 1) | CODE |
| HIGH⚡ | src/basic/heap.py | 267 | h.push("task1", 0) # update priority | CODE |
| HIGH⚡ | src/basic/list.py | 181 | s.push(1) | CODE |
| HIGH⚡ | src/basic/list.py | 182 | s.push(2) | CODE |
| HIGH⚡ | src/basic/list.py | 188 | s.push(1) | CODE |
| HIGH⚡ | src/basic/list.py | 195 | s.push(1) | CODE |
| HIGH | src/basic/typing_.py | 202 | s.push(1) | CODE |
| HIGH | src/basic/typing_.py | 203 | s.push(2) | CODE |
| HIGH | src/cext/test_cext.py | 8 | mkdir build && cd build && cmake .. && make | STRING |
| HIGH⚡ | src/cext/test_cext.py | 85 | assert abs(v.length() - 5.0) < 1e-10 | CODE |
| HIGH⚡ | src/cext/test_cext.py | 88 | assert v.length() == 0 | CODE |
| HIGH⚡ | src/cext/test_cext.py | 98 | assert abs(n.length() - 1.0) < 1e-10 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | app_test.py | 62 | def test_index_redirection_req(self): | CODE |
| LOW | app_test.py | 152 | def test_legacy_rtd_path_redirect(self): | CODE |
| LOW⚡ | app_test.py | 169 | def test_redirect_legacy_rtd_paths_passthrough(self): | CODE |
| LOW⚡ | app_test.py | 174 | def test_redirect_legacy_rtd_paths_match(self): | CODE |
| LOW⚡ | app_test.py | 181 | def test_resolve_legacy_flat_target_known(self): | CODE |
| LOW⚡ | app_test.py | 231 | def test_resolve_legacy_flat_target_unknown(self): | CODE |
| LOW⚡ | app_test.py | 241 | def test_redirect_legacy_flat_paths_passthrough(self): | CODE |
| LOW⚡ | app_test.py | 246 | def test_redirect_legacy_flat_paths_match(self): | CODE |
| LOW | app_test.py | 257 | def test_redirect_canonical_host_bare(self): | CODE |
| LOW | app_test.py | 271 | def test_redirect_canonical_host_preserves_query(self): | CODE |
| LOW | app_test.py | 284 | def test_redirect_canonical_host_passthrough(self): | CODE |
| LOW | app.py | 134 | def _resolve_legacy_flat_target(path): | CODE |
| LOW | app.py | 223 | def redirect_legacy_rtd_paths(): | CODE |
| LOW | app.py | 231 | def redirect_legacy_flat_paths(): | CODE |
| LOW | src/security/vulnerability_.py | 69 | def test_vulnerable_query_building(self): | CODE |
| LOW | src/security/vulnerability_.py | 101 | def test_vulnerable_shell_command(self): | CODE |
| LOW | src/security/vulnerability_.py | 136 | def test_pickle_code_execution(self): | CODE |
| LOW | src/security/vulnerability_.py | 169 | def test_environment_variables(self): | CODE |
| LOW | src/security/vulnerability_.py | 189 | def test_ecb_mode_pattern_leak(self): | CODE |
| LOW | src/security/vulnerability_.py | 212 | def test_cbc_needs_authentication(self): | CODE |
| LOW | src/security/vulnerability_.py | 240 | def test_secure_password_hash(self): | CODE |
| LOW | src/basic/object.py | 364 | def test_abstract_instantiation(self): | CODE |
| LOW | src/basic/fileio_.py | 253 | def test_zipfile_create_extract(tmp_path): | CODE |
| LOW | src/basic/fileio_.py | 346 | def test_shutil_copytree_ignore(tmp_path): | CODE |
| LOW | src/basic/fileio_.py | 362 | def test_shutil_copytree_dirs_exist_ok(tmp_path): | CODE |
| LOW | src/basic/fileio_.py | 450 | def test_shutil_unpack_archive(tmp_path): | CODE |
| LOW | src/basic/asyncio_.py | 58 | def test_wait_first_completed(self): | CODE |
| LOW | src/basic/asyncio_.py | 132 | def test_async_context_manager(self): | CODE |
| LOW | src/basic/asyncio_.py | 154 | def test_asynccontextmanager_decorator(self): | CODE |
| LOW | src/basic/asyncio_.py | 299 | def test_gather_return_exceptions(self): | CODE |
| LOW⚡ | src/basic/sqlalchemy_core.py | 46 | def test_create_sqlite_memory(self): | CODE |
| LOW | src/basic/socket_.py | 17 | def test_gethostbyname_localhost(self): | CODE |
| LOW | src/basic/concurrency_.py | 52 | def test_thread_with_return_value(self): | CODE |
| LOW | src/basic/concurrency_.py | 398 | def test_basic_producer_consumer(self): | CODE |
| LOW | src/basic/cext_.py | 297 | def test_python_fib_iterative(self): | CODE |
| LOW | src/basic/unicode_.py | 87 | def test_encode_errors_ignore(self): | CODE |
| LOW | src/basic/unicode_.py | 90 | def test_encode_errors_replace(self): | CODE |
| LOW | src/basic/unicode_.py | 121 | def test_normalization_equality(self): | CODE |
| LOW | src/basic/dict.py | 22 | def create_dict_comprehension(n: int) -> dict: | CODE |
| LOW | src/basic/dict.py | 76 | def dict_comprehension_filter(n: int) -> dict: | CODE |
| LOW | src/basic/future_.py | 94 | def test_annotations_are_strings(self): | CODE |
| LOW | src/basic/set.py | 36 | def set_comprehension_squares(n: int) -> set: | CODE |
| LOW | src/basic/set.py | 219 | def test_symmetric_difference(self): | CODE |
| LOW | src/basic/datetime_.py | 34 | def test_timestamp_conversion(): | CODE |
| LOW | src/basic/datetime_.py | 68 | def test_timedelta_arithmetic(): | CODE |
| LOW | src/basic/func.py | 231 | def test_keyword_only_default(self): | CODE |
| LOW | src/basic/crypto_.py | 89 | def test_hmac_tamper_detection(self): | CODE |
| LOW | src/basic/crypto_.py | 158 | def test_with_associated_data(self): | CODE |
| LOW | src/basic/crypto_.py | 238 | def test_oaep_encrypt_decrypt(self): | CODE |
| LOW | src/basic/crypto_.py | 329 | def test_hybrid_encrypt_decrypt(self): | CODE |
| LOW | src/cext/test_cext.py | 149 | def test_add_arrays_length_mismatch(self): | CODE |
| LOW | src/cext/test_cext.py | 173 | def test_slow_operation_parallel(self): | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | app.py | 19 | CODE | |
| LOW | src/llm/vllm/offline_bench.py | 25 | CODE | |
| LOW | src/llm/vllm/offline_bench.py | 28 | CODE | |
| LOW | src/security/vulnerability_.py | 116 | CODE | |
| LOW | src/basic/heap.py | 8 | CODE | |
| LOW | src/basic/list.py | 12 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 3 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 4 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 5 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 5 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 5 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 5 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 5 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 5 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 29 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 29 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 29 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 29 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 29 | CODE | |
| LOW | src/basic/sqlalchemy_core.py | 36 | CODE | |
| LOW | src/basic/socket_.py | 5 | CODE | |
| LOW | src/basic/socket_.py | 6 | CODE | |
| LOW | src/basic/generator.py | 10 | CODE | |
| LOW | src/basic/sqlalchemy_orm.py | 3 | CODE | |
| LOW | src/basic/sqlalchemy_orm.py | 4 | CODE | |
| LOW | src/basic/sqlalchemy_query.py | 3 | CODE | |
| LOW | src/basic/sqlalchemy_query.py | 4 | CODE | |
| LOW | src/basic/sqlalchemy_query.py | 20 | CODE | |
| LOW | src/basic/rexp.py | 9 | CODE | |
| LOW | src/basic/cext_.py | 10 | CODE | |
| LOW | src/basic/cext_.py | 13 | CODE | |
| LOW | src/basic/unicode_.py | 6 | CODE | |
| LOW | src/basic/dict.py | 6 | CODE | |
| LOW | src/basic/future_.py | 9 | CODE | |
| LOW | src/basic/typing_.py | 6 | CODE | |
| LOW | src/basic/typing_.py | 7 | CODE | |
| LOW | src/basic/func.py | 8 | CODE | |
| LOW | src/cext/test_cext.py | 11 | CODE | |
| LOW | src/cext/setup.py | 10 | CODE | |
| LOW | src/megatron/viztracer_plugin.py | 15 | CODE | |
| LOW | src/megatron/viztracer_plugin.py | 18 | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM⚡ | src/basic/sqlalchemy_core.py | 38 | # ============================================================================ | COMMENT |
| MEDIUM⚡ | src/basic/sqlalchemy_core.py | 40 | # ============================================================================ | COMMENT |
| MEDIUM | src/basic/sqlalchemy_orm.py | 27 | # ============================================================================ | COMMENT |
| MEDIUM | src/basic/sqlalchemy_orm.py | 29 | # ============================================================================ | COMMENT |
| MEDIUM | src/basic/sqlalchemy_query.py | 27 | # ============================================================================ | COMMENT |
| MEDIUM | src/basic/sqlalchemy_query.py | 29 | # ============================================================================ | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| HIGH | src/basic/asyncio_.py | 338 | except asyncio.CancelledError: | CODE |
| HIGH | src/basic/socket_.py | 216 | except OSError: | CODE |
| HIGH | src/basic/generator.py | 270 | except StopIteration: | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | docs/conf.py | 1 | # -*- coding: utf-8 -*- | COMMENT |
| LOW | docs/conf.py | 81 | # General information about the project. | COMMENT |
| LOW | docs/conf.py | 101 | language = 'en' | COMMENT |
| LOW | docs/conf.py | 121 | # unit titles (such as .. function::). | COMMENT |
| LOW | docs/conf.py | 221 | #html_domain_indices = True | COMMENT |
| LOW | docs/conf.py | 241 | #html_use_opensearch = '' | COMMENT |
| LOW | docs/conf.py | 261 | htmlhelp_basename = 'python-cheatsheetdoc' | COMMENT |
| LOW | docs/conf.py | 281 | # author, documentclass [howto, manual, or own class]). | COMMENT |
| LOW | src/llm/vllm/sweep.sh | 1 | #!/usr/bin/env bash | COMMENT |
| LOW | src/cpp_from_python/cpp_from_py.cpp | 1 | /* | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | docs/conf.py | 6 | # This file is execfile()d with the current directory set to its | COMMENT |
| MEDIUM | src/basic/dict.py | 11 | # Create a Dictionary | COMMENT |
| MEDIUM | src/basic/set.py | 9 | # Create a Set | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/nixl/bench.sh | 3 | # Usage: | COMMENT |
| LOW | src/llm/vllm/bench.sh | 3 | # Usage: | COMMENT |
| LOW | src/llm/vllm/sweep.sh | 8 | # Usage: | COMMENT |
| LOW | src/llm/vllm/offline_bench.sh | 3 | # Usage: | COMMENT |
| LOW | src/llm/tensorrt-llm/bench.sh | 4 | # Usage: | COMMENT |
| LOW | src/llm/sglang/bench.sh | 3 | # Usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/basic/rexp.py | 281 | assert find_before_at("user@example.com") == ["user"] | CODE |
| LOW | src/basic/rexp.py | 304 | assert is_valid_email("user@example.com") | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/llm/vllm/offline_bench.py | 328 | # Check if detailed metrics are available | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/security/vulnerability_.py | 144 | # For safety, we just return a harmless function | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/basic/object.py | 198 | except Exception: | CODE |