Repository Analysis

mastodon/mastodon

Your self-hosted, globally interconnected microblogging community

1.0 Likely human-written View on GitHub
1.0
Adjusted Score
1.0
Raw Score
100%
Time Factor
2026-05-30
Last Push
49,979
Stars
Ruby
Language
612,457
Lines of Code
4857
Files
497
Pattern Hits
2026-05-31
Scan Date

Score History

Severity Breakdown

CRITICAL 2HIGH 0MEDIUM 22LOW 473

Pattern Findings

497 matches across 11 categories. Click a row to expand file-level details.

Hyper-Verbose Identifiers182 hits · 195 pts
SeverityFileLineSnippet
LOWapp/mailers/user_mailer.rb21 def confirmation_instructions(user, token, *, **)
LOWapp/mailers/user_mailer.rb34 def reset_password_instructions(user, token, *, **)
LOWapp/mailers/user_mailer.rb85 def two_factor_recovery_codes_changed(user, *, **)
LOWapp/mailers/user_mailer.rb115 def webauthn_credential_added(user, webauthn_credential)
LOWapp/mailers/user_mailer.rb126 def webauthn_credential_deleted(user, webauthn_credential)
LOWapp/models/announcement.rb108 def value_for_reaction_me_column(account)
LOWapp/models/account_statuses_cleanup_policy.rb101 def invalidate_last_inspected(status, action)
LOWapp/models/account_statuses_cleanup_policy.rb186 def self_status_reference_exists(model)
LOWapp/models/notification.rb193 def preload_cache_collection_target_statuses(notifications, &_block)
LOWapp/models/user.rb418 def render_and_send_devise_message(notification, *, **)
LOWapp/models/admin/account_action.rb30 def disabled_types_for_account(account)
LOWapp/models/account_suggestions/fasp_source.rb14 def fasp_follow_recommendations_for(account)
LOWapp/models/concerns/cacheable.rb17 def preload_cacheable_associations(records)
LOWapp/models/concerns/notification/groups.rb102 def paginate_groups_by_max_id(limit, max_id: nil, since_id: nil, grouped_types: nil)
LOWapp/models/concerns/notification/groups.rb112 def paginate_groups_by_min_id(limit, max_id: nil, min_id: nil, grouped_types: nil)
LOWapp/models/concerns/notification/groups.rb119 def to_a_grouped_paginated_by_id(limit, options = {})
LOWapp/models/concerns/status/threading_concern.rb7 def permitted_statuses_from_ids(ids, account, stable: false)
LOWapp/models/concerns/status/threading_concern.rb96 def find_statuses_from_tree_path(ids, account, promote: false)
LOWapp/models/concerns/account/mappings.rb79 def domain_blocking_map_by_domain(target_domains, account_id)
LOWapp/models/concerns/account/search.rb143 def generate_query_for_search(unsanitized_terms)
LOW…/models/concerns/account/interaction_policy_concern.rb19 def feature_policy_for_account(other_account)
LOWapp/lib/delivery_failure_tracker.rb91 def exhausted_deliveries_key_by(host)
LOWapp/lib/hashtag_normalizer.rb10 def remove_invalid_characters(str)
LOWapp/lib/request.rb154 def normalize_preserving_url_encodings(url, preserved_chars = SAFE_PRESERVED_CHARS, *flags)
LOWapp/lib/status_reach_finder.rb114 def inboxes_without_suspended_for(scope)
LOWapp/lib/content_security_policy.rb87 def uri_from_configuration_and_string(host_string)
LOWapp/lib/extractor.rb10 def extract_entities_with_indices(text, options = {}, &block)
LOWapp/lib/extractor.rb23 def extract_mentions_or_lists_with_indices(text)
LOWapp/lib/extractor.rb56 def extract_hashtags_with_indices(text, _options = {})
LOWapp/lib/extractor.rb89 def extract_extra_uris_with_indices(text)
LOWapp/lib/feed_manager.rb654 def crutches_exclusive_list_users(recipient_id, statuses)
LOWapp/lib/status_cache_hydrator.rb29 def hydrate_non_reblog_payload(empty_payload, account, nested: false)
LOWapp/lib/status_cache_hydrator.rb132 def mapped_applied_custom_filter(account, status)
LOWapp/lib/connection_pool/shared_timed_stack.rb82 def fetch_preferred_connection(preferred_tag)
LOWapp/lib/admin/metrics/measure/base_measure.rb53 def read_attribute_for_serialization(key)
LOWapp/lib/admin/metrics/dimension/base_dimension.rb38 def read_attribute_for_serialization(key)
LOWapp/lib/activitypub/tag_manager.rb275 def uri_to_local_conversation(uri)
LOWapp/lib/activitypub/tag_manager.rb308 def uri_to_local_account_params(uri)
LOWapp/lib/activitypub/activity/feature_request.rb51 def collection_item_attributes(state = :accepted)
LOWapp/lib/activitypub/activity/create.rb286 def process_tagged_collection(tag)
LOWapp/lib/activitypub/activity/create.rb380 def resolve_unresolved_mentions(status)
LOWapp/lib/activitypub/activity/create.rb386 def resolve_unresolved_collections(status)
LOWapp/validators/vote_validator.rb50 def account_votes_on_same_poll(vote)
LOWapp/javascript/mastodon/features/emoji/locale.ts15export function toSupportedLocaleOrCustom(locale: string): LocaleOrCustom {
LOWapp/javascript/mastodon/features/emoji/database.ts281export async function loadCustomEmojiByShortcode(shortcode: string) {
LOWapp/javascript/mastodon/features/emoji/database.ts286export async function searchCustomEmojisByShortcodes(shortcodes: string[]) {
LOWapp/javascript/mastodon/features/emoji/database.ts305export async function loadLegacyShortcodesByShortcode(shortcode: string) {
LOWapp/javascript/mastodon/features/emoji/normalize.ts176export function emojiToInversionClassName(emoji: string): string | null {
LOW…ascript/mastodon/features/collections/detail/index.tsx249function useRevealSensitiveContent({
LOWapp/javascript/mastodon/models/account.ts123export function createAccountFromServerJSON(serverJSON: ApiAccountJSON) {
LOWapp/javascript/mastodon/models/poll.ts19export function createPollOptionTranslationFromServerJSON(translation: {
LOWapp/javascript/mastodon/models/notification_request.ts11export function createNotificationRequestFromJSON(
LOWapp/javascript/mastodon/models/notification_group.ts128function createAccountWarningFromJSON(
LOWapp/javascript/mastodon/models/notification_group.ts138function createAccountRelationshipSeveranceEventFromJSON(
LOWapp/javascript/mastodon/models/notification_group.ts144function createAnnualReportEventFromJSON(
LOWapp/javascript/mastodon/models/notification_group.ts150export function createNotificationGroupFromJSON(
LOWapp/javascript/mastodon/models/notification_group.ts215export function createNotificationGroupFromNotificationJSON(
LOWapp/javascript/mastodon/components/hashtag_bar.tsx50function uniqueHashtagsWithCaseHandling(hashtags: string[]) {
LOWapp/javascript/mastodon/components/hashtag_bar.tsx91export function computeHashtagBarForStatus(status: StatusLike): {
LOW…p/javascript/mastodon/actions/notification_requests.ts23function dispatchAssociatedRecords(
122 more matches not shown…
Over-Commented Block188 hits · 188 pts
SeverityFileLineSnippet
LOW.rubocop_todo.yml1# This configuration was generated by
LOWdocker-compose.yml21 networks:
LOWdocker-compose.yml41 # - "thread_pool.write.queue_size=1000"
LOWdocker-compose.yml121 ## http_hidden_proxy=http://privoxy:8118
LOWapp/models/announcement.rb1# frozen_string_literal: true
LOWapp/models/preview_card_trend.rb1# frozen_string_literal: true
LOWapp/models/conversation_mute.rb1# frozen_string_literal: true
LOWapp/models/report.rb1# frozen_string_literal: true
LOWapp/models/generated_annual_report.rb1# frozen_string_literal: true
LOWapp/models/identity.rb1# frozen_string_literal: true
LOWapp/models/account_conversation.rb1# frozen_string_literal: true
LOWapp/models/account_alias.rb1# frozen_string_literal: true
LOWapp/models/instance_moderation_note.rb1# frozen_string_literal: true
LOWapp/models/account.rb1# frozen_string_literal: true
LOWapp/models/account.rb21# domain :string
LOWapp/models/account.rb41# note :text default(""), not null
LOWapp/models/tag.rb1# frozen_string_literal: true
LOWapp/models/preview_card_provider.rb1# frozen_string_literal: true
LOWapp/models/relationship_severance_event.rb1# frozen_string_literal: true
LOWapp/models/status.rb1# frozen_string_literal: true
LOWapp/models/status.rb21# url :string
LOWapp/models/account_migration.rb1# frozen_string_literal: true
LOWapp/models/block.rb1# frozen_string_literal: true
LOWapp/models/poll.rb1# frozen_string_literal: true
LOWapp/models/announcement_mute.rb1# frozen_string_literal: true
LOWapp/models/custom_emoji_category.rb1# frozen_string_literal: true
LOWapp/models/severed_relationship.rb1# frozen_string_literal: true
LOWapp/models/featured_tag.rb1# frozen_string_literal: true
LOWapp/models/rule_translation.rb1# frozen_string_literal: true
LOWapp/models/ip_block.rb1# frozen_string_literal: true
LOWapp/models/mention.rb1# frozen_string_literal: true
LOWapp/models/list_account.rb1# frozen_string_literal: true
LOWapp/models/account_warning_preset.rb1# frozen_string_literal: true
LOWapp/models/status_pin.rb1# frozen_string_literal: true
LOWapp/models/bulk_import.rb1# frozen_string_literal: true
LOWapp/models/account_statuses_cleanup_policy.rb1# frozen_string_literal: true
LOWapp/models/appeal.rb1# frozen_string_literal: true
LOWapp/models/tag_feed.rb1# frozen_string_literal: true
LOWapp/models/software_update.rb1# frozen_string_literal: true
LOWapp/models/status_stat.rb1# frozen_string_literal: true
LOWapp/models/collection.rb1# frozen_string_literal: true
LOWapp/models/follow_recommendation_mute.rb1# frozen_string_literal: true
LOWapp/models/bookmark.rb1# frozen_string_literal: true
LOWapp/models/custom_emoji.rb1# frozen_string_literal: true
LOWapp/models/account_domain_block.rb1# frozen_string_literal: true
LOWapp/models/marker.rb1# frozen_string_literal: true
LOWapp/models/email_subscription.rb1# frozen_string_literal: true
LOWapp/models/preview_cards_status.rb1# frozen_string_literal: true
LOWapp/models/rule.rb1# frozen_string_literal: true
LOWapp/models/relay.rb1# frozen_string_literal: true
LOWapp/models/media_attachment.rb1# frozen_string_literal: true
LOWapp/models/media_attachment.rb21# thumbnail_file_size :integer
LOWapp/models/keypair.rb1# frozen_string_literal: true
LOWapp/models/favourite.rb1# frozen_string_literal: true
LOWapp/models/email_domain_block.rb1# frozen_string_literal: true
LOWapp/models/tag_trend.rb1# frozen_string_literal: true
LOWapp/models/public_feed.rb1# frozen_string_literal: true
LOWapp/models/poll_vote.rb1# frozen_string_literal: true
LOWapp/models/preview_card.rb1# frozen_string_literal: true
LOWapp/models/preview_card.rb21# language :string
128 more matches not shown…
Fake / Example Data88 hits · 92 pts
SeverityFileLineSnippet
LOWapp/javascript/mastodon/utils/__tests__/html-test.ts17 const input = '<p>lorem ipsum</p>';
LOWapp/javascript/mastodon/utils/__tests__/html-test.ts48 const input = '<p>lorem ipsum</p>';
LOWapp/javascript/mastodon/utils/__tests__/html-test.ts51 expect(onText).toHaveBeenCalledExactlyOnceWith('lorem ipsum', {});
LOWapp/javascript/mastodon/utils/__tests__/html-test.ts55 const input = '<p>lorem ipsum</p>';
LOWapp/javascript/mastodon/utils/__tests__/html-test.ts69 expect.arrayContaining(['lorem ipsum']),
LOWapp/javascript/mastodon/utils/__tests__/html-test.ts75 const input = '<p>lorem ipsum</p>';
LOWapp/javascript/mastodon/utils/__tests__/html-test.ts82 expect.arrayContaining(['lorem ipsum']),
LOW…pt/mastodon/components/mini_card/mini_card.stories.tsx46 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore
LOW…pt/mastodon/components/mini_card/mini_card.stories.tsx46 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore
LOWspec/mailers/previews/user_mailer_preview.rb14 user.unconfirmed_email = 'foo@bar.com'
LOWspec/mailers/previews/user_mailer_preview.rb63 user.unconfirmed_email = 'foo@bar.com'
LOWspec/models/canonical_email_block_spec.rb69 before { Fabricate(:canonical_email_block, email: 'foo@bar.com') }
LOWspec/models/canonical_email_block_spec.rb72 expect(described_class.block?('foo@bar.com')).to be true
LOWspec/models/form/import_spec.rb270 { 'acct' => 'user@example.com', 'show_reblogs' => true, 'notify' => false, 'languages' => nil },
LOWspec/models/form/import_spec.rb275 { 'acct' => 'user@example.com', 'hide_notifications' => true },
LOWspec/presenters/instance_presenter_spec.rb24 Setting.site_contact_email = 'admin@example.com'
LOWspec/presenters/instance_presenter_spec.rb25 expect(instance_presenter.contact.email).to eq 'admin@example.com'
LOWspec/requests/api/v1/media_spec.rb161 let(:params) { { description: 'Lorem ipsum!!!' } }
LOWspec/requests/api/v1/media_spec.rb174 let(:params) { { description: 'Lorem ipsum!!!' } }
LOWspec/requests/api/v1/media_spec.rb177 expect { subject }.to change { media.reload.description }.from('old').to('Lorem ipsum!!!')
LOWspec/requests/api/v1/emails/confirmations_spec.rb52 user.update(email: 'foo@bar.com')
LOWspec/requests/api/v1/emails/confirmations_spec.rb76 let(:params) { { email: 'foo@bar.com' } }
LOWspec/requests/api/v1/emails/confirmations_spec.rb84 expect(user.reload.unconfirmed_email).to eq('foo@bar.com')
LOWspec/system/report_interface_spec.rb8 let(:email) { 'admin@example.com' }
LOWspec/system/admin/terms_of_service/generates_spec.rb25 fill_in 'terms_of_service_generator_arbitration_address', with: '123 Main Street'
LOWspec/fabricators/status_fabricator.rb5 text 'Lorem ipsum dolor sit amet'
LOWspec/fabricators/status_fabricator.rb5 text 'Lorem ipsum dolor sit amet'
LOWspec/lib/plain_text_formatter_spec.rb24 expect(subject).to eq 'Lorem ipsum'
LOWspec/lib/plain_text_formatter_spec.rb64 expect(subject).to eq 'Lorem ipsum'
LOWspec/lib/plain_text_formatter_spec.rb72 expect(subject).to eq 'Lorem ipsum'
LOWspec/lib/request_spec.rb62 before { stub_request(:get, 'http://example.com').to_return(body: 'lorem ipsum') }
LOWspec/lib/request_spec.rb96 expect(response.body_with_limit).to eq 'lorem ipsum'
LOWspec/lib/request_spec.rb106 stub_request(:get, 'http://redirected.example.com/foo').to_return(body: 'lorem ipsum')
LOWspec/lib/mastodon/cli/canonical_email_blocks_spec.rb17 let(:arguments) { ['user@example.com'] }
LOWspec/lib/mastodon/cli/canonical_email_blocks_spec.rb20 before { Fabricate(:canonical_email_block, email: 'user@example.com') }
LOWspec/lib/mastodon/cli/canonical_email_blocks_spec.rb38 let(:arguments) { ['user@example.com'] }
LOWspec/lib/mastodon/cli/canonical_email_blocks_spec.rb41 before { Fabricate(:canonical_email_block, email: 'user@example.com') }
LOWspec/lib/mastodon/cli/canonical_email_blocks_spec.rb47 expect(CanonicalEmailBlock.matching_email('user@example.com')).to be_empty
LOWspec/lib/activitypub/activity/announce_spec.rb68 content: 'Lorem ipsum',
LOWspec/lib/activitypub/activity/announce_spec.rb84 content: 'Lorem ipsum',
LOWspec/lib/activitypub/activity/announce_spec.rb163 content: 'Lorem ipsum',
LOWspec/lib/activitypub/activity/create_spec.rb45 content: '@bob lorem ipsum',
LOWspec/lib/activitypub/activity/create_spec.rb70 content: '@bob lorem ipsum',
LOWspec/lib/activitypub/activity/create_spec.rb88 content: '@bob lorem ipsum',
LOWspec/lib/activitypub/activity/create_spec.rb201 expect(status.text).to eq 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb220 expect(status.text).to eq 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb240 expect(status.text).to eq 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb263 expect(status.text).to eq 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb289 expect(status.text).to eq 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb817 content: 'Lorem ipsum :tinking:',
LOWspec/lib/activitypub/activity/create_spec.rb843 content: 'Lorem ipsum :tinkong:',
LOWspec/lib/activitypub/activity/create_spec.rb869 content: 'Lorem ipsum :tinking:',
LOWspec/lib/activitypub/activity/create_spec.rb892 content: 'Lorem ipsum :tinking:',
LOWspec/lib/activitypub/activity/create_spec.rb1274 text: 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb1293 expect(status.text).to eq 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb1315 expect(status.text).to eq 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb1338 expect(status.text).to eq 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb1360 expect(status.text).to eq 'Lorem ipsum'
LOWspec/lib/activitypub/activity/create_spec.rb1382 content: 'Lorem ipsum',
LOWspec/lib/activitypub/parser/status_parser_spec.rb30 content: '@bob lorem ipsum',
28 more matches not shown…
Self-Referential Comments20 hits · 59 pts
SeverityFileLineSnippet
MEDIUMdocker-compose.yml1# This file is designed for production server deployment, not local development work
MEDIUMapp/models/setting.rb14# This file is derived from a fork of the `rails-settings-cached` gem available at
MEDIUMapp/models/concerns/user/omniauthable.rb67 # Create a user for the given auth params. If no email was provided,
MEDIUM…/services/activitypub/process_status_update_service.rb327 # This method is only concerned with approval and skips other meaningful changes,
MEDIUMconfig/settings.yml1# This file contains default values, and does not need to be edited. All
MEDIUMconfig/initializers/wrap_parameters.rb5# This file contains settings for ActionController::ParamsWrapper which
MEDIUMconfig/initializers/permissions_policy.rb5# Define an application-wide HTTP permissions policy. For further
MEDIUMconfig/initializers/content_security_policy.rb5# Define an application-wide content security policy.
MEDIUMconfig/initializers/simple_form.rb124 # Define the way to render check boxes / radio buttons with labels.
MEDIUMconfig/initializers/simple_form.rb223 # Define the default class of the input wrapper of the boolean input.
MEDIUMspec/requests/api/v1/annual_reports_spec.rb110 # Define the ID manually as it is otherwise handled by the database, which is not affected by `travel_to`
MEDIUMspec/requests/api/v1/annual_reports_spec.rb133 # Define the ID manually as it is otherwise handled by the database, which is not affected by `travel_to`
MEDIUMspec/system/admin/email_subscriptions_spec.rb12 Fabricate.create :email_subscription # Create a sub show that purge is shown
MEDIUMspec/support/streaming_client.rb79 # Create a synthetic close event:
MEDIUM…/scheduler/accounts_statuses_cleanup_scheduler_spec.rb91 # Create a bunch of old statuses
MEDIUM…/scheduler/accounts_statuses_cleanup_scheduler_spec.rb101 # Create a bunch of newer statuses
MEDIUMlib/mastodon/migration_helpers.rb3# This file is copied almost entirely from GitLab, which has done a large
MEDIUMlib/mastodon/database.rb3# This file is entirely lifted from GitLab.
MEDIUMdb/schema.rb1# This file is auto-generated from the current state of the database. Instead
MEDIUMdb/schema.rb5# This file is the source Rails uses to define your schema when running `bin/rails
Hallucination Indicators2 hits · 20 pts
SeverityFileLineSnippet
CRITICALspec/requests/api/v2/media_spec.rb15 expect(File.exist?(user.account.media_attachments.first.file.path(:small)))
CRITICALspec/requests/api/v2/media_spec.rb51 expect(File.exist?(user.account.media_attachments.first.file.path(:small)))
Redundant / Tautological Comments10 hits · 17 pts
SeverityFileLineSnippet
LOWapp/lib/feed_manager.rb62 # Check if the status should not be added to a feed
LOWapp/lib/feed_manager.rb426 # Check if there is a streaming API client connected
LOWapp/lib/feed_manager.rb434 # Check if the account is blocking or muting any of the given accounts
LOWapp/lib/feed_manager.rb443 # Check if status should not be added to the home feed
LOWapp/lib/feed_manager.rb481 # Check if status should not be added to the mentions feed
LOWapp/lib/feed_manager.rb498 # Check if status should not be added to the list feed
LOWapp/lib/feed_manager.rb514 # Check if a status should not be added to the home feed when it comes
LOWapp/lib/admin/system_check/media_privacy_check.rb32 # Check if we can list the uploaded file. If true, that's an error
LOWapp/services/software_update_check_service.rb45 # Check if any of the notices is new, and issue notifications
LOWspec/rails_helper.rb70 # Set type to `cli` for all CLI specs
AI Slop Vocabulary3 hits · 5 pts
SeverityFileLineSnippet
LOWapp/lib/feed_manager.rb553 # can just add it to the feed (and note that we're reblogging it).
MEDIUMspec/system/auth/passwords_spec.rb15 allow(Devise).to receive(:pam_authentication).and_return(false) # Avoid the "seamless external" path
LOWdb/migrate/20170920032311_fix_reblogs_in_feeds.rb77 # just use the data in Redis to reverse this transition.
Slop Phrases1 hit · 3 pts
SeverityFileLineSnippet
MEDIUMconfig/initializers/simple_form.rb61 # extensions by default, you can change `b.optional` to `b.use`.
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippet
LOWapp/javascript/mastodon/components/hotkeys/index.tsx247 * ### How to use
Verbosity Indicators1 hit · 2 pts
SeverityFileLineSnippet
LOWapp/services/resolve_account_service.rb37 # we already checked, we need to check if we've already got
Overly Generic Function Names1 hit · 1 pts
SeverityFileLineSnippet
LOW.storybook/static/mockServiceWorker.js124async function handleRequest(event, requestId, requestInterceptedAt) {