An opinionated framework for creating REST-like APIs in Ruby.
This report presents the forensic synthetic code analysis of ruby-grape/grape, a Ruby project with 9,996 GitHub stars. SynthScan v2.0 examined 47,580 lines of code across 338 source files, recording 86 pattern matches distributed across 8 syntactic categories. The overall adjusted score of 2.6 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 86 distinct pattern matches across 8 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 | .rubocop_todo.yml | 1 | # This configuration was generated by | COMMENT |
| LOW | benchmark/version_throughput/run.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/mountable.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/endpoint.rb | 41 | remove_method :temp_unbound_method | COMMENT |
| LOW | lib/grape/endpoint.rb | 61 | # @param anchor [Boolean] whether the route anchors to the whole path | COMMENT |
| LOW | lib/grape/middleware/versioner.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/middleware/precomputed_content_types.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/middleware/error.rb | 161 | COMMENT | |
| LOW | lib/grape/middleware/versioner/path.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/middleware/versioner/param.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/middleware/versioner/accept_version_header.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/middleware/versioner/header.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/validations/param_scope_tracker.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/validations/validations_spec.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/validations/types.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/validations/types.rb | 61 | # | COMMENT |
| LOW | lib/grape/validations/types.rb | 81 | # Does Grape provide special coercion and validation | COMMENT |
| LOW | lib/grape/validations/types.rb | 121 | array_or_set?(type) && type.length == 1 && (custom?(type.first) || special?(type.first)) | COMMENT |
| LOW | lib/grape/validations/types.rb | 141 | # specifies a custom type which implements requirments of | COMMENT |
| LOW | lib/grape/validations/coerce_options.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/validations/types/json.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | …/grape/validations/types/variant_collection_coercer.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | …pe/validations/types/custom_type_collection_coercer.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | …pe/validations/types/custom_type_collection_coercer.rb | 21 | # @param type [Class,#parse] | COMMENT |
| LOW | lib/grape/validations/types/multiple_type_coercer.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/validations/types/custom_type_coercer.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/validations/types/custom_type_coercer.rb | 21 | # that the coerced value produced above is in fact of the | COMMENT |
| LOW | lib/grape/validations/types/custom_type_coercer.rb | 41 | # and coercion method. | COMMENT |
| LOW | lib/grape/validations/validators/base.rb | 21 | # {Grape::Validations::SharedOptions} value object; no per-validator | COMMENT |
| LOW | lib/grape/dsl/helpers.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/dsl/version_options.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/dsl/routing.rb | 21 | inheritable_setting.namespace_inheritable[:cascade] = value | COMMENT |
| LOW | lib/grape/dsl/routing.rb | 41 | # get '/main' do | COMMENT |
| LOW | lib/grape/dsl/routing.rb | 161 | http_methods: :any, | COMMENT |
| LOW | lib/grape/dsl/entity.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/dsl/parameters.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/dsl/parameters.rb | 21 | # class API < Grape::API | COMMENT |
| LOW | lib/grape/dsl/parameters.rb | 41 | # helpers do | COMMENT |
| LOW | lib/grape/dsl/parameters.rb | 81 | # types that are supported automatically. Custom classes may be used | COMMENT |
| LOW | lib/grape/dsl/parameters.rb | 101 | # @option attrs :coerce_with [#parse, #call] method to be used when coercing | COMMENT |
| LOW | lib/grape/dsl/validations.rb | 21 | raise ArgumentError, 'Cannot inherit from contract, only schema' if block && contract.respond_to?(:schema) | COMMENT |
| LOW | lib/grape/dsl/desc.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/dsl/desc.rb | 21 | # endpoint may return, with their meanings, in a 2d array | COMMENT |
| LOW | lib/grape/dsl/desc.rb | 41 | # # ... | COMMENT |
| LOW | lib/grape/dsl/rescue_options.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/grape/dsl/inside_route.rb | 21 | # End the request and display an error to the | COMMENT |
| LOW | lib/grape/dsl/inside_route.rb | 101 | # Allows you to explicitly return no content. | COMMENT |
| LOW | lib/grape/dsl/inside_route.rb | 121 | # GET /file # => "contents of file" | COMMENT |
| LOW | lib/grape/dsl/request_response.rb | 61 | Grape::ContentTypes.content_types_for c_types | COMMENT |
| LOW | lib/grape/dsl/request_response.rb | 81 | # | COMMENT |
| LOW | lib/grape/dsl/request_response.rb | 121 | namespace_inheritable[:internal_grape_exceptions_rescue_handler] = handler | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | spec/grape/util/registry_spec.rb | 4 | # Create a test class that includes the Registry module | COMMENT |
| MEDIUM | spec/grape/validations/validators/base_i18n_spec.rb | 41 | # Define the API while zh-CN is the active locale | COMMENT |
| MEDIUM | lib/grape/api.rb | 40 | # Initialize the instance variables on the remountable class, and the base_instance | COMMENT |
| MEDIUM | lib/grape/endpoint.rb | 46 | # Create a new endpoint. | COMMENT |
| MEDIUM | lib/grape/util/inheritable_setting.rb | 66 | # Create a point-in-time copy of this settings instance, with clones of | COMMENT |
| MEDIUM | lib/grape/validations/types/multiple_type_coercer.rb | 6 | # This class is intended for use with Grape endpoint parameters that | COMMENT |
| MEDIUM | lib/grape/dsl/routing.rb | 87 | # Define a root URL prefix for your entire API. | COMMENT |
| MEDIUM | lib/grape/dsl/routing.rb | 94 | # Create a scope without affecting the URL. | COMMENT |
| MEDIUM | lib/grape/dsl/parameters.rb | 169 | # Define a block of validations which should be applied if and only if | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | lib/grape/endpoint.rb | 265 | def instrument_run_validators(validators, request, &) | CODE |
| LOW | lib/grape/endpoint.rb | 330 | def prepare_routes_requirements(route_options_requirements) | CODE |
| LOW | lib/grape/middleware/error.rb | 120 | def registered_rescue_handler(klass) | CODE |
| LOW | lib/grape/middleware/error.rb | 133 | def rescue_handler_for_grape_exception(klass) | CODE |
| LOW | lib/grape/middleware/error.rb | 141 | def rescue_handler_for_any_class(klass) | CODE |
| LOW | lib/grape/middleware/formatter.rb | 64 | def instrument_format_response(formatter, &) | CODE |
| LOW | lib/grape/middleware/auth/dsl.rb | 44 | def merge_legacy_auth_options(method_name, legacy_options, options) | CODE |
| LOW | lib/grape/util/inheritable_setting.rb | 102 | def namespace_stackable_with_hash(key) | CODE |
| LOW | lib/grape/validations/validations_spec.rb | 82 | def check_incompatible_option_values(default, values, except_values) | CODE |
| LOW | lib/grape/validations/validations_spec.rb | 128 | def extract_value_and_message(opt) | CODE |
| LOW | lib/grape/validations/params_scope.rb | 220 | def require_required_and_optional_fields(context, using:, except: nil) | CODE |
| LOW | …ape/validations/validators/contract_scope_validator.rb | 35 | def build_errors_from_messages(messages) | CODE |
| LOW | lib/grape/error_formatter/base.rb | 60 | def format_structured_message(_structured_message) | CODE |
| LOW | lib/grape/error_formatter/json.rb | 7 | def format_structured_message(structured_message) | CODE |
| LOW | lib/grape/api/instance.rb | 168 | def collect_route_config_per_pattern(all_routes, namespace_inheritable) | CODE |
| LOW | lib/grape/dsl/helpers.rb | 71 | def inject_api_helpers_to_mod(mod, &block) | CODE |
| LOW | lib/grape/dsl/helpers.rb | 85 | def warn_on_endpoint_overrides(mod) | CODE |
| LOW | lib/grape/dsl/routing.rb | 321 | def evaluate_as_instance_with_configuration(block, lazy: false) | CODE |
| LOW | lib/grape/dsl/entity.rb | 82 | def entity_representation_for(entity_class, object, options) | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| CRITICAL | lib/grape/api/instance.rb | 164 | namespace_inheritable = self.class.inheritable_setting.namespace_inheritable.to_hash.except(*ROOT_PREFIX_VERSION | CODE |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | lib/grape/api.rb | 59 | # configuration hash to the block which you can use to configure your | COMMENT |
| MEDIUM | lib/grape/dsl/parameters.rb | 119 | # # pass in a block, within which you can use any of the | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | lib/grape/dsl/request_response.rb | 131 | # entities once and then simply call `present` with the model. | COMMENT |
| MEDIUM | lib/grape/dsl/request_response.rb | 145 | # bubble up and utilize the entity provided on that `represent` call. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | lib/grape/validations/types/custom_type_coercer.rb | 18 | # ------------- | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | benchmark/version_throughput/run.rb | 12 | # Usage: | COMMENT |