AI Slop Code RIsk Monitor

bloomberg/memray

Memray is a memory profiler for Python

7.5 Moderate pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for bloomberg/memray, a Python project with 15,372 GitHub stars. SynthScan examined 81,907 lines of code across 263 source files, recording 632 pattern matches distributed across 13 syntactic categories. The legacy adjusted pattern signal is 7.5 (Moderate 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.

7.5
Adjusted Signal
7.5
Raw Pattern Score
100%
Time Factor
2026-10-10
Last Push
15.4K
Stars
Python
Language
81.9K
Lines of Code
263
Files
632
Pattern Hits
2026-10-12
Scan Date
0.01
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 27.6/100 · MEDIUM

Can maintainers explain intent, assumptions, and trade-offs? 574 finding(s).

Hallucinated Dependency & Supply Chain Risk 2.5/100 · LOW

Are imports declared and package/API names verified? 39 finding(s).

Agent Over-Engineering Ratio 24.8/100 · LOW

Are wrappers, guards, and repeated structures necessary? 501 finding(s).

PR Review Velocity Impact 33.6/100 · MEDIUM

Which changes need focused human review? 632 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

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.

Severity Breakdown

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.

CRITICAL 0HIGH 2MEDIUM 15LOW 615

Directory Score Breakdown

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.

Pattern Findings

The scanner identified 632 distinct pattern matches across 13 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.

Hyper-Verbose Identifiers480 hits · 421 pts
SeverityFileLineSnippetContext
LOWtests/test_utils.py10 def test_filters_for_valloc_and_free(self):CODE
LOWtests/test_utils.py21 def test_filters_based_on_addresses(self):CODE
LOWtests/test_utils.py33 def test_free_records_with_valid_addresses_that_dont_match_do_not_appear(self):CODE
LOWtests/test_utils.py47 def test_free_records_with_unmatched_addresses_do_not_appear(self):CODE
LOWtests/test_utils.py63 def test_holds_values_at_correct_names(self):CODE
LOWtests/conftest.py55def pytest_collection_modifyitems(config, items):CODE
LOWtests/utils.py16def filter_relevant_allocations(records, ranged=False):CODE
LOWtests/utils.py33def filter_relevant_pymalloc_allocations(records, size):CODE
LOWtests/unit/test_stats_reporter.py22def _generate_mock_allocations(CODE
LOWtests/unit/test_stats_reporter.py174def test_get_histogram_databins():CODE
LOWtests/unit/test_stats_reporter.py209def test_get_histogram_databins_rounding():CODE
LOWtests/unit/test_stats_reporter.py243def test_get_histogram_over_bound():CODE
LOWtests/unit/test_stats_reporter.py271def test_get_histogram_all_allocations_same_size():CODE
LOWtests/unit/test_stats_reporter.py293def test_get_histogram_databins_invalid_bins():CODE
LOWtests/unit/test_stats_reporter.py337def test_draw_histogram_smaller_scale_factor():CODE
LOWtests/unit/test_stats_reporter.py377def test_draw_histogram_invalid_input():CODE
LOWtests/unit/test_stats_reporter.py509def test_stats_terminal_skips_empty_modules(empty_module_stats):CODE
LOWtests/unit/test_stats_reporter.py518def test_stats_json_includes_empty_module_list(empty_module_stats, tmp_path):CODE
LOWtests/unit/test_reader.py12def test_rejects_different_header_magic(tmp_path):CODE
LOWtests/unit/test_reader.py33def test_rejects_different_header_version(tmp_path):CODE
LOWtests/unit/test_reader.py54def test_filereader_fails_to_open_file(tmp_path):CODE
LOWtests/unit/test_templates.py22def test_title_for_regular_report(kind, show_memory_leaks, inverted, expected):CODE
LOWtests/unit/test_templates.py35def test_html_report_escaping(kind):CODE
LOWtests/unit/test_high_water_mark_aggregator.py31def contribution_by_location_and_allocator(allocations):CODE
LOWtests/unit/test_high_water_mark_aggregator.py44def test_no_allocations_at_start():CODE
LOWtests/unit/test_high_water_mark_aggregator.py56def test_one_allocation_is_both_high_water_mark_and_leaked():CODE
LOWtests/unit/test_high_water_mark_aggregator.py77def test_one_freed_allocation_is_high_water_mark_but_not_leaked():CODE
LOWtests/unit/test_high_water_mark_aggregator.py101def test_zero_byte_allocation():CODE
LOWtests/unit/test_high_water_mark_aggregator.py123def test_freeing_one_of_two_high_water_mark_allocations_at_the_same_location():CODE
LOWtests/unit/test_high_water_mark_aggregator.py148def test_freeing_one_of_two_high_water_mark_allocations_at_different_locations():CODE
LOWtests/unit/test_high_water_mark_aggregator.py180def test_allocation_freed_before_high_water_mark():CODE
LOWtests/unit/test_high_water_mark_aggregator.py205def test_allocation_made_and_leaked_after_high_water_mark():CODE
LOWtests/unit/test_high_water_mark_aggregator.py237def test_allocation_made_and_freed_after_high_water_mark():CODE
LOWtests/unit/test_high_water_mark_aggregator.py271def test_allocation_made_and_freed_between_high_water_marks():CODE
LOWtests/unit/test_high_water_mark_aggregator.py309def test_allocation_made_between_high_water_marks_and_freed_after_high_water_mark():CODE
LOWtests/unit/test_high_water_mark_aggregator.py348def test_allocation_made_between_high_water_marks_and_leaked():CODE
LOWtests/unit/test_high_water_mark_aggregator.py381def test_different_allocators_at_one_location():CODE
LOWtests/unit/test_high_water_mark_aggregator.py407def test_same_stack_in_different_threads():CODE
LOWtests/unit/test_high_water_mark_aggregator.py439def test_completely_freed_range():CODE
LOWtests/unit/test_high_water_mark_aggregator.py487def test_shrunk_then_freed_range():CODE
LOWtests/unit/test_high_water_mark_aggregator.py538def test_split_then_freed_range():CODE
LOWtests/unit/test_high_water_mark_aggregator.py565def test_reporting_on_true_high_water_mark_that_was_in_a_past_snapshot():CODE
LOWtests/unit/test_high_water_mark_aggregator.py609def test_one_allocation_before_first_snapshot():CODE
LOWtests/unit/test_high_water_mark_aggregator.py632def test_one_allocation_after_first_snapshot():CODE
LOWtests/unit/test_high_water_mark_aggregator.py656def test_one_allocation_freed_at_high_water_mark_in_second_snapshot():CODE
LOWtests/unit/test_high_water_mark_aggregator.py682def test_two_allocations_in_different_snapshots():CODE
LOWtests/unit/test_high_water_mark_aggregator.py720def test_one_allocation_freed_before_high_water_mark_in_second_snapshot():CODE
LOWtests/unit/test_high_water_mark_aggregator.py760def test_allocations_freed_over_two_snapshots():CODE
LOWtests/unit/test_high_water_mark_aggregator.py792def test_allocations_freed_over_two_non_adjacent_snapshots():CODE
LOWtests/unit/test_high_water_mark_aggregator.py826def test_allocation_after_high_water_mark_in_current_snapshot():CODE
LOWtests/unit/test_high_water_mark_aggregator.py853def test_allocation_after_high_water_mark_in_historical_snapshot():CODE
LOWtests/unit/test_high_water_mark_aggregator.py881def test_allocation_and_deallocation_after_high_water_mark():CODE
LOWtests/unit/test_high_water_mark_aggregator.py912def test_allocation_and_deallocation_across_multiple_snapshots():CODE
LOWtests/unit/test_high_water_mark_aggregator.py946def test_allocation_and_deallocation_across_multiple_snapshots_with_other_allocators():CODE
LOWtests/unit/test_transform_reporter.py66 def test_single_native_allocation(self):CODE
LOWtests/unit/test_transform_reporter.py100 def test_multiple_allocations(self):CODE
LOWtests/unit/test_transform_reporter.py241 def test_single_native_allocation(self):CODE
LOWtests/unit/test_transform_reporter.py271 def test_multiple_allocations(self):CODE
LOWtests/unit/test_transform_reporter.py344 def test_multiple_stack_frames(self):CODE
LOWtests/unit/test_transform_reporter.py418 def test_stacks_are_written_root_to_leaf(self):CODE
420 more matches not shown…
Over-Commented Block44 hits · 44 pts
SeverityFileLineSnippetContext
LOWCMakeLists.txt41add_compile_definitions(_FILE_OFFSET_BITS=64)COMMENT
LOWasv.conf.json21 // Customizable commands for building, installing, andCOMMENT
LOWasv.conf.json41COMMENT
LOWasv.conf.json61 // dependency packages in the specified orderCOMMENT
LOWasv.conf.json81 // from the set to test. Each entry is a dictionary containing additionalCOMMENT
LOWasv.conf.json101 // "exclude": [COMMENT
LOWasv.conf.json121 // The directory (relative to the current directory) that raw benchmarkCOMMENT
LOWasv.conf.json141 // regressions. The default is to start from the first commitCOMMENT
LOWtests/integration/native_extension/native_ext.c1#define PY_SSIZE_T_CLEANCOMMENT
LOWdocs/conf.py81# -- Improving man page generation ----------------------------------------------------COMMENT
LOWbenchmarks/benchmarking/cases/regex_v8_base.py1# Copyright 2009 the V8 project authors. All rights reserved.COMMENT
LOWbenchmarks/benchmarking/cases/regex_v8_base.py21# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTCOMMENT
LOWbenchmarks/benchmarking/cases/go_base.py421# text = input('?').strip()COMMENT
LOWbenchmarks/benchmarking/cases/regex_v8_memray.py1# Copyright 2009 the V8 project authors. All rights reserved.COMMENT
LOWbenchmarks/benchmarking/cases/regex_v8_memray.py21# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTCOMMENT
LOWbenchmarks/benchmarking/cases/go_memray.py421COMMENT
LOW…arking/cases/docutils_data/docs/dev/enthought-plan.txt181Python doesn't have multi-line comments; only single-line. A similarCOMMENT
LOWsrc/memray/commands/attach.py501COMMENT
LOWsrc/memray/_memray/source.cpp1#define PY_SSIZE_T_CLEANCOMMENT
LOWsrc/memray/_memray/record_reader.cpp1#define __STDC_FORMAT_MACROSCOMMENT
LOWsrc/memray/_memray/sink.cpp1#define PY_SSIZE_T_CLEANCOMMENT
LOWsrc/memray/_memray/hooks.h1#pragma onceCOMMENT
LOWsrc/memray/_memray/hooks.h21#include <dlfcn.h>COMMENT
LOWsrc/memray/_memray/macho_shenanigans.cpp81}COMMENT
LOWsrc/memray/_memray/macho_shenanigans.cpp101 // This means that the address of the GOT entry can be calculated as:COMMENT
LOWsrc/memray/_memray/macho_shenanigans.cpp181 static_assert(1 << 12 == 4 * 1024);COMMENT
LOWsrc/memray/_memray/elf_utils.h1#pragma onceCOMMENT
LOWsrc/memray/_memray/record_writer.cpp1#include "record_writer.h"COMMENT
LOWsrc/memray/_memray/record_writer.cpp101 int d_version{CURRENT_HEADER_VERSION};COMMENT
LOWsrc/memray/_memray/record_writer.cpp401 // ALLOCATION ENCODING: 0b1ppppaaaCOMMENT
LOWsrc/memray/_memray/record_reader.h1#pragma onceCOMMENT
LOWsrc/memray/_memray/tracking_api.cpp1#define PY_SSIZE_T_CLEANCOMMENT
LOWsrc/memray/_memray/tracking_api.cpp161// constructed. That's normally great, but we need to prevent that fromCOMMENT
LOWsrc/memray/_memray/tracking_api.cpp221 // Threads' initial stacks can have calls to sys.settrace tracingCOMMENT
LOWsrc/memray/_memray/snapshot.cpp361{COMMENT
LOWsrc/memray/_memray/tracking_api.h1#pragma onceCOMMENT
LOWsrc/memray/_memray/tracking_api.h21#include <unwind.h>COMMENT
LOWsrc/memray/_memray/native_resolver.h1#pragma onceCOMMENT
LOWsrc/memray/_memray/macho_utils.h1#pragma onceCOMMENT
LOWsrc/memray/_memray/lz4_stream.h1// Copyright (c) 2015, Kasper Laudrup <laudrup@stacktrace.dk>COMMENT
LOWsrc/memray/_memray/lz4_stream.h21// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FORCOMMENT
LOWsrc/memray/_memray/snapshot.h1#pragma onceCOMMENT
LOWsrc/memray/_memray/records.h1#pragma onceCOMMENT
LOWsrc/memray/_memray/records.h21const int CURRENT_HEADER_VERSION = 13;COMMENT
Unused Imports35 hits · 35 pts
SeverityFileLineSnippetContext
LOWbenchmarks/benchmarking/cases/raytrace_memray.py15CODE
LOWbenchmarks/benchmarking/cases/json_dumps_base.py2CODE
LOWbenchmarks/benchmarking/cases/docutils_html_base.py7CODE
LOWbenchmarks/benchmarking/cases/docutils_html_base.py12CODE
LOWsrc/memray/_metadata.py1CODE
LOWsrc/memray/__init__.py1CODE
LOWsrc/memray/__init__.py2CODE
LOWsrc/memray/__init__.py3CODE
LOWsrc/memray/__init__.py4CODE
LOWsrc/memray/__init__.py5CODE
LOWsrc/memray/__init__.py6CODE
LOWsrc/memray/__init__.py7CODE
LOWsrc/memray/__init__.py8CODE
LOWsrc/memray/__init__.py9CODE
LOWsrc/memray/__init__.py10CODE
LOWsrc/memray/__init__.py11CODE
LOWsrc/memray/__init__.py12CODE
LOWsrc/memray/__init__.py13CODE
LOWsrc/memray/__init__.py14CODE
LOWsrc/memray/__init__.py15CODE
LOWsrc/memray/__init__.py16CODE
LOWsrc/memray/_test.py4CODE
LOWsrc/memray/_test.py5CODE
LOWsrc/memray/_test.py6CODE
LOWsrc/memray/_test.py7CODE
LOWsrc/memray/_test.py8CODE
LOWsrc/memray/_test.py9CODE
LOWsrc/memray/_test.py10CODE
LOWsrc/memray/_test.py11CODE
LOWsrc/memray/_test.py12CODE
LOWsrc/memray/_test.py13CODE
LOWsrc/memray/_test.py14CODE
LOWsrc/memray/_test.py15CODE
LOWsrc/memray/commands/attach.py1CODE
LOWsrc/memray/reporters/tree.py18CODE
Deep Nesting29 hits · 29 pts
SeverityFileLineSnippetContext
LOWtests/utils.py16CODE
LOWtests/utils.py33CODE
LOWtests/integration/test_native_tracking.py23CODE
LOWtests/integration/test_socket.py362CODE
LOWtests/integration/test_attach.py170CODE
LOWbenchmarks/benchmarking/cases/meteor_context_base.py113CODE
LOWbenchmarks/benchmarking/cases/meteor_context_base.py157CODE
LOWbenchmarks/benchmarking/cases/meteor_context_memray.py117CODE
LOWbenchmarks/benchmarking/cases/meteor_context_memray.py161CODE
LOWbenchmarks/benchmarking/cases/hexion_base.py234CODE
LOWbenchmarks/benchmarking/cases/hexion_base.py374CODE
LOWbenchmarks/benchmarking/cases/hexion_base.py148CODE
LOWbenchmarks/benchmarking/cases/go_base.py43CODE
LOWbenchmarks/benchmarking/cases/go_base.py69CODE
LOWbenchmarks/benchmarking/cases/go_base.py240CODE
LOWbenchmarks/benchmarking/cases/go_base.py258CODE
LOWbenchmarks/benchmarking/cases/hexion_memray.py237CODE
LOWbenchmarks/benchmarking/cases/hexion_memray.py377CODE
LOWbenchmarks/benchmarking/cases/hexion_memray.py151CODE
LOWbenchmarks/benchmarking/cases/go_memray.py47CODE
LOWbenchmarks/benchmarking/cases/go_memray.py73CODE
LOWbenchmarks/benchmarking/cases/go_memray.py244CODE
LOWbenchmarks/benchmarking/cases/go_memray.py262CODE
LOWbenchmarks/benchmarking/cases/telco_memray.py35CODE
LOWsrc/memray/_ipython/flamegraph.py141CODE
LOWsrc/memray/commands/run.py39CODE
LOWsrc/memray/commands/run.py112CODE
LOWsrc/memray/commands/common.py144CODE
LOWsrc/memray/reporters/frame_tools.py42CODE
Self-Referential Comments7 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUMtests/unit/test_reader.py18 # Create a valid allocation record fileCOMMENT
MEDIUMtests/unit/test_reader.py39 # Create a valid allocation record fileCOMMENT
MEDIUMtests/integration/test_object_tracking.py9# Define a decorator for tests that require Python 3.13+COMMENT
MEDIUMtests/integration/test_object_tracking.py15# Define a decorator for tests that verify version-check errors on older PythonCOMMENT
MEDIUMtests/integration/test_object_tracking.py49 # Create a tracker without reference tracking (should work on all versions)COMMENT
MEDIUMtests/integration/test_object_tracking.py65 # Create a tracker without reference trackingCOMMENT
MEDIUMtests/integration/test_object_tracking.py298 # Create an object in this threadCOMMENT
Decorative Section Separators5 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUM…rks/benchmarking/cases/docutils_data/docs/dev/todo.txt807 # =================COMMENT
MEDIUM⚡src/memray/_memray/record_writer.cpp404 // ┌─┬─────┬─────┐COMMENT
MEDIUM⚡src/memray/_memray/record_writer.cpp406 // └─┴─────┴─────┘COMMENT
MEDIUM⚡src/memray/_memray/record_writer.cpp411 // │ └──────── Pointer cache index (0-15):COMMENT
MEDIUM⚡src/memray/_memray/record_writer.cpp414 // └──────────── Record type marker (always 1 for ALLOCATION)COMMENT
Empty Error Handlers2 hits · 10 pts
SeverityFileLineSnippetContext
HIGHtests/unit/test_reader.py62except OSError:CODE
HIGHbenchmarks/benchmarking/cases/docutils_html_base.py17except ImportError:CODE
Modern Structural Boilerplate8 hits · 8 pts
SeverityFileLineSnippetContext
LOWsrc/memray/__init__.py18__all__ = [CODE
LOWsrc/memray/_test.py65__all__ = [CODE
LOWsrc/memray/_ipython/__init__.py10__all__ = ["load_ipython_extension"]CODE
LOWsrc/memray/commands/__init__.py14__all__ = ["get_argument_parser", "main"]CODE
LOWsrc/memray/reporters/tree.py95 async def update_text_area(self) -> None:CODE
LOWsrc/memray/reporters/_textual_hacks.py23def update_key_description(bindings: Bindings, key: str, description: str) -> None:CODE
LOWsrc/memray/reporters/tui.py561 def update_label(self) -> None:CODE
LOWsrc/memray/reporters/tui.py619 def update_sort_key(self, col_number: int) -> None:CODE
Overly Generic Function Names9 hits · 7 pts
SeverityFileLineSnippetContext
LOWtests/integration/test_tracking.py836 def test_function():CODE
LOWtests/integration/test_tracking.py877 def test_function():CODE
LOWtests/integration/test_tracking.py909 def test_function():CODE
LOWtests/integration/test_tracking.py1007 def test_function():CODE
LOWtests/integration/test_tracking.py1032 def test_function():CODE
LOWtests/integration/test_tracking.py485 def test_function():STRING
LOWtests/integration/test_tracking.py522 def test_function():STRING
LOWtests/integration/test_tracking.py560 def test_function():STRING
LOWdocs/tutorials/exercise_2/holding_onto_memory.py35def process_data() -> np.ndarray:CODE
Fake / Example Data4 hits · 6 pts
SeverityFileLineSnippetContext
LOW…mray/reporters/templates/assets/temporal_flamegraph.js9 */t=e.nmd(t),function(){var i,o="Expected a function",u="__lodash_hash_undefined__",a="__lodash_placeholder__",c=16,l=3COMMENT
LOWsrc/memray/reporters/templates/assets/table.js9 */n=r.nmd(n),function(){var u,i="Expected a function",o="__lodash_hash_undefined__",a="__lodash_placeholder__",f=16,c=3COMMENT
LOWsrc/memray/reporters/templates/assets/flamegraph.js9 */t=e.nmd(t),function(){var i,o="Expected a function",u="__lodash_hash_undefined__",a="__lodash_placeholder__",c=16,f=3COMMENT
LOW…memray/reporters/templates/assets/flamegraph_common.js9 */t=r.nmd(t),function(){var i,u="Expected a function",o="__lodash_hash_undefined__",a="__lodash_placeholder__",f=16,c=3COMMENT
AI Slop Vocabulary3 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMpackage-lock.json6293 "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz",CODE
MEDIUMpackage-lock.json11859 "resolved": "https://registry.npmjs.org/robust-predicates/-/robust-predicates-3.0.2.tgz",CODE
LOWsrc/memray/_ipython/flamegraph.py152 # It already printed a message, just return control to IPython.COMMENT
Excessive Try-Catch Wrapping4 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/integration/test_attach.py195 except Exception:STRING
LOWsrc/memray/commands/attach.py284 except Exception as exc:CODE
LOWsrc/memray/commands/attach.py299 except Exception as exc:STRING
MEDIUMsrc/memray/commands/attach.py281def thread_body():CODE
AI Structural Patterns2 hits · 2 pts
SeverityFileLineSnippetContext
LOWtests/unit/test_tui_reporter.py161CODE
LOW…/tutorials/solutions/exercise_2/holding_onto_memory.py56CODE