Preparing report...

Report for github.com/nats-io/nats-streaming-server

(v0.24.6)

A+    Excellent!    Found 35 issues across 72 files

Tweet

go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gofmt100%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command

No problems detected. Good job!


gocyclo51%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

    • server/server_test.go
    • Line 807: warning: cyclomatic complexity 72 of function TestProtocolOrder() is high (> 15) (gocyclo)
    • Line 569: warning: cyclomatic complexity 21 of function TestChannelStore() is high (> 15) (gocyclo)
    • Line 1187: warning: cyclomatic complexity 19 of function TestMsgsNotSentToSubBeforeSubReqResponse() is high (> 15) (gocyclo)
    • stores/filestore_sub_test.go
    • Line 564: warning: cyclomatic complexity 39 of function TestFSSubStoreVariousBufferSizes() is high (> 15) (gocyclo)
    • Line 287: warning: cyclomatic complexity 25 of function TestFSCompactSubsFileOnAck() is high (> 15) (gocyclo)
    • server/server_clients_test.go
    • Line 491: warning: cyclomatic complexity 33 of function testClientPings() is high (> 15) (gocyclo)
    • Line 85: warning: cyclomatic complexity 22 of function TestClientCrashAndReconnect() is high (> 15) (gocyclo)
    • Line 311: warning: cyclomatic complexity 21 of function TestClientsWithDupCID() is high (> 15) (gocyclo)
    • Line 858: warning: cyclomatic complexity 16 of function TestSubHasFailedHBClearedAfterDurableResume() is high (> 15) (gocyclo)
    • server/monitor_test.go
    • Line 172: warning: cyclomatic complexity 52 of function TestMonitorServerz() is high (> 15) (gocyclo)
    • Line 916: warning: cyclomatic complexity 20 of function TestMonitorChannelsWithSubsz() is high (> 15) (gocyclo)
    • Line 440: warning: cyclomatic complexity 20 of function TestMonitorServerzAfterRestart() is high (> 15) (gocyclo)
    • Line 1390: warning: cyclomatic complexity 16 of function TestMonitorInOutMsgs() is high (> 15) (gocyclo)
    • stores/filestore.go
    • Line 2614: warning: cyclomatic complexity 45 of function (*FileMsgStore).Store() is high (> 15) (gocyclo)
    • Line 2283: warning: cyclomatic complexity 35 of function (*FileMsgStore).recoverOneMsgFile() is high (> 15) (gocyclo)
    • Line 1992: warning: cyclomatic complexity 27 of function (*FileStore).newFileMsgStore() is high (> 15) (gocyclo)
    • Line 4007: warning: cyclomatic complexity 24 of function (*FileSubStore).recoverSubscriptions() is high (> 15) (gocyclo)
    • Line 3213: warning: cyclomatic complexity 23 of function (*FileMsgStore).backgroundTasks() is high (> 15) (gocyclo)
    • Line 3404: warning: cyclomatic complexity 20 of function (*FileMsgStore).readAheadMsgs() is high (> 15) (gocyclo)
    • Line 3553: warning: cyclomatic complexity 19 of function (*FileMsgStore).GetSequenceFromTimestamp() is high (> 15) (gocyclo)
    • Line 4337: warning: cyclomatic complexity 18 of function (*FileSubStore).writeRecord() is high (> 15) (gocyclo)
    • Line 2885: warning: cyclomatic complexity 18 of function (*FileMsgStore).expireMsgs() is high (> 15) (gocyclo)
    • Line 3314: warning: cyclomatic complexity 17 of function (*FileMsgStore).lookup() is high (> 15) (gocyclo)
    • Line 1321: warning: cyclomatic complexity 16 of function (*FileStore).Recover() is high (> 15) (gocyclo)
    • server/clustering.go
    • Line 332: warning: cyclomatic complexity 26 of function (*StanServer).createRaftNode() is high (> 15) (gocyclo)
    • Line 583: warning: cyclomatic complexity 25 of function (*raftFSM).Apply() is high (> 15) (gocyclo)
    • Line 185: warning: cyclomatic complexity 17 of function (*StanServer).createServerRaftNode() is high (> 15) (gocyclo)
    • server/server_durable_test.go
    • Line 652: warning: cyclomatic complexity 20 of function closeSubscriber() is high (> 15) (gocyclo)
    • Line 497: warning: cyclomatic complexity 18 of function TestPersistentStoreDontSendToOfflineDurablesAfterServerRestart() is high (> 15) (gocyclo)
    • Line 774: warning: cyclomatic complexity 17 of function TestNewOnHoldSetOnDurableRestart() is high (> 15) (gocyclo)
    • server/raft_log_test.go
    • Line 42: warning: cyclomatic complexity 32 of function TestRaftLogDeleteRange() is high (> 15) (gocyclo)
    • Line 235: warning: cyclomatic complexity 26 of function TestRaftLogWithEncryption() is high (> 15) (gocyclo)
    • Line 537: warning: cyclomatic complexity 23 of function TestRaftLogCache() is high (> 15) (gocyclo)
    • stores/filestore_msg_test.go
    • Line 612: warning: cyclomatic complexity 30 of function TestFSMsgStoreVariousBufferSizes() is high (> 15) (gocyclo)
    • Line 46: warning: cyclomatic complexity 23 of function TestFSBadMsgFile() is high (> 15) (gocyclo)
    • Line 777: warning: cyclomatic complexity 22 of function TestFSArchiveScript() is high (> 15) (gocyclo)
    • Line 521: warning: cyclomatic complexity 19 of function TestFSFirstEmptySliceRemovedOnCreateNewSlice() is high (> 15) (gocyclo)
    • Line 1958: warning: cyclomatic complexity 19 of function TestFSReadBuffer() is high (> 15) (gocyclo)
    • Line 2209: warning: cyclomatic complexity 18 of function TestFSGapsInSequenceWithoutFillAndExpiration() is high (> 15) (gocyclo)
    • Line 2101: warning: cyclomatic complexity 17 of function TestFSReadMsgRecord() is high (> 15) (gocyclo)
    • server/server_sub_test.go
    • Line 267: warning: cyclomatic complexity 18 of function TestSubStartPositionSequenceStart() is high (> 15) (gocyclo)
    • Line 357: warning: cyclomatic complexity 16 of function TestSubStartPositionTimeDelta() is high (> 15) (gocyclo)
    • server/snapshot.go
    • Line 457: warning: cyclomatic complexity 35 of function (*raftFSM).restoreMsgsFromSnapshot() is high (> 15) (gocyclo)
    • Line 349: warning: cyclomatic complexity 19 of function (*raftFSM).restoreChannelsFromSnapshot() is high (> 15) (gocyclo)
    • Line 146: warning: cyclomatic complexity 17 of function (*serverSnapshot).snapshotChannels() is high (> 15) (gocyclo)
    • server/ft_test.go
    • Line 425: warning: cyclomatic complexity 17 of function TestFTPartitionReversed() is high (> 15) (gocyclo)
    • server/conf.go
    • Line 36: warning: cyclomatic complexity 65 of function ProcessConfigFile() is high (> 15) (gocyclo)
    • Line 262: warning: cyclomatic complexity 42 of function parseCluster() is high (> 15) (gocyclo)
    • Line 484: warning: cyclomatic complexity 37 of function parseFileOptions() is high (> 15) (gocyclo)
    • Line 403: warning: cyclomatic complexity 23 of function parseChannelLimits() is high (> 15) (gocyclo)
    • Line 628: warning: cyclomatic complexity 20 of function ConfigureOptions() is high (> 15) (gocyclo)
    • server/server.go
    • Line 1662: warning: cyclomatic complexity 43 of function RunServerWithOpts() is high (> 15) (gocyclo)
    • Line 1080: warning: cyclomatic complexity 38 of function (*subStore).Remove() is high (> 15) (gocyclo)
    • Line 1961: warning: cyclomatic complexity 34 of function (*StanServer).start() is high (> 15) (gocyclo)
    • Line 4297: warning: cyclomatic complexity 32 of function (*StanServer).ioLoop() is high (> 15) (gocyclo)
    • Line 1511: warning: cyclomatic complexity 29 of function (*StanServer).createNatsClientConn() is high (> 15) (gocyclo)
    • Line 3687: warning: cyclomatic complexity 27 of function (*StanServer).performAckExpirationRedelivery() is high (> 15) (gocyclo)
    • Line 4981: warning: cyclomatic complexity 26 of function (*StanServer).processSub() is high (> 15) (gocyclo)
    • Line 5451: warning: cyclomatic complexity 25 of function (*StanServer).processAck() is high (> 15) (gocyclo)
    • Line 5157: warning: cyclomatic complexity 24 of function (*StanServer).processSubscriptionRequest() is high (> 15) (gocyclo)
    • Line 4158: warning: cyclomatic complexity 22 of function (*StanServer).sendMsgToSub() is high (> 15) (gocyclo)
    • Line 5660: warning: cyclomatic complexity 22 of function (*StanServer).setSubStartSequence() is high (> 15) (gocyclo)
    • Line 5785: warning: cyclomatic complexity 20 of function (*StanServer).Shutdown() is high (> 15) (gocyclo)
    • Line 537: warning: cyclomatic complexity 20 of function (*StanServer).subToSnapshotRestoreRequests() is high (> 15) (gocyclo)
    • Line 2234: warning: cyclomatic complexity 18 of function (*StanServer).leadershipAcquired() is high (> 15) (gocyclo)
    • Line 5356: warning: cyclomatic complexity 18 of function traceSubState() is high (> 15) (gocyclo)
    • Line 3205: warning: cyclomatic complexity 16 of function (*StanServer).checkClientHealth() is high (> 15) (gocyclo)
    • Line 2560: warning: cyclomatic complexity 16 of function (*StanServer).recoverOneSub() is high (> 15) (gocyclo)
    • stores/common_test.go
    • Line 606: warning: cyclomatic complexity 33 of function TestCSBasicRecovery() is high (> 15) (gocyclo)
    • Line 435: warning: cyclomatic complexity 24 of function TestGSNoOps() is high (> 15) (gocyclo)
    • stores/filestore_test.go
    • Line 135: warning: cyclomatic complexity 69 of function TestFSFilesManager() is high (> 15) (gocyclo)
    • Line 998: warning: cyclomatic complexity 27 of function TestFSBadServerFile() is high (> 15) (gocyclo)
    • Line 1387: warning: cyclomatic complexity 27 of function TestFSReadRecord() is high (> 15) (gocyclo)
    • Line 703: warning: cyclomatic complexity 25 of function TestFSLimitsOnRecovery() is high (> 15) (gocyclo)
    • Line 861: warning: cyclomatic complexity 21 of function TestFSBadClientFile() is high (> 15) (gocyclo)
    • Line 1960: warning: cyclomatic complexity 17 of function TestFSAutoSync() is high (> 15) (gocyclo)
    • Line 1554: warning: cyclomatic complexity 16 of function TestFSWriteRecord() is high (> 15) (gocyclo)
    • stores/sqlstore_test.go
    • Line 1093: warning: cyclomatic complexity 33 of function TestSQLSubStoreCachingAndRecovery() is high (> 15) (gocyclo)
    • Line 1382: warning: cyclomatic complexity 26 of function TestSQLGetExclusiveLock() is high (> 15) (gocyclo)
    • Line 2216: warning: cyclomatic complexity 20 of function TestSQLStoreMaxSeqWithExpiredMsgs() is high (> 15) (gocyclo)
    • Line 1619: warning: cyclomatic complexity 19 of function TestSQLDeleteChannel() is high (> 15) (gocyclo)
    • Line 723: warning: cyclomatic complexity 19 of function TestSQLNoCachingOption() is high (> 15) (gocyclo)
    • server/clustering_test.go
    • Line 3295: warning: cyclomatic complexity 25 of function TestClusteringNoMsgSeqGapOnApplyError() is high (> 15) (gocyclo)
    • Line 7440: warning: cyclomatic complexity 24 of function TestClusteringPendingCountOnFollowers() is high (> 15) (gocyclo)
    • Line 5404: warning: cyclomatic complexity 22 of function TestClusteringKeepSubIDOnReplay() is high (> 15) (gocyclo)
    • Line 637: warning: cyclomatic complexity 21 of function TestClusteringBasic() is high (> 15) (gocyclo)
    • Line 2610: warning: cyclomatic complexity 20 of function TestClusteringRaftLogReplay() is high (> 15) (gocyclo)
    • Line 5086: warning: cyclomatic complexity 20 of function TestClusteringSubDontStallDueToMsgExpiration() is high (> 15) (gocyclo)
    • Line 994: warning: cyclomatic complexity 19 of function TestClusteringLogSnapshotRestore() is high (> 15) (gocyclo)
    • Line 7744: warning: cyclomatic complexity 19 of function TestClusteringRedeliveryCount() is high (> 15) (gocyclo)
    • Line 4123: warning: cyclomatic complexity 19 of function TestClusteringLogSnapshotRestoreQueueGroupSubNewOnHold() is high (> 15) (gocyclo)
    • Line 5796: warning: cyclomatic complexity 17 of function TestClusteringSubSentAckReplication() is high (> 15) (gocyclo)
    • Line 7594: warning: cyclomatic complexity 17 of function TestClusteringSubStateProperlyResetOnLeadershipAcquired() is high (> 15) (gocyclo)
    • Line 1350: warning: cyclomatic complexity 17 of function TestClusteringLogSnapshotRestoreConnections() is high (> 15) (gocyclo)
    • Line 2261: warning: cyclomatic complexity 17 of function TestClusteringSubscriberFailover() is high (> 15) (gocyclo)
    • Line 6700: warning: cyclomatic complexity 16 of function TestClusteringRestoreSnapshotMsgsBailIfNoLeader() is high (> 15) (gocyclo)
    • server/server_redelivery_test.go
    • Line 329: warning: cyclomatic complexity 23 of function testStalledRedelivery() is high (> 15) (gocyclo)
    • Line 1406: warning: cyclomatic complexity 22 of function TestQueueRedeliveryWithMsgsReassignedToMemberWithAcksPending() is high (> 15) (gocyclo)
    • Line 1508: warning: cyclomatic complexity 20 of function TestPersistentStoreRedeliveryCount() is high (> 15) (gocyclo)
    • Line 848: warning: cyclomatic complexity 18 of function TestDurableQueueSubRedeliveryOnRejoin() is high (> 15) (gocyclo)
    • Line 461: warning: cyclomatic complexity 17 of function TestPersistentStoreRedeliveredPerSub() is high (> 15) (gocyclo)
    • Line 559: warning: cyclomatic complexity 16 of function TestPersistentStoreRedeliveryCbPerSub() is high (> 15) (gocyclo)
    • Line 738: warning: cyclomatic complexity 16 of function TestPersistentStoreAckMsgRedeliveredToDifferentQueueSub() is high (> 15) (gocyclo)
    • Line 103: warning: cyclomatic complexity 16 of function TestMultipleRedeliveries() is high (> 15) (gocyclo)
    • util/util.go
    • Line 162: warning: cyclomatic complexity 19 of function IsChannelNameValid() is high (> 15) (gocyclo)
    • stores/common_sub_test.go
    • Line 23: warning: cyclomatic complexity 18 of function TestCSMaxSubs() is high (> 15) (gocyclo)
    • Line 99: warning: cyclomatic complexity 18 of function TestCSBasicSubStore() is high (> 15) (gocyclo)
    • stores/sqlstore.go
    • Line 782: warning: cyclomatic complexity 47 of function (*SQLStore).Recover() is high (> 15) (gocyclo)
    • Line 1419: warning: cyclomatic complexity 26 of function (*SQLMsgStore).Store() is high (> 15) (gocyclo)
    • Line 1029: warning: cyclomatic complexity 25 of function (*SQLStore).applyLimitsOnRecovery() is high (> 15) (gocyclo)
    • Line 2183: warning: cyclomatic complexity 20 of function (*SQLSubStore).flush() is high (> 15) (gocyclo)
    • Line 2105: warning: cyclomatic complexity 18 of function (*SQLSubStore).recoverPendingRow() is high (> 15) (gocyclo)
    • Line 1716: warning: cyclomatic complexity 16 of function (*SQLMsgStore).bulkInsert() is high (> 15) (gocyclo)
    • stores/common_msg_test.go
    • Line 193: warning: cyclomatic complexity 33 of function TestCSMaxMsgs() is high (> 15) (gocyclo)
    • Line 795: warning: cyclomatic complexity 25 of function TestCSMsgStoreEmpty() is high (> 15) (gocyclo)
    • Line 49: warning: cyclomatic complexity 23 of function TestCSBasicMsgStore() is high (> 15) (gocyclo)
    • Line 631: warning: cyclomatic complexity 18 of function TestCSFirstAndLastMsg() is high (> 15) (gocyclo)
    • Line 532: warning: cyclomatic complexity 17 of function TestCSGetSeqFromStartTime() is high (> 15) (gocyclo)
    • server/server_limits_test.go
    • Line 530: warning: cyclomatic complexity 25 of function TestMaxInactivity() is high (> 15) (gocyclo)
    • Line 292: warning: cyclomatic complexity 19 of function TestPerChannelLimits() is high (> 15) (gocyclo)
    • server/conf_test.go
    • Line 38: warning: cyclomatic complexity 90 of function TestParseConfig() is high (> 15) (gocyclo)
    • Line 547: warning: cyclomatic complexity 40 of function TestParseConfigureOptions() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!