Preparing report...

Report for github.com/raintank/statsdaemon

A    Great!    Found 16 issues across 19 files

Tweet

gofmt89%

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.

    • statsdaemon/statsdaemon.go
    • Line 199: warning: cyclomatic complexity 18 of function (*StatsDaemon).graphiteWriter() is high (> 15) (gocyclo)
    • Line 406: warning: cyclomatic complexity 16 of function (*StatsDaemon).handleApiRequest() is high (> 15) (gocyclo)

golint21%

Golint is a linter for Go source code.

    • statsdaemon/out/write.go
    • Line 5: warning: exported function WriteFloat64 should have comment or be unexported (golint)
    • Line 14: warning: exported function WriteInt64 should have comment or be unexported (golint)
    • statsdaemon/out/counters.go
    • Line 8: warning: exported type Counters should have comment or be unexported (golint)
    • Line 14: warning: exported function NewCounters should have comment or be unexported (golint)
    • Line 27: warning: comment on exported method Counters.Process should be of the form "Process ..." (golint)
    • statsdaemon/out/formatter.go
    • Line 3: warning: exported type Formatter should have comment or be unexported (golint)
    • Line 8: warning: don't use underscores in Go names; struct field Legacy_namespace should be LegacyNamespace (golint)
    • Line 9: warning: don't use underscores in Go names; struct field Prefix_counters should be PrefixCounters (golint)
    • Line 10: warning: don't use underscores in Go names; struct field Prefix_gauges should be PrefixGauges (golint)
    • Line 11: warning: don't use underscores in Go names; struct field Prefix_rates should be PrefixRates (golint)
    • Line 12: warning: don't use underscores in Go names; struct field Prefix_timers should be PrefixTimers (golint)
    • Line 15: warning: don't use underscores in Go names; struct field Prefix_m20_counters should be PrefixM20Counters (golint)
    • Line 16: warning: don't use underscores in Go names; struct field Prefix_m20_gauges should be PrefixM20Gauges (golint)
    • Line 17: warning: don't use underscores in Go names; struct field Prefix_m20_rates should be PrefixM20Rates (golint)
    • Line 18: warning: don't use underscores in Go names; struct field Prefix_m20_timers should be PrefixM20Timers (golint)
    • Line 21: warning: don't use underscores in Go names; struct field Prefix_m20ne_counters should be PrefixM20neCounters (golint)
    • Line 22: warning: don't use underscores in Go names; struct field Prefix_m20ne_gauges should be PrefixM20neGauges (golint)
    • Line 23: warning: don't use underscores in Go names; struct field Prefix_m20ne_rates should be PrefixM20neRates (golint)
    • Line 24: warning: don't use underscores in Go names; struct field Prefix_m20ne_timers should be PrefixM20neTimers (golint)
    • statsdaemon/cmd/statsdaemon/main.go
    • Line 28: warning: exported const VERSION should have comment (or a comment on this block) or be unexported (golint)
    • Line 29: warning: comment on exported const MAX_UNPROCESSED_PACKETS should be of the form "MAX_UNPROCESSED_PACKETS ..." (golint)
    • Line 37: warning: don't use underscores in Go names; var listen_addr should be listenAddr (golint)
    • Line 38: warning: don't use underscores in Go names; var admin_addr should be adminAddr (golint)
    • Line 39: warning: don't use underscores in Go names; var profile_addr should be profileAddr (golint)
    • Line 40: warning: don't use underscores in Go names; var graphite_addr should be graphiteAddr (golint)
    • Line 46: warning: don't use underscores in Go names; var legacy_namespace should be legacyNamespace (golint)
    • Line 47: warning: don't use underscores in Go names; var prefix_rates should be prefixRates (golint)
    • Line 48: warning: don't use underscores in Go names; var prefix_counters should be prefixCounters (golint)
    • Line 49: warning: don't use underscores in Go names; var prefix_timers should be prefixTimers (golint)
    • Line 50: warning: don't use underscores in Go names; var prefix_gauges should be prefixGauges (golint)
    • Line 52: warning: don't use underscores in Go names; var prefix_m20_counters should be prefixM20Counters (golint)
    • Line 53: warning: don't use underscores in Go names; var prefix_m20_gauges should be prefixM20Gauges (golint)
    • Line 54: warning: don't use underscores in Go names; var prefix_m20_rates should be prefixM20Rates (golint)
    • Line 55: warning: don't use underscores in Go names; var prefix_m20_timers should be prefixM20Timers (golint)
    • Line 57: warning: don't use underscores in Go names; var flush_rates should be flushRates (golint)
    • Line 58: warning: don't use underscores in Go names; var flush_counts should be flushCounts (golint)
    • Line 60: warning: don't use underscores in Go names; var percentile_thresholds should be percentileThresholds (golint)
    • Line 61: warning: don't use underscores in Go names; var max_timers_per_s should be maxTimersPerS (golint)
    • Line 76: warning: don't use underscores in Go names; var config_file should be configFile (golint)
    • Line 79: warning: exported var GitHash should have comment or be unexported (golint)
    • Line 82: warning: don't use underscores in Go names; func expand_cfg_vars should be expandCfgVars (golint)
    • statsdaemon/statsdaemon.go
    • Line 28: warning: exported type SubmitFunc should have comment or be unexported (golint)
    • Line 29: warning: exported type StatsDaemon should have comment or be unexported (golint)
    • Line 33: warning: don't use underscores in Go names; struct field flush_rates should be flushRates (golint)
    • Line 34: warning: don't use underscores in Go names; struct field flush_counts should be flushCounts (golint)
    • Line 37: warning: don't use underscores in Go names; struct field max_unprocessed should be maxUnprocessed (golint)
    • Line 38: warning: don't use underscores in Go names; struct field max_timers_per_s should be maxTimersPerS (golint)
    • Line 45: warning: don't use underscores in Go names; struct field valid_lines should be validLines (golint)
    • Line 46: warning: don't use underscores in Go names; struct field Invalid_lines should be InvalidLines (golint)
    • Line 53: warning: don't use underscores in Go names; struct field listen_addr should be listenAddr (golint)
    • Line 54: warning: don't use underscores in Go names; struct field admin_addr should be adminAddr (golint)
    • Line 55: warning: don't use underscores in Go names; struct field graphite_addr should be graphiteAddr (golint)
    • Line 58: warning: exported function New should have comment or be unexported (golint)
    • Line 58: warning: don't use underscores in Go names; func parameter flush_rates should be flushRates (golint)
    • Line 58: warning: don't use underscores in Go names; func parameter flush_counts should be flushCounts (golint)
    • Line 58: warning: don't use underscores in Go names; func parameter max_unprocessed should be maxUnprocessed (golint)
    • Line 58: warning: don't use underscores in Go names; func parameter max_timers_per_s should be maxTimersPerS (golint)
    • Line 78: warning: comment on exported method StatsDaemon.Run should be of the form "Run ..." (golint)
    • Line 79: warning: don't use underscores in Go names; method parameter listen_addr should be listenAddr (golint)
    • Line 79: warning: don't use underscores in Go names; method parameter admin_addr should be adminAddr (golint)
    • Line 79: warning: don't use underscores in Go names; method parameter graphite_addr should be graphiteAddr (golint)
    • Line 106: warning: exported method StatsDaemon.RunBare should have comment or be unexported (golint)
    • Line 188: warning: don't use underscores in Go names; var time_start should be timeStart (golint)
    • Line 190: warning: don't use underscores in Go names; var time_end should be timeEnd (golint)
    • Line 191: warning: don't use underscores in Go names; var duration_ms should be durationMs (golint)
    • Line 292: warning: comment on exported method StatsDaemon.GraphiteQueue should be of the form "GraphiteQueue ..." (golint)
    • Line 325: warning: don't use underscores in Go names; var cur_counts should be curCounts (golint)
    • Line 326: warning: don't use underscores in Go names; var prev_counts should be prevCounts (golint)
    • Line 327: warning: don't use underscores in Go names; var swap_ts should be swapTs (golint)
    • Line 332: warning: don't use underscores in Go names; var new_counts should be newCounts (golint)
    • Line 346: warning: don't use underscores in Go names; var current_ts should be currentTs (golint)
    • Line 361: warning: don't use underscores in Go names; var submitted_per_s should be submittedPerS (golint)
    • Line 363: warning: don't use underscores in Go names; var ideal_sample_rate should be idealSampleRate (golint)
    • Line 406: warning: don't use underscores in Go names; method parameter write_first should be writeFirst (golint)
    • Line 424: warning: don't use underscores in Go names; var clean_cmd should be cleanCmd (golint)
    • statsdaemon/out/gauges.go
    • Line 8: warning: exported type Gauges should have comment or be unexported (golint)
    • Line 12: warning: exported function NewGauges should have comment or be unexported (golint)
    • statsdaemon/out/output.go
    • Line 8: warning: exported type Output should have comment or be unexported (golint)
    • Line 11: warning: don't use underscores in Go names; struct field Valid_lines should be ValidLines (golint)
    • Line 12: warning: don't use underscores in Go names; struct field Invalid_lines should be InvalidLines (golint)
    • Line 15: warning: exported function NullOutput should have comment or be unexported (golint)
    • statsdaemon/out/timers.go
    • Line 12: warning: exported type Float64Slice should have comment or be unexported (golint)
    • Line 14: warning: exported type Timers should have comment or be unexported (golint)
    • Line 19: warning: exported function NewTimers should have comment or be unexported (golint)
    • Line 26: warning: exported type Data should have comment or be unexported (golint)
    • Line 28: warning: don't use underscores in Go names; struct field Amount_submitted should be AmountSubmitted (golint)
    • Line 40: warning: receiver name timers should be consistent with previous receiver name t for Timers (golint)
    • Line 52: warning: receiver name timers should be consistent with previous receiver name t for Timers (golint)
    • Line 71: warning: don't use underscores in Go names; var count_ps should be countPs (golint)
    • Line 103: warning: don't use underscores in Go names; var sum_pct should be sumPct (golint)
    • Line 104: warning: don't use underscores in Go names; var mean_pct should be meanPct (golint)
    • statsdaemon/udp/udp.go
    • Line 15: warning: exported const MaxUdpPacketSize should have comment (or a comment on this block) or be unexported (golint)
    • Line 71: warning: don't use underscores in Go names; func parameter prefix_internal should be prefixInternal (golint)
    • Line 76: warning: don't use underscores in Go names; var report_line should be reportLine (golint)
    • Line 87: warning: don't use underscores in Go names; var report_line should be reportLine (golint)
    • Line 100: warning: exported function StatsListener should have comment or be unexported (golint)
    • Line 100: warning: don't use underscores in Go names; func parameter listen_addr should be listenAddr (golint)
    • Line 100: warning: don't use underscores in Go names; func parameter prefix_internal should be prefixInternal (golint)
    • Line 106: warning: don't use underscores in Go names; func parameter listen_addr should be listenAddr (golint)
    • Line 106: warning: don't use underscores in Go names; func parameter prefix_internal should be prefixInternal (golint)
    • statsdaemon/out/percentiles.go
    • Line 9: warning: exported type Percentiles should have comment or be unexported (golint)
    • Line 10: warning: exported type Percentile should have comment or be unexported (golint)
    • Line 15: warning: exported method Percentiles.Set should have comment or be unexported (golint)
    • Line 25: warning: exported function NewPercentile should have comment or be unexported (golint)
    • Line 33: warning: exported function NewPercentiles should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign94%

IneffAssign detects ineffectual assignments in Go code.


misspell89%

Misspell Finds commonly misspelled English words