Repository Analysis

sinatra/sinatra

Classy web-development dressed in a DSL (official / canonical repo)

6.0 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of sinatra/sinatra, a Ruby project with 12,452 GitHub stars. SynthScan v2.0 examined 30,319 lines of code across 172 source files, recording 146 pattern matches distributed across 7 syntactic categories. The overall adjusted score of 6.0 places this repository in the Low AI signal 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).

6.0
Adjusted Score
6.0
Raw Score
100%
Time Factor
2026-07-20
Last Push
12.5K
Stars
Ruby
Language
30.3K
Lines of Code
172
Files
146
Pattern Hits
2026-08-02
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

Longitudinal tracking requires multiple scan runs. Once this repository is re-scanned after new commits land, this chart will visualise how the synthetic code signal evolves over time — enabling you to detect whether AI authorship is growing, stabilising, or being actively corrected by human engineers.

No multi-scan history yet — run the scanner again to build trend data.

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 0HIGH 0MEDIUM 17LOW 129

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 146 distinct pattern matches across 7 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 Block119 hits · 119 pts
SeverityFileLineSnippetContext
LOWtest/contest.rb1# Copyright (c) 2009 Damian Janowski and Michel Martens for CitrusbyteCOMMENT
LOWtest/views/hello.md1# Hello From MarkdownCOMMENT
LOWrack-protection/spec/spec_helper.rb1# frozen_string_literal: trueCOMMENT
LOWrack-protection/spec/spec_helper.rb21# The `.rspec` file also contains a few flags that are not defaults but thatCOMMENT
LOWrack-protection/spec/spec_helper.rb41 # Use the documentation formatter for detailed output,COMMENT
LOWrack-protection/spec/spec_helper.rb61 # as the one that triggered the failure.COMMENT
LOWrack-protection/lib/rack/protection/base.rb1# frozen_string_literal: trueCOMMENT
LOWrack-protection/lib/rack/protection/base.rb21 # [<tt>:message</tt>] - if set, this is the message sent when a request is rejected via <tt>deny</tt>.COMMENT
LOWrack-protection/lib/rack/protection/json_csrf.rb1# frozen_string_literal: trueCOMMENT
LOWrack-protection/lib/rack/protection/cookie_tossing.rb1# frozen_string_literal: trueCOMMENT
LOWrack-protection/lib/rack/protection/escaped_params.rb21 #COMMENT
LOWrack-protection/lib/rack/protection/escaped_params.rb41 # To avoid this, include the {<tt>escape_utils</tt>}[https://rubygems.org/gems/escape_utils]COMMENT
LOWrack-protection/lib/rack/protection/referrer_policy.rb1# frozen_string_literal: trueCOMMENT
LOWrack-protection/lib/rack/protection/frame_options.rb1# frozen_string_literal: trueCOMMENT
LOWrack-protection/lib/rack/protection/frame_options.rb21 # {frame-ancestors directive}[https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Content-Security-PCOMMENT
LOWrack-protection/lib/rack/protection/http_origin.rb1# frozen_string_literal: trueCOMMENT
LOWrack-protection/lib/rack/protection/http_origin.rb21 #COMMENT
LOW…k-protection/lib/rack/protection/authenticity_token.rb1# frozen_string_literal: trueCOMMENT
LOW…k-protection/lib/rack/protection/authenticity_token.rb21 #COMMENT
LOW…k-protection/lib/rack/protection/authenticity_token.rb41 #COMMENT
LOW…k-protection/lib/rack/protection/authenticity_token.rb61 # use Rack::Session::Cookie, secret: 'CHANGEMEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'COMMENT
LOW…k-protection/lib/rack/protection/authenticity_token.rb81 # <h1>With Authenticity Token</h1>COMMENT
LOWrack-protection/lib/rack/protection/strict_transport.rb1# frozen_string_literal: trueCOMMENT
LOW…tection/lib/rack/protection/content_security_policy.rb1# frozen_string_literal: trueCOMMENT
LOW…tection/lib/rack/protection/content_security_policy.rb21 # More info:: * W3C CSP Level 1 : https://www.w3.org/TR/CSP1/ (deprecated)COMMENT
LOW…tection/lib/rack/protection/content_security_policy.rb41 # <tt>:report_to</tt> option. If you *do* set <tt>:report_to</tt>, you must COMMENT
LOWrack-protection/lib/rack/protection/form_token.rb1# frozen_string_literal: trueCOMMENT
LOW…k-protection/lib/rack/protection/host_authorization.rb1# frozen_string_literal: trueCOMMENT
LOW…k-protection/lib/rack/protection/host_authorization.rb21 # [<tt>:permitted_hosts</tt>] an Array of hosts to allow. Elements can be as follows:COMMENT
LOWsinatra-contrib/spec/spec_helper.rb1ENV['RACK_ENV'] = 'test'COMMENT
LOWsinatra-contrib/spec/spec_helper.rb21 # The settings below are suggested to provide a good initial experienceCOMMENT
LOWsinatra-contrib/spec/spec_helper.rb41COMMENT
LOWsinatra-contrib/spec/spec_helper.rb61 # assertions if you prefer.COMMENT
LOWsinatra-contrib/spec/reloader_spec.rb21 endCOMMENT
LOWsinatra-contrib/spec/okjson.rb1# Copyright 2011 Keith RarickCOMMENT
LOWsinatra-contrib/spec/okjson.rb21# See https://github.com/kr/okjson for updates.COMMENT
LOWsinatra-contrib/spec/okjson.rb181 endCOMMENT
LOWsinatra-contrib/lib/sinatra/json.rb1# frozen_string_literal: trueCOMMENT
LOWsinatra-contrib/lib/sinatra/json.rb21 # get '/' doCOMMENT
LOWsinatra-contrib/lib/sinatra/json.rb41 #COMMENT
LOWsinatra-contrib/lib/sinatra/json.rb61 # set :json_encoder, WhateverCOMMENT
LOWsinatra-contrib/lib/sinatra/respond_with.rb1# frozen_string_literal: trueCOMMENT
LOWsinatra-contrib/lib/sinatra/respond_with.rb21 # halt haml(:index, :locals => data)COMMENT
LOWsinatra-contrib/lib/sinatra/respond_with.rb41 #COMMENT
LOWsinatra-contrib/lib/sinatra/respond_with.rb61 #COMMENT
LOWsinatra-contrib/lib/sinatra/test_helpers.rb21COMMENT
LOWsinatra-contrib/lib/sinatra/test_helpers.rb41 # @return [Integer] HTTP status of the last responseCOMMENT
LOWsinatra-contrib/lib/sinatra/test_helpers.rb61 # @!scope classCOMMENT
LOWsinatra-contrib/lib/sinatra/test_helpers.rb81 # @!scope classCOMMENT
LOWsinatra-contrib/lib/sinatra/test_helpers.rb101 def_delegators :current_session, :env_forCOMMENT
LOWsinatra-contrib/lib/sinatra/test_helpers.rb141COMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb1# frozen_string_literal: trueCOMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb21 #COMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb41 # or both:COMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb61 # it. For instance, lets define a before filter to prevent the access ofCOMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb81 # Well, they actually also affect the nested namespaces:COMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb101 #COMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb121 # endCOMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb141 # an extension. This includes defining the `registered(app)` method in theCOMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb161 # endCOMMENT
59 more matches not shown…
Self-Referential Comments9 hits · 27 pts
SeverityFileLineSnippetContext
MEDIUMsinatra-contrib/lib/sinatra/namespace.rb148 # module Routes # Define a new "Routes" moduleCOMMENT
MEDIUMlib/sinatra/base.rb1397 # Define a custom error handler. Optionally takes either an ExceptionCOMMENT
MEDIUMlib/sinatra/base.rb1413 # Define a named template. The block must return the template source.COMMENT
MEDIUMlib/sinatra/base.rb1419 # Define the layout template. The block must return the template source.COMMENT
MEDIUMlib/sinatra/base.rb1483 # Define a before filter; runs before all requests within the sameCOMMENT
MEDIUMlib/sinatra/base.rb1490 # Define an after filter; runs after all requests within the sameCOMMENT
MEDIUMlib/sinatra/base.rb1656 # Create a new instance without middleware in front of it.COMMENT
MEDIUMlib/sinatra/base.rb1659 # Create a new instance of the class fronted by its middlewareCOMMENT
MEDIUMlib/sinatra/base.rb2152 # Create a new Sinatra application; the block is evaluated in the class scope.COMMENT
Slop Phrases8 hits · 21 pts
SeverityFileLineSnippetContext
MEDIUMrack-protection/spec/spec_helper.rb27 # with RSpec, but feel free to customize to your heart's content.COMMENT
MEDIUMsinatra-contrib/spec/spec_helper.rb22 # with RSpec, but feel free to customize to your heart's content.COMMENT
MEDIUMsinatra-contrib/lib/sinatra/namespace.rb17 # Once you have loaded the extension (see below), you can use the +namespace+COMMENT
LOWsinatra-contrib/lib/sinatra/namespace.rb182 # Zomg::App.run! # Don't forget to start your app ;)COMMENT
MEDIUMsinatra-contrib/lib/sinatra/extension.rb11 # module. This means you can use +get+ to define a route, +before+COMMENT
MEDIUMsinatra-contrib/lib/sinatra/haml_helpers.rb18 # # now you can use the helpers in your viewsCOMMENT
LOWsinatra-contrib/lib/sinatra/runner.rb39 # **Don't forget to override #app_file specific to your application!**COMMENT
MEDIUMsinatra-contrib/lib/sinatra/webdav.rb18 # # Now you can use any WebDAV verb:COMMENT
AI Slop Vocabulary3 hits · 8 pts
SeverityFileLineSnippetContext
MEDIUM…k-protection/lib/rack/protection/authenticity_token.rb191 # Essentially the inverse of +mask_token+.COMMENT
MEDIUM…tection/lib/rack/protection/content_security_policy.rb36 # section for CSP usage examples and best practices.COMMENT
LOWsinatra-contrib/lib/sinatra/json.rb63 # To force +json+ to simply call +to_json+ on the object:COMMENT
Fake / Example Data3 hits · 3 pts
SeverityFileLineSnippetContext
LOWtest/compile_test.rb60 parses "/:foo/:bar", "/user@example.com/name", "foo" => "user@example.com", "bar" => "name"CODE
LOWtest/routing_test.rb488 assert_equal 'user@example.com', bodyCODE
LOWtest/routing_test.rb557 assert_equal "John Doe", bodyCODE
Hyper-Verbose Identifiers3 hits · 3 pts
SeverityFileLineSnippetContext
LOW…k-protection/lib/rack/protection/authenticity_token.rb213 def compare_with_global_token(token, session)CODE
LOW…k-protection/lib/rack/protection/authenticity_token.rb217 def compare_with_per_form_token(token, session, request)CODE
LOWsinatra-contrib/lib/sinatra/streaming.rb208 def enum_not_open_for_reading(*)CODE
Redundant / Tautological Comments1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsinatra-contrib/lib/sinatra/content_for.rb138 # Check if a block of content with the given key was defined. ForCOMMENT