Preparing report...

Report for github.com/ostrost/ostent

A+    Excellent!    Found 29 issues across 52 files

Tweet

gofmt96%

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!


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.

    • ostent/internal/config/config.go
    • Line 997: warning: cyclomatic complexity 48 of function buildFilter() is high (> 15) (gocyclo)
    • Line 578: warning: cyclomatic complexity 42 of function (*Config).LoadTable() is high (> 15) (gocyclo)
    • Line 1197: warning: cyclomatic complexity 34 of function buildParser() is high (> 15) (gocyclo)
    • Line 858: warning: cyclomatic complexity 28 of function buildAggregator() is high (> 15) (gocyclo)
    • Line 1133: warning: cyclomatic complexity 18 of function buildInput() is high (> 15) (gocyclo)

golint53%

Golint is a linter for Go source code.

    • ostent/internal/plugins/outputs/ostent/ostent.go
    • Line 189: warning: don't use underscores in Go names; struct field time_user should be timeUser (golint)
    • Line 189: warning: don't use underscores in Go names; struct field time_system should be timeSystem (golint)
    • Line 820: warning: exported type Update should have comment or be unexported (golint)
    • Line 852: warning: exported var Updates should have comment or be unexported (golint)
    • Line 854: warning: exported var Output should have comment or be unexported (golint)
    • ostent/internal/models/running_aggregator.go
    • Line 10: warning: exported type RunningAggregator should have comment or be unexported (golint)
    • Line 20: warning: exported function NewRunningAggregator should have comment or be unexported (golint)
    • Line 47: warning: exported method RunningAggregator.Name should have comment or be unexported (golint)
    • Line 51: warning: exported method RunningAggregator.MakeMetric should have comment or be unexported (golint)
    • ostent/internal/models/running_input.go
    • Line 11: warning: exported var GlobalMetricsGathered should have comment or be unexported (golint)
    • Line 13: warning: exported type RunningInput should have comment or be unexported (golint)
    • Line 23: warning: exported function NewRunningInput should have comment or be unexported (golint)
    • Line 49: warning: exported method RunningInput.Name should have comment or be unexported (golint)
    • Line 86: warning: exported method RunningInput.Trace should have comment or be unexported (golint)
    • Line 90: warning: exported method RunningInput.SetTrace should have comment or be unexported (golint)
    • Line 94: warning: exported method RunningInput.SetDefaultTags should have comment or be unexported (golint)
    • ostent/internal/agent/accumulator.go
    • Line 12: warning: exported var NErrors should have comment or be unexported (golint)
    • Line 15: warning: exported type MetricMaker should have comment or be unexported (golint)
    • Line 26: warning: exported function NewAccumulator should have comment or be unexported (golint)
    • ostent/internal/internal.go
    • Line 25: warning: error var TimeoutErr should have name of the form ErrFoo (golint)
    • Line 25: warning: exported var TimeoutErr should have comment or be unexported (golint)
    • Line 27: warning: error var NotImplementedError should have name of the form ErrFoo (golint)
    • Line 81: warning: comment on exported function ReadLinesOffsetN should be of the form "ReadLinesOffsetN ..." (golint)
    • Line 138: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 150: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • ostent/params/params.go
    • Line 42: warning: exported var NumType should have comment or be unexported (golint)
    • Line 71: warning: exported type Params should have comment or be unexported (golint)
    • Line 76: warning: exported type Schema should have comment or be unexported (golint)
    • Line 96: warning: exported type Nlinks should have comment or be unexported (golint)
    • Line 100: warning: exported type ALink should have comment or be unexported (golint)
    • Line 106: warning: exported type VLink should have comment or be unexported (golint)
    • Line 112: warning: exported method Params.MarshalJSON should have comment or be unexported (golint)
    • Line 127: warning: exported method Params.Nlinks should have comment or be unexported (golint)
    • Line 149: warning: exported method Params.Vlinks should have comment or be unexported (golint)
    • Line 177: warning: exported function ContainsPrefix should have comment or be unexported (golint)
    • Line 186: warning: exported function NumPrefix should have comment or be unexported (golint)
    • Line 195: warning: exported method Params.Tlinks should have comment or be unexported (golint)
    • Line 213: warning: exported function TagsOk should have comment or be unexported (golint)
    • Line 249: warning: exported method Num.EncodeValues should have comment or be unexported (golint)
    • Line 256: warning: exported method Num.UnmarshalText should have comment or be unexported (golint)
    • Line 280: warning: exported method Params.ResetSchema should have comment or be unexported (golint)
    • Line 298: warning: exported method Params.SetDefaults should have comment or be unexported (golint)
    • Line 337: warning: exported method Params.Decode should have comment or be unexported (golint)
    • Line 383: warning: exported method Params.Encode should have comment or be unexported (golint)
    • Line 391: warning: exported method Params.EncodeT should have comment or be unexported (golint)
    • Line 398: warning: exported method Params.EncodeN should have comment or be unexported (golint)
    • Line 428: warning: exported function NewFetchKeys should have comment or be unexported (golint)
    • Line 436: warning: exported type FetchKeys should have comment or be unexported (golint)
    • Line 474: warning: exported function AddScheme should have comment or be unexported (golint)
    • ostent/ostent/ws.go
    • Line 101: warning: exported function AddExporter should have comment or be unexported (golint)
    • Line 234: warning: exported function Fetch should have comment or be unexported (golint)
    • Line 337: warning: exported function FetchExtract should have comment or be unexported (golint)
    • ostent/format/format.go
    • Line 30: warning: exported function HumanUnitless should have comment or be unexported (golint)
    • Line 35: warning: exported function HumanBits should have comment or be unexported (golint)
    • Line 40: warning: exported function HumanB should have comment or be unexported (golint)
    • Line 45: warning: exported function HumanBandback should have comment or be unexported (golint)
    • Line 51: warning: exported function Percent should have comment or be unexported (golint)
    • Line 63: warning: exported function Time should have comment or be unexported (golint)
    • ostent/system_ostent/net.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 15: warning: exported type PS should have comment or be unexported (golint)
    • Line 18: warning: exported type NetIOStats should have comment or be unexported (golint)
    • Line 27: warning: exported method NetIOStats.Description should have comment or be unexported (golint)
    • Line 27: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 39: warning: exported method NetIOStats.SampleConfig should have comment or be unexported (golint)
    • Line 39: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 43: warning: exported method NetIOStats.Gather should have comment or be unexported (golint)
    • ostent/system_ostent/system_ostent.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 14: warning: exported type SystemStats should have comment or be unexported (golint)
    • Line 16: warning: exported method SystemStats.Description should have comment or be unexported (golint)
    • Line 16: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 20: warning: exported method SystemStats.SampleConfig should have comment or be unexported (golint)
    • Line 20: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 22: warning: exported method SystemStats.Gather should have comment or be unexported (golint)
    • Line 22: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • ostent/procstat_ostent/pgrep.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 13: warning: exported type PIDFinder should have comment or be unexported (golint)
    • Line 21: warning: comment on exported type Pgrep should be of the form "Pgrep ..." (with optional leading article) (golint)
    • Line 26: warning: exported function NewPgrep should have comment or be unexported (golint)
    • Line 34: warning: exported method Pgrep.PidFile should have comment or be unexported (golint)
    • Line 49: warning: exported method Pgrep.Pattern should have comment or be unexported (golint)
    • Line 54: warning: exported method Pgrep.Uid should have comment or be unexported (golint)
    • Line 59: warning: exported method Pgrep.FullPattern should have comment or be unexported (golint)
    • Line 96: warning: exported method Pgrep.All should have comment or be unexported (golint)
    • ostent/procstat_ostent/procstat.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 16: warning: exported type PID should have comment or be unexported (golint)
    • Line 18: warning: exported type Procstat should have comment or be unexported (golint)
    • Line 55: warning: exported method Procstat.SampleConfig should have comment or be unexported (golint)
    • Line 55: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 59: warning: exported method Procstat.Description should have comment or be unexported (golint)
    • Line 59: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 63: warning: exported method Procstat.Gather should have comment or be unexported (golint)
    • Line 151: warning: don't use underscores in Go names; var cpu_time should be cpuTime (golint)
    • ostent/internal/config/config.go
    • Line 62: warning: exported function NewConfig should have comment or be unexported (golint)
    • Line 81: warning: exported type AgentConfig should have comment or be unexported (golint)
    • Line 150: warning: comment on exported method Config.InputNames should be of the form "InputNames ..." (golint)
    • Line 159: warning: comment on exported method Config.OutputNames should be of the form "OutputNames ..." (golint)
    • Line 501: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 511: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 516: warning: exported method Config.LoadDirectory should have comment or be unexported (golint)
    • Line 578: warning: exported method Config.LoadTable should have comment or be unexported (golint)
    • Line 715: warning: exported function ParseContents should have comment or be unexported (golint)
    • Line 719: warning: don't use underscores in Go names; var env_vars should be envVars (golint)
    • Line 720: warning: don't use underscores in Go names; range var env_var should be envVar (golint)
    • Line 721: warning: don't use underscores in Go names; var env_val should be envVal (golint)
    • Line 1340: warning: don't use underscores in Go names; var nearest_exponent should be nearestExponent (golint)
    • Line 1341: warning: don't use underscores in Go names; var new_nanoseconds should be newNanoseconds (golint)
    • ostent/ostent/server.go
    • Line 16: warning: exported function LogHandler should have comment or be unexported (golint)
    • Line 23: warning: exported function ServerHandler should have comment or be unexported (golint)
    • Line 34: warning: exported const CAssetPath should have comment (or a comment on this block) or be unexported (golint)
    • Line 40: warning: exported function AddAssetPathContextFunc should have comment or be unexported (golint)
    • Line 114: warning: exported type ServeAssets should have comment or be unexported (golint)
    • ostent/system_ostent/internal/internal_net.go
    • Line 21: warning: exported function AddTags should have comment or be unexported (golint)
    • Line 30: warning: exported type LastNetIOStats should have comment or be unexported (golint)
    • Line 35: warning: exported method LastNetIOStats.AddDeltaFields should have comment or be unexported (golint)
    • ostent/internal/models/running_output.go
    • Line 16: warning: comment on exported const DEFAULT_METRIC_BATCH_SIZE should be of the form "DEFAULT_METRIC_BATCH_SIZE ..." (golint)
    • Line 19: warning: comment on exported const DEFAULT_METRIC_BUFFER_LIMIT should be of the form "DEFAULT_METRIC_BUFFER_LIMIT ..." (golint)
    • Line 45: warning: exported function NewRunningOutput should have comment or be unexported (golint)
    • ostent/internal/models/running_processor.go
    • Line 9: warning: exported type RunningProcessor should have comment or be unexported (golint)
    • Line 17: warning: exported type RunningProcessors should have comment or be unexported (golint)
    • Line 23: warning: comment on exported type ProcessorConfig should be of the form "ProcessorConfig ..." (with optional leading article) (golint)
    • Line 30: warning: exported method RunningProcessor.Apply should have comment or be unexported (golint)
    • ostent/procstat_ostent/process.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 11: warning: exported type Process should have comment or be unexported (golint)
    • Line 31: warning: exported type Proc should have comment or be unexported (golint)
    • Line 51: warning: exported method Proc.Tags should have comment or be unexported (golint)
    • Line 55: warning: exported method Proc.PID should have comment or be unexported (golint)
    • Line 59: warning: exported method Proc.Percent should have comment or be unexported (golint)
    • Line 60: warning: don't use underscores in Go names; var cpu_perc should be cpuPerc (golint)
    • Line 68: warning: exported method Proc.Prio should have comment or be unexported (golint)
    • ostent/procstat_ostent/process_gosigar.go
    • Line 3: warning: don't use an underscore in package name (golint)
    • Line 18: warning: exported function NewProc should have comment or be unexported (golint)
    • Line 116: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • ostent/ostent/index.go
    • Line 22: warning: exported type UpgradeInfo should have comment or be unexported (golint)
    • Line 27: warning: exported method UpgradeInfo.Set should have comment or be unexported (golint)
    • Line 33: warning: exported method UpgradeInfo.Get should have comment or be unexported (golint)
    • Line 43: warning: exported var OstentUpgrade should have comment or be unexported (golint)
    • Line 45: warning: exported function Updates should have comment or be unexported (golint)
    • Line 81: warning: exported type ServeSSE should have comment or be unexported (golint)
    • Line 85: warning: exported type ServeWS should have comment or be unexported (golint)
    • Line 90: warning: exported type ServeIndex should have comment or be unexported (golint)
    • Line 96: warning: exported type StaticData should have comment or be unexported (golint)
    • Line 102: warning: exported function NewServeSSE should have comment or be unexported (golint)
    • Line 106: warning: exported function NewServeWS should have comment or be unexported (golint)
    • Line 108: warning: exported function NewServeIndex should have comment or be unexported (golint)
    • Line 134: warning: exported type SSE should have comment or be unexported (golint)
    • Line 169: warning: exported method SSE.SetHeader should have comment or be unexported (golint)
    • ostent/internal/buffer/buffer.go
    • Line 11: warning: exported var MetricsWritten should have comment or be unexported (golint)
    • Line 43: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • ostent/internal/models/filter.go
    • Line 81: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 87: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 120: warning: should omit 2nd value from range; this loop is equivalent to `for fieldkey := range ...` (golint)
    • Line 249: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 257: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell96%

Misspell Finds commonly misspelled English words