Preparing report...

Report for github.com/influxdata/influxdb

(v1.11.0)

A+    Excellent!    Found 132 issues across 624 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!


gofmt95%

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


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo81%

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.

    • tsdb/guard.go
    • Line 95: warning: cyclomatic complexity 16 of function newExprGuard() is high (> 15) (gocyclo)
    • tsdb/store.go
    • Line 312: warning: cyclomatic complexity 37 of function (*Store).loadShards() is high (> 15) (gocyclo)
    • Line 1919: warning: cyclomatic complexity 29 of function (*Store).TagValues() is high (> 15) (gocyclo)
    • Line 1693: warning: cyclomatic complexity 28 of function (*Store).TagKeys() is high (> 15) (gocyclo)
    • Line 2095: warning: cyclomatic complexity 20 of function (*Store).monitorShards() is high (> 15) (gocyclo)
    • Line 1415: warning: cyclomatic complexity 17 of function (*Store).DeleteSeries() is high (> 15) (gocyclo)
    • query/compile.go
    • Line 252: warning: cyclomatic complexity 32 of function (*compiledField).compileExpr() is high (> 15) (gocyclo)
    • Line 1116: warning: cyclomatic complexity 23 of function (*compiledStatement).Prepare() is high (> 15) (gocyclo)
    • Line 922: warning: cyclomatic complexity 21 of function (*compiledStatement).compileDimensions() is high (> 15) (gocyclo)
    • Line 611: warning: cyclomatic complexity 20 of function (*compiledField).compileExponentialMovingAverage() is high (> 15) (gocyclo)
    • Line 711: warning: cyclomatic complexity 17 of function (*compiledField).compileChandeMomentumOscillator() is high (> 15) (gocyclo)
    • toml/toml.go
    • Line 153: warning: cyclomatic complexity 40 of function applyEnvOverrides() is high (> 15) (gocyclo)
    • cmd/influx/cli/cli.go
    • Line 83: warning: cyclomatic complexity 38 of function (*CommandLine).Run() is high (> 15) (gocyclo)
    • Line 946: warning: cyclomatic complexity 22 of function (*CommandLine).formatResults() is high (> 15) (gocyclo)
    • Line 281: warning: cyclomatic complexity 21 of function (*CommandLine).ParseCommand() is high (> 15) (gocyclo)
    • Line 776: warning: cyclomatic complexity 19 of function (*CommandLine).ExecuteQuery() is high (> 15) (gocyclo)
    • Line 1296: warning: cyclomatic complexity 17 of function (*formatter).WriteTo() is high (> 15) (gocyclo)
    • services/retention/service_test.go
    • Line 60: warning: cyclomatic complexity 19 of function TestService_CheckShards() is high (> 15) (gocyclo)
    • Line 231: warning: cyclomatic complexity 17 of function testService_8819_repro() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/tombstone.go
    • Line 602: warning: cyclomatic complexity 21 of function (*Tombstoner).readTombstoneV4() is high (> 15) (gocyclo)
    • Line 90: warning: cyclomatic complexity 16 of function (*Tombstoner).AddRange() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/file_store_test.go
    • Line 1829: warning: cyclomatic complexity 16 of function TestFileStore_SeekToDesc_AfterEnd_OverlapString() is high (> 15) (gocyclo)
    • Line 1481: warning: cyclomatic complexity 16 of function TestFileStore_SeekToDesc_AfterEnd_OverlapFloat() is high (> 15) (gocyclo)
    • Line 1732: warning: cyclomatic complexity 16 of function TestFileStore_SeekToDesc_AfterEnd_OverlapBoolean() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/reader_test.go
    • Line 1775: warning: cyclomatic complexity 18 of function TestTSMReader_References() is high (> 15) (gocyclo)
    • Line 1306: warning: cyclomatic complexity 16 of function TestBlockIterator_MultipleBlocks() is high (> 15) (gocyclo)
    • Line 909: warning: cyclomatic complexity 16 of function TestTSMReader_MMAP_TombstoneOutsideRange() is high (> 15) (gocyclo)
    • query/select.go
    • Line 214: warning: cyclomatic complexity 88 of function (*exprIteratorBuilder).buildCallIterator() is high (> 15) (gocyclo)
    • Line 625: warning: cyclomatic complexity 29 of function buildCursor() is high (> 15) (gocyclo)
    • Line 781: warning: cyclomatic complexity 19 of function buildAuxIterator() is high (> 15) (gocyclo)
    • query/iterator.go
    • Line 1035: warning: cyclomatic complexity 17 of function decodeIteratorOptions() is high (> 15) (gocyclo)
    • Line 707: warning: cyclomatic complexity 17 of function newIteratorOptionsSubstatement() is high (> 15) (gocyclo)
    • tsdb/index.go
    • Line 1639: warning: cyclomatic complexity 34 of function (IndexSet).measurementNamesByTagFilter() is high (> 15) (gocyclo)
    • Line 2500: warning: cyclomatic complexity 27 of function (IndexSet).seriesByBinaryExprIterator() is high (> 15) (gocyclo)
    • Line 2846: warning: cyclomatic complexity 27 of function (IndexSet).tagValuesByKeyAndExpr() is high (> 15) (gocyclo)
    • Line 2950: warning: cyclomatic complexity 24 of function (IndexSet).MeasurementTagKeyValuesByExpr() is high (> 15) (gocyclo)
    • Line 1952: warning: cyclomatic complexity 19 of function (IndexSet).measurementHasTagValueRegex() is high (> 15) (gocyclo)
    • Line 3055: warning: cyclomatic complexity 18 of function (IndexSet).TagSets() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/compact_test.go
    • Line 1007: warning: cyclomatic complexity 18 of function TestCompactor_CompactFull_MaxKeys() is high (> 15) (gocyclo)
    • Line 2832: warning: cyclomatic complexity 16 of function TestDefaultPlanner_Plan_ForceFull() is high (> 15) (gocyclo)
    • services/meta/client_test.go
    • Line 576: warning: cyclomatic complexity 46 of function TestMetaClient_CreateUser() is high (> 15) (gocyclo)
    • Line 1027: warning: cyclomatic complexity 16 of function TestMetaClient_PruneShardGroups() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/engine.go
    • Line 1541: warning: cyclomatic complexity 58 of function (*Engine).deleteSeriesRange() is high (> 15) (gocyclo)
    • Line 2836: warning: cyclomatic complexity 41 of function (*Engine).createVarRefSeriesIterator() is high (> 15) (gocyclo)
    • Line 3013: warning: cyclomatic complexity 25 of function (*Engine).buildCursor() is high (> 15) (gocyclo)
    • Line 1300: warning: cyclomatic complexity 25 of function (*Engine).WritePoints() is high (> 15) (gocyclo)
    • Line 2544: warning: cyclomatic complexity 22 of function (*Engine).createCallIterator() is high (> 15) (gocyclo)
    • Line 1428: warning: cyclomatic complexity 20 of function (*Engine).DeleteSeriesRangeWithPredicate() is high (> 15) (gocyclo)
    • Line 1103: warning: cyclomatic complexity 19 of function (*Engine).overlay() is high (> 15) (gocyclo)
    • Line 2647: warning: cyclomatic complexity 19 of function (*Engine).createVarRefIterator() is high (> 15) (gocyclo)
    • Line 958: warning: cyclomatic complexity 19 of function (*Engine).timeStampFilterTarFile() is high (> 15) (gocyclo)
    • Line 2071: warning: cyclomatic complexity 16 of function (*Engine).compact() is high (> 15) (gocyclo)
    • Line 1026: warning: cyclomatic complexity 16 of function (*Engine).filterFileToBackup() is high (> 15) (gocyclo)
    • Line 811: warning: cyclomatic complexity 16 of function (*Engine).LoadMetadataIndex() is high (> 15) (gocyclo)
    • tsdb/shard.go
    • Line 573: warning: cyclomatic complexity 26 of function (*Shard).validateSeriesAndFields() is high (> 15) (gocyclo)
    • Line 930: warning: cyclomatic complexity 17 of function (*Shard).FieldDimensions() is high (> 15) (gocyclo)
    • tsdb/index_test.go
    • Line 283: warning: cyclomatic complexity 21 of function TestIndex_Sketches() is high (> 15) (gocyclo)
    • Line 652: warning: cyclomatic complexity 19 of function BenchmarkIndex_ConcurrentWriteQuery() is high (> 15) (gocyclo)
    • coordinator/statement_executor.go
    • Line 64: warning: cyclomatic complexity 60 of function (*StatementExecutor).ExecuteStatement() is high (> 15) (gocyclo)
    • Line 726: warning: cyclomatic complexity 24 of function (*StatementExecutor).executeShowMeasurementsStatement() is high (> 15) (gocyclo)
    • Line 1091: warning: cyclomatic complexity 24 of function (*StatementExecutor).executeShowTagValues() is high (> 15) (gocyclo)
    • Line 1004: warning: cyclomatic complexity 18 of function (*StatementExecutor).executeShowTagKeys() is high (> 15) (gocyclo)
    • Line 1370: warning: cyclomatic complexity 17 of function (*StatementExecutor).NormalizeStatement() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/engine_test.go
    • Line 500: warning: cyclomatic complexity 46 of function TestEngine_Export() is high (> 15) (gocyclo)
    • Line 1374: warning: cyclomatic complexity 29 of function TestEngine_DeleteSeriesRangeWithPredicate() is high (> 15) (gocyclo)
    • Line 1586: warning: cyclomatic complexity 29 of function TestEngine_DeleteSeriesRangeWithPredicate_FlushBatch() is high (> 15) (gocyclo)
    • Line 1264: warning: cyclomatic complexity 23 of function TestEngine_DeleteSeriesRange() is high (> 15) (gocyclo)
    • Line 377: warning: cyclomatic complexity 23 of function TestEngine_Backup() is high (> 15) (gocyclo)
    • Line 1500: warning: cyclomatic complexity 19 of function TestEngine_DeleteSeriesRangeWithPredicate_Nil() is high (> 15) (gocyclo)
    • Line 1117: warning: cyclomatic complexity 18 of function TestIndex_SeriesIDSet() is high (> 15) (gocyclo)
    • Line 1712: warning: cyclomatic complexity 17 of function TestEngine_DeleteSeriesRange_OutsideTime() is high (> 15) (gocyclo)
    • Line 178: warning: cyclomatic complexity 16 of function TestEngine_Digest() is high (> 15) (gocyclo)
    • query/functions.go
    • Line 1305: warning: cyclomatic complexity 33 of function (*FloatHoltWintersReducer).Emit() is high (> 15) (gocyclo)
    • tsdb/index/tsi1/log_file_test.go
    • Line 215: warning: cyclomatic complexity 27 of function TestLogFile_Open() is high (> 15) (gocyclo)
    • Line 24: warning: cyclomatic complexity 20 of function TestLogFile_AddSeriesList() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/writer_test.go
    • Line 431: warning: cyclomatic complexity 25 of function TestTSMWriter_WriteBlock_Multiple() is high (> 15) (gocyclo)
    • Line 313: warning: cyclomatic complexity 17 of function TestTSMWriter_Read_Multiple() is high (> 15) (gocyclo)
    • tsdb/index/inmem/meta.go
    • Line 624: warning: cyclomatic complexity 51 of function (*measurement).idsForExpr() is high (> 15) (gocyclo)
    • Line 904: warning: cyclomatic complexity 19 of function (*measurement).TagKeysByExpr() is high (> 15) (gocyclo)
    • Line 372: warning: cyclomatic complexity 17 of function (*measurement).TagSets() is high (> 15) (gocyclo)
    • Line 514: warning: cyclomatic complexity 17 of function unionSeriesFilters() is high (> 15) (gocyclo)
    • Line 811: warning: cyclomatic complexity 16 of function (*measurement).WalkWhereForSeriesIds() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/wal_test.go
    • Line 356: warning: cyclomatic complexity 20 of function TestWALWriter_WriteMultiDeleteRange_Multiple() is high (> 15) (gocyclo)
    • Line 262: warning: cyclomatic complexity 18 of function TestWALWriter_WriteMultiDelete_Multiple() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/file_store.go
    • Line 755: warning: cyclomatic complexity 38 of function (*FileStore).replace() is high (> 15) (gocyclo)
    • Line 481: warning: cyclomatic complexity 25 of function (*FileStore).Open() is high (> 15) (gocyclo)
    • tsdb/index/tsi1/index_test.go
    • Line 858: warning: cyclomatic complexity 20 of function BenchmarkIndex_ConcurrentWriteQuery() is high (> 15) (gocyclo)
    • Line 363: warning: cyclomatic complexity 16 of function TestIndex_TagValueSeriesIDIterator() is high (> 15) (gocyclo)
    • query/math.go
    • Line 93: warning: cyclomatic complexity 44 of function (MathValuer).Call() is high (> 15) (gocyclo)
    • tsdb/shard_test.go
    • Line 522: warning: cyclomatic complexity 27 of function TestShard_WritePoints_FieldConflictConcurrentQuery() is high (> 15) (gocyclo)
    • Line 889: warning: cyclomatic complexity 23 of function TestShard_CreateIterator_Series_Auth() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/wal.go
    • Line 756: warning: cyclomatic complexity 25 of function (*WriteWALEntry).UnmarshalBinary() is high (> 15) (gocyclo)
    • Line 642: warning: cyclomatic complexity 20 of function (*WriteWALEntry).Encode() is high (> 15) (gocyclo)
    • models/points.go
    • Line 899: warning: cyclomatic complexity 52 of function scanNumber() is high (> 15) (gocyclo)
    • Line 760: warning: cyclomatic complexity 30 of function scanFields() is high (> 15) (gocyclo)
    • Line 1040: warning: cyclomatic complexity 24 of function scanBoolean() is high (> 15) (gocyclo)
    • Line 2467: warning: cyclomatic complexity 17 of function appendField() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/compact.go
    • Line 428: warning: cyclomatic complexity 50 of function (*DefaultPlanner).Plan() is high (> 15) (gocyclo)
    • Line 1439: warning: cyclomatic complexity 29 of function (*tsmBatchKeyIterator).Next() is high (> 15) (gocyclo)
    • Line 1099: warning: cyclomatic complexity 25 of function (*Compactor).write() is high (> 15) (gocyclo)
    • Line 337: warning: cyclomatic complexity 22 of function (*DefaultPlanner).PlanOptimize() is high (> 15) (gocyclo)
    • Line 241: warning: cyclomatic complexity 21 of function (*DefaultPlanner).PlanLevel() is high (> 15) (gocyclo)
    • tsdb/series_partition.go
    • Line 198: warning: cyclomatic complexity 24 of function (*SeriesPartition).CreateSeriesListIfNotExists() is high (> 15) (gocyclo)
    • Line 576: warning: cyclomatic complexity 16 of function (*SeriesPartitionCompactor).compactIndexTo() is high (> 15) (gocyclo)
    • services/httpd/response_writer.go
    • Line 164: warning: cyclomatic complexity 28 of function (*csvFormatter).WriteResponse() is high (> 15) (gocyclo)
    • Line 275: warning: cyclomatic complexity 20 of function (*msgpackFormatter).WriteResponse() is high (> 15) (gocyclo)
    • client/influxdb.go
    • Line 225: warning: cyclomatic complexity 19 of function (*Client).QueryContext() is high (> 15) (gocyclo)
    • Line 344: warning: cyclomatic complexity 16 of function (*Client).Write() is high (> 15) (gocyclo)
    • tsdb/store_test.go
    • Line 1415: warning: cyclomatic complexity 39 of function TestStore_Sketches() is high (> 15) (gocyclo)
    • Line 1810: warning: cyclomatic complexity 23 of function TestStore_TagKeys_Auth() is high (> 15) (gocyclo)
    • Line 1908: warning: cyclomatic complexity 21 of function TestStore_TagValues_Auth() is high (> 15) (gocyclo)
    • Line 2217: warning: cyclomatic complexity 18 of function TestStore_TagValues_ConcurrentDropShard() is high (> 15) (gocyclo)
    • Line 2126: warning: cyclomatic complexity 17 of function TestStore_TagKeys_ConcurrentDropShard() is high (> 15) (gocyclo)
    • Line 35: warning: cyclomatic complexity 17 of function TestStore_DeleteRetentionPolicy() is high (> 15) (gocyclo)
    • Line 428: warning: cyclomatic complexity 17 of function TestStore_DeleteShard() is high (> 15) (gocyclo)
    • Line 2041: warning: cyclomatic complexity 16 of function TestStore_MeasurementNames_ConcurrentDropShard() is high (> 15) (gocyclo)
    • Line 1721: warning: cyclomatic complexity 16 of function TestStore_Measurements_Auth() is high (> 15) (gocyclo)
    • tsdb/index/inmem/inmem.go
    • Line 652: warning: cyclomatic complexity 19 of function (*Index).measurementNamesByTagFilters() is high (> 15) (gocyclo)
    • Line 189: warning: cyclomatic complexity 19 of function (*Index).CreateSeriesListIfNotExists() is high (> 15) (gocyclo)
    • Line 425: warning: cyclomatic complexity 17 of function (*Index).MeasurementTagKeyValuesByExpr() is high (> 15) (gocyclo)
    • services/meta/data_test.go
    • Line 249: warning: cyclomatic complexity 21 of function TestData_TruncateShardGroups() is high (> 15) (gocyclo)
    • Line 145: warning: cyclomatic complexity 19 of function TestData_AdminUserExists() is high (> 15) (gocyclo)
    • monitor/service_test.go
    • Line 87: warning: cyclomatic complexity 19 of function TestMonitor_StoreStatistics() is high (> 15) (gocyclo)
    • Line 287: warning: cyclomatic complexity 16 of function TestMonitor_Expvar() is high (> 15) (gocyclo)
    • query/executor.go
    • Line 253: warning: cyclomatic complexity 29 of function (*Executor).executeQuery() is high (> 15) (gocyclo)
    • query/cursor.go
    • Line 285: warning: cyclomatic complexity 22 of function (*multiScannerCursor).scan() is high (> 15) (gocyclo)
    • storage/flux/reader.go
    • Line 689: warning: cyclomatic complexity 33 of function (*windowAggregateIterator).handleRead() is high (> 15) (gocyclo)
    • Line 293: warning: cyclomatic complexity 16 of function (*groupIterator).handleRead() is high (> 15) (gocyclo)
    • services/httpd/handler.go
    • Line 555: warning: cyclomatic complexity 46 of function (*Handler).serveQuery() is high (> 15) (gocyclo)
    • Line 2190: warning: cyclomatic complexity 31 of function (*Handler).serveExpvar() is high (> 15) (gocyclo)
    • Line 1353: warning: cyclomatic complexity 28 of function (*Handler).serveListBucketsV2() is high (> 15) (gocyclo)
    • Line 1941: warning: cyclomatic complexity 26 of function (*Handler).servePromRead() is high (> 15) (gocyclo)
    • Line 1601: warning: cyclomatic complexity 26 of function (*Handler).serveWrite() is high (> 15) (gocyclo)
    • Line 1808: warning: cyclomatic complexity 25 of function (*Handler).servePromWrite() is high (> 15) (gocyclo)
    • Line 910: warning: cyclomatic complexity 25 of function (*Handler).serveDeleteV2() is high (> 15) (gocyclo)
    • Line 1090: warning: cyclomatic complexity 22 of function (*Handler).servePostCreateBucketV2() is high (> 15) (gocyclo)
    • Line 2622: warning: cyclomatic complexity 20 of function authenticate() is high (> 15) (gocyclo)
    • tsdb/engine/tsm1/batch_float.go
    • Line 278: warning: cyclomatic complexity 30 of function FloatArrayDecodeAll() is high (> 15) (gocyclo)
    • Line 17: warning: cyclomatic complexity 30 of function FloatArrayEncodeAll() is high (> 15) (gocyclo)
    • cmd/influxd/run/config_test.go
    • Line 108: warning: cyclomatic complexity 27 of function TestConfig_Parse_EnvOverride() is high (> 15) (gocyclo)
    • Line 19: warning: cyclomatic complexity 17 of function TestConfig_Parse() is high (> 15) (gocyclo)
    • Line 339: warning: cyclomatic complexity 17 of function TestConfig_Parse_UTF8_ByteOrderMark() is high (> 15) (gocyclo)
    • Line 431: warning: cyclomatic complexity 17 of function TestConfig_Parse_UTF16_ByteOrderMark() is high (> 15) (gocyclo)
    • services/graphite/parser.go
    • Line 99: warning: cyclomatic complexity 16 of function (*Parser).Parse() is high (> 15) (gocyclo)
    • Line 218: warning: cyclomatic complexity 16 of function (*Template).Apply() is high (> 15) (gocyclo)

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!