Repository Analysis

ruby-grape/grape

An opinionated framework for creating REST-like APIs in Ruby.

2.6 Likely human-written View on GitHub

Analysis Overview

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).

2.6
Adjusted Score
2.6
Raw Score
100%
Time Factor
2026-07-14
Last Push
10.0K
Stars
Ruby
Language
47.6K
Lines of Code
338
Files
86
Pattern Hits
2026-07-14
Scan Date
0.00
HC Hit Rate

What These Metrics Mean

Adjusted Score
Primary synthetic code indicator. Raw score normalised per 1,000 lines of code and multiplied by the temporal discount factor. This is the definitive comparative metric — use it to rank repositories by AI authorship density.
Raw Score
The unmodified sum of all severity-weighted, context-multiplied pattern match scores before temporal discounting. Reflects the absolute signal strength independent of when the repository was last active.
Time Factor
The temporal discount multiplier (0–100%) applied to the raw score. Repositories last updated before ChatGPT's launch (Nov 2022) receive a 5% factor. Full signal is only assigned to repositories active in the post-adoption era (Jan 2024+).
Pattern Hits
Total count of individual pattern matches across all files and categories. A high hit count with a low score may indicate a very large codebase with isolated AI snippets; a low count with a high score indicates dense, concentrated AI signatures.
HC Hit Rate
High+Critical pattern hits per file, averaged across the repository. This orthogonal signal catches repositories where a few files are densely packed with high-severity AI tells — a strong indicator even when the normalised score appears moderate due to codebase size.
Lines of Code / Files
Total lines and files analysed. The scanner examines 94 file extensions. These denominators are used to normalise the score, enabling fair comparison between repositories of vastly different sizes.

Score History

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.

Severity Breakdown

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.

CRITICAL 1HIGH 0MEDIUM 13LOW 72

Directory Score Breakdown

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.

Pattern Findings

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.

