Repository Analysis

doorkeeper-gem/doorkeeper

Doorkeeper is an OAuth 2 provider for Ruby on Rails / Grape.

5.8 Low AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of doorkeeper-gem/doorkeeper, a Ruby project with 5,516 GitHub stars. SynthScan v2.0 examined 34,564 lines of code across 330 source files, recording 190 pattern matches distributed across 6 syntactic categories. The overall adjusted score of 5.8 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).

5.8
Adjusted Score
5.8
Raw Score
100%
Time Factor
2026-08-02
Last Push
5.5K
Stars
Ruby
Language
34.6K
Lines of Code
330
Files
190
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 5LOW 185

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 190 distinct pattern matches across 6 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 Block117 hits · 108 pts
SeverityFileLineSnippetContext
LOW.rubocop_todo.yml1# This configuration was generated byCOMMENT
LOWapp/controllers/doorkeeper/tokens_controller.rb61 # The client also includes its authentication credentials as describedCOMMENT
LOWapp/controllers/doorkeeper/tokens_controller.rb81 # RFC7009COMMENT
LOWspec/dummy/app/assets/config/manifest.js1// JS and CSS bundlesCOMMENT
LOWspec/dummy/config/environments/production.rb21COMMENT
LOWspec/dummy/config/environments/production.rb41 # Use a different cache store in productionCOMMENT
LOWspec/dummy/config/environments/test.rb21 # Show full error reports and disable cachingCOMMENT
LOWspec/dummy/config/initializers/backtrace_silencers.rb1# frozen_string_literal: trueCOMMENT
LOWspec/dummy/config/initializers/session_store.rb1# frozen_string_literal: trueCOMMENT
LOWspec/dummy/config/initializers/doorkeeper.rb1# frozen_string_literal: trueCOMMENT
LOWspec/dummy/config/initializers/doorkeeper.rb21 # Admin.find_by_id(session[:admin_id]) || redirect_to(new_admin_session_url)COMMENT
LOWspec/dummy/config/initializers/doorkeeper.rb41 #COMMENT
LOWspec/dummy/config/initializers/doorkeeper.rb61 # Change the way client credentials are retrieved from the request object.COMMENT
LOWspec/dummy/config/initializers/doorkeeper.rb81 #COMMENT
LOWspec/dummy/config/initializers/doorkeeper.rb101 # puts "BEFORE HOOK FIRED! #{request}"COMMENT
LOWspec/dummy/config/initializers/doorkeeper.rb121 #COMMENT
LOWspec/dummy/config/initializers/doorkeeper.rb141 # `authorized_client` is nil if and only if `authorized_token` is present, and vice versa.COMMENT
LOWspec/dummy/config/initializers/doorkeeper.rb161 #COMMENT
LOWspec/dummy/config/initializers/secret_token.rb1# frozen_string_literal: trueCOMMENT
LOWspec/dummy/db/schema.rb1# This file is auto-generated from the current state of the database. InsteadCOMMENT
LOWspec/requests/endpoints/metadata_spec.rb201 context "with a custom tokens controller outside the doorkeeper namespace" doCOMMENT
LOWspec/support/helpers/application_model_helper.rb1# frozen_string_literal: trueCOMMENT
LOWspec/lib/doorkeeper/orm/active_record_spec.rb61COMMENT
LOWspec/lib/doorkeeper/orm/active_record_spec.rb161 expect(CustomStiAccessGrant.ancestors).to include(COMMENT
LOWlib/doorkeeper/request.rb61 endCOMMENT
LOWlib/doorkeeper/config.rb1# frozen_string_literal: trueCOMMENT
LOWlib/doorkeeper/config.rb61 # @param { Hash } with grant_types as keys.COMMENT
LOWlib/doorkeeper/config.rb101 #COMMENT
LOWlib/doorkeeper/config.rb141 # (writable) database when automatic role switching is enabled.COMMENT
LOWlib/doorkeeper/config.rb321 # By default it will be 100COMMENT
LOWlib/doorkeeper/config.rb341 # Hook to allow arbitrary user-client authorizationCOMMENT
LOWlib/doorkeeper/config.rb361 # ->(flow, client) { client.grant_flows.include?(flow) }COMMENT
LOWlib/doorkeeper/config.rb381 #COMMENT
LOWlib/doorkeeper/config.rb401 # @param validator [Proc, nil] A callable that validates resource indicatorsCOMMENT
LOWlib/doorkeeper/config.rb421 # Use a custom class for generating the access token.COMMENT
LOWlib/doorkeeper/config.rb441 #COMMENT
LOWlib/doorkeeper/config.rb481COMMENT
LOWlib/doorkeeper/config.rb501 # You can define any custom rule you need or just disable tokenCOMMENT
LOWlib/doorkeeper/config.rb541 #COMMENT
LOWlib/doorkeeper/oauth/nonstandard.rb1# frozen_string_literal: trueCOMMENT
LOWlib/doorkeeper/oauth/nonstandard.rb21 #COMMENT
LOWlib/doorkeeper/oauth/authorization_code_request.rb161 # RFC 8707: validate resource indicators on the token request.COMMENT
LOWlib/doorkeeper/oauth/authorization_code_request.rb221 # With `reuse_access_token` the same token can back several grantsCOMMENT
LOWlib/doorkeeper/oauth/client.rb1# frozen_string_literal: trueCOMMENT
LOWlib/doorkeeper/oauth/scopes.rb81 # DEPRECATED: With dynamic scopes, #allowed should be called becauseCOMMENT
LOWlib/doorkeeper/oauth/token_introspection.rb41 privateCOMMENT
LOWlib/doorkeeper/oauth/token_introspection.rb121COMMENT
LOWlib/doorkeeper/oauth/token_introspection.rb141 # much of the authorization server's state to a third party, theCOMMENT
LOWlib/doorkeeper/oauth/token_introspection.rb161 # before its expiration time).COMMENT
LOWlib/doorkeeper/oauth/token_introspection.rb181 # place.COMMENT
LOWlib/doorkeeper/oauth/password_access_token_request.rb61 # other authentication requirements), the client MUST authenticate with the authorizationCOMMENT
LOWlib/doorkeeper/oauth/resource_indicator_validator.rb1# frozen_string_literal: trueCOMMENT
LOW…per/oauth/client_authentication/client_secret_basic.rb1# frozen_string_literal: trueCOMMENT
LOWlib/doorkeeper/oauth/client_authentication/none.rb1# frozen_string_literal: trueCOMMENT
LOWlib/doorkeeper/oauth/client_authentication/none.rb21 # +client_id+.COMMENT
LOWlib/doorkeeper/config/option.rb1# frozen_string_literal: trueCOMMENT
LOWlib/doorkeeper/config/option.rb21 #COMMENT
LOWlib/doorkeeper/models/access_grant_mixin.rb21 endCOMMENT
LOWlib/doorkeeper/models/access_grant_mixin.rb61 # function that uses padding.COMMENT
LOWlib/doorkeeper/models/access_grant_mixin.rb81 # A-z_4MECOMMENT
57 more matches not shown…
Hyper-Verbose Identifiers61 hits · 67 pts
SeverityFileLineSnippetContext
LOWapp/controllers/doorkeeper/tokens_controller.rb179 def before_successful_authorization(context = nil)CODE
LOWapp/controllers/doorkeeper/tokens_controller.rb183 def after_successful_authorization(context)CODE
LOWapp/controllers/doorkeeper/authorizations_controller.rb170 def before_successful_authorization(context = nil)CODE
LOWapp/controllers/doorkeeper/authorizations_controller.rb174 def after_successful_authorization(context)CODE
LOWspec/support/helpers/model_helper.rb12 def authorization_code_exists(options = {})CODE
LOWspec/support/helpers/model_helper.rb20 def access_grant_should_exist_for(client, resource_owner)CODE
LOWspec/support/helpers/model_helper.rb29 def access_token_should_exist_for(client, resource_owner)CODE
LOWspec/support/helpers/model_helper.rb46 def access_grant_should_have_scopes(*args)CODE
LOWspec/support/helpers/model_helper.rb51 def access_token_should_have_scopes(*args)CODE
LOWspec/support/helpers/authorization_request_helper.rb4 def resource_owner_is_authenticated(resource_owner = nil)CODE
LOWspec/support/helpers/authorization_request_helper.rb21 def client_should_be_authorized(client)CODE
LOWspec/support/helpers/authorization_request_helper.rb25 def client_should_not_be_authorized(client)CODE
LOWspec/support/helpers/authorization_request_helper.rb29 def i_should_be_on_client_callback(client)CODE
LOWspec/support/helpers/authorization_request_helper.rb33 def allowing_forgery_protection(&_block)CODE
LOWspec/support/helpers/url_helper.rb19 def password_token_endpoint_params(options = {})CODE
LOWspec/support/helpers/url_helper.rb30 def authorization_endpoint_url(options = {})CODE
LOWspec/support/helpers/url_helper.rb48 def refresh_token_endpoint_params(options = {})CODE
LOWspec/support/helpers/request_spec_helper.rb24 def url_should_not_have_param(param)CODE
LOWspec/support/helpers/request_spec_helper.rb56 def basic_auth_header_for_client(client)CODE
LOWspec/support/helpers/request_spec_helper.rb69 def i_should_see_translated_error_message(key)CODE
LOWspec/support/helpers/request_spec_helper.rb73 def i_should_not_see_translated_error_message(key)CODE
LOWspec/support/helpers/request_spec_helper.rb81 def i_should_see_translated_invalid_request_error_message(key, value)CODE
LOWspec/support/helpers/request_spec_helper.rb85 def translated_invalid_request_error_message(key, value)CODE
LOWspec/support/helpers/request_spec_helper.rb89 def response_status_should_be(status)CODE
LOWspec/lib/oauth/client_spec.rb20 def with_deprecation_warnings(enabled: true)CODE
LOW…ec/generators/previous_refresh_token_generator_spec.rb23 def stub_previous_refresh_token_column(exists:)CODE
LOW…ec/generators/grant_reuse_revocation_generator_spec.rb16 def stub_access_token_id_column(exists:)CODE
LOWspec/controllers/protected_resources_controller_spec.rb14 def doorkeeper_unauthorized_render_options(*); endCODE
LOWspec/controllers/protected_resources_controller_spec.rb16 def doorkeeper_forbidden_render_options(*); endCODE
LOWspec/controllers/protected_resources_controller_spec.rb160 def doorkeeper_unauthorized_render_options(error: nil)CODE
LOWspec/controllers/protected_resources_controller_spec.rb170 def doorkeeper_unauthorized_render_options(error: nil); endCODE
LOWspec/controllers/protected_resources_controller_spec.rb190 def doorkeeper_unauthorized_render_options(**)CODE
LOWspec/controllers/protected_resources_controller_spec.rb200 def doorkeeper_unauthorized_render_options(error: nil); endCODE
LOWspec/controllers/protected_resources_controller_spec.rb218 def doorkeeper_unauthorized_render_options(**)CODE
LOWspec/controllers/protected_resources_controller_spec.rb228 def doorkeeper_unauthorized_render_options(error: nil); endCODE
LOWspec/controllers/protected_resources_controller_spec.rb250 def doorkeeper_forbidden_render_options(*); endCODE
LOWspec/controllers/protected_resources_controller_spec.rb276 def doorkeeper_forbidden_render_options(*)CODE
LOWspec/controllers/protected_resources_controller_spec.rb297 def doorkeeper_forbidden_render_options(*)CODE
LOWspec/controllers/protected_resources_controller_spec.rb315 def doorkeeper_forbidden_render_options(*)CODE
LOWspec/controllers/protected_resources_controller_spec.rb334 def doorkeeper_forbidden_render_options(*)CODE
LOWlib/doorkeeper/request.rb14 def client_authentication_method(request)CODE
LOWlib/doorkeeper/request.rb116 def build_fallback_strategy_class(grant_or_request_type)CODE
LOWlib/doorkeeper/oauth/base_request.rb29 def find_or_create_access_token(client, resource_owner, scopes, custom_attributes, server)CODE
LOWlib/doorkeeper/oauth/token.rb33 def from_bearer_authorization(request)CODE
LOWlib/doorkeeper/oauth/token.rb52 def decode_basic_credentials_token(encoded_header)CODE
LOWlib/doorkeeper/oauth/client_credentials/creator.rb66 def find_active_existing_token_for(client, scopes, attributes, &filter)CODE
LOWlib/doorkeeper/models/access_token_mixin.rb57 def by_previous_refresh_token(previous_refresh_token)CODE
LOWlib/doorkeeper/models/access_token_mixin.rb110 def find_access_token_in_batches(relation, **args, &block)CODE
LOWlib/doorkeeper/models/access_token_mixin.rb382 def last_authorized_token_for(application_id, resource_owner)CODE
LOWlib/doorkeeper/models/access_token_mixin.rb412 def extract_custom_attributes(attributes)CODE
LOWlib/doorkeeper/orm/active_record/mixins/application.rb105 def read_attribute_for_serialization(key)CODE
LOWlib/doorkeeper/orm/active_record/mixins/application.rb160 def extract_serializable_attributes(options = {})CODE
LOWlib/doorkeeper/orm/active_record/mixins/application.rb209 def revoke_tokens_and_grants_for(id, resource_owner)CODE
LOWlib/doorkeeper/grape/helpers.rb28 def doorkeeper_render_error_with(error)CODE
LOWlib/doorkeeper/helpers/controller.rb52 def get_error_response_from_exception(exception)CODE
LOWlib/doorkeeper/rails/helpers.rb12 def doorkeeper_unauthorized_render_options(**); endCODE
LOWlib/doorkeeper/rails/helpers.rb14 def doorkeeper_forbidden_render_options(**); endCODE
LOWlib/doorkeeper/rails/helpers.rb30 def doorkeeper_render_error_with(error)CODE
LOWlib/doorkeeper/rails/helpers.rb52 def doorkeeper_render_options(error)CODE
LOWlib/doorkeeper/rails/helpers.rb60 def doorkeeper_status_for_error(error, respond_not_found_when_forbidden)CODE
1 more matches not shown…
Slop Phrases7 hits · 14 pts
SeverityFileLineSnippetContext
LOWspec/dummy/config/initializers/doorkeeper.rb144 # them to make sure you doesn't get NoMethodError exception.COMMENT
MEDIUMlib/doorkeeper/config.rb352 # For example you can add an additional database column to `oauth_applications` table,COMMENT
MEDIUMlib/generators/doorkeeper/templates/initializer.rb414 # For example you can add an additional database column to `oauth_applications` table,COMMENT
LOWlib/generators/doorkeeper/templates/initializer.rb56 # Don't forget to include Doorkeeper ORM mixins into your custom models:COMMENT
LOWlib/generators/doorkeeper/templates/initializer.rb87 # [NOTE] If you apply this option on already existing project don't forget to manuallyCOMMENT
LOWlib/generators/doorkeeper/templates/initializer.rb87 # [NOTE] If you apply this option on already existing project don't forget to manuallyCOMMENT
LOWlib/generators/doorkeeper/templates/initializer.rb536 # them to make sure you doesn't get NoMethodError exception.COMMENT
Self-Referential Comments2 hits · 6 pts
SeverityFileLineSnippetContext
MEDIUMspec/dummy/config/initializers/wrap_parameters.rb5# This file contains settings for ActionController::ParamsWrapper whichCOMMENT
MEDIUMspec/dummy/db/schema.rb1# This file is auto-generated from the current state of the database. InsteadCOMMENT
Verbosity Indicators2 hits · 3 pts
SeverityFileLineSnippetContext
LOWapp/controllers/doorkeeper/tokens_controller.rb101 # Token belongs to specific client, so we need to check ifCOMMENT
LOWlib/doorkeeper/orm/active_record/mixins/application.rb82 # if application belongs to some owner we need to check if it's the same asCOMMENT
Modern AI Meta-Vocabulary1 hit · 2 pts
SeverityFileLineSnippetContext
MEDIUMREADME.md7[![GuardRails badge](https://api.guardrails.io/v2/badges/21183?token=66768ce8f6995814df81f65a2cff40f739f688492704f973e62CODE