AI Slop Code RIsk Monitor

element-hq/synapse

Synapse: Matrix homeserver written in Python/Twisted + Rust

24.2 Elevated pattern signal View on GitHub

Maintenance and Governance Review

This report summarizes scanner evidence for element-hq/synapse, a Python project with 4,689 GitHub stars. SynthScan examined 572,354 lines of code across 1732 source files, recording 10004 pattern matches distributed across 23 syntactic categories. The legacy adjusted pattern signal is 24.2 (Elevated pattern signal); it is not an authorship estimate.

Use the findings to ask whether maintainers can explain intent, verify dependencies, simplify unnecessary scaffolding, and focus review effort. Risk Payload v1 adds ownership, supply-chain, over-engineering, and review-effort vectors when available. These are prompts for human verification, not probabilities, security findings, or measured maintenance costs.

24.2
Adjusted Signal
24.2
Raw Pattern Score
100%
Time Factor
2026-10-10
Last Push
4.7K
Stars
Python
Language
572.4K
Lines of Code
1.7K
Files
10.0K
Pattern Hits
2026-10-12
Scan Date
0.24
HC Hit Rate

Risk Review · v3

Use each vector to guide manual verification of the underlying findings.

Cognitive Ownership Risk 61.9/100 · HIGH

Can maintainers explain intent, assumptions, and trade-offs? 8267 finding(s).

Hallucinated Dependency & Supply Chain Risk 7.3/100 · LOW

Are imports declared and package/API names verified? 616 finding(s).

Agent Over-Engineering Ratio 40.1/100 · MEDIUM

Are wrappers, guards, and repeated structures necessary? 5794 finding(s).

PR Review Velocity Impact 73.2/100 · HIGH

Which changes need focused human review? 10004 finding(s).

What These Metrics Mean

Adjusted Signal
Legacy pattern score normalized per 1,000 scanned lines and multiplied by the repository-level time factor. It is not an estimate of AI authorship.
Raw Pattern Score
Sum of severity- and context-weighted pattern findings before applying the time factor.
Time Factor
A coarse multiplier based on repository last-push metadata. It does not identify when individual code was written.
Pattern Hits
Count of configured pattern findings. Review each location and surrounding code before acting.
HC Hit Rate
High- and critical-severity findings per scanned file. Severity is a configured detector weight, not proof of a vulnerability or authorship.
Lines / Files
Scan coverage denominators used by the legacy normalized score.

Pattern-Signal History

This chart tracks the legacy adjusted pattern score across scan runs. Changes can reflect source changes, scan coverage, or detector/scoring versions; they do not measure AI adoption or prove that a team refactored code. Compare runs only when their scoring versions are compatible. The dashed line tracks the raw pattern-hit count.

Severity Breakdown

Groups findings by configured severity weight. Severity is not a confidence estimate, security rating, or proof that a package is missing. Verify imports against the project's manifests and inspect each finding in its local design context.

CRITICAL 18HIGH 402MEDIUM 1455LOW 8129

Directory Score Breakdown

This horizontal bar chart shows where configured pattern scores accumulate across directories. Treat the bars as locations to inspect, not as evidence of authorship or code quality. Use the file-level findings to decide whether a directory needs a focused ownership, dependency, complexity, or review check.

Pattern Findings

The scanner identified 10004 distinct pattern matches across 23 syntactic categories. Each entry below represents a discrete location in the source code where the engine recorded a detector match to inspect in context. 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 configured finding weight (CRITICAL / HIGH / MEDIUM / LOW). The Context column identifies whether the match occurred inside executable code, an inline comment, or a string literal — legacy comment-context matches receive a ×1.5 score weight. The ⚡ bolt icon marks clustered matches: three or more patterns within a 10-line window, each receiving an additional ×1.5 density multiplier under the legacy scoring model.