Over-Commented Block51 hits · 51 pts
SeverityFileLineSnippetContext
LOW.rubocop_todo.yml1# This configuration was generated byCOMMENT
LOWbenchmark/version_throughput/run.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/mountable.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/endpoint.rb41 remove_method :temp_unbound_methodCOMMENT
LOWlib/grape/endpoint.rb61 # @param anchor [Boolean] whether the route anchors to the whole pathCOMMENT
LOWlib/grape/middleware/versioner.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/middleware/precomputed_content_types.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/middleware/error.rb161COMMENT
LOWlib/grape/middleware/versioner/path.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/middleware/versioner/param.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/middleware/versioner/accept_version_header.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/middleware/versioner/header.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/validations/param_scope_tracker.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/validations/validations_spec.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/validations/types.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/validations/types.rb61 #COMMENT
LOWlib/grape/validations/types.rb81 # Does Grape provide special coercion and validationCOMMENT
LOWlib/grape/validations/types.rb121 array_or_set?(type) && type.length == 1 && (custom?(type.first) || special?(type.first))COMMENT
LOWlib/grape/validations/types.rb141 # specifies a custom type which implements requirments ofCOMMENT
LOWlib/grape/validations/coerce_options.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/validations/types/json.rb1# frozen_string_literal: trueCOMMENT
LOW…/grape/validations/types/variant_collection_coercer.rb1# frozen_string_literal: trueCOMMENT
LOW…pe/validations/types/custom_type_collection_coercer.rb1# frozen_string_literal: trueCOMMENT
LOW…pe/validations/types/custom_type_collection_coercer.rb21 # @param type [Class,#parse]COMMENT
LOWlib/grape/validations/types/multiple_type_coercer.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/validations/types/custom_type_coercer.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/validations/types/custom_type_coercer.rb21 # that the coerced value produced above is in fact of theCOMMENT
LOWlib/grape/validations/types/custom_type_coercer.rb41 # and coercion method.COMMENT
LOWlib/grape/validations/validators/base.rb21 # {Grape::Validations::SharedOptions} value object; no per-validatorCOMMENT
LOWlib/grape/dsl/helpers.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/dsl/version_options.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/dsl/routing.rb21 inheritable_setting.namespace_inheritable[:cascade] = valueCOMMENT
LOWlib/grape/dsl/routing.rb41 # get '/main' doCOMMENT
LOWlib/grape/dsl/routing.rb161 http_methods: :any,COMMENT
LOWlib/grape/dsl/entity.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/dsl/parameters.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/dsl/parameters.rb21 # class API < Grape::APICOMMENT
LOWlib/grape/dsl/parameters.rb41 # helpers doCOMMENT
LOWlib/grape/dsl/parameters.rb81 # types that are supported automatically. Custom classes may be usedCOMMENT
LOWlib/grape/dsl/parameters.rb101 # @option attrs :coerce_with [#parse, #call] method to be used when coercingCOMMENT
LOWlib/grape/dsl/validations.rb21 raise ArgumentError, 'Cannot inherit from contract, only schema' if block && contract.respond_to?(:schema)COMMENT
LOWlib/grape/dsl/desc.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/dsl/desc.rb21 # endpoint may return, with their meanings, in a 2d arrayCOMMENT
LOWlib/grape/dsl/desc.rb41 # # ...COMMENT
LOWlib/grape/dsl/rescue_options.rb1# frozen_string_literal: trueCOMMENT
LOWlib/grape/dsl/inside_route.rb21 # End the request and display an error to theCOMMENT
LOWlib/grape/dsl/inside_route.rb101 # Allows you to explicitly return no content.COMMENT
LOWlib/grape/dsl/inside_route.rb121 # GET /file # => "contents of file"COMMENT
LOWlib/grape/dsl/request_response.rb61 Grape::ContentTypes.content_types_for c_typesCOMMENT
LOWlib/grape/dsl/request_response.rb81 #COMMENT
LOWlib/grape/dsl/request_response.rb121 namespace_inheritable[:internal_grape_exceptions_rescue_handler] = handlerCOMMENT
Self-Referential Comments9 hits · 27 pts
SeverityFileLineSnippetContext
MEDIUMspec/grape/util/registry_spec.rb4 # Create a test class that includes the Registry moduleCOMMENT
MEDIUMspec/grape/validations/validators/base_i18n_spec.rb41 # Define the API while zh-CN is the active localeCOMMENT
MEDIUMlib/grape/api.rb40 # Initialize the instance variables on the remountable class, and the base_instanceCOMMENT
MEDIUMlib/grape/endpoint.rb46 # Create a new endpoint.COMMENT
MEDIUMlib/grape/util/inheritable_setting.rb66 # Create a point-in-time copy of this settings instance, with clones ofCOMMENT
MEDIUMlib/grape/validations/types/multiple_type_coercer.rb6 # This class is intended for use with Grape endpoint parameters thatCOMMENT
MEDIUMlib/grape/dsl/routing.rb87 # Define a root URL prefix for your entire API.COMMENT
MEDIUMlib/grape/dsl/routing.rb94 # Create a scope without affecting the URL.COMMENT
MEDIUMlib/grape/dsl/parameters.rb169 # Define a block of validations which should be applied if and only ifCOMMENT
Hyper-Verbose Identifiers19 hits · 19 pts
SeverityFileLineSnippetContext
LOWlib/grape/endpoint.rb265 def instrument_run_validators(validators, request, &)CODE
LOWlib/grape/endpoint.rb330 def prepare_routes_requirements(route_options_requirements)CODE
LOWlib/grape/middleware/error.rb120 def registered_rescue_handler(klass)CODE
LOWlib/grape/middleware/error.rb133 def rescue_handler_for_grape_exception(klass)CODE
LOWlib/grape/middleware/error.rb141 def rescue_handler_for_any_class(klass)CODE
LOWlib/grape/middleware/formatter.rb64 def instrument_format_response(formatter, &)CODE
LOWlib/grape/middleware/auth/dsl.rb44 def merge_legacy_auth_options(method_name, legacy_options, options)CODE
LOWlib/grape/util/inheritable_setting.rb102 def namespace_stackable_with_hash(key)CODE
LOWlib/grape/validations/validations_spec.rb82 def check_incompatible_option_values(default, values, except_values)CODE
LOWlib/grape/validations/validations_spec.rb128 def extract_value_and_message(opt)CODE
LOWlib/grape/validations/params_scope.rb220 def require_required_and_optional_fields(context, using:, except: nil)CODE
LOW…ape/validations/validators/contract_scope_validator.rb35 def build_errors_from_messages(messages)CODE
LOWlib/grape/error_formatter/base.rb60 def format_structured_message(_structured_message)CODE
LOWlib/grape/error_formatter/json.rb7 def format_structured_message(structured_message)CODE
LOWlib/grape/api/instance.rb168 def collect_route_config_per_pattern(all_routes, namespace_inheritable)CODE
LOWlib/grape/dsl/helpers.rb71 def inject_api_helpers_to_mod(mod, &block)CODE
LOWlib/grape/dsl/helpers.rb85 def warn_on_endpoint_overrides(mod)CODE
LOWlib/grape/dsl/routing.rb321 def evaluate_as_instance_with_configuration(block, lazy: false)CODE
LOWlib/grape/dsl/entity.rb82 def entity_representation_for(entity_class, object, options)CODE
Hallucination Indicators1 hit · 10 pts
SeverityFileLineSnippetContext
CRITICALlib/grape/api/instance.rb164 namespace_inheritable = self.class.inheritable_setting.namespace_inheritable.to_hash.except(*ROOT_PREFIX_VERSIONCODE
Slop Phrases2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMlib/grape/api.rb59 # configuration hash to the block which you can use to configure yourCOMMENT
MEDIUMlib/grape/dsl/parameters.rb119 # # pass in a block, within which you can use any of theCOMMENT
AI Slop Vocabulary2 hits · 4 pts
SeverityFileLineSnippetContext
LOWlib/grape/dsl/request_response.rb131 # entities once and then simply call `present` with the model.COMMENT
MEDIUMlib/grape/dsl/request_response.rb145 # bubble up and utilize the entity provided on that `represent` call.COMMENT
Decorative Section Separators1 hit · 3 pts
SeverityFileLineSnippetContext
MEDIUMlib/grape/validations/types/custom_type_coercer.rb18 # -------------COMMENT
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWbenchmark/version_throughput/run.rb12# Usage:COMMENT