Preparing report...

Report for github.com/profefe/profefe

A+    Excellent!    Found 47 issues across 76 files

Tweet

gofmt98%

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


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!


gocyclo89%

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.

    • profefe/internal/pprof/profile/legacy_profile.go
    • Line 679: warning: cyclomatic complexity 31 of function parseContention() is high (> 15) (gocyclo)
    • Line 190: warning: cyclomatic complexity 19 of function (*Profile).remapMappingIDs() is high (> 15) (gocyclo)
    • Line 836: warning: cyclomatic complexity 18 of function parseThread() is high (> 15) (gocyclo)
    • Line 464: warning: cyclomatic complexity 16 of function parseHeap() is high (> 15) (gocyclo)

golint46%

Golint is a linter for Go source code.

    • profefe/agent/agent.go
    • Line 35: warning: exported function Start should have comment or be unexported (golint)
    • Line 47: warning: exported type Agent should have comment or be unexported (golint)
    • Line 69: warning: exported function New should have comment or be unexported (golint)
    • Line 92: warning: exported method Agent.Start should have comment or be unexported (golint)
    • Line 102: warning: exported method Agent.Stop should have comment or be unexported (golint)
    • profefe/pkg/profefe/profiles_handler.go
    • Line 17: warning: exported type ProfilesHandler should have comment or be unexported (golint)
    • Line 23: warning: exported function NewProfilesHandler should have comment or be unexported (golint)
    • Line 55: warning: exported method ProfilesHandler.HandleCreateProfile should have comment or be unexported (golint)
    • Line 75: warning: exported method ProfilesHandler.HandleGetProfile should have comment or be unexported (golint)
    • Line 107: warning: exported method ProfilesHandler.HandleFindProfiles should have comment or be unexported (golint)
    • Line 129: warning: exported method ProfilesHandler.HandleMergeProfiles should have comment or be unexported (golint)
    • profefe/pkg/profefe/request.go
    • Line 28: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • profefe/pkg/storage/s3/s3.go
    • Line 18: warning: exported type Config should have comment or be unexported (golint)
    • Line 26: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • Line 34: warning: exported method Config.CreateStorage should have comment or be unexported (golint)
    • profefe/pkg/storage/badger/badger.go
    • Line 20: warning: exported type Config should have comment or be unexported (golint)
    • Line 27: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • Line 34: warning: exported method Config.CreateStorage should have comment or be unexported (golint)
    • profefe/pkg/log/logger.go
    • Line 5: warning: exported type Logger should have comment or be unexported (golint)
    • Line 9: warning: exported function New should have comment or be unexported (golint)
    • Line 15: warning: exported function NewNop should have comment or be unexported (golint)
    • Line 19: warning: exported method Logger.With should have comment or be unexported (golint)
    • Line 23: warning: exported method Logger.Debugw should have comment or be unexported (golint)
    • Line 27: warning: exported method Logger.Infow should have comment or be unexported (golint)
    • Line 31: warning: exported method Logger.Errorw should have comment or be unexported (golint)
    • profefe/pkg/storage/gcs/gcs.go
    • Line 16: warning: exported type Config should have comment or be unexported (golint)
    • Line 21: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • Line 26: warning: exported method Config.CreateStorage should have comment or be unexported (golint)
    • profefe/pkg/profile/profile.go
    • Line 9: warning: exported const TestID should have comment or be unexported (golint)
    • Line 11: warning: exported type ID should have comment or be unexported (golint)
    • Line 13: warning: exported function JoinIDs should have comment or be unexported (golint)
    • Line 31: warning: exported function SplitIDs should have comment or be unexported (golint)
    • Line 46: warning: exported type Meta should have comment or be unexported (golint)
    • profefe/pkg/storage/clickhouse/model.go
    • Line 13: warning: exported type ProfileKey should have comment or be unexported (golint)
    • Line 15: warning: exported function NewProfileKey should have comment or be unexported (golint)
    • Line 24: warning: exported method ProfileKey.Scan should have comment or be unexported (golint)
    • Line 36: warning: exported method ProfileKey.Value should have comment or be unexported (golint)
    • Line 44: warning: exported type ProfileType should have comment or be unexported (golint)
    • Line 59: warning: exported function ProfileTypeToDBModel should have comment or be unexported (golint)
    • Line 80: warning: exported function ProfileTypeFromDBModel should have comment or be unexported (golint)
    • profefe/pkg/log/config.go
    • Line 10: warning: exported type Config should have comment or be unexported (golint)
    • Line 15: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • Line 20: warning: exported method Config.Build should have comment or be unexported (golint)
    • profefe/pkg/profile/profile_type.go
    • Line 8: warning: exported type ProfileType should have comment or be unexported (golint)
    • Line 11: warning: exported const TypeUnknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported method ProfileType.FromString should have comment or be unexported (golint)
    • profefe/pkg/storage/clickhouse/clickhouse.go
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 13: warning: exported type Config should have comment or be unexported (golint)
    • Line 19: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • Line 24: warning: exported method Config.CreateStorage should have comment or be unexported (golint)
    • profefe/pkg/agentutil/confg.go
    • Line 19: warning: exported type Config should have comment or be unexported (golint)
    • Line 35: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • Line 53: warning: exported method Config.Start should have comment or be unexported (golint)
    • profefe/pkg/storage/multi_writer.go
    • Line 12: warning: exported type MultiWriter should have comment or be unexported (golint)
    • Line 18: warning: exported function NewMultiWriter should have comment or be unexported (golint)
    • Line 27: warning: exported method MultiWriter.WriteProfile should have comment or be unexported (golint)
    • profefe/pkg/storage/storage.go
    • Line 14: warning: exported var ErrNotFound should have comment or be unexported (golint)
    • Line 19: warning: exported type Storage should have comment or be unexported (golint)
    • Line 24: warning: exported type Writer should have comment or be unexported (golint)
    • Line 28: warning: exported type WriteProfileParams should have comment or be unexported (golint)
    • Line 36: warning: exported method WriteProfileParams.Validate should have comment or be unexported (golint)
    • Line 49: warning: exported type Reader should have comment or be unexported (golint)
    • Line 56: warning: exported type FindProfilesParams should have comment or be unexported (golint)
    • Line 65: warning: exported method FindProfilesParams.Validate should have comment or be unexported (golint)
    • Line 81: warning: exported type ProfileList should have comment or be unexported (golint)
    • profefe/pkg/storage/storagetest/suite.go
    • Line 18: warning: exported type WriterTestSuite should have comment or be unexported (golint)
    • Line 25: warning: exported method WriterTestSuite.TestWriteProfile should have comment or be unexported (golint)
    • Line 58: warning: exported type ReaderTestSuite should have comment or be unexported (golint)
    • Line 65: warning: exported method ReaderTestSuite.TestFindProfileIDs should have comment or be unexported (golint)
    • Line 69: warning: exported method ReaderTestSuite.TestListProfiles should have comment or be unexported (golint)
    • Line 73: warning: exported method ReaderTestSuite.TestListServices should have comment or be unexported (golint)
    • profefe/pkg/middleware/context.go
    • Line 16: warning: exported function ContextWithRequestID should have comment or be unexported (golint)
    • Line 20: warning: exported function RequestIDFromContext should have comment or be unexported (golint)
    • profefe/pkg/storage/stub.go
    • Line 10: warning: exported type WriteProfileFunc should have comment or be unexported (golint)
    • Line 12: warning: exported type StubWriter should have comment or be unexported (golint)
    • Line 18: warning: exported method StubWriter.WriteProfile should have comment or be unexported (golint)
    • Line 22: warning: exported type ListServicesFunc should have comment or be unexported (golint)
    • Line 24: warning: exported type FindProfilesFunc should have comment or be unexported (golint)
    • Line 26: warning: exported type FindProfileIDsFunc should have comment or be unexported (golint)
    • Line 28: warning: exported type ListProfilesFunc should have comment or be unexported (golint)
    • Line 30: warning: exported type StubReader should have comment or be unexported (golint)
    • Line 39: warning: exported method StubReader.ListServices should have comment or be unexported (golint)
    • Line 43: warning: exported method StubReader.FindProfiles should have comment or be unexported (golint)
    • Line 47: warning: exported method StubReader.FindProfileIDs should have comment or be unexported (golint)
    • Line 51: warning: exported method StubReader.ListProfiles should have comment or be unexported (golint)
    • profefe/pkg/pprofutil/profile_parser.go
    • Line 12: warning: exported type ProfileParserError should have comment or be unexported (golint)
    • Line 24: warning: exported type ProfileParser should have comment or be unexported (golint)
    • Line 29: warning: exported function NewProfileParser should have comment or be unexported (golint)
    • Line 37: warning: exported method ProfileParser.WriteTo should have comment or be unexported (golint)
    • Line 41: warning: exported method ProfileParser.Seek should have comment or be unexported (golint)
    • Line 45: warning: exported method ProfileParser.ParseProfile should have comment or be unexported (golint)
    • Line 58: warning: exported function ParseProfileFrom should have comment or be unexported (golint)
    • profefe/pkg/storage/badger/storage.go
    • Line 60: warning: exported type Storage should have comment or be unexported (golint)
    • Line 70: warning: exported function NewStorage should have comment or be unexported (golint)
    • Line 79: warning: exported method Storage.WriteProfile should have comment or be unexported (golint)
    • Line 213: warning: exported method Storage.ListServices should have comment or be unexported (golint)
    • Line 221: warning: exported method Storage.ListProfiles should have comment or be unexported (golint)
    • Line 252: warning: exported type ProfileList should have comment or be unexported (golint)
    • Line 267: warning: exported method ProfileList.Next should have comment or be unexported (golint)
    • Line 296: warning: exported method ProfileList.Profile should have comment or be unexported (golint)
    • Line 310: warning: exported method ProfileList.Close should have comment or be unexported (golint)
    • Line 323: warning: exported method Storage.FindProfiles should have comment or be unexported (golint)
    • Line 370: warning: exported method Storage.FindProfileIDs should have comment or be unexported (golint)
    • profefe/agent/retry.go
    • Line 7: warning: exported function DoRetry should have comment or be unexported (golint)
    • Line 11: warning: exported function DoRetryAttempts should have comment or be unexported (golint)
    • Line 16: warning: exported type Retry should have comment or be unexported (golint)
    • Line 30: warning: exported method Retry.Do should have comment or be unexported (golint)
    • Line 49: warning: exported method Retry.Check should have comment or be unexported (golint)
    • Line 71: warning: exported function Cancel should have comment or be unexported (golint)
    • profefe/pkg/pprofutil/profile_builder.go
    • Line 8: warning: exported type ProfileBuilder should have comment or be unexported (golint)
    • Line 13: warning: exported function NewProfileBuilder should have comment or be unexported (golint)
    • Line 20: warning: exported method ProfileBuilder.IsEmpty should have comment or be unexported (golint)
    • Line 24: warning: exported method ProfileBuilder.AddSample should have comment or be unexported (golint)
    • Line 28: warning: exported method ProfileBuilder.AddMapping should have comment or be unexported (golint)
    • Line 35: warning: exported method ProfileBuilder.AddLocation should have comment or be unexported (golint)
    • Line 42: warning: exported method ProfileBuilder.AddFunction should have comment or be unexported (golint)
    • Line 49: warning: exported method ProfileBuilder.Build should have comment or be unexported (golint)
    • profefe/pkg/storage/clickhouse/reader.go
    • Line 33: warning: exported method Storage.FindProfiles should have comment or be unexported (golint)
    • Line 84: warning: exported method Storage.FindProfileIDs should have comment or be unexported (golint)
    • Line 117: warning: exported method Storage.ListProfiles should have comment or be unexported (golint)
    • Line 121: warning: exported method Storage.ListServices should have comment or be unexported (golint)
    • profefe/pkg/profefe/querier.go
    • Line 15: warning: exported type Querier should have comment or be unexported (golint)
    • Line 20: warning: exported function NewQuerier should have comment or be unexported (golint)
    • Line 27: warning: exported method Querier.GetProfilesTo should have comment or be unexported (golint)
    • Line 75: warning: exported method Querier.FindProfiles should have comment or be unexported (golint)
    • Line 93: warning: exported method Querier.FindMergeProfileTo should have comment or be unexported (golint)
    • Line 102: warning: exported method Querier.ListServices should have comment or be unexported (golint)
    • profefe/pkg/profefe/reply.go
    • Line 15: warning: exported var ErrNoResults should have comment or be unexported (golint)
    • Line 25: warning: exported function ReplyJSON should have comment or be unexported (golint)
    • Line 35: warning: exported function ReplyError should have comment or be unexported (golint)
    • Line 68: warning: exported function HandleErrorHTTP should have comment or be unexported (golint)
    • Line 89: warning: exported function StatusError should have comment or be unexported (golint)
    • profefe/pkg/config/config.go
    • Line 22: warning: exported const StorageTypeBadger should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported type Config should have comment or be unexported (golint)
    • Line 43: warning: exported method Config.RegisterFlags should have comment or be unexported (golint)
    • Line 58: warning: exported method Config.StorageType should have comment or be unexported (golint)
    • profefe/version/version.go
    • Line 14: warning: exported type Version should have comment or be unexported (golint)
    • Line 21: warning: exported function Details should have comment or be unexported (golint)
    • profefe/pkg/storage/clickhouse/writer.go
    • Line 47: warning: exported type ProfilesWriter should have comment or be unexported (golint)
    • Line 51: warning: exported type SamplesWriter should have comment or be unexported (golint)
    • Line 75: warning: exported type ProfilesWriterWrapper should have comment or be unexported (golint)
    • Line 82: warning: exported function NewProfilesWriter should have comment or be unexported (golint)
    • Line 146: warning: exported function NewSamplesWriter should have comment or be unexported (golint)
    • profefe/agent/options.go
    • Line 9: warning: exported type Option should have comment or be unexported (golint)
    • Line 11: warning: exported function WithTickInterval should have comment or be unexported (golint)
    • Line 17: warning: exported function WithCPUProfile should have comment or be unexported (golint)
    • Line 24: warning: exported function WithHeapProfile should have comment or be unexported (golint)
    • Line 30: warning: exported function WithBlockProfile should have comment or be unexported (golint)
    • Line 36: warning: exported function WithMutexProfile should have comment or be unexported (golint)
    • Line 42: warning: exported function WithGoroutineProfile should have comment or be unexported (golint)
    • Line 48: warning: exported function WithThreadcreateProfile should have comment or be unexported (golint)
    • Line 54: warning: exported function WithLabels should have comment or be unexported (golint)
    • Line 73: warning: exported function WithHTTPClient should have comment or be unexported (golint)
    • Line 79: warning: exported function WithLogger should have comment or be unexported (golint)
    • profefe/pkg/profefe/collector.go
    • Line 16: warning: exported type Collector should have comment or be unexported (golint)
    • Line 21: warning: exported function NewCollector should have comment or be unexported (golint)
    • Line 28: warning: exported method Collector.WriteProfile should have comment or be unexported (golint)
    • profefe/pkg/profile/labels.go
    • Line 11: warning: exported type Label should have comment or be unexported (golint)
    • Line 16: warning: exported type Labels should have comment or be unexported (golint)
    • Line 18: warning: exported function LabelsFromMap should have comment or be unexported (golint)
    • Line 38: warning: exported method Labels.Equal should have comment or be unexported (golint)
    • Line 68: warning: comment on exported method Labels.Include should be of the form "Include ..." (golint)
    • Line 96: warning: exported method Labels.Add should have comment or be unexported (golint)
    • Line 121: warning: exported method Labels.FromString should have comment or be unexported (golint)
    • Line 161: warning: exported type LabelsEncoder should have comment or be unexported (golint)
    • Line 166: warning: exported method Labels.EncodeTo should have comment or be unexported (golint)
    • profefe/pkg/storage/clickhouse/storage.go
    • Line 17: warning: exported type Storage should have comment or be unexported (golint)
    • Line 26: warning: exported function NewStorage should have comment or be unexported (golint)
    • Line 36: warning: exported method Storage.WriteProfile should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign97%

IneffAssign detects ineffectual assignments in Go code.


misspell0%

Misspell Finds commonly misspelled English words

An error occurred while running this test (exit status 2)