Preparing report...

Report for github.com/BraeTroutman/prometheus

(v0.37.0)

A+    Excellent!    Found 60 issues across 385 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!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo84%

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.

    • rules/manager.go
    • Line 601: warning: cyclomatic complexity 18 of function (*Group).Eval() is high (> 15) (gocyclo)
    • Line 340: warning: cyclomatic complexity 17 of function (*Group).run() is high (> 15) (gocyclo)
    • tsdb/repair.go
    • Line 32: warning: cyclomatic complexity 16 of function repairBadIndexVersion() is high (> 15) (gocyclo)
    • promql/test.go
    • Line 513: warning: cyclomatic complexity 22 of function (*Test).exec() is high (> 15) (gocyclo)
    • model/relabel/relabel.go
    • Line 98: warning: cyclomatic complexity 29 of function (*Config).UnmarshalYAML() is high (> 15) (gocyclo)
    • Line 203: warning: cyclomatic complexity 22 of function relabel() is high (> 15) (gocyclo)
    • promql/parser/lex.go
    • Line 335: warning: cyclomatic complexity 43 of function lexStatements() is high (> 15) (gocyclo)
    • Line 458: warning: cyclomatic complexity 17 of function lexInsideBraces() is high (> 15) (gocyclo)
    • tsdb/head.go
    • Line 479: warning: cyclomatic complexity 25 of function (*Head).Init() is high (> 15) (gocyclo)
    • tsdb/index/index.go
    • Line 817: warning: cyclomatic complexity 25 of function (*Writer).writePostingsToTmpFiles() is high (> 15) (gocyclo)
    • Line 1620: warning: cyclomatic complexity 24 of function (*Reader).Postings() is high (> 15) (gocyclo)
    • Line 1131: warning: cyclomatic complexity 21 of function newReader() is high (> 15) (gocyclo)
    • Line 341: warning: cyclomatic complexity 17 of function (*Writer).ensureStage() is high (> 15) (gocyclo)
    • Line 417: warning: cyclomatic complexity 16 of function (*Writer).AddSeries() is high (> 15) (gocyclo)
    • tsdb/wal/watcher.go
    • Line 332: warning: cyclomatic complexity 23 of function (*Watcher).watch() is high (> 15) (gocyclo)
    • Line 474: warning: cyclomatic complexity 17 of function (*Watcher).readSegment() is high (> 15) (gocyclo)
    • tsdb/querier.go
    • Line 226: warning: cyclomatic complexity 20 of function PostingsForMatchers() is high (> 15) (gocyclo)
    • Line 443: warning: cyclomatic complexity 16 of function (*blockBaseSeriesSet).Next() is high (> 15) (gocyclo)
    • storage/merge.go
    • Line 618: warning: cyclomatic complexity 17 of function (*compactChunkIterator).Next() is high (> 15) (gocyclo)
    • cmd/promtool/main.go
    • Line 408: warning: cyclomatic complexity 38 of function checkConfig() is high (> 15) (gocyclo)
    • Line 76: warning: cyclomatic complexity 26 of function main() is high (> 15) (gocyclo)
    • config/config.go
    • Line 261: warning: cyclomatic complexity 20 of function (*Config).UnmarshalYAML() is high (> 15) (gocyclo)
    • tsdb/head_wal.go
    • Line 44: warning: cyclomatic complexity 50 of function (*Head).loadWAL() is high (> 15) (gocyclo)
    • Line 845: warning: cyclomatic complexity 38 of function (*Head).loadChunkSnapshot() is high (> 15) (gocyclo)
    • Line 581: warning: cyclomatic complexity 28 of function (*Head).ChunkSnapshot() is high (> 15) (gocyclo)
    • tsdb/compact.go
    • Line 665: warning: cyclomatic complexity 29 of function (*LeveledCompactor).populateBlock() is high (> 15) (gocyclo)
    • Line 549: warning: cyclomatic complexity 19 of function (*LeveledCompactor).write() is high (> 15) (gocyclo)
    • tsdb/head_test.go
    • Line 269: warning: cyclomatic complexity 27 of function TestHead_HighConcurrencyReadAndWrite() is high (> 15) (gocyclo)
    • Line 2754: warning: cyclomatic complexity 18 of function TestChunkSnapshot() is high (> 15) (gocyclo)
    • Line 134: warning: cyclomatic complexity 16 of function BenchmarkLoadWAL() is high (> 15) (gocyclo)
    • Line 1025: warning: cyclomatic complexity 16 of function TestDelete_e2e() is high (> 15) (gocyclo)
    • tsdb/wal/wal.go
    • Line 608: warning: cyclomatic complexity 21 of function (*WAL).log() is high (> 15) (gocyclo)
    • Line 348: warning: cyclomatic complexity 20 of function (*WAL).Repair() is high (> 15) (gocyclo)
    • web/federate.go
    • Line 53: warning: cyclomatic complexity 28 of function (*Handler).federation() is high (> 15) (gocyclo)
    • tsdb/db.go
    • Line 613: warning: cyclomatic complexity 26 of function open() is high (> 15) (gocyclo)
    • Line 1050: warning: cyclomatic complexity 20 of function (*DB).reloadBlocks() is high (> 15) (gocyclo)
    • tsdb/wal.go
    • Line 869: warning: cyclomatic complexity 27 of function (*walReader).Read() is high (> 15) (gocyclo)
    • Line 297: warning: cyclomatic complexity 25 of function (*SegmentWAL).Truncate() is high (> 15) (gocyclo)
    • Line 1232: warning: cyclomatic complexity 16 of function MigrateWAL() is high (> 15) (gocyclo)
    • model/textparse/promparse.go
    • Line 260: warning: cyclomatic complexity 30 of function (*PromParser).Next() is high (> 15) (gocyclo)
    • Line 69: warning: cyclomatic complexity 21 of function (token).String() is high (> 15) (gocyclo)
    • promql/engine.go
    • Line 1221: warning: cyclomatic complexity 78 of function (*evaluator).eval() is high (> 15) (gocyclo)
    • Line 2237: warning: cyclomatic complexity 61 of function (*evaluator).aggregation() is high (> 15) (gocyclo)
    • Line 1023: warning: cyclomatic complexity 27 of function (*evaluator).rangeEval() is high (> 15) (gocyclo)
    • Line 2569: warning: cyclomatic complexity 24 of function preprocessExprHelper() is high (> 15) (gocyclo)
    • Line 1938: warning: cyclomatic complexity 23 of function (*evaluator).VectorBinop() is high (> 15) (gocyclo)
    • Line 461: warning: cyclomatic complexity 22 of function (*Engine).validateOpts() 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!