Preparing report...

Report for periph.io/x/periph

A+    Excellent!    Found 55 issues across 503 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!


gocyclo90%

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.

    • /periph.io/x/periph/host/allwinner/gpio.go
    • Line 108: warning: cyclomatic complexity 24 of function (*Pin).Func() is high (> 15) (gocyclo)
    • Line 376: warning: cyclomatic complexity 19 of function (*Pin).FastOut() is high (> 15) (gocyclo)
    • Line 188: warning: cyclomatic complexity 18 of function (*Pin).SetFunc() is high (> 15) (gocyclo)
    • Line 238: warning: cyclomatic complexity 18 of function (*Pin).In() is high (> 15) (gocyclo)
    • /periph.io/x/periph/host/allwinner/gpio_pl.go
    • Line 85: warning: cyclomatic complexity 22 of function (*PinPL).Func() is high (> 15) (gocyclo)
    • Line 159: warning: cyclomatic complexity 18 of function (*PinPL).SetFunc() is high (> 15) (gocyclo)
    • Line 478: warning: cyclomatic complexity 17 of function (*driverGPIOPL).Init() is high (> 15) (gocyclo)
    • Line 200: warning: cyclomatic complexity 17 of function (*PinPL).In() is high (> 15) (gocyclo)
    • /periph.io/x/periph/host/bcm283x/gpio.go
    • Line 1277: warning: cyclomatic complexity 30 of function (*driverGPIO).Init() is high (> 15) (gocyclo)
    • Line 312: warning: cyclomatic complexity 21 of function (*Pin).SetFunc() is high (> 15) (gocyclo)
    • Line 246: warning: cyclomatic complexity 20 of function (*Pin).Func() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 20 of function (*Pin).In() is high (> 15) (gocyclo)
    • Line 609: warning: cyclomatic complexity 19 of function (*Pin).PWM() is high (> 15) (gocyclo)
    • /periph.io/x/periph/conn/physic/units.go
    • Line 2013: warning: cyclomatic complexity 42 of function atod() is high (> 15) (gocyclo)
    • Line 168: warning: cyclomatic complexity 40 of function (*Distance).Set() is high (> 15) (gocyclo)
    • Line 983: warning: cyclomatic complexity 29 of function (*Speed).Set() is high (> 15) (gocyclo)
    • Line 1143: warning: cyclomatic complexity 27 of function (*Temperature).Set() is high (> 15) (gocyclo)
    • Line 714: warning: cyclomatic complexity 22 of function (*Mass).Set() is high (> 15) (gocyclo)
    • Line 505: warning: cyclomatic complexity 20 of function (*Force).Set() is high (> 15) (gocyclo)
    • Line 67: warning: cyclomatic complexity 19 of function (*Angle).Set() is high (> 15) (gocyclo)
    • Line 1766: warning: cyclomatic complexity 17 of function microAsString() is high (> 15) (gocyclo)
    • Line 1688: warning: cyclomatic complexity 17 of function nanoAsString() is high (> 15) (gocyclo)
    • Line 1844: warning: cyclomatic complexity 17 of function picoAsString() is high (> 15) (gocyclo)
    • Line 2187: warning: cyclomatic complexity 16 of function decimalMul() is high (> 15) (gocyclo)

golint98%

Golint is a linter for Go source code.

    • /periph.io/x/periph/experimental/devices/mfrc522/blockaccess.go
    • Line 56: warning: don't use underscores in Go names; const KeyA_RN_WA_BITS_RA_WN_KeyB_RA_WA should be KeyARNWABITSRAWNKeyBRAWA (golint)
    • Line 57: warning: don't use underscores in Go names; const KeyA_RN_WN_BITS_RA_WN_KeyB_RA_WN should be KeyARNWNBITSRAWNKeyBRAWN (golint)
    • Line 58: warning: don't use underscores in Go names; const KeyA_RN_WB_BITS_RAB_WN_KeyB_RN_WB should be KeyARNWBBITSRABWNKeyBRNWB (golint)
    • Line 59: warning: don't use underscores in Go names; const KeyA_RN_WN_BITS_RAB_WN_KeyB_RN_WN should be KeyARNWNBITSRABWNKeyBRNWN (golint)
    • Line 60: warning: don't use underscores in Go names; const KeyA_RN_WA_BITS_RA_WA_KeyB_RA_WA should be KeyARNWABITSRAWAKeyBRAWA (golint)
    • Line 61: warning: don't use underscores in Go names; const KeyA_RN_WB_BITS_RAB_WB_KeyB_RN_WB should be KeyARNWBBITSRABWBKeyBRNWB (golint)
    • Line 62: warning: don't use underscores in Go names; const KeyA_RN_WN_BITS_RAB_WB_KeyB_RN_WN should be KeyARNWNBITSRABWBKeyBRNWN (golint)
    • Line 63: warning: don't use underscores in Go names; const KeyA_RN_WN_BITS_RAB_WN_KeyB_RN_WN_EXTRA should be KeyARNWNBITSRABWNKeyBRNWNEXTRA (golint)
    • /periph.io/x/periph/experimental/devices/st7567/st7567.go
    • Line 10: warning: package comment is detached; there should be no blank lines between it and the package statement (golint)
    • Line 83: warning: exported method Bias.Set should have comment or be unexported (golint)
    • Line 116: warning: exported method SegmentDirection.Set should have comment or be unexported (golint)
    • Line 149: warning: exported method CommonDirection.Set should have comment or be unexported (golint)
    • Line 182: warning: exported method Display.Set should have comment or be unexported (golint)
    • Line 217: warning: exported method RegulationResistor.Set should have comment or be unexported (golint)
    • Line 251: warning: exported method RegulationRatio.Set should have comment or be unexported (golint)
    • /periph.io/x/periph/host/allwinner/gpio.go
    • Line 38: warning: exported var PA1 should have its own declaration (golint)
    • Line 39: warning: exported var PB1 should have its own declaration (golint)
    • Line 40: warning: exported var PC1 should have its own declaration (golint)
    • Line 41: warning: exported var PD1 should have its own declaration (golint)
    • Line 42: warning: exported var PE1 should have its own declaration (golint)
    • Line 43: warning: exported var PF1 should have its own declaration (golint)
    • Line 44: warning: exported var PG1 should have its own declaration (golint)
    • Line 45: warning: exported var PH1 should have its own declaration (golint)
    • Line 46: warning: exported var PI1 should have its own declaration (golint)
    • /periph.io/x/periph/host/rpi/rpi.go
    • Line 111: warning: don't use underscores in Go names; var SO_1 should be SO1 (golint)
    • Line 112: warning: don't use underscores in Go names; var SO_2 should be SO2 (golint)
    • Line 113: warning: don't use underscores in Go names; var SO_3 should be SO3 (golint)
    • Line 114: warning: don't use underscores in Go names; var SO_4 should be SO4 (golint)
    • Line 115: warning: don't use underscores in Go names; var SO_5 should be SO5 (golint)
    • Line 116: warning: don't use underscores in Go names; var SO_6 should be SO6 (golint)
    • Line 117: warning: don't use underscores in Go names; var SO_7 should be SO7 (golint)
    • Line 118: warning: don't use underscores in Go names; var SO_8 should be SO8 (golint)
    • Line 119: warning: don't use underscores in Go names; var SO_9 should be SO9 (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!