Self-Referential Comments1409 hits · 4250 pts
SeverityFileLineSnippetContext
MEDIUMscripts-dev/make_full_schema.sh99# Create the output directory if it doesn't existCOMMENT
MEDIUMscripts-dev/make_full_schema.sh208# Create the PostgreSQL database.COMMENT
MEDIUMscripts-dev/release.py3# This file is licensed under the Affero General Public License (AGPL) version 3.COMMENT
MEDIUM⚡scripts-dev/release.py238 # Create the new release branchCOMMENT
MEDIUMscripts-dev/release.py408 # 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.py942 # 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.py1099 # 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.py1331 # 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
MEDIUM⚡tests/test_notifier.py39 # Create a tokenCOMMENT
MEDIUMtests/test_notifier.py65 # Create the new token based on the stream ID above.COMMENT
MEDIUMtests/test_notifier.py112 # Create the new token based on the stream ID above.COMMENT
MEDIUMtests/test_notifier.py148 # Create a new token with the stream IDs artificially advanced far intoCOMMENT
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.py293 # 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
MEDIUM⚡tests/util/test_linearizer.py240 # Create a second task, waiting for the first task.COMMENT
1349 more matches not shown…
Hyper-Verbose Identifiers4635 hits · 3920 pts
SeverityFileLineSnippetContext
LOWscripts-dev/release.py855def get_repo_and_check_clean_checkout(CODE
LOWscripts-dev/release.py971def generate_and_write_changelog(CODE
LOWscripts-dev/mypy_synapse_plugin.py235 def get_function_signature_hook(CODE
LOWscripts-dev/mypy_synapse_plugin.py265 def get_method_signature_hook(CODE
LOWscripts-dev/mypy_synapse_plugin.py405def check_add_system_event_trigger(ctx: MethodSigContext) -> CallableType:CODE
LOWscripts-dev/mypy_synapse_plugin.py453def analyze_prometheus_metric_classes(ctx: ClassDefContext) -> None:CODE
LOWscripts-dev/mypy_synapse_plugin.py488def check_prometheus_metric_instantiation(CODE
LOWscripts-dev/mypy_synapse_plugin.py625def cached_function_method_signature(ctx: MethodSigContext) -> CallableType:CODE
LOWscripts-dev/mypy_synapse_plugin.py702def check_is_cacheable_wrapper(ctx: MethodSigContext) -> CallableType:CODE
LOWscripts-dev/check_schema_delta.py256def _replace_auto_increment_primary_key_placeholder(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.py490def add_worker_roles_to_shared_config(STRING
LOWdocker/configure_workers_and_start.py555def merge_worker_template_configs(STRING
LOWdocker/configure_workers_and_start.py593def insert_worker_name_for_worker_config(STRING
LOWdocker/configure_workers_and_start.py611def apply_requested_multiplier_for_worker(worker_types: list[str]) -> list[str]:STRING
LOWdocker/configure_workers_and_start.py653def is_sharding_allowed_for_worker_type(worker_type: str) -> bool:STRING
LOWdocker/configure_workers_and_start.py688def generate_base_homeserver_config() -> None:STRING
LOWdocker/configure_workers_and_start.py1291def generate_worker_log_config(STRING
LOWtests/unittest.py197def make_homeserver_config_obj(config: dict[str, Any]) -> HomeServerConfig:CODE
LOWtests/unittest.py301 def _fail_with_set_inequality(CODE
LOWtests/unittest.py646 def wait_for_background_updates(self) -> None:CODE
LOWtests/unittest.py1261 def get_prometheus_metric_current_values(CODE
LOWtests/unittest.py1317 def get_prometheus_metric_current_value(CODE
LOWtests/unittest.py1413 def make_signed_federation_request(CODE
LOWtests/unittest.py1459 def add_hashes_and_signatures_from_other_server(CODE
LOWtests/test_phone_home.py38 def test_performance_frozen_clock(self) -> None:CODE
LOWtests/server.py795def cleanup_test_reactor_system_event_triggers(CODE
LOW⚡tests/test_notifier.py35 def test_wait_for_stream_token_with_caught_up_token(self) -> None:CODE
LOWtests/test_notifier.py51 def test_wait_for_stream_token_with_future_sync_token(self) -> None:CODE
LOWtests/test_notifier.py95 def test_wait_for_stream_token_with_future_sync_token_timeout(CODE
LOWtests/test_notifier.py140 def test_wait_for_stream_token_timeout_counts_each_lagging_stream(self) -> None:CODE
LOWtests/test_notifier.py175 def _get_timeout_counts_from_metric(self) -> "Counter[str]":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.py169 def register_event_id_state_group(self, event_id: str, state_group: int) -> None:CODE
LOWtests/test_state.py175 async def get_state_group_for_events(CODE
LOWtests/test_state.py309 def test_branch_basic_conflict(CODE
LOWtests/test_state.py358 def test_branch_have_banned_conflict(CODE
LOWtests/test_state.py419 def test_branch_have_perms_conflict(CODE
LOWtests/test_state.py512 def test_annotate_with_old_message(CODE
LOWtests/test_state.py548 def test_annotate_with_old_state(CODE
LOWtests/test_state.py591 def test_trivial_annotate_message(CODE
LOWtests/test_state.py629 def test_trivial_annotate_state(CODE
LOWtests/test_state.py665 def test_resolve_message_conflict(CODE
LOWtests/test_state.py708 def test_resolve_state_conflict(CODE
LOWtests/test_state.py754 def test_standard_depth_conflict(CODE
LOWtests/test_state.py899 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
4575 more matches not shown…
Over-Commented Block1381 hits · 1282 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.toml161cache-memory = ["pympler>=1.0"]COMMENT
LOWpyproject.toml181 # saml2COMMENT
LOWpyproject.toml241# $ poetry installCOMMENT
LOWpyproject.toml461# https://github.com/matrix-org/synapse/issues/14079 where we see buildtime orCOMMENT
LOWmypy.ini1[mypy]COMMENT
LOWtox.ini21 # cyptography 2.2 requires setuptools >= 18.5COMMENT
LOWtox.ini61 #COMMENT
LOWtox.ini81#COMMENT
LOWscripts-dev/make_full_schema.sh261sqlite3 "$SQLITE_STATE_DB" ".dump --data-only --nosys" >> "$OUTPUT_DIR/state/full_schemas/$SCHEMA_NUMBER/full.sql.sqlitCOMMENT
LOWscripts-dev/make_full_schema.sh281 # SET client_min_messages = warning;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 # Find/replace the host placeholder in the response body with the actualCOMMENT
LOWdocker/configure_workers_and_start.py921COMMENT
LOWdocker/configure_workers_and_start.py1101 if enable_metrics:COMMENT
LOWdocker/configure_workers_and_start.py1121 #COMMENT
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/runtime.rs41/// down with the reactor.COMMENT
LOWrust/src/runtime.rs121 /// Shut the tokio runtime down, cancelling all in-flight tasks and waitingCOMMENT
LOWrust/src/runtime.rs161 // Backstop for homeservers whose shutdown trigger never fires (e.g. inCOMMENT
LOWrust/src/room_versions.rs41impl EventFormatVersions {COMMENT
1321 more matches not shown…
Docstring Block Structure183 hits · 915 pts
SeverityFileLineSnippetContext
HIGHtests/unittest.py1135Register 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.py236Update 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.py85Parse `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__.py454Build an EventContext structure for a non-outlier event. (for an outlier, call EventContext.for_outlier directlSTRING
HIGHsynapse/state/__init__.py500Given 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.py321Persist a set of events alongside updates to the current state and forward extremities tables. STRING
HIGHsynapse/storage/databases/main/events.py2818Update 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.py321Ensure 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.py236Get the predecessor of an upgraded room if it exists. Otherwise return None. Args: room_id:STRING
HIGHsynapse/storage/databases/main/state.py268Get the create state event for a room. Args: room_id: The room ID. Returns: ThSTRING
HIGHsynapse/storage/databases/main/delayed_events.py157 Inserts a new delayed event in the DB. Args: user_localpart: The localpart of the requesteSTRING
HIGHsynapse/storage/databases/main/delayed_events.py264 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.py105Parse an integer parameter from the request string Args: request: the twisted HTTP request. name: tSTRING
HIGHsynapse/http/servlet.py171Parse an integer parameter from the request string Args: args: A mapping of request args as bytes to a listSTRING
HIGHsynapse/http/servlet.py229Parse a boolean parameter from the request query string Args: request: the twisted HTTP request. naSTRING
HIGHsynapse/http/servlet.py281Parse a boolean parameter from the request query string Args: args: A mapping of request args as bytes to aSTRING
HIGHsynapse/http/servlet.py352 Parse a string parameter as bytes from the request query string. Args: args: A mapping of request argsSTRING
HIGHsynapse/http/servlet.py421 Parse a string parameter from the request query string. If encoding is not None, the content of the query paraSTRING
HIGHsynapse/http/servlet.py464 Parse a JSON parameter from the request query string. Args: request: the twisted HTTP request. STRING
HIGHsynapse/http/servlet.py567 Parse an enum parameter from the request query string. Note that the enum *must only have string values*. STRING
HIGHsynapse/http/servlet.py679 Parse a string parameter from the request query string list. The content of the query param will be decoded toSTRING
123 more matches not shown…
Modern Structural Boilerplate528 hits · 509 pts
SeverityFileLineSnippetContext
LOWscripts-dev/release.py900def update_branch(repo: git.Repo) -> None:CODE
LOWscripts-dev/mypy_synapse_plugin.py199 def set_modules(self, modules: dict[str, MypyFile]) -> None:CODE
LOWtests/unittest.py108logger = logging.getLogger(__name__)CODE
LOWtests/server.py122logger = logging.getLogger(__name__)CODE
LOW⚡tests/test_notifier.py27logger = 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.py52logger = logging.getLogger(__name__)CODE
LOWtests/util/caches/test_descriptors.py51logger = logging.getLogger(__name__)CODE
LOWtests/storage/test_id_generators.py73 def _setup_db(self, txn: LoggingTransaction) -> None:CODE
LOWtests/storage/test_state.py42logger = 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.py31logger = logging.getLogger(__name__)CODE
LOWtests/storage/test_stream.py56logger = logging.getLogger(__name__)CODE
LOWtests/push/test_http.py788 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.py67logger = logging.getLogger(__name__)CODE
LOWtests/synapse_rust/test_http_client.py36logger = logging.getLogger(__name__)CODE
LOWtests/synapse_rust/test_logcontext.py52logger = logging.getLogger(__name__)CODE
LOWtests/federation/test_federation_server.py50logger = logging.getLogger(__name__)CODE
LOW…s/federation/test_federation_out_of_band_membership.py56logger = logging.getLogger(__name__)CODE
LOWtests/federation/_remote_join.py36logger = logging.getLogger(__name__)CODE
LOWtests/federation/test_federation_join_upgraded_room.py30logger = logging.getLogger(__name__)CODE
LOWtests/federation/test_federation_devices.py34logger = logging.getLogger(__name__)CODE
LOWtests/replication/_base.py53logger = 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/test_sharded_sticky_events.py32logger = logging.getLogger(__name__)CODE
LOWtests/replication/test_sharded_sticky_events.py78 def _setup_workers_and_rooms(self) -> None: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.py2599 def _set_presence(self, user_id: str, state: str = "online") -> None:CODE
LOWtests/handlers/test_sliding_sync.py60logger = logging.getLogger(__name__)CODE
LOWtests/handlers/test_message.py39logger = logging.getLogger(__name__)CODE
LOWtests/handlers/test_profile.py1361 def _setup_local_files(self, names_and_props: dict[str, dict[str, Any]]) -> None:CODE
LOWtests/handlers/test_register.py847 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.py3136 def set_user_type(self, user_type: str | None) -> None:CODE
LOWtests/rest/client/test_sync.py53logger = 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.py895 def _setup_local_files(self, names_and_props: dict[str, dict[str, Any]]) -> None:CODE
LOWtests/rest/client/test_rooms.py4266 def _set_alias_via_directory(self, alias: str, expected_code: int = 200) -> None:CODE
LOWtests/rest/client/test_rooms.py4295 def _set_alias_via_directory(self, alias: str, expected_code: int = 200) -> None:CODE
LOWtests/rest/client/test_versions.py25logger = 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
468 more matches not shown…
Empty Error Handlers99 hits · 495 pts
SeverityFileLineSnippetContext
HIGHscripts-dev/federation_client.py382except Exception:CODE
HIGHtests/server.py1276except FileNotFoundError:CODE
HIGHtests/crypto/test_keyring.py142except SynapseError:CODE
HIGHtests/util/test_batching_queue.py46except KeyError:CODE
HIGHtests/util/test_retryutils.py78except AssertionError:CODE
HIGHtests/util/test_retryutils.py122except AssertionError:CODE
HIGHtests/util/test_retryutils.py198except AssertionError:CODE
HIGHtests/util/test_retryutils.py213except AssertionError:CODE
HIGHtests/util/test_retryutils.py294except AssertionError:CODE
HIGHtests/util/caches/test_descriptors.py370except SynapseError:CODE
HIGHtests/storage/test_database.py212except Exception:CODE
HIGHtests/storage/test_appservice.py87except Exception:CODE
HIGHtests/http/test_endpoint.py61except ValueError:CODE
HIGHtests/federation/transport/test_client.py154except ijson.common.IncompleteJSONError:CODE
HIGHtests/rest/client/test_third_party_rules.py141except Exception:CODE
HIGHtests/rest/client/test_profile.py991except AssertionError:CODE
HIGHtests/rest/client/test_directory.py245except AssertionError:CODE
HIGHcontrib/cmdclient/console.py786except Exception:CODE
HIGHcontrib/cmdclient/console.py592except Exception:CODE
HIGHcontrib/cmdclient/console.py783except Exception:CODE
HIGHsynapse/server.py252except AttributeError:CODE
HIGHsynapse/server.py482except HomeServerNotSetupException:CODE
HIGHsynapse/server.py504except HomeServerNotSetupException:CODE
HIGHsynapse/server.py543except HomeServerNotSetupException:CODE
HIGHsynapse/server.py422except KeyError:CODE
HIGHsynapse/server.py511except Exception:CODE
HIGHsynapse/server.py536except Exception:CODE
HIGHsynapse/__init__.py67except ImportError:CODE
HIGHsynapse/__init__.py91except ImportError:CODE
HIGHsynapse/metrics/__init__.py590except (ValueError, TypeError, AttributeError):CODE
HIGHsynapse/types/__init__.py943except Exception:CODE
HIGHsynapse/util/async_helpers.py248except ValueError:CODE
HIGHsynapse/util/async_helpers.py288except StopIteration:CODE
HIGHsynapse/util/async_helpers.py1125except defer.TimeoutError:CODE
HIGHsynapse/util/async_helpers.py1167except defer.TimeoutError:CODE
HIGHsynapse/util/async_helpers.py1103except Exception:CODE
HIGHsynapse/util/async_helpers.py135except defer.CancelledError:CODE
HIGHsynapse/util/async_helpers.py163except defer.CancelledError:CODE
HIGHsynapse/util/ratelimitutils.py416except KeyError:CODE
HIGHsynapse/util/clock.py84except Exception:CODE
HIGHsynapse/util/clock.py605except KeyError:CODE
HIGHsynapse/util/manhole.py148except ValueError:CODE
HIGHsynapse/util/frozenutils.py44except TypeError:CODE
HIGHsynapse/util/frozenutils.py59except TypeError:CODE
HIGHsynapse/util/caches/response_cache.py376except defer.CancelledError:CODE
HIGHsynapse/util/caches/response_cache.py406except Exception:CODE
HIGHsynapse/util/caches/response_cache.py480except Exception:CODE
HIGHsynapse/config/logger.py266except Exception:CODE
HIGHsynapse/_scripts/register_new_matrix_user.py72except Exception:CODE
HIGHsynapse/_scripts/register_new_matrix_user.py114except Exception:CODE
HIGHsynapse/_scripts/synapse_port_db.py814except Exception:CODE
HIGHsynapse/_scripts/synapse_port_db.py1039except BadValueException:CODE
HIGHsynapse/_scripts/synctl.py69except Exception:CODE
HIGHsynapse/_scripts/synctl.py82except AttributeError:CODE
HIGHsynapse/state/v1.py355except AuthError:CODE
HIGHsynapse/state/v2.py878except AuthError:CODE
HIGHsynapse/storage/prepare_database.py467except FileNotFoundError:CODE
HIGHsynapse/storage/database.py520except Exception:CODE
HIGHsynapse/storage/databases/main/tags.py322except self.database_engine.module.IntegrityError:CODE
HIGHsynapse/storage/databases/main/sticky_events.py578except AuthError:CODE
39 more matches not shown…
Unused Imports518 hits · 480 pts
SeverityFileLineSnippetContext
LOWtests/unittest.py103CODE
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/test_utils/__init__.py51CODE
LOWtests/test_utils/__init__.py53CODE
LOWtests/storage/test_database.py28CODE
LOWtests/http/test_proxyagent.py30CODE
LOWtests/http/__init__.py38CODE
LOWtests/http/test_matrixfederationclient.py28CODE
LOWtests/http/test_simple_client.py32CODE
LOWtests/http/test_client.py28CODE
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.py66CODE
LOWtests/rest/admin/test_admin.py21CODE
LOWtests/rest/client/test_third_party_rules.py45CODE
LOWtests/rest/client/test_transactions.py23CODE
LOWsynapse/server.py195CODE
LOWsynapse/server.py196CODE
LOWsynapse/server.py201CODE
LOWsynapse/event_auth.py81CODE
LOWsynapse/notifier.py70CODE
LOWsynapse/metrics/background_process_metrics.py61CODE
LOWsynapse/metrics/background_process_metrics.py63CODE
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__.py79CODE
LOWsynapse/types/__init__.py80CODE
LOWsynapse/types/__init__.py81CODE
LOWsynapse/types/__init__.py81CODE
LOWsynapse/types/__init__.py82CODE
LOWsynapse/types/handlers/sliding_sync.py56CODE
LOWsynapse/types/rest/client/__init__.py51CODE
LOWsynapse/app/_base.py55CODE
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
458 more matches not shown…
Cross-File Repetition95 hits · 475 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.py0request.finish expects the factory to have a 'log' method.STRING
HIGHtests/http/federation/test_matrix_federation_agent.py0request.finish expects the factory to have a 'log' method.STRING
HIGHtests/replication/test_multi_media_repo.py0request.finish expects the factory to have a 'log' method.STRING
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
HIGHtests/rest/client/test_auth.py0a null `auth` value is treated as if it was omitted.STRING
HIGHtests/rest/client/test_register.py0a null `auth` value is treated as if it was omitted.STRING
HIGHtests/rest/client/test_login_token_request.py0a null `auth` value is treated as if it was omitted.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. (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
35 more matches not shown…
Excessive Try-Catch Wrapping378 hits · 369 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.py845 except Exception as exc:CODE
LOWtests/server.py1116 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.py87 except Exception:CODE
LOWtests/http/federation/test_matrix_federation_agent.py216 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
MEDIUMcontrib/cmdclient/console.py361def do_joinalias(self, line):CODE
LOW⚡contrib/cmdclient/console.py783 except Exception:CODE
LOW⚡contrib/cmdclient/console.py786 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/http.py164 except Exception as e:CODE
LOW⚡synapse/server.py511 except Exception:CODE
LOW⚡synapse/server.py518 except Exception as e:CODE
LOW⚡synapse/server.py526 except Exception as e:CODE
LOW⚡synapse/server.py536 except Exception:CODE
LOWsynapse/event_auth.py974 except Exception:CODE
LOWsynapse/event_auth.py979 except Exception:CODE
LOWsynapse/notifier.py400 except Exception:CODE
LOWsynapse/notifier.py515 except Exception:CODE
LOWsynapse/notifier.py521 except Exception:CODE
LOWsynapse/notifier.py623 except Exception:CODE
LOWsynapse/notifier.py649 except Exception:CODE
LOWsynapse/__init__.py79 except Exception:CODE
LOWsynapse/metrics/background_process_metrics.py380 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
318 more matches not shown…
Deep Nesting347 hits · 274 pts
SeverityFileLineSnippetContext
LOWscripts-dev/mypy_synapse_plugin.py604CODE
LOWscripts-dev/mypy_synapse_plugin.py798CODE
LOWscripts-dev/sign_json.py153CODE
LOWscripts-dev/check_schema_delta.py166CODE
LOWscripts-dev/federation_client.py254CODE
LOWscripts-dev/schema_versions.py60CODE
LOWdocker/start.py68CODE
LOWdocker/configure_workers_and_start.py555CODE
LOWdocker/configure_workers_and_start.py733CODE
LOWtests/unittest.py1261CODE
LOWtests/test_utils/oidc.py295CODE
LOWtests/test_utils/html_parsers.py41CODE
LOWtests/storage/test_event_federation.py140CODE
LOWtests/storage/test_event_federation.py1794CODE
LOWtests/http/server/_base.py141CODE
LOWtests/module_api/test_api.py388CODE
LOWtests/synapse_rust/test_logcontext.py113CODE
LOW…s/federation/test_federation_out_of_band_membership.py174CODE
LOW…s/federation/test_federation_out_of_band_membership.py471CODE
LOWtests/replication/_base.py634CODE
LOWtests/events/test_validator.py54CODE
LOWtests/handlers/test_sliding_sync.py3669CODE
LOWtests/handlers/test_e2e_keys.py209CODE
LOWtests/rest/admin/test_user.py5312CODE
LOWtests/rest/admin/test_user.py5419CODE
LOWtests/rest/admin/test_user.py5538CODE
LOWtests/rest/admin/test_room.py208CODE
LOWtests/rest/admin/test_room.py274CODE
LOWtests/rest/client/test_rooms.py5081CODE
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.py561CODE
LOWsynapse/notifier.py657CODE
LOWsynapse/metrics/background_process_metrics.py221CODE
LOWsynapse/metrics/background_process_metrics.py270CODE
LOWsynapse/metrics/_reactor_metrics.py128CODE
LOWsynapse/crypto/keyring.py762CODE
LOWsynapse/types/__init__.py894CODE
LOWsynapse/types/__init__.py981CODE
LOWsynapse/types/__init__.py1163CODE
LOWsynapse/types/__init__.py1416CODE
LOWsynapse/types/__init__.py1503CODE
LOWsynapse/types/handlers/sliding_sync.py548CODE
LOWsynapse/types/handlers/sliding_sync.py617CODE
LOWsynapse/types/handlers/sliding_sync.py701CODE
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
287 more matches not shown…
Redundant / Tautological Comments150 hits · 201 pts
SeverityFileLineSnippetContext
LOWscripts-dev/release.py961 # 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.py557 # Check if the `labelnames` argument includes `SERVER_NAME_LABEL`COMMENT
LOWscripts-dev/mypy_synapse_plugin.py574 # 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.py1172 # Write the fileSTRING
LOWdocker/complement/conf/start_for_complement.sh35 # Set START_POSTGRES to false unless it has already been setCOMMENT
LOW.ci/scripts/schema_diff.py165 # Check if working tree is dirty before potentially stashingCOMMENT
LOWtests/server.py1288 # 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.py140 # Set displayname to an empty stringCOMMENT
LOWtests/handlers/test_profile.py1073 # Set avatar to an empty stringCOMMENT
LOWtests/handlers/test_appservice.py1202 # Check if our application service - that is interested in exclusive_as_user - receivedCOMMENT
LOWtests/handlers/test_appservice.py1424 # 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/notifier.py905 # Check if we are caught up to the stream token, if so return early.COMMENT
LOWsynapse/visibility.py472 # Check if the room has lax history visibility, allowing us to skipCOMMENT
LOWsynapse/metrics/background_process_metrics.py552 # 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__.py237 # 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.py608 # Check if the legacy "restrict_public_rooms_to_local_users" flag is set. ThisCOMMENT
LOWsynapse/config/workers.py307 # Check if the main process is declared. The main process itself doesn't needCOMMENT
LOWsynapse/appservice/__init__.py320 # Check if we have interest in this room IDCOMMENT
LOWsynapse/appservice/__init__.py357 # 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.py200 # Check if an externally defined module cache has been registeredCOMMENT
LOWsynapse/storage/prepare_database.py638 # Check if this line contains an end to the commentCOMMENT
LOWsynapse/storage/databases/state/deletion.py502 # Check if the sequence number has changed, if it has then itSTRING
LOW⚡synapse/storage/databases/main/registration.py1661 # Check if the token existsSTRING
LOW⚡synapse/storage/databases/main/registration.py1667 # Check if the token has expiredSTRING
LOW⚡synapse/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.py4270 # Check if the new link is redundantCOMMENT
LOWsynapse/storage/databases/main/events.py2186 # Check if any of the remote membership changes requires us toSTRING
LOWsynapse/storage/databases/main/events.py2610 # Check if the event is a backfilled event (with a negative `stream_ordering`).STRING
LOWsynapse/storage/databases/main/events_worker.py2370 # Check if this is a duplicate of an event in the given events.STRING
90 more matches not shown…
Hallucination Indicators18 hits · 190 pts
SeverityFileLineSnippetContext
CRITICALtests/replication/test_sharded_event_persister.py144 self.hs.config.worker.events_shard_config.get_instance(room_id1), "worker1"CODE
CRITICALtests/replication/test_sharded_event_persister.py147 self.hs.config.worker.events_shard_config.get_instance(room_id2), "worker2"CODE
CRITICALtests/replication/test_sharded_sticky_events.py96 self.hs.config.worker.events_shard_config.get_instance(self.room_id1),CODE
CRITICALtests/replication/test_sharded_sticky_events.py100 self.hs.config.worker.events_shard_config.get_instance(self.room_id2),CODE
CRITICALtests/handlers/test_appservice.py459 self.event_source.sources.receipt.get_new_events_as.assert_not_called()CODE
CRITICALtests/rest/client/test_register.py1123 expected_html = self.hs.config.account_validity.account_validity_account_renewed_template.render(CODE
CRITICALtests/rest/client/test_register.py1141 expected_html = self.hs.config.account_validity.account_validity_account_previously_renewed_template.render(CODE
CRITICALtests/rest/client/test_register.py1168 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
CRITICAL⚡synapse/storage/controllers/purge_events.py268 await self.stores.state.db_pool.updates._background_update_progress(CODE
CRITICAL⚡synapse/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.py1684 ) + self.hs.config.auth.password_pepper.encode("utf8")CODE
CRITICALsynapse/handlers/room.py1395 self.hs.config.worker.events_shard_config.get_instance(room_id),CODE
CRITICALsynapse/handlers/room.py2487 self.hs.config.worker.events_shard_config.get_instance(new_room_id),CODE
CRITICALsynapse/handlers/room.py2519 self.hs.config.worker.events_shard_config.get_instance(room_id),CODE
CRITICALsynapse/rest/admin/users.py671 key=self.hs.config.registration.registration_shared_secret.encode(),CODE
Cross-Language Confusion25 hits · 134 pts
SeverityFileLineSnippetContext
HIGH⚡scripts-dev/release.py245 sytest_repo.git.push("-u", sytest_repo.remote().name, release_branch_name)CODE
HIGH⚡scripts-dev/release.py249 complement_repo.git.push(CODE
HIGHscripts-dev/release.py327 synapse_repo.git.push(CODE
HIGHscripts-dev/release.py389 repo.git.push(repo.remote().name, "tag", tag_name)CODE
HIGH⚡tests/test_types.py246 Tests that `Absent` rejects `None` (JSON null) when used in Pydantic models.STRING
HIGH⚡tests/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
HIGH…ts/rest/client/sliding_sync/test_extension_profiles.py599 null, for a user that left their last shared room and then rejoined itSTRING
HIGHtests/rest/client/sliding_sync/test_rooms_meta.py656 # > 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.py136 # '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.py477 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.py1906 SELECT ?, ?, room_id, type, state_key, null, event_idCODE
HIGHsynapse/storage/databases/main/keys.py184 # 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__.py938 # 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 Vocabulary76 hits · 109 pts
SeverityFileLineSnippetContext
LOWscripts-dev/mypy_synapse_plugin.py248 # callback, let's just pass it in while we have it.COMMENT
LOWdocker/configure_workers_and_start.py571 # It doesn't exist yet, just use the new dict(but take a copy not a reference)STRING
LOWdocker/configure_workers_and_start.py694 # start.py already does this for us, so just call that.STRING
MEDIUMtests/app/test_homeserver_shutdown.py291 # 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.py300 # This also needs to just return a truth-y valueCOMMENT
LOWtests/api/test_auth.py335 # 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.py40 """Sync token to pass to `?since=` in order to do an incremental sync."""STRING
LOW⚡contrib/cmdclient/console.py791 # If using another HTTP client, just call syn_cmd.cmdloop()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
MEDIUMsynapse/visibility.py452 # Essentially, this alters `invited`/`joined` history visibility rules to `shared` for sticky events.COMMENT
LOWsynapse/metrics/background_process_metrics.py303 # 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.py605 # Otherwise, just add it to the setCOMMENT
LOWsynapse/types/handlers/sliding_sync.py692 # Otherwise, just add it to the setCOMMENT
LOWsynapse/types/handlers/sliding_sync.py754 # We're lazy-loading membership so we can just return the state we have.COMMENT
LOWsynapse/util/__init__.py238 # 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.py1006 # Didn't find a power level auth event, so we just return 0COMMENT
LOWsynapse/storage/background_updates.py1157 # 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.py2134 # If we haven't got a last processed room then just use the emptySTRING
LOWsynapse/storage/databases/main/transactions.py484 # therefore sort the output and just return the first 25 rows. Obviously thatSTRING
LOWsynapse/storage/databases/main/profile.py1002 # We don't have stream ID's at this point, so just use a counter, and add inSTRING
LOWsynapse/storage/databases/main/sticky_events.py558 # This event is one we are about to persist, so just use itSTRING
LOWsynapse/storage/databases/main/stream.py1758 # can just use the latest position from it.COMMENT
LOWsynapse/storage/databases/main/event_federation.py1664 # we just use the 10 newest events. Older events will becomeSTRING
LOWsynapse/storage/util/id_generators.py421 # 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__.py510 # We just use the minimum stream ordering and ignore the vector clockCOMMENT
LOWsynapse/api/auth/base.py379 # 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.py417 # We just use the txn_id here, but we probably also want to use theCOMMENT
MEDIUMsynapse/handlers/sync.py2170 # `archived` sync results since we want to utilize the work we did to collectCOMMENT
LOWsynapse/handlers/sync.py573 # database (invalid), then we simply use our max persisted position (recoverCOMMENT
LOWsynapse/handlers/sync.py578 # just return an empty response.COMMENT
LOWsynapse/handlers/sync.py1523 # timeline. If at the end we can just use the current state.COMMENT
LOWsynapse/handlers/sync.py1662 # timeline. If at the end we can just use the current state delta stream.COMMENT
LOWsynapse/handlers/sync.py2636 # No profile data for this user, just return a blank dictionaryCOMMENT
LOWsynapse/handlers/sync.py3684 # 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
16 more matches not shown…
Decorative Section Separators21 hits · 69 pts
SeverityFileLineSnippetContext
MEDIUMrust/src/twisted_dispatch.rs33//! └─ Write one byte to socket A ───────► socket B becomes readableCOMMENT
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.py262 # ------------------------------------------------------COMMENT
MEDIUMtests/http/test_matrixfederationclient.py280 # -------------------------------------------------------COMMENT
MEDIUMtests/http/test_matrixfederationclient.py301 # ----------------------------------------------------------COMMENT
MEDIUMtests/http/test_simple_client.py146 # ------------------------------------------------------COMMENT
MEDIUMtests/http/test_simple_client.py158 # -------------------------------------------------------COMMENT
MEDIUMtests/http/test_simple_client.py175 # ----------------------------------------------------------COMMENT
MEDIUM⚡tests/rest/client/test_sync.py1453 # ------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rest/client/test_sync.py1455 # ------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rest/client/test_sync.py1502 # ------------------------------------------------------------------COMMENT
MEDIUM⚡tests/rest/client/test_sync.py1505 # ------------------------------------------------------------------COMMENT
MEDIUMtests/rest/client/test_sync.py1395 # ------------------------------------------------------------------COMMENT
MEDIUMtests/rest/client/test_sync.py1397 # ------------------------------------------------------------------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.py3710 # ----------COMMENT
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.py160 "fake_token",CODE
LOWtests/storage/test_registration.py175 "fake_token",CODE
LOW⚡tests/storage/databases/main/test_end_to_end_keys.py47 dummy_key = {"keys": {"a": "b"}}CODE
LOW⚡tests/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.py119 "foo@bar.com", "test subject", "Tests", "HTML content", "Text content"CODE
LOWtests/handlers/test_send_email.py156 self.assertEqual(str(user), "foo@bar.com")CODE
LOWtests/handlers/test_send_email.py177 "foo@bar.com", "test subject", "Tests", "HTML content", "Text content"CODE
LOWtests/handlers/test_send_email.py227 self.assertEqual(str(user), "foo@bar.com")CODE
LOW⚡tests/handlers/test_e2e_keys.py222 "alg1:k1": {"dummy_id": 1},CODE
LOW⚡tests/handlers/test_e2e_keys.py223 "alg1:k2": {"dummy_id": 2},CODE
LOW⚡tests/handlers/test_e2e_keys.py224 "alg2:k3": {"dummy_id": 3},CODE
LOW⚡tests/handlers/test_e2e_keys.py225 "alg2:k4": {"dummy_id": 4},CODE
LOW⚡tests/handlers/test_e2e_keys.py228 "alg1:k5": {"dummy_id": 5},CODE
LOW⚡tests/handlers/test_e2e_keys.py229 "alg1:k6": {"dummy_id": 6},CODE
LOW⚡tests/handlers/test_e2e_keys.py230 "alg2:k7": {"dummy_id": 7},CODE
LOW⚡tests/handlers/test_e2e_keys.py231 "alg2:k8": {"dummy_id": 8},CODE
LOW⚡tests/handlers/test_e2e_keys.py236 "alg1:k9": {"dummy_id": 9},CODE
LOW⚡tests/handlers/test_e2e_keys.py237 "alg1:k10": {"dummy_id": 10},CODE
LOW⚡tests/handlers/test_e2e_keys.py238 "alg2:k11": {"dummy_id": 11},CODE
LOW⚡tests/handlers/test_e2e_keys.py239 "alg2:k12": {"dummy_id": 12},CODE
LOW⚡tests/handlers/test_e2e_keys.py242 "alg1:k13": {"dummy_id": 13},CODE
LOW⚡tests/handlers/test_e2e_keys.py243 "alg1:k14": {"dummy_id": 14},CODE
LOW⚡tests/handlers/test_e2e_keys.py244 "alg2:k15": {"dummy_id": 15},CODE
LOW⚡tests/handlers/test_e2e_keys.py245 "alg2:k16": {"dummy_id": 16},CODE
LOW⚡tests/handlers/test_e2e_keys.py250 "alg1:k17": {"dummy_id": 17},CODE
LOW⚡tests/handlers/test_e2e_keys.py251 "alg1:k18": {"dummy_id": 18},CODE
LOW⚡tests/handlers/test_e2e_keys.py252 "alg2:k19": {"dummy_id": 19},CODE
LOW⚡tests/handlers/test_e2e_keys.py253 "alg2:k20": {"dummy_id": 20},CODE
LOW⚡tests/handlers/test_e2e_keys.py256 "alg1:k21": {"dummy_id": 21},CODE
LOW⚡tests/handlers/test_e2e_keys.py257 "alg1:k22": {"dummy_id": 22},CODE
LOW⚡tests/handlers/test_e2e_keys.py258 "alg2:k23": {"dummy_id": 23},CODE
LOW⚡tests/handlers/test_e2e_keys.py259 "alg2:k24": {"dummy_id": 24},CODE
LOW⚡tests/handlers/test_e2e_keys.py1919 dummy_key = {"keys": {"a": "b"}}CODE
LOW⚡tests/handlers/test_e2e_keys.py1921 self.store.set_e2e_cross_signing_key("@alice:test", "master", dummy_key)CODE
LOWtests/rest/admin/test_user.py1567 self.store.user_add_threepid("@user:test", "email", "foo@bar.com", 0, 0)CODE
LOWtests/rest/admin/test_user.py1655 self.assertEqual("foo@bar.com", channel.json_body["threepids"][0]["address"])CODE
LOWtests/rest/admin/test_user.py1727 self.assertEqual("foo@bar.com", channel.json_body["threepids"][0]["address"])CODE
LOWtests/rest/admin/test_user.py1781 self.assertEqual("foo@bar.com", channel.json_body["threepids"][0]["address"])CODE
LOWtests/rest/admin/test_user.py2785 self.store.user_add_threepid("@user:test", "email", "foo@bar.com", 0, 0)CODE
LOWtests/rest/admin/test_user.py2798 self.assertEqual("foo@bar.com", channel.json_body["threepids"][0]["address"])CODE
LOWtests/rest/admin/test_user.py5166 fake_user = "@bums:other"CODE
LOWtests/rest/admin/test_user.py5168 "POST", self.url(fake_user), access_token=self.admin_user_tokCODE
LOWtests/rest/admin/test_user.py5181 dummy_key = {"keys": {"a": "b"}}CODE
LOWtests/rest/admin/test_user.py5183 self.store.set_e2e_cross_signing_key(self.other_user, "master", dummy_key)CODE
LOWtests/rest/client/test_rooms.py1730 channel = self.make_request("PUT", path, {"displayname": "John Doe"})CODE
LOWtests/rest/client/test_rooms.py1744 self.assertEqual(channel.json_body["displayname"], "John Doe")CODE
LOW⚡tests/rest/synapse/mas/test_users.py1382 dummy_key = {"keys": {"a": "b"}}CODE
LOW⚡tests/rest/synapse/mas/test_users.py1384 store.set_e2e_cross_signing_key(str(alice), "master", dummy_key)CODE
LOW⚡tests/rest/synapse/mas/test_users.py1468 dummy_key = {"keys": {"a": "b"}}CODE
LOW⚡tests/rest/synapse/mas/test_users.py1470 store.set_e2e_cross_signing_key(str(alice), "master", dummy_key)CODE
LOWsynapse/types/rest/client/__init__.py113 # Without this, an email stored in the database as "foo@bar.com" would causeCOMMENT
Slop Phrases25 hits · 40 pts
SeverityFileLineSnippetContext
LOWpyproject.toml162# If this is updated, don't forget to update the equivalent lines inCOMMENT
LOWpyproject.toml162# If this is updated, don't forget to update the equivalent lines inCOMMENT
LOWpyproject.toml289 # If this is updated, don't forget to update the equivalent lines inCOMMENT
LOWpyproject.toml289 # 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
LOW⚡scripts-dev/complement.sh48# XXX: If the Docker image name changes, don't forget to updateCOMMENT
LOW⚡scripts-dev/complement.sh48# XXX: If the Docker image name changes, don't forget to updateCOMMENT
LOW⚡scripts-dev/complement.sh55# XXX: If the Docker image name changes, don't forget to updateCOMMENT
LOW⚡scripts-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.py917 # 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.py1640 # `sliding_sync_joined_rooms` or `forgotten`), make sure to bust theCOMMENT
LOWsynapse/storage/databases/main/transactions.py491 # (NB: we make sure to do the top-level sort and limit on the database, ratherSTRING
LOWsynapse/storage/databases/main/cache.py417 # XXX: If you add something to this function make sure you add it toSTRING
MEDIUMsynapse/storage/databases/main/event_federation.py836 # 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.py257 # This will commit the txn in sqlite, so make sure to keep this actually last.COMMENT
LOWsynapse/storage/databases/main/purge_events.py447 # 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__.py149 # If we're working with a user-provided token, we need to make sure to wait forCOMMENT
AI Structural Patterns38 hits · 30 pts
SeverityFileLineSnippetContext
LOWtests/unittest.py728CODE
LOWtests/server.py450CODE
LOWtests/test_state.py872CODE
LOW…s/federation/test_federation_out_of_band_membership.py346CODE
LOW…s/federation/test_federation_out_of_band_membership.py499CODE
LOWtests/federation/_remote_join.py306CODE
LOWtests/replication/storage/test_events.py237CODE
LOWsynapse/notifier.py856CODE
LOWsynapse/util/caches/descriptors.py532CODE
LOWsynapse/util/caches/descriptors.py212CODE
LOWsynapse/appservice/__init__.py105CODE
LOWsynapse/state/__init__.py559CODE
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__.py402CODE
LOWsynapse/module_api/__init__.py498CODE
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.py579CODE
LOWsynapse/handlers/message.py978CODE
LOWsynapse/handlers/message.py1123CODE
LOWsynapse/handlers/message.py1249CODE
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
LOW⚡complement/tests/federation_room_join_test.go140 // Step 1: make_join, hs1 returns a join event template whose prev_eventsCOMMENT
LOW⚡complement/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.py892 We need to check if the client is interested in the stream or notSTRING
LOWsynapse/handlers/e2e_keys.py1612 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
LOW⚡complement/tests/federation_room_join_test.go140 // Step 1: make_join, hs1 returns a join event template whose prev_eventsCOMMENT
LOW⚡complement/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 Blocks2 hits · 3 pts
SeverityFileLineSnippetContext
LOW.ci/scripts/schema_diff.py5# Usage:COMMENT
LOWdebian/manage_debconf.pl5# Usage:COMMENT
TODO Padding1 hit · 2 pts
SeverityFileLineSnippetContext
LOWsynapse/media/storage_provider.py114 # TODO: Handle errors.COMMENT