aboutsummaryrefslogtreecommitdiff
path: root/syncapi
diff options
context:
space:
mode:
authorNeil Alexander <neilalexander@users.noreply.github.com>2021-03-03 14:35:57 +0000
committerGitHub <noreply@github.com>2021-03-03 14:35:57 +0000
commitd15836e260130f85edd5d9a104e5304f001d2681 (patch)
treea426e886cc66b3d676741010860cb794a6999b87 /syncapi
parentf0139f12ca6f93b7626be369dc2a829c0326c6e0 (diff)
Increase gocyclo complexity to 25 (and remove all but 2 golint directives related to it) (#1783)
Diffstat (limited to 'syncapi')
-rw-r--r--syncapi/internal/keychange.go2
-rw-r--r--syncapi/routing/messages.go2
-rw-r--r--syncapi/storage/postgres/syncserver.go1
-rw-r--r--syncapi/storage/shared/syncserver.go2
-rw-r--r--syncapi/storage/sqlite3/filtering.go1
-rw-r--r--syncapi/storage/sqlite3/syncserver.go1
-rw-r--r--syncapi/streams/stream_pdu.go2
7 files changed, 0 insertions, 11 deletions
diff --git a/syncapi/internal/keychange.go b/syncapi/internal/keychange.go
index e980437e..0bbaf31e 100644
--- a/syncapi/internal/keychange.go
+++ b/syncapi/internal/keychange.go
@@ -46,7 +46,6 @@ func DeviceOTKCounts(ctx context.Context, keyAPI keyapi.KeyInternalAPI, userID,
// DeviceListCatchup fills in the given response for the given user ID to bring it up-to-date with device lists. hasNew=true if the response
// was filled in, else false if there are no new device list changes because there is nothing to catch up on. The response MUST
// be already filled in with join/leave information.
-// nolint:gocyclo
func DeviceListCatchup(
ctx context.Context, keyAPI keyapi.KeyInternalAPI, rsAPI roomserverAPI.RoomserverInternalAPI,
userID string, res *types.Response, from, to types.LogPosition,
@@ -137,7 +136,6 @@ func DeviceListCatchup(
}
// TrackChangedUsers calculates the values of device_lists.changed|left in the /sync response.
-// nolint:gocyclo
func TrackChangedUsers(
ctx context.Context, rsAPI roomserverAPI.RoomserverInternalAPI, userID string, newlyJoinedRooms, newlyLeftRooms []string,
) (changed, left []string, err error) {
diff --git a/syncapi/routing/messages.go b/syncapi/routing/messages.go
index ba739148..2ef25e03 100644
--- a/syncapi/routing/messages.go
+++ b/syncapi/routing/messages.go
@@ -61,7 +61,6 @@ const defaultMessagesLimit = 10
// OnIncomingMessagesRequest implements the /messages endpoint from the
// client-server API.
// See: https://matrix.org/docs/spec/client_server/latest.html#get-matrix-client-r0-rooms-roomid-messages
-// nolint:gocyclo
func OnIncomingMessagesRequest(
req *http.Request, db storage.Database, roomID string, device *userapi.Device,
federation *gomatrixserverlib.FederationClient,
@@ -306,7 +305,6 @@ func (r *messagesReq) retrieveEvents() (
return clientEvents, start, end, err
}
-// nolint:gocyclo
func (r *messagesReq) filterHistoryVisible(events []*gomatrixserverlib.HeaderedEvent) []*gomatrixserverlib.HeaderedEvent {
// TODO FIXME: We don't fully implement history visibility yet. To avoid leaking events which the
// user shouldn't see, we check the recent events and remove any prior to the join event of the user
diff --git a/syncapi/storage/postgres/syncserver.go b/syncapi/storage/postgres/syncserver.go
index a69fda4f..6f4e7749 100644
--- a/syncapi/storage/postgres/syncserver.go
+++ b/syncapi/storage/postgres/syncserver.go
@@ -36,7 +36,6 @@ type SyncServerDatasource struct {
}
// NewDatabase creates a new sync server database
-// nolint:gocyclo
func NewDatabase(dbProperties *config.DatabaseOptions) (*SyncServerDatasource, error) {
var d SyncServerDatasource
var err error
diff --git a/syncapi/storage/shared/syncserver.go b/syncapi/storage/shared/syncserver.go
index ee2c176c..b8271877 100644
--- a/syncapi/storage/shared/syncserver.go
+++ b/syncapi/storage/shared/syncserver.go
@@ -661,7 +661,6 @@ func (d *Database) fetchMissingStateEvents(
// exclusive of oldPos, inclusive of newPos, for the rooms in which
// the user has new membership events.
// A list of joined room IDs is also returned in case the caller needs it.
-// nolint:gocyclo
func (d *Database) GetStateDeltas(
ctx context.Context, device *userapi.Device,
r types.Range, userID string,
@@ -773,7 +772,6 @@ func (d *Database) GetStateDeltas(
// requests with full_state=true.
// Fetches full state for all joined rooms and uses selectStateInRange to get
// updates for other rooms.
-// nolint:gocyclo
func (d *Database) GetStateDeltasForFullStateSync(
ctx context.Context, device *userapi.Device,
r types.Range, userID string,
diff --git a/syncapi/storage/sqlite3/filtering.go b/syncapi/storage/sqlite3/filtering.go
index 050f3a26..11f3e647 100644
--- a/syncapi/storage/sqlite3/filtering.go
+++ b/syncapi/storage/sqlite3/filtering.go
@@ -23,7 +23,6 @@ const (
// fields might come from either a StateFilter or an EventFilter,
// and it's easier just to have the caller extract the relevant
// parts.
-// nolint:gocyclo
func prepareWithFilters(
db *sql.DB, txn *sql.Tx, query string, params []interface{},
senders, notsenders, types, nottypes []string, excludeEventIDs []string,
diff --git a/syncapi/storage/sqlite3/syncserver.go b/syncapi/storage/sqlite3/syncserver.go
index b0e43b68..ae0647fc 100644
--- a/syncapi/storage/sqlite3/syncserver.go
+++ b/syncapi/storage/sqlite3/syncserver.go
@@ -52,7 +52,6 @@ func NewDatabase(dbProperties *config.DatabaseOptions) (*SyncServerDatasource, e
return &d, nil
}
-// nolint:gocyclo
func (d *SyncServerDatasource) prepare(dbProperties *config.DatabaseOptions) (err error) {
if err = d.PartitionOffsetStatements.Prepare(d.db, d.writer, "syncapi"); err != nil {
return err
diff --git a/syncapi/streams/stream_pdu.go b/syncapi/streams/stream_pdu.go
index e11ac8dd..1486ad3c 100644
--- a/syncapi/streams/stream_pdu.go
+++ b/syncapi/streams/stream_pdu.go
@@ -137,7 +137,6 @@ func (p *PDUStreamProvider) CompleteSync(
return to
}
-// nolint:gocyclo
func (p *PDUStreamProvider) IncrementalSync(
ctx context.Context,
req *types.SyncRequest,
@@ -254,7 +253,6 @@ func (p *PDUStreamProvider) addRoomDeltaToResponse(
return nil
}
-// nolint:gocyclo
func (p *PDUStreamProvider) getJoinResponseForCompleteSync(
ctx context.Context,
roomID string,