Lightweight Ruby
This report presents the forensic synthetic code analysis of mruby/mruby, a C project with 5,590 GitHub stars. SynthScan v2.0 examined 174,609 lines of code across 630 source files, recording 508 pattern matches distributed across 10 syntactic categories. The overall adjusted score of 3.3 places this repository in the Likely human-written band.
The scanner applied 160+ deterministic lexical heuristics, multi-line block detectors, abstract syntax tree depth profilers, and a cross-file Jaccard similarity matrix to construct a statistically normalised synthetic code estimate. All matches are individually weighted by severity coefficient and contextual multiplier before summation, and the resulting headline score is temporally discounted to account for the repository's development history relative to the commercial emergence of large language model coding tooling (November 2022 onward).
This chart maps the temporal evolution of the adjusted synthetic code score across successive scan runs. An upward trajectory indicates ongoing incorporation of AI-generated code or expanding LLM-assisted scaffolding; a stable or declining trajectory may reflect active human refactoring, code removal, or the adoption of stricter authorship policies. The dashed secondary line (right axis) independently tracks total raw pattern hit count, which can diverge from the normalised score when codebase size changes significantly between scans.
Classifies detected patterns by their diagnostic confidence and structural impact. CRITICAL patterns (coefficient 10) represent definitive synthetic signatures — hallucinated imports, explicit LLM attribution metadata — virtually never produced by human authors. HIGH (5) indicates strong structural tells such as cross-file repetition or cross-linguistic idioms. MEDIUM (2) covers recognisable conversational padding and AI-specific vocabulary. LOW (1) captures subtle indicators like tautological comments and generic boilerplate that require density to carry independent signal.
This horizontal bar chart decomposes the repository's raw synthetic code score by top-level directory, allowing you to pinpoint precisely which modules or components carry the highest AI authorship density. Directories with disproportionately high scores relative to their size warrant targeted manual review: concentrated AI signatures often trace back to mass-generated configuration layers, auto-ported test suites, LLM-scaffolded boilerplate classes, or entire subsystems authored under heavy copilot assistance. Use this view to prioritise your human code-review effort.
The scanner identified 508 distinct pattern matches across 10 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a statistically significant AI authorship indicator. 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 diagnostic confidence level (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — comment-context matches receive a ×1.5 weight because LLMs systematically over-annotate. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier as dense clusters constitute far stronger evidence of synthetic authorship than isolated hits.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | build_config.rb | 1 | # The default build configuration file was moved to `build_config/default.rb`. | COMMENT |
| LOW | benchmark/vm_optimization_bench.rb | 1 | # VM Optimization Benchmarks for mruby | COMMENT |
| LOW | mrblib/compar.rb | 1 | ## | COMMENT |
| LOW | mrblib/compar.rb | 41 | ## | COMMENT |
| LOW | mrblib/compar.rb | 61 | # false. | COMMENT |
| LOW | mrblib/string.rb | 81 | # Replace all matches of `pattern` with `replacement`. | COMMENT |
| LOW | mrblib/string.rb | 161 | # those two methods requires Regexp that is optional in mruby | COMMENT |
| LOW | mrblib/enum.rb | 1 | ## | COMMENT |
| LOW | mrblib/enum.rb | 21 | # if one block value is false. Otherwise | COMMENT |
| LOW | mrblib/enum.rb | 161 | # Return true if at least one element which | COMMENT |
| LOW | mrblib/enum.rb | 321 | # ISO 15.3.2.2.18 | COMMENT |
| LOW | mrblib/array.rb | 1 | ## | COMMENT |
| LOW | mrblib/array.rb | 61 | while idx < len | COMMENT |
| LOW | mrblib/array.rb | 81 | # array.sort {|a, b| ... } -> new_array | COMMENT |
| LOW | mrblib/numeric.rb | 1 | ## | COMMENT |
| LOW | mrblib/hash.rb | 1 | ## | COMMENT |
| LOW | mrblib/hash.rb | 21 | # was found. Return nil if nothing was | COMMENT |
| LOW | mrblib/hash.rb | 41 | # and pass the key and value of each element. | COMMENT |
| LOW | mrblib/hash.rb | 61 | while i < len | COMMENT |
| LOW | mrblib/hash.rb | 81 | # <em>produces:</em> | COMMENT |
| LOW | mrblib/hash.rb | 101 | # If no block is given, an enumerator is returned instead. | COMMENT |
| LOW | mrblib/hash.rb | 121 | # hsh.merge(other_hash..) -> hsh | COMMENT |
| LOW | mrblib/hash.rb | 181 | end | COMMENT |
| LOW | mrblib/hash.rb | 261 | end | COMMENT |
| LOW | mrblib/range.rb | 1 | ## | COMMENT |
| LOW | mrblib/kernel.rb | 1 | ## | COMMENT |
| LOW | test/assert.rb | 241 | unless ret = obj1.__send__(op, obj2) == affirmed | COMMENT |
| LOW | test/t/localjumperror.rb | 1 | ## | COMMENT |
| LOW | test/t/module.rb | 581 | # assert_separately [], %{ | COMMENT |
| LOW | test/t/module.rb | 601 | # a = c.new | COMMENT |
| LOW | test/t/module.rb | 621 | COMMENT | |
| LOW | test/t/regexperror.rb | 1 | ## | COMMENT |
| LOW | test/t/lang.rb | 1 | # The aim of these tests is to detect pitfall for optimized VM. | COMMENT |
| LOW | include/mruby.h | 41 | #endif | COMMENT |
| LOW | include/mruby.h | 61 | #define SIZE_MAX __SIZE_MAX__ | COMMENT |
| LOW | include/mruby.h | 81 | #if (defined __cplusplus && __cplusplus >= 201703L) | COMMENT |
| LOW | include/mruby.h | 121 | #define mrb_static_assert_powerof2(num) mrb_static_assert((num) > 0 && (num) == ((num) & -(num)), "need power of 2 for " | COMMENT |
| LOW | include/mruby.h | 1501 | MRB_API mrb_value mrb_obj_clone(mrb_state *mrb, mrb_value self); | COMMENT |
| LOW | include/mruby.h | 1541 | #define E_STANDARD_ERROR mrb->eStandardError_class | COMMENT |
| LOW | include/mrbconf.h | 41 | #if defined(MRB_USE_FLOAT32) && defined(MRB_NO_FLOAT) | COMMENT |
| LOW | include/mrbconf.h | 81 | Default for 64-bit CPU mode (unless using MRB_NAN_BOXING). */ | COMMENT |
| LOW | include/mrbconf.h | 181 | COMMENT | |
| LOW | include/mrbconf.h | 221 | COMMENT | |
| LOW | include/mrbconf.h | 241 | # ifndef MRB_METHOD_CACHE_SIZE | COMMENT |
| LOW | include/mruby/dump.h | 41 | #define MRB_DUMP_WRITE_FAULT (-2) | COMMENT |
| LOW | include/mruby/version.h | 101 | MRUBY_RELEASE_DAY_STR | COMMENT |
| LOW | include/mruby/presym.h | 41 | #define MRB_SYM_E(name) MRB_SYM_E__##name | COMMENT |
| LOW | include/mruby/proc.h | 81 | #define MRB_PROC_CFUNC_FL 128 | COMMENT |
| LOW | include/mruby/proc.h | 181 | COMMENT | |
| LOW | include/mruby/boxing_no.h | 21 | mrb_sym sym; | COMMENT |
| LOW | include/mruby/boxing_no.h | 41 | (o).tt = ttt;\ | COMMENT |
| LOW | include/mruby/numeric.h | 21 | #define TYPED_FIXABLE(f,t) (TYPED_POSFIXABLE(f,t) && TYPED_NEGFIXABLE(f,t)) | COMMENT |
| LOW | include/mruby/numeric.h | 141 | # define MRB_FLT_MANT_DIG FLT_MANT_DIG | COMMENT |
| LOW | include/mruby/endian.h | 21 | # define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__ | COMMENT |
| LOW | include/mruby/value.h | 41 | # define TRUE true | COMMENT |
| LOW | include/mruby/value.h | 61 | # define PRIu64 "llu" | COMMENT |
| LOW | include/mruby/value.h | 81 | # define MRB_PRIo PRIo64 | COMMENT |
| LOW | include/mruby/value.h | 121 | # define vsnprintf(s, n, format, arg) mrb_msvc_vsnprintf(s, n, format, arg) | COMMENT |
| LOW | include/mruby/value.h | 201 | COMMENT | |
| LOW | include/mruby/value.h | 221 | # define MRB_SSIZE_MAX INTPTR_MAX | COMMENT |
| 380 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | benchmark/vm_optimization_bench.rb | 35 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 38 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 61 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 64 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 125 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 128 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 207 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 210 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 264 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 267 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 314 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 317 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 373 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 376 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 424 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 427 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 457 | #============================================================================= | COMMENT |
| MEDIUM | benchmark/vm_optimization_bench.rb | 459 | #============================================================================= | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | test/assert.rb | 54 | # Create the assertion in a readable way | COMMENT |
| MEDIUM⚡ | mrbgems/mruby-struct/src/struct.c | 252 | * # Create a structure with a name in Struct | COMMENT |
| MEDIUM⚡ | mrbgems/mruby-struct/src/struct.c | 256 | * # Create a structure named by its constant | COMMENT |
| MEDIUM⚡ | mrbgems/mruby-struct/src/struct.c | 260 | * # Create a structure with keyword initialization | COMMENT |
| MEDIUM | mrbgems/mruby-task/examples/statistics.rb | 29 | # Create a monitor task | COMMENT |
| MEDIUM | mrbgems/mruby-task/examples/simple.rb | 7 | # Create a simple task | COMMENT |
| MEDIUM | mrbgems/mruby-task/examples/suspend_resume.rb | 9 | # Create a worker task | COMMENT |
| MEDIUM | mrbgems/mruby-task/examples/suspend_resume.rb | 19 | # Create a controller task | COMMENT |
| MEDIUM | mrbgems/mruby-task/examples/inspection.rb | 29 | # Create an observer task | COMMENT |
| MEDIUM | mrbgems/mruby-data/src/data.c | 315 | * # Create a structure named by its constant | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | mrbgems/mruby-struct/src/struct.c | 262 | * User.new(id: 1, email: "user@example.com") | COMMENT |
| LOW⚡ | mrbgems/mruby-struct/src/struct.c | 263 | * #=> #<struct User id=1, email="user@example.com"> | COMMENT |
| LOW | mrbgems/mruby-struct/src/struct.c | 586 | * jane = Customer.new("Jane Doe", "456 Elm, Anytown NC", 12345) | COMMENT |
| LOW⚡ | mrbgems/mruby-data/README.md | 32 | customer1 = Customer.new("John Doe", "123 Main St", 12345) | CODE |
| LOW⚡ | mrbgems/mruby-data/README.md | 32 | customer1 = Customer.new("John Doe", "123 Main St", 12345) | CODE |
| LOW⚡ | mrbgems/mruby-data/README.md | 38 | customer2 = Customer.new(name: "Jane Doe", address: "456 Oak Ave", zip: 67890) | CODE |
| LOW | mrbgems/mruby-data/README.md | 49 | puts customer1.name # Output: "John Doe" | CODE |
| LOW | mrbgems/mruby-data/README.md | 78 | # Output: {:name=>"John Doe", :address=>"123 Main St", :zip=>12345} | COMMENT |
| LOW | mrbgems/mruby-data/README.md | 78 | # Output: {:name=>"John Doe", :address=>"123 Main St", :zip=>12345} | COMMENT |
| LOW⚡ | mrbgems/mruby-data/README.md | 92 | puts customer1 # Output: #<data Customer name="John Doe", address="123 Main St", zip=12345> | CODE |
| LOW⚡ | mrbgems/mruby-data/README.md | 92 | puts customer1 # Output: #<data Customer name="John Doe", address="123 Main St", zip=12345> | CODE |
| LOW⚡ | mrbgems/mruby-data/README.md | 93 | p customer1 # Output: #<data Customer name="John Doe", address="123 Main St", zip=12345> | CODE |
| LOW⚡ | mrbgems/mruby-data/README.md | 93 | p customer1 # Output: #<data Customer name="John Doe", address="123 Main St", zip=12345> | CODE |
| LOW | mrbgems/mruby-data/src/data.c | 220 | * Customer.new("Joe", "123 Main St", 12345) | COMMENT |
| LOW | mrbgems/mruby-data/src/data.c | 221 | * Customer.new(name: "Joe", address: "123 Main St", zip: 12345) | COMMENT |
| LOW | mrbgems/mruby-data/src/data.c | 394 | * customer = Customer.new("Joe", "123 Main St", 12345) | COMMENT |
| LOW | mrbgems/mruby-data/src/data.c | 426 | * jane = Customer.new("Jane Doe", "456 Elm, Anytown NC", 12345) | COMMENT |
| LOW | doc/guides/mrbgems.md | 278 | spec.author = 'John Doe' | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW⚡ | test/assert.rb | 332 | def assert_raise_with_message(*args, &block) | CODE |
| LOW⚡ | test/assert.rb | 335 | def assert_raise_with_message_pattern(*args, &block) | CODE |
| LOW⚡ | test/assert.rb | 338 | def _assert_raise_with_message(type, exc, exp_msg, msg = nil, &block) | CODE |
| LOW | test/t/module.rb | 24 | def assert_uninitialized_const(&block) | CODE |
| LOW | mrbgems/mruby-io/test/file.rb | 6 | def assert_dirname_with_level(path, results) | CODE |
| LOW | mrbgems/mruby-array-ext/test/array.rb | 4 | def assert_permutation_combination(exp, receiver, meth, *args) | CODE |
| LOW | mrbgems/mruby-array-ext/test/array.rb | 21 | def assert_repeated_permutation(exp, receiver, *args) | CODE |
| LOW | mrbgems/mruby-array-ext/test/array.rb | 25 | def assert_repeated_combination(exp, receiver, *args) | CODE |
| LOW | lib/mruby/amalgam.rb | 644 | def write_static_rename_cleanup(f, collisions) | CODE |
| LOW | lib/mruby/amalgam.rb | 780 | def opcode_macro_reconciliation(header) | CODE |
| LOW | lib/mruby/amalgam.rb | 794 | def transform_source_includes(content, source_dir = nil) | CODE |
| LOW | lib/mruby/build.rb | 430 | def define_installer_if_needed(bin) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | mrbgems/mruby-pack/test/pack.rb | 66 | # Check if last two characters are backtick and newline | COMMENT |
| LOW | scripts/check_makefiles_for_tabs.sh | 5 | # Check if the file exists and is a regular file | COMMENT |
| LOW | lib/mruby/amalgam.rb | 901 | # Check if header was already processed | COMMENT |
| LOW | lib/mruby/amalgam.rb | 912 | # Check if this is an mruby header that should be inlined/transformed | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | doc/guides/rom-method-table.md | 75 | ### Step 1: Define the Static Data | COMMENT |
| LOW | doc/guides/rom-method-table.md | 90 | ### Step 2: Register in the Init Function | COMMENT |
| LOW | doc/guides/rom-method-table.md | 107 | ### Step 3: Verify | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | mrbgems/mruby-proc-ext/mrblib/proc.rb | 46 | # Instances of class Proc simply return themselves. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | build_config/cosmopolitan.rb | 15 | # Usage: | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | src/gc.c | 628 | arguments. Don't forget to remove the object using | CODE |