Preparing report...

Report for github.com/yobert/alsa

A    Great!    Found 18 issues across 19 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo78%

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.

    • alsa/asound.go
    • Line 357: warning: cyclomatic complexity 31 of function (*hwParams).Diff() is high (> 15) (gocyclo)
    • Line 120: warning: cyclomatic complexity 20 of function (FormatType).String() is high (> 15) (gocyclo)
    • alsa/param.go
    • Line 76: warning: cyclomatic complexity 17 of function (param).name() is high (> 15) (gocyclo)

golint10%

Golint is a linter for Go source code.

    • alsa/pcm/status.go
    • Line 10: warning: exported type Status should have comment or be unexported (golint)
    • Line 28: warning: exported const StatusSize should have comment or be unexported (golint)
    • alsa/pcm/xfer.go
    • Line 7: warning: exported type XferI should have comment or be unexported (golint)
    • Line 13: warning: exported const XferISize should have comment or be unexported (golint)
    • alsa/alsatype/PVersion.go
    • Line 5: warning: exported method PVersion.Major should have comment or be unexported (golint)
    • Line 8: warning: exported method PVersion.Minor should have comment or be unexported (golint)
    • Line 11: warning: exported method PVersion.Patch should have comment or be unexported (golint)
    • alsa/asound.go
    • Line 62: warning: exported type AccessType should have comment or be unexported (golint)
    • Line 65: warning: exported const MmapInterleaved should have comment (or a comment on this block) or be unexported (golint)
    • Line 91: warning: exported type FormatType should have comment or be unexported (golint)
    • Line 94: warning: exported const Unknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 97: warning: exported const S8 should have comment (or a comment on this block) or be unexported (golint)
    • Line 115: warning: comment on exported const FormatTypeLast should be of the form "FormatTypeLast ..." (golint)
    • Line 163: warning: exported type SubformatType should have comment or be unexported (golint)
    • Line 166: warning: exported const StandardSubformat should have comment (or a comment on this block) or be unexported (golint)
    • Line 316: warning: don't use underscores in Go names; func fmt_uint should be fmtUint (golint)
    • Line 327: warning: receiver name s should be consistent with previous receiver name p for hwParams (golint)
    • Line 331: warning: don't use underscores in Go names; func fmt_cmask should be fmtCmask (golint)
    • Line 357: warning: receiver name s should be consistent with previous receiver name p for hwParams (golint)
    • alsa/buffer.go
    • Line 7: warning: exported type BufferFormat should have comment or be unexported (golint)
    • Line 13: warning: exported type Buffer should have comment or be unexported (golint)
    • alsa/card.go
    • Line 12: warning: exported type Card should have comment or be unexported (golint)
    • Line 26: warning: exported function OpenCards should have comment or be unexported (golint)
    • Line 68: warning: exported function CloseCards should have comment or be unexported (golint)
    • alsa/pcm/state/state.go
    • Line 7: warning: exported type State should have comment or be unexported (golint)
    • Line 10: warning: exported const Open should have comment (or a comment on this block) or be unexported (golint)
    • alsa/cmd/echoback/main.go
    • Line 21: warning: don't use underscores in Go names; var record_device should be recordDevice (golint)
    • Line 22: warning: don't use underscores in Go names; var playback_device should be playbackDevice (golint)
    • Line 96: warning: don't use underscores in Go names; var buffer_size should be bufferSize (golint)
    • Line 112: warning: don't use underscores in Go names; var bytes_per_frame should be bytesPerFrame (golint)
    • Line 117: warning: don't use underscores in Go names; var delay_bytes should be delayBytes (golint)
    • Line 118: warning: don't use underscores in Go names; var buffer_bytes should be bufferBytes (golint)
    • Line 131: warning: don't use underscores in Go names; var cursor_mu should be cursorMu (golint)
    • Line 132: warning: don't use underscores in Go names; var rec_cursor should be recCursor (golint)
    • Line 133: warning: don't use underscores in Go names; var play_cursor should be playCursor (golint)
    • Line 168: warning: don't use underscores in Go names; var rec_cursor should be recCursor (golint)
    • Line 198: warning: don't use underscores in Go names; var frames_actual should be framesActual (golint)
    • Line 208: warning: don't use underscores in Go names; var play_cursor should be playCursor (golint)
    • alsa/alsatype/types_amd64.go
    • Line 4: warning: exported type Uframes should have comment or be unexported (golint)
    • Line 5: warning: exported type Sframes should have comment or be unexported (golint)
    • Line 8: warning: exported type Timespec should have comment or be unexported (golint)
    • Line 13: warning: exported type SwParams should have comment or be unexported (golint)
    • Line 30: warning: exported type PVersion should have comment or be unexported (golint)
    • alsa/param.go
    • Line 35: warning: exported type Flags should have comment or be unexported (golint)
    • Line 38: warning: exported const OpenMin should have comment (or a comment on this block) or be unexported (golint)
    • Line 114: warning: don't use underscores in Go names; func get_status should be getStatus (golint)
    • alsa/color/color.go
    • Line 13: warning: exported type Color should have comment or be unexported (golint)
    • Line 16: warning: exported const Black should have comment (or a comment on this block) or be unexported (golint)
    • Line 26: warning: exported function Text should have comment or be unexported (golint)
    • Line 29: warning: exported function All should have comment or be unexported (golint)
    • Line 32: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 36: warning: exported function Reset should have comment or be unexported (golint)
    • Line 40: warning: comment on exported function Error should be of the form "Error ..." (golint)
    • Line 45: warning: comment on exported function Pass should be of the form "Pass ..." (golint)
    • Line 50: warning: comment on exported function Fail should be of the form "Fail ..." (golint)
    • alsa/device.go
    • Line 14: warning: exported type DeviceType should have comment or be unexported (golint)
    • Line 17: warning: exported const UnknownDeviceType should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported type Device should have comment or be unexported (golint)
    • Line 46: warning: don't use underscores in Go names; struct field hwparams_prev should be hwparamsPrev (golint)
    • Line 49: warning: don't use underscores in Go names; struct field swparams_prev should be swparamsPrev (golint)
    • Line 56: warning: exported method Card.Devices should have comment or be unexported (golint)
    • Line 105: warning: exported method Device.Open should have comment or be unexported (golint)
    • Line 153: warning: exported method Device.Close should have comment or be unexported (golint)
    • Line 159: warning: exported method Device.Debug should have comment or be unexported (golint)
    • Line 163: warning: exported method Device.Prepare should have comment or be unexported (golint)
    • Line 187: warning: don't use underscores in Go names; var buf_size should be bufSize (golint)
    • Line 211: warning: comment on exported method Device.BufferFormat should be of the form "BufferFormat ..." (golint)
    • Line 231: warning: comment on exported method Device.NewBufferSeconds should be of the form "NewBufferSeconds ..." (golint)
    • Line 237: warning: exported method Device.NewBufferDuration should have comment or be unexported (golint)
    • Line 290: warning: don't use underscores in Go names; method sw_params should be swParams (golint)
    • alsa/ioctl.go
    • Line 9: warning: don't use underscores in Go names; type ioctl_e should be ioctlE (golint)
    • Line 15: warning: don't use underscores in Go names; var mode_str should be modeStr (golint)
    • Line 17: warning: don't use underscores in Go names; var mode_str should be modeStr (golint)
    • Line 20: warning: don't use underscores in Go names; var mode_str should be modeStr (golint)
    • Line 50: warning: don't use underscores in Go names; func ioctl_encode should be ioctlEncode (golint)
    • Line 54: warning: don't use underscores in Go names; func ioctl_encode_ptr should be ioctlEncodePtr (golint)
    • alsa/negotiate.go
    • Line 7: warning: don't use underscores in Go names; func range_check should be rangeCheck (golint)
    • Line 18: warning: don't use underscores in Go names; func format_check should be formatCheck (golint)
    • Line 43: warning: exported method Device.NegotiateChannels should have comment or be unexported (golint)
    • Line 65: warning: exported method Device.NegotiateRate should have comment or be unexported (golint)
    • Line 87: warning: exported method Device.NegotiateFormat should have comment or be unexported (golint)
    • Line 109: warning: exported method Device.NegotiateBufferSize should have comment or be unexported (golint)
    • Line 109: warning: don't use underscores in Go names; method parameter buffer_sizes should be bufferSizes (golint)
    • Line 131: warning: exported method Device.NegotiatePeriodSize should have comment or be unexported (golint)
    • Line 131: warning: don't use underscores in Go names; method parameter period_sizes should be periodSizes (golint)
    • Line 153: warning: exported method Device.BytesPerFrame should have comment or be unexported (golint)
    • Line 154: warning: don't use underscores in Go names; var sample_size should be sampleSize (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!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!