Doorkeeper is an OAuth 2 provider for Ruby on Rails / Grape.
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).
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.
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 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.
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | .rubocop_todo.yml | 1 | # This configuration was generated by | COMMENT |
| LOW | app/controllers/doorkeeper/tokens_controller.rb | 61 | # The client also includes its authentication credentials as described | COMMENT |
| LOW | app/controllers/doorkeeper/tokens_controller.rb | 81 | # RFC7009 | COMMENT |
| LOW | spec/dummy/app/assets/config/manifest.js | 1 | // JS and CSS bundles | COMMENT |
| LOW | spec/dummy/config/environments/production.rb | 21 | COMMENT | |
| LOW | spec/dummy/config/environments/production.rb | 41 | # Use a different cache store in production | COMMENT |
| LOW | spec/dummy/config/environments/test.rb | 21 | # Show full error reports and disable caching | COMMENT |
| LOW | spec/dummy/config/initializers/backtrace_silencers.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/dummy/config/initializers/session_store.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 21 | # Admin.find_by_id(session[:admin_id]) || redirect_to(new_admin_session_url) | COMMENT |
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 41 | # | COMMENT |
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 61 | # Change the way client credentials are retrieved from the request object. | COMMENT |
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 81 | # | COMMENT |
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 101 | # puts "BEFORE HOOK FIRED! #{request}" | COMMENT |
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 121 | # | COMMENT |
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 141 | # `authorized_client` is nil if and only if `authorized_token` is present, and vice versa. | COMMENT |
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 161 | # | COMMENT |
| LOW | spec/dummy/config/initializers/secret_token.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/dummy/db/schema.rb | 1 | # This file is auto-generated from the current state of the database. Instead | COMMENT |
| LOW | spec/requests/endpoints/metadata_spec.rb | 201 | context "with a custom tokens controller outside the doorkeeper namespace" do | COMMENT |
| LOW | spec/support/helpers/application_model_helper.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | spec/lib/doorkeeper/orm/active_record_spec.rb | 61 | COMMENT | |
| LOW | spec/lib/doorkeeper/orm/active_record_spec.rb | 161 | expect(CustomStiAccessGrant.ancestors).to include( | COMMENT |
| LOW | lib/doorkeeper/request.rb | 61 | end | COMMENT |
| LOW | lib/doorkeeper/config.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/doorkeeper/config.rb | 61 | # @param { Hash } with grant_types as keys. | COMMENT |
| LOW | lib/doorkeeper/config.rb | 101 | # | COMMENT |
| LOW | lib/doorkeeper/config.rb | 141 | # (writable) database when automatic role switching is enabled. | COMMENT |
| LOW | lib/doorkeeper/config.rb | 321 | # By default it will be 100 | COMMENT |
| LOW | lib/doorkeeper/config.rb | 341 | # Hook to allow arbitrary user-client authorization | COMMENT |
| LOW | lib/doorkeeper/config.rb | 361 | # ->(flow, client) { client.grant_flows.include?(flow) } | COMMENT |
| LOW | lib/doorkeeper/config.rb | 381 | # | COMMENT |
| LOW | lib/doorkeeper/config.rb | 401 | # @param validator [Proc, nil] A callable that validates resource indicators | COMMENT |
| LOW | lib/doorkeeper/config.rb | 421 | # Use a custom class for generating the access token. | COMMENT |
| LOW | lib/doorkeeper/config.rb | 441 | # | COMMENT |
| LOW | lib/doorkeeper/config.rb | 481 | COMMENT | |
| LOW | lib/doorkeeper/config.rb | 501 | # You can define any custom rule you need or just disable token | COMMENT |
| LOW | lib/doorkeeper/config.rb | 541 | # | COMMENT |
| LOW | lib/doorkeeper/oauth/nonstandard.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/doorkeeper/oauth/nonstandard.rb | 21 | # | COMMENT |
| LOW | lib/doorkeeper/oauth/authorization_code_request.rb | 161 | # RFC 8707: validate resource indicators on the token request. | COMMENT |
| LOW | lib/doorkeeper/oauth/authorization_code_request.rb | 221 | # With `reuse_access_token` the same token can back several grants | COMMENT |
| LOW | lib/doorkeeper/oauth/client.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/doorkeeper/oauth/scopes.rb | 81 | # DEPRECATED: With dynamic scopes, #allowed should be called because | COMMENT |
| LOW | lib/doorkeeper/oauth/token_introspection.rb | 41 | private | COMMENT |
| LOW | lib/doorkeeper/oauth/token_introspection.rb | 121 | COMMENT | |
| LOW | lib/doorkeeper/oauth/token_introspection.rb | 141 | # much of the authorization server's state to a third party, the | COMMENT |
| LOW | lib/doorkeeper/oauth/token_introspection.rb | 161 | # before its expiration time). | COMMENT |
| LOW | lib/doorkeeper/oauth/token_introspection.rb | 181 | # place. | COMMENT |
| LOW | lib/doorkeeper/oauth/password_access_token_request.rb | 61 | # other authentication requirements), the client MUST authenticate with the authorization | COMMENT |
| LOW | lib/doorkeeper/oauth/resource_indicator_validator.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | …per/oauth/client_authentication/client_secret_basic.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/doorkeeper/oauth/client_authentication/none.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/doorkeeper/oauth/client_authentication/none.rb | 21 | # +client_id+. | COMMENT |
| LOW | lib/doorkeeper/config/option.rb | 1 | # frozen_string_literal: true | COMMENT |
| LOW | lib/doorkeeper/config/option.rb | 21 | # | COMMENT |
| LOW | lib/doorkeeper/models/access_grant_mixin.rb | 21 | end | COMMENT |
| LOW | lib/doorkeeper/models/access_grant_mixin.rb | 61 | # function that uses padding. | COMMENT |
| LOW | lib/doorkeeper/models/access_grant_mixin.rb | 81 | # A-z_4ME | COMMENT |
| 57 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | app/controllers/doorkeeper/tokens_controller.rb | 179 | def before_successful_authorization(context = nil) | CODE |
| LOW | app/controllers/doorkeeper/tokens_controller.rb | 183 | def after_successful_authorization(context) | CODE |
| LOW | app/controllers/doorkeeper/authorizations_controller.rb | 170 | def before_successful_authorization(context = nil) | CODE |
| LOW | app/controllers/doorkeeper/authorizations_controller.rb | 174 | def after_successful_authorization(context) | CODE |
| LOW⚡ | spec/support/helpers/model_helper.rb | 12 | def authorization_code_exists(options = {}) | CODE |
| LOW⚡ | spec/support/helpers/model_helper.rb | 20 | def access_grant_should_exist_for(client, resource_owner) | CODE |
| LOW⚡ | spec/support/helpers/model_helper.rb | 29 | def access_token_should_exist_for(client, resource_owner) | CODE |
| LOW | spec/support/helpers/model_helper.rb | 46 | def access_grant_should_have_scopes(*args) | CODE |
| LOW | spec/support/helpers/model_helper.rb | 51 | def access_token_should_have_scopes(*args) | CODE |
| LOW | spec/support/helpers/authorization_request_helper.rb | 4 | def resource_owner_is_authenticated(resource_owner = nil) | CODE |
| LOW⚡ | spec/support/helpers/authorization_request_helper.rb | 21 | def client_should_be_authorized(client) | CODE |
| LOW⚡ | spec/support/helpers/authorization_request_helper.rb | 25 | def client_should_not_be_authorized(client) | CODE |
| LOW⚡ | spec/support/helpers/authorization_request_helper.rb | 29 | def i_should_be_on_client_callback(client) | CODE |
| LOW⚡ | spec/support/helpers/authorization_request_helper.rb | 33 | def allowing_forgery_protection(&_block) | CODE |
| LOW | spec/support/helpers/url_helper.rb | 19 | def password_token_endpoint_params(options = {}) | CODE |
| LOW | spec/support/helpers/url_helper.rb | 30 | def authorization_endpoint_url(options = {}) | CODE |
| LOW | spec/support/helpers/url_helper.rb | 48 | def refresh_token_endpoint_params(options = {}) | CODE |
| LOW | spec/support/helpers/request_spec_helper.rb | 24 | def url_should_not_have_param(param) | CODE |
| LOW | spec/support/helpers/request_spec_helper.rb | 56 | def basic_auth_header_for_client(client) | CODE |
| LOW⚡ | spec/support/helpers/request_spec_helper.rb | 69 | def i_should_see_translated_error_message(key) | CODE |
| LOW⚡ | spec/support/helpers/request_spec_helper.rb | 73 | def i_should_not_see_translated_error_message(key) | CODE |
| LOW⚡ | spec/support/helpers/request_spec_helper.rb | 81 | def i_should_see_translated_invalid_request_error_message(key, value) | CODE |
| LOW⚡ | spec/support/helpers/request_spec_helper.rb | 85 | def translated_invalid_request_error_message(key, value) | CODE |
| LOW⚡ | spec/support/helpers/request_spec_helper.rb | 89 | def response_status_should_be(status) | CODE |
| LOW | spec/lib/oauth/client_spec.rb | 20 | def with_deprecation_warnings(enabled: true) | CODE |
| LOW | …ec/generators/previous_refresh_token_generator_spec.rb | 23 | def stub_previous_refresh_token_column(exists:) | CODE |
| LOW | …ec/generators/grant_reuse_revocation_generator_spec.rb | 16 | def stub_access_token_id_column(exists:) | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 14 | def doorkeeper_unauthorized_render_options(*); end | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 16 | def doorkeeper_forbidden_render_options(*); end | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 160 | def doorkeeper_unauthorized_render_options(error: nil) | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 170 | def doorkeeper_unauthorized_render_options(error: nil); end | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 190 | def doorkeeper_unauthorized_render_options(**) | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 200 | def doorkeeper_unauthorized_render_options(error: nil); end | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 218 | def doorkeeper_unauthorized_render_options(**) | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 228 | def doorkeeper_unauthorized_render_options(error: nil); end | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 250 | def doorkeeper_forbidden_render_options(*); end | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 276 | def doorkeeper_forbidden_render_options(*) | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 297 | def doorkeeper_forbidden_render_options(*) | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 315 | def doorkeeper_forbidden_render_options(*) | CODE |
| LOW | spec/controllers/protected_resources_controller_spec.rb | 334 | def doorkeeper_forbidden_render_options(*) | CODE |
| LOW | lib/doorkeeper/request.rb | 14 | def client_authentication_method(request) | CODE |
| LOW | lib/doorkeeper/request.rb | 116 | def build_fallback_strategy_class(grant_or_request_type) | CODE |
| LOW | lib/doorkeeper/oauth/base_request.rb | 29 | def find_or_create_access_token(client, resource_owner, scopes, custom_attributes, server) | CODE |
| LOW | lib/doorkeeper/oauth/token.rb | 33 | def from_bearer_authorization(request) | CODE |
| LOW | lib/doorkeeper/oauth/token.rb | 52 | def decode_basic_credentials_token(encoded_header) | CODE |
| LOW | lib/doorkeeper/oauth/client_credentials/creator.rb | 66 | def find_active_existing_token_for(client, scopes, attributes, &filter) | CODE |
| LOW | lib/doorkeeper/models/access_token_mixin.rb | 57 | def by_previous_refresh_token(previous_refresh_token) | CODE |
| LOW | lib/doorkeeper/models/access_token_mixin.rb | 110 | def find_access_token_in_batches(relation, **args, &block) | CODE |
| LOW | lib/doorkeeper/models/access_token_mixin.rb | 382 | def last_authorized_token_for(application_id, resource_owner) | CODE |
| LOW | lib/doorkeeper/models/access_token_mixin.rb | 412 | def extract_custom_attributes(attributes) | CODE |
| LOW | lib/doorkeeper/orm/active_record/mixins/application.rb | 105 | def read_attribute_for_serialization(key) | CODE |
| LOW | lib/doorkeeper/orm/active_record/mixins/application.rb | 160 | def extract_serializable_attributes(options = {}) | CODE |
| LOW | lib/doorkeeper/orm/active_record/mixins/application.rb | 209 | def revoke_tokens_and_grants_for(id, resource_owner) | CODE |
| LOW | lib/doorkeeper/grape/helpers.rb | 28 | def doorkeeper_render_error_with(error) | CODE |
| LOW | lib/doorkeeper/helpers/controller.rb | 52 | def get_error_response_from_exception(exception) | CODE |
| LOW | lib/doorkeeper/rails/helpers.rb | 12 | def doorkeeper_unauthorized_render_options(**); end | CODE |
| LOW | lib/doorkeeper/rails/helpers.rb | 14 | def doorkeeper_forbidden_render_options(**); end | CODE |
| LOW | lib/doorkeeper/rails/helpers.rb | 30 | def doorkeeper_render_error_with(error) | CODE |
| LOW | lib/doorkeeper/rails/helpers.rb | 52 | def doorkeeper_render_options(error) | CODE |
| LOW | lib/doorkeeper/rails/helpers.rb | 60 | def doorkeeper_status_for_error(error, respond_not_found_when_forbidden) | CODE |
| 1 more matches not shown… | ||||
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | spec/dummy/config/initializers/doorkeeper.rb | 144 | # them to make sure you doesn't get NoMethodError exception. | COMMENT |
| MEDIUM | lib/doorkeeper/config.rb | 352 | # For example you can add an additional database column to `oauth_applications` table, | COMMENT |
| MEDIUM | lib/generators/doorkeeper/templates/initializer.rb | 414 | # For example you can add an additional database column to `oauth_applications` table, | COMMENT |
| LOW | lib/generators/doorkeeper/templates/initializer.rb | 56 | # Don't forget to include Doorkeeper ORM mixins into your custom models: | COMMENT |
| LOW | lib/generators/doorkeeper/templates/initializer.rb | 87 | # [NOTE] If you apply this option on already existing project don't forget to manually | COMMENT |
| LOW | lib/generators/doorkeeper/templates/initializer.rb | 87 | # [NOTE] If you apply this option on already existing project don't forget to manually | COMMENT |
| LOW | lib/generators/doorkeeper/templates/initializer.rb | 536 | # them to make sure you doesn't get NoMethodError exception. | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | spec/dummy/config/initializers/wrap_parameters.rb | 5 | # This file contains settings for ActionController::ParamsWrapper which | COMMENT |
| MEDIUM | spec/dummy/db/schema.rb | 1 | # This file is auto-generated from the current state of the database. Instead | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| LOW | app/controllers/doorkeeper/tokens_controller.rb | 101 | # Token belongs to specific client, so we need to check if | COMMENT |
| LOW | lib/doorkeeper/orm/active_record/mixins/application.rb | 82 | # if application belongs to some owner we need to check if it's the same as | COMMENT |
| Severity | File | Line | Snippet | Context |
|---|---|---|---|---|
| MEDIUM | README.md | 7 | [![GuardRails badge](https://api.guardrails.io/v2/badges/21183?token=66768ce8f6995814df81f65a2cff40f739f688492704f973e62 | CODE |