Repository Analysis

element-hq/synapse

Synapse: Matrix homeserver written in Python/Twisted + Rust

23.3 Moderate AI signal View on GitHub

Analysis Overview

This report presents the forensic synthetic code analysis of element-hq/synapse, a Python project with 4,408 GitHub stars. SynthScan v2.0 examined 539,166 lines of code across 1686 source files, recording 9199 pattern matches distributed across 22 syntactic categories. The overall adjusted score of 23.3 places this repository in the Moderate 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).

23.3
Adjusted Score
23.3
Raw Score
100%
Time Factor
2026-07-14
Last Push
4.4K
Stars
Python
Language
539.2K
Lines of Code
1.7K
Files
9.2K
Pattern Hits
2026-07-14
Scan Date
0.18
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 15HIGH 294MEDIUM 1398LOW 7492

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 9199 distinct pattern matches across 22 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.

Self-Referential Comments1360 hits · 4094 pts
SeverityFileLineSnippetContext
MEDIUMscripts-dev/make_full_schema.sh91# Create the output directory if it doesn't existCOMMENT
MEDIUMscripts-dev/make_full_schema.sh200# Create the PostgreSQL database.COMMENT
MEDIUMscripts-dev/release.py3# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMscripts-dev/release.py237 # Create the new release branchCOMMENT
MEDIUMscripts-dev/release.py410 # Create a new draft releaseCOMMENT
MEDIUMscripts-dev/check_locked_deps_have_sdists.py3# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMscripts-dev/docker_update_debian_changelog.sh3## This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMscripts-dev/mypy_synapse_plugin.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMscripts-dev/sign_json.py3# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMscripts-dev/check_line_terminators.sh3## This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMscripts-dev/federation_client.py3# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMdocker/configure_workers_and_start.py3# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMdocker/configure_workers_and_start.py939 # Create the worker configuration directory if it doesn't already existSTRING
MEDIUM.ci/scripts/calculate_jobs.py3# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUM.ci/scripts/test_synapse_port_db.sh24# Create the PostgreSQL database.COMMENT
MEDIUM.ci/scripts/test_export_data_command.sh35# Create the PostgreSQL database.COMMENT
MEDIUMtests/unittest.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/unittest.py931 # Create the userCOMMENT
MEDIUMtests/test_phone_home.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/server.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/server.py1274 # Create the database before we actually try and connect to it, based offCOMMENT
MEDIUMtests/test_notifier.py1# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/test_notifier.py37 # Create a tokenCOMMENT
MEDIUMtests/test_notifier.py63 # Create the new token based on the stream ID above.COMMENT
MEDIUMtests/test_notifier.py110 # Create the new token based on the stream ID above.COMMENT
MEDIUMtests/test_distributor.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/test_visibility.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/__init__.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/test_state.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/test_server.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/test_server.py298 # Create a site and query for the resource.COMMENT
MEDIUMtests/utils.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/test_terms_auth.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/test_mau.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/test_event_auth.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/test_types.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/metrics/test_metrics.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/metrics/__init__.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/metrics/test_phone_home_stats.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/metrics/test_phone_home_stats.py143 # Create a room between the two usersCOMMENT
MEDIUMtests/crypto/test_event_signing.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/crypto/__init__.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/crypto/test_keyring.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/app/test_homeserver_start.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/app/test_openid_listener.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/app/test_homeserver_shutdown.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/app/test_homeserver_shutdown.py250 # The following code serves as an example of what I have found to be usefulCOMMENT
MEDIUMtests/util/test_expiring_cache.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/util/test_stringutils.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/util/test_async_helpers.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/util/test_async_helpers.py254 # Create a deferred which we will never completeCOMMENT
MEDIUMtests/util/test_async_helpers.py310 # Create a deferred which we will never completeCOMMENT
MEDIUMtests/util/test_split_dict.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/util/test_wheel_timer.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/util/test_dict_cache.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/util/test_linearizer.py2# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUMtests/util/test_linearizer.py206 # Create a second task, waiting for the first task.COMMENT
MEDIUMtests/util/test_linearizer.py210 # Create a third task, waiting for the second task.COMMENT
MEDIUMtests/util/test_linearizer.py240 # Create a second task, waiting for the first task.COMMENT
MEDIUMtests/util/test_linearizer.py244 # Create a third task, waiting for the second task.COMMENT
1300 more matches not shown…
Hyper-Verbose Identifiers4121 hits · 3504 pts
SeverityFileLineSnippetContext
LOWscripts-dev/release.py851def get_repo_and_check_clean_checkout(CODE
LOWscripts-dev/release.py967def generate_and_write_changelog(CODE
LOWscripts-dev/mypy_synapse_plugin.py234 def get_function_signature_hook(CODE
LOWscripts-dev/mypy_synapse_plugin.py264 def get_method_signature_hook(CODE
LOWscripts-dev/mypy_synapse_plugin.py404def check_add_system_event_trigger(ctx: MethodSigContext) -> CallableType:CODE
LOWscripts-dev/mypy_synapse_plugin.py452def analyze_prometheus_metric_classes(ctx: ClassDefContext) -> None:CODE
LOWscripts-dev/mypy_synapse_plugin.py487def check_prometheus_metric_instantiation(CODE
LOWscripts-dev/mypy_synapse_plugin.py624def cached_function_method_signature(ctx: MethodSigContext) -> CallableType:CODE
LOWscripts-dev/mypy_synapse_plugin.py701def check_is_cacheable_wrapper(ctx: MethodSigContext) -> CallableType:CODE
LOWscripts-dev/federation_client.py312 def get_connection_with_tls_context(CODE
LOWdocker/start.py68def generate_config_from_template(CODE
LOWdocker/configure_workers_and_start.py488def add_worker_roles_to_shared_config(STRING
LOWdocker/configure_workers_and_start.py552def merge_worker_template_configs(STRING
LOWdocker/configure_workers_and_start.py590def insert_worker_name_for_worker_config(STRING
LOWdocker/configure_workers_and_start.py608def apply_requested_multiplier_for_worker(worker_types: list[str]) -> list[str]:STRING
LOWdocker/configure_workers_and_start.py650def is_sharding_allowed_for_worker_type(worker_type: str) -> bool:STRING
LOWdocker/configure_workers_and_start.py685def generate_base_homeserver_config() -> None:STRING
LOWdocker/configure_workers_and_start.py1288def generate_worker_log_config(STRING
LOWtests/unittest.py168def make_homeserver_config_obj(config: dict[str, Any]) -> HomeServerConfig:CODE
LOWtests/unittest.py478 def wait_for_background_updates(self) -> None:CODE
LOWtests/unittest.py1135 def make_signed_federation_request(CODE
LOWtests/unittest.py1181 def add_hashes_and_signatures_from_other_server(CODE
LOWtests/test_phone_home.py38 def test_performance_frozen_clock(self) -> None:CODE
LOWtests/server.py761def cleanup_test_reactor_system_event_triggers(CODE
LOWtests/test_notifier.py33 def test_wait_for_stream_token_with_caught_up_token(self) -> None:CODE
LOWtests/test_notifier.py49 def test_wait_for_stream_token_with_future_sync_token(self) -> None:CODE
LOWtests/test_notifier.py93 def test_wait_for_stream_token_with_future_sync_token_timeout(CODE
LOWtests/test_visibility.py319 def test_normal_operation_as_admin(self) -> None:CODE
LOWtests/test_visibility.py347 def test_see_soft_failed_events(self) -> None:CODE
LOWtests/test_visibility.py386 def test_see_policy_server_spammy_events(self) -> None:CODE
LOWtests/test_visibility.py433 def test_see_soft_failed_and_policy_server_spammy_events(self) -> None:CODE
LOWtests/test_visibility.py491 def test_joined_history_visibility(self) -> None:CODE
LOWtests/test_visibility.py592 def test_out_of_band_invite_rejection(self) -> None:CODE
LOWtests/test_state.py162 def register_event_id_state_group(self, event_id: str, state_group: int) -> None:CODE
LOWtests/test_state.py168 async def get_state_group_for_events(CODE
LOWtests/test_state.py301 def test_branch_basic_conflict(CODE
LOWtests/test_state.py350 def test_branch_have_banned_conflict(CODE
LOWtests/test_state.py411 def test_branch_have_perms_conflict(CODE
LOWtests/test_state.py504 def test_annotate_with_old_message(CODE
LOWtests/test_state.py540 def test_annotate_with_old_state(CODE
LOWtests/test_state.py583 def test_trivial_annotate_message(CODE
LOWtests/test_state.py621 def test_trivial_annotate_state(CODE
LOWtests/test_state.py657 def test_resolve_message_conflict(CODE
LOWtests/test_state.py700 def test_resolve_state_conflict(CODE
LOWtests/test_state.py746 def test_standard_depth_conflict(CODE
LOWtests/test_state.py866 def test_make_state_cache_entry(self) -> None:CODE
LOWtests/test_server.py95 def test_callback_direct_exception(self) -> None:CODE
LOWtests/test_server.py115 def test_callback_indirect_exception(self) -> None:CODE
LOWtests/test_server.py141 def test_callback_synapseerror(self) -> None:CODE
LOWtests/test_server.py215 def test_content_larger_than_content_length(self) -> None:CODE
LOWtests/test_server.py245 def test_content_smaller_than_content_length(self) -> None:CODE
LOWtests/test_server.py320 def _check_cors_standard_headers(self, channel: FakeChannel) -> None:CODE
LOWtests/test_server.py343 def test_unknown_options_request(self) -> None:CODE
LOWtests/test_server.py351 def test_known_options_request(self) -> None:CODE
LOWtests/test_server.py420 def test_redirect_exception_with_cookie(self) -> None:CODE
LOWtests/test_server.py504 def test_cancellable_disconnect(self) -> None:CODE
LOWtests/test_server.py516 def test_uncancellable_disconnect(self) -> None:CODE
LOWtests/test_server.py538 def test_cancellable_disconnect(self) -> None:CODE
LOWtests/test_server.py550 def test_uncancellable_disconnect(self) -> None:CODE
LOWtests/test_mau.py126 def test_allowed_after_a_month_mau(self) -> None:CODE
4061 more matches not shown…
Over-Commented Block1302 hits · 1218 pts
SeverityFileLineSnippetContext
LOWpyproject.toml21 # We can remove this once https://github.com/python-jsonschema/jsonschema/issues/1426 is fixedCOMMENT
LOWpyproject.toml61 "msgpack>=0.5.2",COMMENT
LOWpyproject.toml81 # ijson 3.1.4 fixes a bug with "." in property namesCOMMENT
LOWpyproject.toml101COMMENT
LOWpyproject.toml161test = ["parameterized>=0.9.0", "idna>=3.3"]COMMENT
LOWpyproject.toml181 "authlib>=0.15.1",COMMENT
LOWpyproject.toml241# script.COMMENT
LOWpyproject.toml461COMMENT
LOWmypy.ini1[mypy]COMMENT
LOWtox.ini21 # cyptography 2.2 requires setuptools >= 18.5COMMENT
LOWtox.ini61 #COMMENT
LOWtox.ini81#COMMENT
LOWscripts-dev/make_full_schema.sh261 # Cleanup as follows:COMMENT
LOWscripts-dev/release.py1#!/usr/bin/env pythonCOMMENT
LOWscripts-dev/check_locked_deps_have_sdists.py1#! /usr/bin/env pythonCOMMENT
LOWscripts-dev/docker_update_debian_changelog.sh1#!/bin/bash -eCOMMENT
LOWscripts-dev/docker_update_debian_changelog.sh21COMMENT
LOWscripts-dev/mypy_synapse_plugin.py1#COMMENT
LOWscripts-dev/sign_json.py1#!/usr/bin/env pythonCOMMENT
LOWscripts-dev/lint.sh101COMMENT
LOWscripts-dev/lint.sh121# --allow-staged and --allow-dirty suppress clippy raising errorsCOMMENT
LOWscripts-dev/lint.sh141./scripts-dev/gen_config_documentation.py schema/synapse-config.schema.yaml > docs/usage/configuration/config_documentatCOMMENT
LOWscripts-dev/complement.sh1#!/usr/bin/env bashCOMMENT
LOWscripts-dev/complement.sh21#COMMENT
LOWscripts-dev/complement.sh41# This is important as some Docker storage drivers/types prefer remote images over localCOMMENT
LOWscripts-dev/check_line_terminators.sh1#!/bin/bashCOMMENT
LOWscripts-dev/federation_client.py1#!/usr/bin/env pythonCOMMENT
LOWscripts-dev/schema_versions.py1#!/usr/bin/env pythonCOMMENT
LOWscripts-dev/schema_versions.py121 return (tag for _, tag in sorted(tags, key=lambda t: t[0]))COMMENT
LOWdocker/configure_workers_and_start.py1#!/usr/local/bin/pythonCOMMENT
LOWdocker/configure_workers_and_start.py21#COMMENT
LOWdocker/configure_workers_and_start.py41# * SYNAPSE_TLS_KEY: Path to a TLS key. If this and SYNAPSE_TLS_CERT are specified,COMMENT
LOWdocker/configure_workers_and_start.py401 #COMMENT
LOWdocker/configure_workers_and_start.py921 # program blocks.COMMENT
LOWdocker/configure_workers_and_start.py1101 # `http_sd_config` in their Prometheus config.COMMENT
LOWdocker/configure_workers_and_start.py1121 # > server-side ("job" and "instance" labels, manually configured targetCOMMENT
LOWdocker/README-testing.md161 - job_name: synapseCOMMENT
LOWcomplement/.golangci.yml1# Docs: https://golangci-lint.run/docs/configuration/file/COMMENT
LOWcomplement/tests/room_messages_test.go1// This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
LOWcomplement/tests/room_messages_test.go41COMMENT
LOWcomplement/tests/room_messages_test.go61 // This test lives in our in-repo Complement tests for Synapse because the Matrix specCOMMENT
LOWcomplement/tests/room_messages_test.go81 // points, Synapse will compare `t3` with the backward extremity at an approximateCOMMENT
LOWcomplement/tests/room_messages_test.go161 slices.Reverse(chronologicalActualEventIds)COMMENT
LOWcomplement/tests/federation_test.go1// This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
LOWcomplement/tests/federation_room_join_test.go21)COMMENT
LOWcomplement/tests/federation_room_join_test.go61 // hs1 fetches our signing keys via /_matrix/key/v2/server to verify ourCOMMENT
LOWcomplement/tests/synapse_version_check_test.go1// This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
LOWcomplement/tests/oidc_test.go1// This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
LOWcomplement/tests/oidc_test.go41 display_name_template: "{{ user.given_name }}"COMMENT
LOWcomplement/tests/oidc_test.go81 // Restart the homeserver to apply the new configCOMMENT
LOWcomplement/tests/main_test.go1// This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
LOW.ci/scripts/checkout_complement.sh1#!/bin/bashCOMMENT
LOW.ci/scripts/calculate_jobs.py1#!/usr/bin/env pythonCOMMENT
LOW.ci/scripts/test_synapse_port_db.sh1#!/usr/bin/env bashCOMMENT
LOWdebian/manage_debconf.pl1#!/usr/bin/perlCOMMENT
LOWrust/src/room_versions.rs41impl EventFormatVersions {COMMENT
LOWrust/src/room_versions.rs101#[derive(Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]COMMENT
LOWrust/src/room_versions.rs121 pub limit_notifications_power_levels: bool,COMMENT
LOWrust/src/room_versions.rs141 /// is not enough to mark it "supported": the push rule evaluator also needs toCOMMENT
LOWrust/src/room_versions.rs361 self.clone().into_pyobject(py)COMMENT
1242 more matches not shown…
Docstring Block Structure179 hits · 895 pts
SeverityFileLineSnippetContext
HIGHtests/unittest.py967Register an appservice user as an application service. Requires the client-facing registration API be registeredSTRING
HIGHtests/rest/client/utils.py542Read or write some state from a given room Args: room_id: event_type: The type of stateSTRING
HIGHtests/rest/client/utils.py591Gets some state from a room Args: room_id: event_type: The type of state event STRING
HIGHtests/rest/client/utils.py619Set some state in a room Args: room_id: event_type: The type of state event STRING
HIGHsynapse/metrics/jemalloc.py54Wrapper around `mallctl` for reading and writing integers to jemalloc. Args: name: The nameSTRING
HIGHsynapse/crypto/keyring.py765 Args: keys_to_fetch: the keys to be fetched. key_server: notary serverSTRING
HIGHsynapse/crypto/keyring.py965 Args: server_name: Server to request keys from Returns: Map from key ID to loSTRING
HIGHsynapse/util/threepids.py84'Canonicalise' email address Case folding of local part of email address and lowercase domain part See MSC2265, STRING
HIGHsynapse/util/task_scheduler.py231Update some task-associated values. This is exposed publicly so it can be used inside task functions, mainly to STRING
HIGHsynapse/util/stringutils.py113Split a server name into host/port parts. Args: server_name: server name to parse Returns: hosSTRING
HIGHsynapse/util/stringutils.py144Split a server name into host/port parts and do some basic validation. Args: server_name: server name to paSTRING
HIGHsynapse/util/stringutils.py211Parse the given string as an MXC URI Checks that the "server name" part is a valid server name Args: mSTRING
HIGHsynapse/util/msisdn.py28 Takes an ISO-3166-1 2 letter country code and phone number and returns an msisdn representing the canonical verSTRING
HIGHsynapse/util/macaroons.py38Extracts a caveat value from a macaroon token. Checks that there is exactly one caveat of the form "key = <val>" inSTRING
HIGHsynapse/util/macaroons.py206Verify a guest access token macaroon Checks that the given token is a valid, unexpired guest access token STRING
HIGHsynapse/util/macaroons.py269Verifies and extract an OIDC session token. This verifies that a given session token was issued by this homeserSTRING
HIGHsynapse/util/caches/ttlcache.py117Get a value, and its expiry time, from the cache Args: key: key to look up Returns: STRING
HIGHsynapse/util/caches/deferred_cache.py161Looks the key up in the caches. For symmetry with set(), this method does *not* follow the synapse logcontext STRING
HIGHsynapse/config/_base.py205Convert a duration as a string or integer to a number of milliseconds. If an integer is provided it is treated STRING
HIGHsynapse/config/_base.py298Load a template file from disk. This function will attempt to load the given template from the default Synapse STRING
HIGHsynapse/config/_base.py322Load a list of template files from disk using the given variables. This function will attempt to load the givenSTRING
HIGHsynapse/config/_base.py1118Check the given file exists, and read it into a string If it does not, emit an error indicating the problem ArSTRING
HIGHsynapse/config/_util.py84Parse `config` as a mapping from strings to a given `Model` type. Args: config: The configuration data to chSTRING
HIGHsynapse/config/saml2.py199Generate a configuration dictionary with required and optional attributes that will be needed to process new useSTRING
HIGHsynapse/state/__init__.py444Build an EventContext structure for a non-outlier event. (for an outlier, call EventContext.for_outlier directlSTRING
HIGHsynapse/state/__init__.py490Given a list of event_ids this method fetches the state at each event, resolves conflicts between them and returSTRING
HIGHsynapse/storage/databases/main/registration.py1611Retrieves the time (in milliseconds) of the last validation of an access token. Args: token_id: TheSTRING
HIGHsynapse/storage/databases/main/registration.py1831Generate a random registration token. Used by the admin API. Args: length: The length of the token STRING
HIGHsynapse/storage/databases/main/registration.py2206Lookup a login token and consume it. Args: token: The login token. Returns: ThSTRING
HIGHsynapse/storage/databases/main/registration.py2731Adds an access token for the given user. Args: user_id: The user ID. token: The new accSTRING
HIGHsynapse/storage/databases/main/registration.py2775Adds a refresh token for the given user. Args: user_id: The user ID. token: The new accSTRING
HIGHsynapse/storage/databases/main/registration.py2866Attempt to validate a threepid session using a token Args: session_id: The id of a validation sessiSTRING
HIGHsynapse/storage/databases/main/e2e_room_keys.py490Get info metadata about a version of our room_keys backup. Args: user_id: the user whose backup we'STRING
HIGHsynapse/storage/databases/main/events.py302Persist a set of events alongside updates to the current state and forward extremities tables. STRING
HIGHsynapse/storage/databases/main/events.py2594Update any outliers with new event info. This turns outliers into ex-outliers (unless the new event was rejecteSTRING
HIGHsynapse/storage/databases/main/session.py64 Creates a new pagination session for the room hierarchy endpoint. Args: session_type: The STRING
HIGHsynapse/storage/databases/main/stream.py1902The stream token for an event Args: event_id: The id of the event to look up a stream token for. STRING
HIGHsynapse/storage/databases/main/ui_auth.py61 Creates a new user interactive authentication session. The session can be used to track the stages necSTRING
HIGHsynapse/storage/databases/main/ui_auth.py117Retrieve a UI auth session. Args: session_id: The ID of the session. Returns: ASTRING
HIGHsynapse/storage/databases/main/devices.py317Ensure the given device is known; add it to the store if not Args: user_id: id of user associated wSTRING
HIGHsynapse/storage/databases/main/room.py1359 Get updates to quarantined media in stream ordering since `from_id`. Paginating forwards: from_id < x STRING
HIGHsynapse/storage/databases/main/state.py235Get the predecessor of an upgraded room if it exists. Otherwise return None. Args: room_id:STRING
HIGHsynapse/storage/databases/main/state.py267Get the create state event for a room. Args: room_id: The room ID. Returns: ThSTRING
HIGHsynapse/storage/databases/main/delayed_events.py130 Inserts a new delayed event in the DB. Args: user_localpart: The localpart of the requesteSTRING
HIGHsynapse/storage/databases/main/delayed_events.py237 Restarts the send time of the matching delayed event, as long as it hasn't already been marked for procSTRING
HIGHsynapse/storage/controllers/persist_events.py410 Write events to the database Args: events_and_contexts: list of tuples of (event, context) STRING
HIGHsynapse/storage/controllers/state.py112Get the event IDs of all the state for the state groups for the given events Args: _room_id: id of STRING
HIGHsynapse/storage/controllers/state.py220Given a list of event_ids and type tuples, return a list of state dicts for each event. Args: STRING
HIGHsynapse/storage/controllers/state.py275 Get the room states after each of a list of events. For each event in `event_ids`, the result containsSTRING
HIGHsynapse/storage/controllers/state.py325 Get the state dict corresponding to a particular event Args: event_id: event whose state sSTRING
HIGHsynapse/storage/controllers/state.py353 Get the state dict corresponding to the state after a particular event Args: event_id: eveSTRING
HIGHsynapse/http/servlet.py102Parse an integer parameter from the request string Args: request: the twisted HTTP request. name: tSTRING
HIGHsynapse/http/servlet.py168Parse an integer parameter from the request string Args: args: A mapping of request args as bytes to a listSTRING
HIGHsynapse/http/servlet.py226Parse a boolean parameter from the request query string Args: request: the twisted HTTP request. naSTRING
HIGHsynapse/http/servlet.py278Parse a boolean parameter from the request query string Args: args: A mapping of request args as bytes to aSTRING
HIGHsynapse/http/servlet.py349 Parse a string parameter as bytes from the request query string. Args: args: A mapping of request argsSTRING
HIGHsynapse/http/servlet.py418 Parse a string parameter from the request query string. If encoding is not None, the content of the query paraSTRING
HIGHsynapse/http/servlet.py461 Parse a JSON parameter from the request query string. Args: request: the twisted HTTP request. STRING
HIGHsynapse/http/servlet.py564 Parse an enum parameter from the request query string. Note that the enum *must only have string values*. STRING
HIGHsynapse/http/servlet.py676 Parse a string parameter from the request query string list. The content of the query param will be decoded toSTRING
119 more matches not shown…
Modern Structural Boilerplate519 hits · 500 pts
SeverityFileLineSnippetContext
LOWscripts-dev/release.py896def update_branch(repo: git.Repo) -> None:CODE
LOWscripts-dev/mypy_synapse_plugin.py198 def set_modules(self, modules: dict[str, MypyFile]) -> None:CODE
LOWtests/unittest.py98logger = logging.getLogger(__name__)CODE
LOWtests/server.py119logger = logging.getLogger(__name__)CODE
LOWtests/test_notifier.py25logger = logging.getLogger(__name__)CODE
LOWtests/test_visibility.py44logger = logging.getLogger(__name__)CODE
LOWtests/util/test_async_helpers.py50logger = logging.getLogger(__name__)CODE
LOWtests/util/test_logcontext.py45logger = logging.getLogger(__name__)CODE
LOWtests/util/caches/test_descriptors.py51logger = logging.getLogger(__name__)CODE
LOWtests/storage/test_id_generators.py59 def _setup_db(self, txn: LoggingTransaction) -> None:CODE
LOWtests/storage/test_state.py41logger = logging.getLogger(__name__)CODE
LOWtests/storage/test_roommember.py44logger = logging.getLogger(__name__)CODE
LOWtests/storage/test_events.py38logger = logging.getLogger(__name__)CODE
LOWtests/storage/test_sliding_sync_tables.py52logger = logging.getLogger(__name__)CODE
LOWtests/storage/test_state_deletion.py28logger = logging.getLogger(__name__)CODE
LOWtests/storage/test_stream.py56logger = logging.getLogger(__name__)CODE
LOWtests/push/test_http.py766 def _set_pusher(self, user_id: str, access_token: str, enabled: bool) -> None:CODE
LOWtests/http/test_proxyagent.py51logger = logging.getLogger(__name__)CODE
LOWtests/http/server/_base.py56logger = logging.getLogger(__name__)CODE
LOWtests/http/federation/test_matrix_federation_agent.py71logger = logging.getLogger(__name__)CODE
LOWtests/synapse_rust/test_http_client.py36logger = logging.getLogger(__name__)CODE
LOWtests/federation/test_federation_server.py48logger = logging.getLogger(__name__)CODE
LOW…s/federation/test_federation_out_of_band_membership.py56logger = logging.getLogger(__name__)CODE
LOWtests/federation/test_federation_devices.py34logger = logging.getLogger(__name__)CODE
LOWtests/replication/_base.py52logger = logging.getLogger(__name__)CODE
LOWtests/replication/test_sharded_event_persister.py35logger = logging.getLogger(__name__)CODE
LOWtests/replication/test_module_cache_invalidation.py29logger = logging.getLogger(__name__)CODE
LOWtests/replication/test_auth.py33logger = logging.getLogger(__name__)CODE
LOWtests/replication/test_pusher_shard.py34logger = logging.getLogger(__name__)CODE
LOWtests/replication/test_client_reader_shard.py28logger = logging.getLogger(__name__)CODE
LOWtests/replication/test_multi_media_repo.py45logger = logging.getLogger(__name__)CODE
LOWtests/replication/test_sharded_receipts.py36logger = logging.getLogger(__name__)CODE
LOWtests/replication/test_federation_sender_shard.py49logger = logging.getLogger(__name__)CODE
LOWtests/replication/storage/test_events.py50logger = logging.getLogger(__name__)CODE
LOWtests/replication/tcp/streams/test_typing.py29logger = logging.getLogger(__name__)CODE
LOWtests/replication/tcp/streams/test_to_device.py32logger = logging.getLogger(__name__)CODE
LOWtests/handlers/test_federation.py49logger = logging.getLogger(__name__)CODE
LOWtests/handlers/test_presence.py2600 def _set_presence(self, user_id: str, state: str = "online") -> None:CODE
LOWtests/handlers/test_sliding_sync.py61logger = logging.getLogger(__name__)CODE
LOWtests/handlers/test_message.py39logger = logging.getLogger(__name__)CODE
LOWtests/handlers/test_profile.py582 def _setup_local_files(self, names_and_props: dict[str, dict[str, Any]]) -> None:CODE
LOWtests/handlers/test_register.py840 async def update_membership(*args: Any, **kwargs: Any) -> None:CODE
LOWtests/handlers/test_directory.py335 def _set_canonical_alias(self, content: JsonDict) -> None:CODE
LOWtests/logging/test_opentracing.py62logger = logging.getLogger(__name__)CODE
LOWtests/rest/admin/test_user.py3117 def set_user_type(self, user_type: str | None) -> None:CODE
LOWtests/rest/client/test_sync.py48logger = logging.getLogger(__name__)CODE
LOWtests/rest/client/test_login.py70logger = logging.getLogger(__name__)CODE
LOWtests/rest/client/test_third_party_rules.py553 def _update_power_levels(self, event_default: int = 0) -> None:CODE
LOWtests/rest/client/test_profile.py781 def _setup_local_files(self, names_and_props: dict[str, dict[str, Any]]) -> None:CODE
LOWtests/rest/client/test_rooms.py4002 def _set_alias_via_directory(self, alias: str, expected_code: int = 200) -> None:CODE
LOWtests/rest/client/test_rooms.py4031 def _set_alias_via_directory(self, alias: str, expected_code: int = 200) -> None:CODE
LOWtests/rest/client/test_versions.py26logger = logging.getLogger(__name__)CODE
LOW…s/rest/client/sliding_sync/test_connection_tracking.py32logger = logging.getLogger(__name__)CODE
LOW…s/rest/client/sliding_sync/test_extension_to_device.py29logger = logging.getLogger(__name__)CODE
LOWtests/rest/client/sliding_sync/test_sliding_sync.py55logger = logging.getLogger(__name__)CODE
LOWtests/rest/client/sliding_sync/test_extensions.py30logger = logging.getLogger(__name__)CODE
LOW…/rest/client/sliding_sync/test_rooms_required_state.py34logger = logging.getLogger(__name__)CODE
LOWtests/rest/client/sliding_sync/test_extension_typing.py30logger = logging.getLogger(__name__)CODE
LOWtests/rest/client/sliding_sync/test_rooms_invites.py29logger = logging.getLogger(__name__)CODE
LOWtests/rest/client/sliding_sync/test_lists_filters.py35logger = logging.getLogger(__name__)CODE
459 more matches not shown…
Unused Imports507 hits · 471 pts
SeverityFileLineSnippetContext
LOWtests/utils.py42CODE
LOWtests/metrics/test_metrics.py27CODE
LOWtests/util/caches/test_descriptors.py22CODE
LOWtests/appservice/test_scheduler.py21CODE
LOWtests/appservice/test_scheduler.py27CODE
LOWtests/appservice/test_scheduler.py29CODE
LOWtests/appservice/test_scheduler.py29CODE
LOWtests/appservice/test_scheduler.py29CODE
LOWtests/appservice/test_scheduler.py40CODE
LOWtests/appservice/test_scheduler.py43CODE
LOWtests/appservice/test_appservice.py22CODE
LOWtests/test_utils/__init__.py46CODE
LOWtests/storage/test_database.py28CODE
LOWtests/http/test_proxyagent.py30CODE
LOWtests/http/__init__.py38CODE
LOWtests/http/test_matrixfederationclient.py28CODE
LOWtests/http/test_simple_client.py31CODE
LOWtests/http/test_client.py27CODE
LOWtests/events/test_utils.py47CODE
LOWtests/handlers/test_oidc.py44CODE
LOWtests/handlers/test_oidc.py45CODE
LOWtests/handlers/test_oidc.py46CODE
LOWtests/handlers/test_oidc.py48CODE
LOWtests/handlers/test_oidc.py48CODE
LOWtests/handlers/test_appservice.py65CODE
LOWtests/rest/admin/test_admin.py21CODE
LOWtests/rest/client/test_third_party_rules.py45CODE
LOWtests/rest/client/test_transactions.py23CODE
LOWsynapse/server.py194CODE
LOWsynapse/server.py195CODE
LOWsynapse/server.py200CODE
LOWsynapse/event_auth.py81CODE
LOWsynapse/notifier.py70CODE
LOWsynapse/metrics/background_process_metrics.py60CODE
LOWsynapse/metrics/background_process_metrics.py63CODE
LOWsynapse/metrics/background_process_metrics.py65CODE
LOWsynapse/metrics/common_usage_metrics.py29CODE
LOWsynapse/metrics/__init__.py62CODE
LOWsynapse/metrics/__init__.py63CODE
LOWsynapse/metrics/__init__.py63CODE
LOWsynapse/crypto/keyring.py59CODE
LOWsynapse/types/__init__.py77CODE
LOWsynapse/types/__init__.py78CODE
LOWsynapse/types/__init__.py79CODE
LOWsynapse/types/__init__.py79CODE
LOWsynapse/types/__init__.py80CODE
LOWsynapse/types/handlers/sliding_sync.py56CODE
LOWsynapse/app/_base.py94CODE
LOWsynapse/app/phone_stats_home.py29CODE
LOWsynapse/app/phone_stats_home.py36CODE
LOWsynapse/util/async_helpers.py30CODE
LOWsynapse/util/logcontext.py26CODE
LOWsynapse/util/logcontext.py26CODE
LOWsynapse/util/logcontext.py26CODE
LOWsynapse/util/logcontext.py26CODE
LOWsynapse/util/logcontext.py26CODE
LOWsynapse/util/logcontext.py26CODE
LOWsynapse/util/logcontext.py26CODE
LOWsynapse/util/logcontext.py26CODE
LOWsynapse/util/threepids.py26CODE
447 more matches not shown…
Cross-File Repetition91 hits · 455 pts
SeverityFileLineSnippetContext
HIGHtests/test_server.py0test that handlers with the `@cancellable` flag can be cancelled.STRING
HIGHtests/http/test_servlet.py0test that handlers with the `@cancellable` flag can be cancelled.STRING
HIGHtests/federation/transport/server/test__base.py0test that handlers with the `@cancellable` flag can be cancelled.STRING
HIGHtests/replication/http/test__base.py0test that handlers with the `@cancellable` flag can be cancelled.STRING
HIGHtests/test_server.py0test that handlers without the `@cancellable` flag cannot be cancelled.STRING
HIGHtests/http/test_servlet.py0test that handlers without the `@cancellable` flag cannot be cancelled.STRING
HIGHtests/federation/transport/server/test__base.py0test that handlers without the `@cancellable` flag cannot be cancelled.STRING
HIGHtests/replication/http/test__base.py0test that handlers without the `@cancellable` flag cannot be cancelled.STRING
HIGHtests/http/test_proxyagent.py0implements factory.log, which is expected by request.finishSTRING
HIGHtests/http/federation/test_matrix_federation_agent.py0implements factory.log, which is expected by request.finishSTRING
HIGHtests/replication/test_multi_media_repo.py0implements factory.log, which is expected by request.finishSTRING
HIGHtests/federation/transport/server/test__base.py0overrides `homeservertestcase.create_test_resource`.STRING
HIGHtests/replication/_base.py0overrides `homeservertestcase.create_test_resource`.STRING
HIGHtests/replication/http/test__base.py0overrides `homeservertestcase.create_test_resource`.STRING
HIGHtests/rest/admin/test_statistics.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_federation.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_background_updates.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_event_reports.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_event.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_room.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_user_reports.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_scheduled_tasks.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_server_notice.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_user.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_media.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_device.py0if the user is not a server admin, an error is returned.STRING
HIGHtests/rest/admin/test_statistics.py0testing that `next_token` appears at the right placeSTRING
HIGHtests/rest/admin/test_user.py0testing that `next_token` appears at the right placeSTRING
HIGHtests/rest/admin/test_federation.py0testing that `next_token` appears at the right placeSTRING
HIGHtests/rest/admin/test_event_reports.py0testing that `next_token` appears at the right placeSTRING
HIGHtests/rest/admin/test_user_reports.py0testing that `next_token` appears at the right placeSTRING
HIGHtests/rest/admin/test_statistics.py0request the list of destinations in a certain order. assert that order is what we expect args: expected_destination_listSTRING
HIGHtests/rest/admin/test_user.py0request the list of destinations in a certain order. assert that order is what we expect args: expected_destination_listSTRING
HIGHtests/rest/admin/test_federation.py0request the list of destinations in a certain order. assert that order is what we expect args: expected_destination_listSTRING
HIGHtests/rest/admin/test_server_notice.py0tests that a lookup for a user that does not exist returns a 404STRING
HIGHtests/rest/admin/test_user.py0tests that a lookup for a user that does not exist returns a 404STRING
HIGHtests/rest/admin/test_room.py0tests that a lookup for a user that does not exist returns a 404STRING
HIGHtests/rest/admin/test_device.py0tests that a lookup for a user that does not exist returns a 404STRING
HIGHtests/rest/admin/test_server_notice.py0tests that a lookup for a user that is not a local returns a 400STRING
HIGHtests/rest/admin/test_user.py0tests that a lookup for a user that is not a local returns a 400STRING
HIGHtests/rest/admin/test_device.py0tests that a lookup for a user that is not a local returns a 400STRING
HIGH…s/rest/client/sliding_sync/test_extension_to_device.py0test to make sure that the sliding sync request waits for new data to arrive. (only applies to incremental syncs with a STRING
HIGHtests/rest/client/sliding_sync/test_sliding_sync.py0test to make sure that the sliding sync request waits for new data to arrive. (only applies to incremental syncs with a STRING
HIGHtests/rest/client/sliding_sync/test_extension_typing.py0test to make sure that the sliding sync request waits for new data to arrive. (only applies to incremental syncs with a STRING
HIGH…ts/rest/client/sliding_sync/test_extension_receipts.py0test to make sure that the sliding sync request waits for new data to arrive. (only applies to incremental syncs with a STRING
HIGH…est/client/sliding_sync/test_extension_account_data.py0test to make sure that the sliding sync request waits for new data to arrive. (only applies to incremental syncs with a STRING
HIGHtests/rest/client/sliding_sync/test_extension_e2ee.py0test to make sure that the sliding sync request waits for new data to arrive. (only applies to incremental syncs with a STRING
HIGH…s/rest/client/sliding_sync/test_extension_to_device.py0test to make sure that the sliding sync request waits for new data to arrive but no data ever arrives so we timeout. we'STRING
HIGHtests/rest/client/sliding_sync/test_sliding_sync.py0test to make sure that the sliding sync request waits for new data to arrive but no data ever arrives so we timeout. we'STRING
HIGHtests/rest/client/sliding_sync/test_extension_typing.py0test to make sure that the sliding sync request waits for new data to arrive but no data ever arrives so we timeout. we'STRING
HIGH…ts/rest/client/sliding_sync/test_extension_receipts.py0test to make sure that the sliding sync request waits for new data to arrive but no data ever arrives so we timeout. we'STRING
HIGH…est/client/sliding_sync/test_extension_account_data.py0test to make sure that the sliding sync request waits for new data to arrive but no data ever arrives so we timeout. we'STRING
HIGHtests/rest/client/sliding_sync/test_extension_e2ee.py0test to make sure that the sliding sync request waits for new data to arrive but no data ever arrives so we timeout. we'STRING
HIGHtests/rest/client/sliding_sync/test_extension_typing.py0test that enabling the account_data extension works during an intitial sync, even if there is no-data.STRING
HIGH…ts/rest/client/sliding_sync/test_extension_receipts.py0test that enabling the account_data extension works during an intitial sync, even if there is no-data.STRING
HIGH…est/client/sliding_sync/test_extension_account_data.py0test that enabling the account_data extension works during an intitial sync, even if there is no-data.STRING
HIGHtests/rest/client/sliding_sync/test_extension_typing.py0test that enabling account_data extension works during an incremental sync, even if there is no-data.STRING
HIGH…ts/rest/client/sliding_sync/test_extension_receipts.py0test that enabling account_data extension works during an incremental sync, even if there is no-data.STRING
HIGH…est/client/sliding_sync/test_extension_account_data.py0test that enabling account_data extension works during an incremental sync, even if there is no-data.STRING
HIGHsynapse/server.py0run the given function in its own logcontext, with resource metrics this should be used to wrap processes which are fireSTRING
31 more matches not shown…
Excessive Try-Catch Wrapping370 hits · 367 pts
SeverityFileLineSnippetContext
LOWscripts-dev/federation_client.py382 except Exception:CODE
LOWscripts-dev/federation_client.py392 except Exception:CODE
LOWscripts-dev/federation_client.py422 except Exception as e:CODE
LOWscripts-dev/dump_macaroon.py24except Exception as e:CODE
LOWscripts-dev/build_debian_packages.py69 except Exception as e:CODE
LOW.ci/scripts/check_lockfile.py15except Exception:CODE
LOWtests/server.py811 except Exception as exc:CODE
LOWtests/server.py1076 except Exception as e:CODE
LOWtests/util/test_async_helpers.py116 except Exception as e:CODE
LOWtests/util/caches/test_cached_call.py124 except Exception as e1:CODE
MEDIUMtests/util/caches/test_cached_call.py121def r() -> None:CODE
LOWtests/storage/test_database.py212 except Exception:CODE
LOWtests/storage/test_appservice.py83 except Exception:CODE
LOWtests/http/federation/test_matrix_federation_agent.py220 except Exception as e:CODE
LOWtests/rest/client/test_third_party_rules.py141 except Exception:CODE
LOWtests/rest/client/test_transactions.py138 except Exception as e:CODE
LOWtests/rest/client/test_transactions.py170 except Exception as e:CODE
LOWdocs/development/synapse_architecture/cancellation.md120except Exception:CODE
LOWdocs/development/synapse_architecture/cancellation.md133except Exception:CODE
LOWdocs/development/synapse_architecture/cancellation.md146except Exception:CODE
LOWdocs/development/synapse_architecture/cancellation.md187except Exception:CODE
LOWdocs/development/synapse_architecture/cancellation.md206except Exception:CODE
LOWcontrib/graph/graph.py64 except Exception:CODE
LOWcontrib/graph/graph2.py121 except Exception:CODE
LOWcontrib/graph/graph3.py124 except Exception:CODE
LOWcontrib/cmdclient/console.py144 except Exception as e:CODE
LOWcontrib/cmdclient/console.py219 except Exception as e:CODE
LOWcontrib/cmdclient/console.py358 except Exception as e:CODE
LOWcontrib/cmdclient/console.py366 except Exception as e:CODE
LOWcontrib/cmdclient/console.py393 except Exception as e:CODE
LOWcontrib/cmdclient/console.py404 except Exception as e:CODE
LOWcontrib/cmdclient/console.py476 except Exception as e:CODE
LOWcontrib/cmdclient/console.py515 except Exception:CODE
LOWcontrib/cmdclient/console.py578 except Exception as e:CODE
LOWcontrib/cmdclient/console.py592 except Exception:CODE
LOWcontrib/cmdclient/console.py783 except Exception:CODE
LOWcontrib/cmdclient/console.py786 except Exception:CODE
MEDIUMcontrib/cmdclient/console.py361def do_joinalias(self, line):CODE
LOWcontrib/cmdclient/http.py164 except Exception as e:CODE
LOWsynapse/server.py510 except Exception:CODE
LOWsynapse/server.py517 except Exception as e:CODE
LOWsynapse/server.py525 except Exception as e:CODE
LOWsynapse/server.py535 except Exception:CODE
LOWsynapse/event_auth.py974 except Exception:CODE
LOWsynapse/event_auth.py979 except Exception:CODE
LOWsynapse/notifier.py376 except Exception:CODE
LOWsynapse/notifier.py491 except Exception:CODE
LOWsynapse/notifier.py497 except Exception:CODE
LOWsynapse/notifier.py599 except Exception:CODE
LOWsynapse/notifier.py625 except Exception:CODE
LOWsynapse/__init__.py79 except Exception:CODE
LOWsynapse/metrics/background_process_metrics.py382 except Exception:CODE
LOWsynapse/metrics/_reactor_metrics.py174 except Exception as e:CODE
LOWsynapse/metrics/jemalloc.py123 except Exception as e:CODE
LOWsynapse/metrics/jemalloc.py225 except Exception as e:CODE
LOWsynapse/metrics/jemalloc.py245 except Exception as e:CODE
LOWsynapse/metrics/__init__.py185 except Exception:CODE
LOWsynapse/crypto/event_signing.py76 except Exception:CODE
LOWsynapse/crypto/keyring.py738 except Exception as e:CODE
LOWsynapse/crypto/keyring.py956 except Exception:CODE
310 more matches not shown…
Deep Nesting337 hits · 270 pts
SeverityFileLineSnippetContext
LOWscripts-dev/mypy_synapse_plugin.py603CODE
LOWscripts-dev/mypy_synapse_plugin.py797CODE
LOWscripts-dev/sign_json.py153CODE
LOWscripts-dev/check_schema_delta.py161CODE
LOWscripts-dev/federation_client.py254CODE
LOWscripts-dev/schema_versions.py60CODE
LOWdocker/start.py68CODE
LOWdocker/configure_workers_and_start.py552CODE
LOWdocker/configure_workers_and_start.py730CODE
LOWtests/test_utils/oidc.py295CODE
LOWtests/test_utils/html_parsers.py41CODE
LOWtests/storage/test_event_federation.py134CODE
LOWtests/http/server/_base.py141CODE
LOWtests/module_api/test_api.py388CODE
LOW…s/federation/test_federation_out_of_band_membership.py174CODE
LOW…s/federation/test_federation_out_of_band_membership.py476CODE
LOWtests/replication/_base.py560CODE
LOWtests/events/test_validator.py54CODE
LOWtests/handlers/test_sliding_sync.py3689CODE
LOWtests/handlers/test_e2e_keys.py209CODE
LOWtests/rest/admin/test_user.py5293CODE
LOWtests/rest/admin/test_user.py5400CODE
LOWtests/rest/admin/test_user.py5519CODE
LOWtests/rest/admin/test_room.py208CODE
LOWtests/rest/admin/test_room.py274CODE
LOWtests/rest/client/test_rooms.py4812CODE
LOWtests/rest/client/sliding_sync/test_sliding_sync.py193CODE
LOWtests/rest/client/sliding_sync/test_extensions.py70CODE
LOW…/rest/client/sliding_sync/test_rooms_required_state.py525CODE
LOWcontrib/graph/graph3.py34CODE
LOWcontrib/cmdclient/console.py202CODE
LOWcontrib/cmdclient/console.py408CODE
LOWsynapse/event_auth.py574CODE
LOWsynapse/event_auth.py879CODE
LOWsynapse/event_auth.py964CODE
LOWsynapse/event_auth.py1171CODE
LOWsynapse/notifier.py537CODE
LOWsynapse/notifier.py633CODE
LOWsynapse/metrics/background_process_metrics.py223CODE
LOWsynapse/metrics/background_process_metrics.py272CODE
LOWsynapse/metrics/_reactor_metrics.py128CODE
LOWsynapse/crypto/keyring.py762CODE
LOWsynapse/types/__init__.py851CODE
LOWsynapse/types/__init__.py938CODE
LOWsynapse/types/__init__.py983CODE
LOWsynapse/types/__init__.py1266CODE
LOWsynapse/types/__init__.py1346CODE
LOWsynapse/types/handlers/sliding_sync.py533CODE
LOWsynapse/types/handlers/sliding_sync.py602CODE
LOWsynapse/types/handlers/sliding_sync.py686CODE
LOWsynapse/app/generic_worker.py182CODE
LOWsynapse/app/generic_worker.py277CODE
LOWsynapse/app/homeserver.py270CODE
LOWsynapse/util/retryutils.py231CODE
LOWsynapse/util/background_queue.py95CODE
LOWsynapse/util/iterutils.py103CODE
LOWsynapse/util/iterutils.py142CODE
LOWsynapse/util/batching_queue.py162CODE
LOWsynapse/util/file_consumer.py128CODE
LOWsynapse/util/check_dependencies.py157CODE
277 more matches not shown…
Redundant / Tautological Comments149 hits · 200 pts
SeverityFileLineSnippetContext
LOWscripts-dev/release.py957 # Check if heading version matches the requested version, or if its anCOMMENT
LOWscripts-dev/docker_update_debian_changelog.sh33# Check if a version was provided.COMMENT
LOWscripts-dev/docker_update_debian_changelog.sh46# Check if devscripts is available in the default repos for this distro.COMMENT
LOWscripts-dev/mypy_synapse_plugin.py556 # Check if the `labelnames` argument includes `SERVER_NAME_LABEL`COMMENT
LOWscripts-dev/mypy_synapse_plugin.py573 # Check if the `labelnames` argument includes the `server_name` label (`SERVER_NAME_LABEL`).COMMENT
LOWscripts-dev/config-lint.sh14# Check if anything changedCOMMENT
LOWscripts-dev/schema_versions.py181 # Print the result back out to stdout.COMMENT
LOWdocker/configure_workers_and_start.py1169 # Write the fileSTRING
LOWdocker/complement/conf/start_for_complement.sh35 # Set START_POSTGRES to false unless it has already been setCOMMENT
LOWtests/server.py1247 # Check if we have set up a DB that we can use as a template.COMMENT
LOWtests/config/test_workers.py100 # Set notify_appservices to false for the initialiser's config,COMMENT
LOWtests/config/test_workers.py212 # Set notify_appservices to false for the initialiser's config,COMMENT
LOWtests/push/test_presentable_names.py106 # Check if the event content has garbage.COMMENT
LOWtests/push/test_presentable_names.py120 # Check if the event content has garbage.COMMENT
LOWtests/push/test_presentable_names.py140 # Check if the event content has garbage.COMMENT
LOWtests/push/test_presentable_names.py175 # Check if the event content has no displayname.COMMENT
LOWtests/push/test_presentable_names.py212 # Check if the event content has no displayname and is an invite.COMMENT
LOWtests/events/test_validator.py87 # Check if this room version enforces strict canonical json.COMMENT
LOWtests/handlers/test_presence.py1920 # Set presence to BUSYCOMMENT
LOWtests/handlers/test_saml.py37# Check if we have the dependencies to run the tests.COMMENT
LOWtests/handlers/test_profile.py118 # Set displayname to an empty stringCOMMENT
LOWtests/handlers/test_profile.py427 # Set avatar to an empty stringCOMMENT
LOWtests/handlers/test_appservice.py756 # Check if our application service - that is interested in exclusive_as_user - receivedCOMMENT
LOWtests/handlers/test_appservice.py978 # Check if our application service - that is interested in exclusive_as_user - receivedCOMMENT
LOWtests/rest/client/test_retention.py374 # Check if the event has been purged from the database.COMMENT
LOWsynapse/event_auth.py590 # Check if this is the room creator joining:COMMENT
LOWsynapse/event_auth.py1102 # Check if the old and new levels are greater than the user levelCOMMENT
LOWsynapse/visibility.py450 # Check if the room has lax history visibility, allowing us to skipCOMMENT
LOWsynapse/metrics/background_process_metrics.py554 # Set proc to None to break the reference cycle.COMMENT
LOWsynapse/metrics/_gc.py115 # Check if we need to do a manual GC (since its been disabled), and doCOMMENT
LOWsynapse/crypto/keyring.py530 # Check if this key's expiry timestamp is valid for the verify request.COMMENT
LOWsynapse/crypto/context_factory.py114 # Check if we're using a custom list of a CA certificatesCOMMENT
LOWsynapse/crypto/context_factory.py150 # Check if certificate verification has been enabledCOMMENT
LOWsynapse/crypto/context_factory.py153 # Check if we've disabled certificate verification for this hostCOMMENT
LOWsynapse/util/daemonize.py130 # Set umask to default to safe file permissions when running as a root daemon. 027COMMENT
LOWsynapse/util/check_dependencies.py309 # Check if the requirement is installed and correctly versioned.COMMENT
LOWsynapse/util/__init__.py221 # Check if the whole dict fits within the size limit. If it does, we canCOMMENT
LOWsynapse/util/caches/deferred_cache.py229 # Check if its in the main cache.COMMENT
LOWsynapse/util/caches/deferred_cache.py239 # Check if its in the pending cacheCOMMENT
LOWsynapse/config/server.py588 # Check if the legacy "restrict_public_rooms_to_local_users" flag is set. ThisCOMMENT
LOWsynapse/config/workers.py304 # Check if the main process is declared. The main process itself doesn't needCOMMENT
LOWsynapse/appservice/__init__.py279 # Check if we have interest in this room IDCOMMENT
LOWsynapse/appservice/__init__.py316 # Check if we're interested in this event's sender by namespace (or if they're theCOMMENT
LOWsynapse/appservice/api.py493 # Check if the appservice fulfilled all of the queried user/device/algorithmsCOMMENT
LOWsynapse/_scripts/synapse_port_db.py767 # Check if all background updates are done, abort if not.STRING
LOWsynapse/state/v1.py168 # Check if there is an unconflicted entry for the state key.COMMENT
LOWsynapse/storage/_base.py198 # Check if an externally defined module cache has been registeredCOMMENT
LOWsynapse/storage/prepare_database.py636 # Check if this line contains an end to the commentCOMMENT
LOWsynapse/storage/databases/state/deletion.py465 # Check if the sequence number has changed, if it has then itSTRING
LOWsynapse/storage/databases/main/registration.py1661 # Check if the token existsSTRING
LOWsynapse/storage/databases/main/registration.py1667 # Check if the token has expiredSTRING
LOWsynapse/storage/databases/main/registration.py1672 # Check if the token has been used upSTRING
LOWsynapse/storage/databases/main/registration.py1850 # Check if the token already existsSTRING
LOWsynapse/storage/databases/main/events_bg_updates.py1866 # Check if the current state has been updated since we gathered it.STRING
LOWsynapse/storage/databases/main/events.py3782 # Check if the new link is redundantCOMMENT
LOWsynapse/storage/databases/main/events.py2115 # Check if any of the remote membership changes requires us toSTRING
LOWsynapse/storage/databases/main/events.py2386 # Check if the event is a backfilled event (with a negative `stream_ordering`).STRING
LOWsynapse/storage/databases/main/events_worker.py2320 # Check if this is a duplicate of an event in the given events.STRING
LOWsynapse/storage/databases/main/events_worker.py2328 # Check if this is a duplicate of an event we've alreadySTRING
LOWsynapse/storage/databases/main/deviceinbox.py880 # Check if we've already inserted a matching message_id for thatSTRING
89 more matches not shown…
Hallucination Indicators15 hits · 160 pts
SeverityFileLineSnippetContext
CRITICALtests/replication/test_sharded_event_persister.py153 self.hs.config.worker.events_shard_config.get_instance(room_id1), "worker1"CODE
CRITICALtests/replication/test_sharded_event_persister.py156 self.hs.config.worker.events_shard_config.get_instance(room_id2), "worker2"CODE
CRITICALtests/rest/client/test_register.py1106 expected_html = self.hs.config.account_validity.account_validity_account_renewed_template.render(CODE
CRITICALtests/rest/client/test_register.py1124 expected_html = self.hs.config.account_validity.account_validity_account_previously_renewed_template.render(CODE
CRITICALtests/rest/client/test_register.py1151 expected_html = self.hs.config.account_validity.account_validity_invalid_token_template.render()CODE
CRITICALsynapse/storage/controllers/purge_events.py57 self.stores.state.db_pool.updates.register_background_update_handler(CODE
CRITICALsynapse/storage/controllers/purge_events.py249 await self.stores.state.db_pool.updates._end_background_update(CODE
CRITICALsynapse/storage/controllers/purge_events.py268 await self.stores.state.db_pool.updates._background_update_progress(CODE
CRITICALsynapse/storage/controllers/purge_events.py274 await self.stores.state.db_pool.updates._end_background_update(CODE
CRITICALsynapse/static/client/login/js/jquery-3.4.1.min.js2!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):fCODE
CRITICALsynapse/handlers/auth.py1680 ) + self.hs.config.auth.password_pepper.encode("utf8")CODE
CRITICALsynapse/handlers/room.py1398 self.hs.config.worker.events_shard_config.get_instance(room_id),CODE
CRITICALsynapse/handlers/room.py2396 self.hs.config.worker.events_shard_config.get_instance(new_room_id),CODE
CRITICALsynapse/handlers/room.py2428 self.hs.config.worker.events_shard_config.get_instance(room_id),CODE
CRITICALsynapse/rest/admin/users.py645 key=self.hs.config.registration.registration_shared_secret.encode(),CODE
Cross-Language Confusion24 hits · 131 pts
SeverityFileLineSnippetContext
HIGHscripts-dev/release.py244 sytest_repo.git.push("-u", sytest_repo.remote().name, release_branch_name)CODE
HIGHscripts-dev/release.py248 complement_repo.git.push(CODE
HIGHscripts-dev/release.py320 synapse_repo.git.push(CODE
HIGHscripts-dev/release.py391 repo.git.push(repo.remote().name, "tag", tag_name)CODE
HIGHtests/test_types.py246 Tests that `Absent` rejects `None` (JSON null) when used in Pydantic models.STRING
HIGHtests/test_types.py256 MyModel.model_validate_json('{"absent": null}')CODE
HIGHtests/federation/test_complexity.py106 # Check whether an admin can join if option "admins_can_join" is undefined,COMMENT
HIGHtests/replication/tcp/test_commands.py37 line = 'RDATA events master 6287863 ["ev", ["$eventid", "!roomid", "type", null, null, null]]'CODE
HIGHtests/rest/client/sliding_sync/test_rooms_meta.py651 # > If a room has an m.room.name event with an absent, null, orCOMMENT
HIGHsynapse/metrics/jemalloc.py98 # (if not null), and newp/newlen is the buffer with the new value to setCOMMENT
HIGHsynapse/metrics/jemalloc.py99 # (if not null). Note that they're all references *except* newlen.COMMENT
HIGHsynapse/util/daemonize.py115 # now that we have redirected stderr to /dev/null, any uncaught exceptions willCOMMENT
HIGHsynapse/util/daemonize.py116 # get sent to /dev/null, so make sure we log them.COMMENT
HIGHsynapse/config/appservice.py115 # 'url' must either be a string or explicitly null, not missingCOMMENT
HIGHsynapse/config/logger.py262 # be redirected to /dev/null, but there's not much we can do)STRING
HIGHsynapse/_scripts/synapse_port_db.py466 # We need to make sure there is a single row, `(X, null), as that isSTRING
HIGHsynapse/storage/databases/state/deletion.py440 SELECT state_group, null, null FROM state_groups_persistingCODE
HIGHsynapse/storage/databases/main/events_bg_updates.py743 # We don't want to leave it null, as then we'll never try andSTRING
HIGHsynapse/storage/databases/main/events.py1835 SELECT ?, ?, room_id, type, state_key, null, event_idCODE
HIGHsynapse/storage/databases/main/keys.py174 # Old keys may be stored with a ts_valid_until_ms of null,STRING
HIGHsynapse/storage/schema/main/delta/42/user_dir.py38INSERT INTO user_directory_stream_pos (stream_id) VALUES (null);CODE
HIGHsynapse/replication/tcp/streams/events.py43 RDATA events 12345 ["ev", ["$event:id", "!room:id", "m.type", null, null]]STRING
HIGHsynapse/handlers/sliding_sync/__init__.py937 # If a room has an m.room.name event with an absent, null, or emptyCOMMENT
HIGHsynapse/rest/admin/registration_tokens.py63 "uses_allowed": null,STRING
AI Slop Vocabulary72 hits · 104 pts
SeverityFileLineSnippetContext
LOWscripts-dev/mypy_synapse_plugin.py247 # callback, let's just pass it in while we have it.COMMENT
LOWdocker/configure_workers_and_start.py568 # It doesn't exist yet, just use the new dict(but take a copy not a reference)STRING
LOWdocker/configure_workers_and_start.py691 # start.py already does this for us, so just call that.STRING
MEDIUMtests/app/test_homeserver_shutdown.py248 # To help debug this test when it fails, it is useful to leverage theCOMMENT
LOWtests/storage/databases/main/test_events_worker.py524 # Don't bother with the types here, we just pass into the original function.COMMENT
LOWtests/federation/test_federation_sender.py497 # We can't just use `self.fail(...)` here because the app code is greedyCOMMENT
LOWtests/api/test_auth.py265 # This also needs to just return a truth-y valueCOMMENT
LOWtests/api/test_auth.py300 # This also needs to just return a falsey valueCOMMENT
LOWtests/handlers/test_oidc.py1249 # in this case we'll just use the same username. A more realistic exampleCOMMENT
LOWtests/handlers/test_presence.py2250 # We don't actually check signatures in tests, so lets just create aCOMMENT
MEDIUMtests/rest/client/test_sync_sticky_events.py481 """Sync token to pass to `?since=` in order to do an incremental sync."""STRING
LOWcontrib/cmdclient/console.py791 # If using another HTTP client, just call syn_cmd.cmdloop()COMMENT
MEDIUM.github/dependabot.yml16 # Less PRs means a streamlined review process.COMMENT
LOW.github/workflows/release-artifacts.yml36 # if we're running from a tag, get the full list of distros; otherwise just use debian:sidCOMMENT
LOWsynapse/metrics/background_process_metrics.py305 # used (so we just use `Any` for the type). Ideally, we'd be able toCOMMENT
LOWsynapse/metrics/__init__.py460 # `buckets` at the same time (artificial limitation), we will just set theseCOMMENT
LOWsynapse/types/state.py221 # If there are no non-member wild cards we can just return ourselvesCOMMENT
LOWsynapse/types/handlers/sliding_sync.py590 # Otherwise, just add it to the setCOMMENT
LOWsynapse/types/handlers/sliding_sync.py677 # Otherwise, just add it to the setCOMMENT
LOWsynapse/types/handlers/sliding_sync.py739 # We're lazy-loading membership so we can just return the state we have.COMMENT
LOWsynapse/util/__init__.py222 # skip the splitting logic and just return the original dict.COMMENT
LOWsynapse/util/httpresourcetree.py46 # ideally we'd just use getChild and putChild but getChild doesn't workCOMMENT
MEDIUMsynapse/_scripts/generate_workers_map.py160 # NOTE: a more robust implementation would properly shutdown/cleanup each serverCOMMENT
LOWsynapse/state/v2.py871 # Didn't find a power level auth event, so we just return 0COMMENT
LOWsynapse/storage/background_updates.py1141 # For postgres we can just add the constraint and mark it as NOT VALID,STRING
LOWsynapse/storage/databases/main/events_bg_updates.py741 # have an origin_server_ts, lets just use the current timestamp.STRING
LOWsynapse/storage/databases/main/events_bg_updates.py2218 # out-of-band memberships, we can just set this to `True` as ifSTRING
LOWsynapse/storage/databases/main/roommember.py2057 # If we haven't got a last processed room then just use the emptySTRING
LOWsynapse/storage/databases/main/transactions.py481 # therefore sort the output and just return the first 25 rows. Obviously thatSTRING
LOWsynapse/storage/databases/main/stream.py1758 # can just use the latest position from it.COMMENT
LOWsynapse/storage/databases/main/event_federation.py1473 # we just use the 10 newest events. Older events will becomeSTRING
LOWsynapse/storage/util/id_generators.py384 # date. If we're using Postgres for the sequences, we can just use the currentSTRING
LOWsynapse/storage/controllers/persist_events.py1227 # so lets just return that.COMMENT
LOWsynapse/push/__init__.py178 # We just use the minimum stream ordering and ignore the vector clockCOMMENT
LOWsynapse/push/pusherpool.py271 # We just use the minimum stream ordering and ignore the vector clockCOMMENT
LOWsynapse/push/pusherpool.py286 # We just use the minimum stream ordering and ignore the vector clockCOMMENT
LOWsynapse/push/mailer.py761 # The sender is unknown, just use the room name (or ID).COMMENT
LOWsynapse/http/site.py736 # for now, we just use the first x-forwarded-for header. Really, we oughtCOMMENT
LOWsynapse/http/matrixfederationclient.py726 # that treq.request gives: just use the raw Agent.COMMENT
LOWsynapse/http/federation/matrix_federation_agent.py435 # SRV lookups and just use the given host/port.COMMENT
LOWsynapse/federation/transport/server/_base.py347 # just use our context as a parentCOMMENT
LOWsynapse/federation/sender/__init__.py509 # We just use the minimum stream ordering and ignore the vector clockCOMMENT
LOWsynapse/api/auth/base.py347 # We only just set this so it can't be None!COMMENT
LOWsynapse/replication/tcp/commands.py66 # by default, we just use the command name.COMMENT
LOWsynapse/replication/http/_base.py412 # We just use the txn_id here, but we probably also want to use theCOMMENT
LOWsynapse/handlers/sync.py423 # database (invalid), then we simply use our max persisted position (recoverCOMMENT
LOWsynapse/handlers/sync.py428 # just return an empty response.COMMENT
LOWsynapse/handlers/sync.py1302 # timeline. If at the end we can just use the current state.COMMENT
LOWsynapse/handlers/sync.py1434 # timeline. If at the end we can just use the current state delta stream.COMMENT
LOWsynapse/handlers/sync.py3065 # Naively, we would just return the difference between the state at the startCOMMENT
LOWsynapse/handlers/appservice.py103 # We just use the minimum stream ordering and ignore the vector clockCOMMENT
LOWsynapse/handlers/presence.py2063 # Hence this guard where we just return nothing so that the syncCOMMENT
LOWsynapse/handlers/federation_event.py584 # When we don't know about any of the prev events, it's fine to just useCOMMENT
LOWsynapse/handlers/directory.py175 # Let's just return a generic message, as there may be all sorts ofCOMMENT
LOWsynapse/handlers/directory.py502 # Let's just return a generic message, as there may be all sorts ofCOMMENT
LOWsynapse/handlers/identity.py375 # If not, just return a success without sending an emailCOMMENT
LOWsynapse/handlers/federation.py324 # Check that we actually have later backfill points, if not just return.COMMENT
LOWsynapse/handlers/sliding_sync/__init__.py159 # database (invalid), then we simply use our max persisted position (recoverCOMMENT
LOWsynapse/handlers/sliding_sync/__init__.py172 # just return an empty response.COMMENT
LOWsynapse/handlers/sliding_sync/__init__.py1419 # To deal with this, we just set the bump stamp to zero, which willCOMMENT
12 more matches not shown…
Fake / Example Data55 hits · 61 pts
SeverityFileLineSnippetContext
LOWtests/test_event_auth.py925 pl_event.room_version, pl_event, {("fake_type", "fake_key"): pl_event2}CODE
LOWtests/test_event_auth.py930 pl_event.room_version, pl_event2, {("fake_type", "fake_key"): pl_event}CODE
LOWtests/storage/test_registration.py159 "fake_token",CODE
LOWtests/storage/test_registration.py174 "fake_token",CODE
LOWtests/storage/databases/main/test_end_to_end_keys.py47 dummy_key = {"keys": {"a": "b"}}CODE
LOWtests/storage/databases/main/test_end_to_end_keys.py49 self.store.set_e2e_cross_signing_key(alice, "master", dummy_key)CODE
LOWtests/api/test_ratelimiting.py38 token="fake_token",CODE
LOWtests/api/test_ratelimiting.py77 token="fake_token",CODE
LOWtests/handlers/test_send_email.py118 "foo@bar.com", "test subject", "Tests", "HTML content", "Text content"CODE
LOWtests/handlers/test_send_email.py154 self.assertEqual(str(user), "foo@bar.com")CODE
LOWtests/handlers/test_send_email.py175 "foo@bar.com", "test subject", "Tests", "HTML content", "Text content"CODE
LOWtests/handlers/test_send_email.py221 self.assertEqual(str(user), "foo@bar.com")CODE
LOWtests/handlers/test_e2e_keys.py222 "alg1:k1": {"dummy_id": 1},CODE
LOWtests/handlers/test_e2e_keys.py223 "alg1:k2": {"dummy_id": 2},CODE
LOWtests/handlers/test_e2e_keys.py224 "alg2:k3": {"dummy_id": 3},CODE
LOWtests/handlers/test_e2e_keys.py225 "alg2:k4": {"dummy_id": 4},CODE
LOWtests/handlers/test_e2e_keys.py228 "alg1:k5": {"dummy_id": 5},CODE
LOWtests/handlers/test_e2e_keys.py229 "alg1:k6": {"dummy_id": 6},CODE
LOWtests/handlers/test_e2e_keys.py230 "alg2:k7": {"dummy_id": 7},CODE
LOWtests/handlers/test_e2e_keys.py231 "alg2:k8": {"dummy_id": 8},CODE
LOWtests/handlers/test_e2e_keys.py236 "alg1:k9": {"dummy_id": 9},CODE
LOWtests/handlers/test_e2e_keys.py237 "alg1:k10": {"dummy_id": 10},CODE
LOWtests/handlers/test_e2e_keys.py238 "alg2:k11": {"dummy_id": 11},CODE
LOWtests/handlers/test_e2e_keys.py239 "alg2:k12": {"dummy_id": 12},CODE
LOWtests/handlers/test_e2e_keys.py242 "alg1:k13": {"dummy_id": 13},CODE
LOWtests/handlers/test_e2e_keys.py243 "alg1:k14": {"dummy_id": 14},CODE
LOWtests/handlers/test_e2e_keys.py244 "alg2:k15": {"dummy_id": 15},CODE
LOWtests/handlers/test_e2e_keys.py245 "alg2:k16": {"dummy_id": 16},CODE
LOWtests/handlers/test_e2e_keys.py250 "alg1:k17": {"dummy_id": 17},CODE
LOWtests/handlers/test_e2e_keys.py251 "alg1:k18": {"dummy_id": 18},CODE
LOWtests/handlers/test_e2e_keys.py252 "alg2:k19": {"dummy_id": 19},CODE
LOWtests/handlers/test_e2e_keys.py253 "alg2:k20": {"dummy_id": 20},CODE
LOWtests/handlers/test_e2e_keys.py256 "alg1:k21": {"dummy_id": 21},CODE
LOWtests/handlers/test_e2e_keys.py257 "alg1:k22": {"dummy_id": 22},CODE
LOWtests/handlers/test_e2e_keys.py258 "alg2:k23": {"dummy_id": 23},CODE
LOWtests/handlers/test_e2e_keys.py259 "alg2:k24": {"dummy_id": 24},CODE
LOWtests/handlers/test_e2e_keys.py1771 dummy_key = {"keys": {"a": "b"}}CODE
LOWtests/handlers/test_e2e_keys.py1773 self.store.set_e2e_cross_signing_key("@alice:test", "master", dummy_key)CODE
LOWtests/rest/admin/test_user.py1554 self.store.user_add_threepid("@user:test", "email", "foo@bar.com", 0, 0)CODE
LOWtests/rest/admin/test_user.py1642 self.assertEqual("foo@bar.com", channel.json_body["threepids"][0]["address"])CODE
LOWtests/rest/admin/test_user.py1710 self.assertEqual("foo@bar.com", channel.json_body["threepids"][0]["address"])CODE
LOWtests/rest/admin/test_user.py1764 self.assertEqual("foo@bar.com", channel.json_body["threepids"][0]["address"])CODE
LOWtests/rest/admin/test_user.py2766 self.store.user_add_threepid("@user:test", "email", "foo@bar.com", 0, 0)CODE
LOWtests/rest/admin/test_user.py2779 self.assertEqual("foo@bar.com", channel.json_body["threepids"][0]["address"])CODE
LOWtests/rest/admin/test_user.py5147 fake_user = "@bums:other"CODE
LOWtests/rest/admin/test_user.py5149 "POST", self.url(fake_user), access_token=self.admin_user_tokCODE
LOWtests/rest/admin/test_user.py5162 dummy_key = {"keys": {"a": "b"}}CODE
LOWtests/rest/admin/test_user.py5164 self.store.set_e2e_cross_signing_key(self.other_user, "master", dummy_key)CODE
LOWtests/rest/client/test_rooms.py1692 channel = self.make_request("PUT", path, {"displayname": "John Doe"})CODE
LOWtests/rest/client/test_rooms.py1706 self.assertEqual(channel.json_body["displayname"], "John Doe")CODE
LOWtests/rest/synapse/mas/test_users.py1374 dummy_key = {"keys": {"a": "b"}}CODE
LOWtests/rest/synapse/mas/test_users.py1376 store.set_e2e_cross_signing_key(str(alice), "master", dummy_key)CODE
LOWtests/rest/synapse/mas/test_users.py1460 dummy_key = {"keys": {"a": "b"}}CODE
LOWtests/rest/synapse/mas/test_users.py1462 store.set_e2e_cross_signing_key(str(alice), "master", dummy_key)CODE
LOWsynapse/types/rest/client/__init__.py92 # Without this, an email stored in the database as "foo@bar.com" would causeCOMMENT
Decorative Section Separators14 hits · 42 pts
SeverityFileLineSnippetContext
MEDIUMtests/storage/test_sliding_sync_tables.py1859 # ======================================================COMMENT
MEDIUMtests/storage/test_sliding_sync_tables.py1958 # ======================================================COMMENT
MEDIUMtests/storage/test_sliding_sync_tables.py2025 # ======================================================COMMENT
MEDIUMtests/http/test_matrixfederationclient.py259 # ------------------------------------------------------COMMENT
MEDIUMtests/http/test_matrixfederationclient.py277 # -------------------------------------------------------COMMENT
MEDIUMtests/http/test_matrixfederationclient.py298 # ----------------------------------------------------------COMMENT
MEDIUMtests/http/test_simple_client.py144 # ------------------------------------------------------COMMENT
MEDIUMtests/http/test_simple_client.py156 # -------------------------------------------------------COMMENT
MEDIUMtests/http/test_simple_client.py173 # ----------------------------------------------------------COMMENT
MEDIUM…/rest/client/sliding_sync/test_rooms_required_state.py1767 # =====================================================================COMMENT
MEDIUMsynapse/metrics/_gc.py170 # -----------------------------COMMENT
MEDIUMsynapse/metrics/_gc.py179 # -----------------------------COMMENT
MEDIUMsynapse/util/httpresourcetree.py70 # ===========================COMMENT
MEDIUMsynapse/handlers/sync.py3091 # ----------COMMENT
Slop Phrases25 hits · 40 pts
SeverityFileLineSnippetContext
LOWpyproject.toml159# If this is updated, don't forget to update the equivalent lines inCOMMENT
LOWpyproject.toml159# If this is updated, don't forget to update the equivalent lines inCOMMENT
LOWpyproject.toml286 # If this is updated, don't forget to update the equivalent lines inCOMMENT
LOWpyproject.toml286 # If this is updated, don't forget to update the equivalent lines inCOMMENT
LOWmypy.ini11# If you add a new plugin, make sure to check whether the hooks being used conflict withCOMMENT
MEDIUMscripts-dev/complement.sh33# you can use 'unverifiable' sources such as git repositories as dependencies.COMMENT
LOWscripts-dev/complement.sh48# XXX: If the Docker image name changes, don't forget to updateCOMMENT
LOWscripts-dev/complement.sh48# XXX: If the Docker image name changes, don't forget to updateCOMMENT
LOWscripts-dev/complement.sh55# XXX: If the Docker image name changes, don't forget to updateCOMMENT
LOWscripts-dev/complement.sh55# XXX: If the Docker image name changes, don't forget to updateCOMMENT
LOWrust/src/events/unsigned.rs65/// new field we don't forget to add it to all the necessary places.COMMENT
MEDIUMtests/unittest.py749 # If you have a first `Deferred` `D1`, you can add a callback which returnsCOMMENT
LOWsynapse/util/metrics.py295 Don't forget to register this registry with the main registry!STRING
LOWsynapse/util/caches/lrucache.py907 # We're about to be deleted, so we make sure to clear up all the nodesCOMMENT
LOWsynapse/storage/_base.py102 # XXX: If you add something to this function make sure you add it toCOMMENT
LOWsynapse/storage/databases/main/roommember.py1563 # `sliding_sync_joined_rooms` or `forgotten`), make sure to bust theCOMMENT
LOWsynapse/storage/databases/main/transactions.py488 # (NB: we make sure to do the top-level sort and limit on the database, ratherSTRING
LOWsynapse/storage/databases/main/cache.py395 # XXX: If you add something to this function make sure you add it toSTRING
MEDIUMsynapse/storage/databases/main/event_federation.py835 # It's worth noting that once we have the ALL_ sets, we no longer care about the paths.STRING
LOWsynapse/storage/databases/main/purge_events.py251 # This will commit the txn in sqlite, so make sure to keep this actually last.COMMENT
LOWsynapse/storage/databases/main/purge_events.py441 # so make sure to keep this actually last.STRING
LOWsynapse/events/builder.py250 # Also make sure to point to the previous membership event that willCOMMENT
MEDIUMsynapse/server_notices/server_notices_manager.py121 # it's worth noting that there is an asymmetry here in that weCOMMENT
MEDIUMsynapse/handlers/oidc.py1580 but it's worth noting that we still put the generated secret in the "client_secret"STRING
LOWsynapse/handlers/sliding_sync/__init__.py148 # If we're working with a user-provided token, we need to make sure to wait forCOMMENT
AI Structural Patterns37 hits · 30 pts
SeverityFileLineSnippetContext
LOWtests/unittest.py560CODE
LOWtests/server.py447CODE
LOWtests/test_state.py864CODE
LOW…s/federation/test_federation_out_of_band_membership.py351CODE
LOW…s/federation/test_federation_out_of_band_membership.py504CODE
LOWtests/replication/storage/test_events.py237CODE
LOWsynapse/notifier.py832CODE
LOWsynapse/util/caches/descriptors.py532CODE
LOWsynapse/util/caches/descriptors.py212CODE
LOWsynapse/appservice/__init__.py92CODE
LOWsynapse/state/__init__.py549CODE
LOWsynapse/storage/databases/main/registration.py232CODE
LOWsynapse/storage/databases/main/transactions.py190CODE
LOWsynapse/storage/databases/main/__init__.py181CODE
LOWsynapse/storage/databases/main/stream.py1407CODE
LOWsynapse/http/proxyagent.py118CODE
LOWsynapse/http/matrixfederationclient.py968CODE
LOWsynapse/http/matrixfederationclient.py985CODE
LOWsynapse/http/matrixfederationclient.py1001CODE
LOWsynapse/http/federation/matrix_federation_agent.py250CODE
LOWsynapse/module_api/__init__.py386CODE
LOWsynapse/module_api/__init__.py482CODE
LOWsynapse/module_api/callbacks/spamchecker_callbacks.py275CODE
LOW…ule_api/callbacks/third_party_event_rules_callbacks.py189CODE
LOWsynapse/handlers/register.py228CODE
LOWsynapse/handlers/register.py722CODE
LOWsynapse/handlers/message.py581CODE
LOWsynapse/handlers/message.py977CODE
LOWsynapse/handlers/message.py1122CODE
LOWsynapse/handlers/message.py1248CODE
LOWsynapse/handlers/admin.py101CODE
LOWsynapse/handlers/room_member.py397CODE
LOWsynapse/handlers/room_member.py579CODE
LOWsynapse/handlers/room_member.py698CODE
LOWsynapse/handlers/initial_sync.py299CODE
LOWsynapse/rest/client/login.py365CODE
LOWsynapse/rest/client/login.py367CODE
Verbosity Indicators9 hits · 13 pts
SeverityFileLineSnippetContext
LOWcomplement/tests/federation_room_join_test.go140 // Step 1: make_join, hs1 returns a join event template whose prev_eventsCOMMENT
LOWcomplement/tests/federation_room_join_test.go149 // Step 2: Alice sends a message on hs1. This advances the DAG past theCOMMENT
LOWcomplement/tests/federation_room_join_test.go161 // Step 3: Build and sign the join event, then send_join.COMMENT
LOWcomplement/tests/federation_room_join_test.go178 // Step 4: hs1 should make the missed message discoverable to the joiningCOMMENT
LOWsynapse/res/templates/sso_error.html83 // We might end up with no error in the URL, so we need to check if we have oneCOMMENT
LOWsynapse/replication/tcp/handler.py875 We need to check if the client is interested in the stream or notSTRING
LOWsynapse/handlers/e2e_keys.py1572 The purpose of this function is to detect whether or not we need to apply UIA checks.STRING
LOWsynapse/handlers/user_directory.py281 # For join rule and visibility changes we need to check if the roomCOMMENT
LOWsynapse/rest/client/login.py102 # Whether we need to check if the user has been approved or not.COMMENT
Structural Annotation Overuse5 hits · 9 pts
SeverityFileLineSnippetContext
LOWcomplement/tests/federation_room_join_test.go140 // Step 1: make_join, hs1 returns a join event template whose prev_eventsCOMMENT
LOWcomplement/tests/federation_room_join_test.go149 // Step 2: Alice sends a message on hs1. This advances the DAG past theCOMMENT
LOWcomplement/tests/federation_room_join_test.go161 // Step 3: Build and sign the join event, then send_join.COMMENT
LOWcomplement/tests/federation_room_join_test.go178 // Step 4: hs1 should make the missed message discoverable to the joiningCOMMENT
LOWsynapse/storage/databases/main/transactions.py280 # WARNING: This is executed in autocommit, so we shouldn't add any moreCOMMENT
Overly Generic Function Names6 hits · 4 pts
SeverityFileLineSnippetContext
LOWtests/http/test_additional_resource.py37 async def handle_request(self, request: Request) -> None:CODE
LOWtests/http/test_additional_resource.py46 async def handle_request(self, request: Request) -> None:CODE
LOWsynapse/util/caches/response_cache.py321 async def handle_request(request):STRING
LOWsynapse/util/caches/cached_call.py54 async def handle_request() -> X:STRING
LOWsynapse/util/caches/descriptors.py607 def do_something(self, first_arg, second_arg):STRING
LOWsynapse/http/site.py478 async def handle_request(request):STRING
Example Usage Blocks1 hit · 2 pts
SeverityFileLineSnippetContext
LOWdebian/manage_debconf.pl5# Usage:COMMENT
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsynapse/media/storage_provider.py114 # TODO: Handle errors.COMMENT