Preparing report...

Report for github.com/u-root/u-bmc

A+    Excellent!    Found 42 issues across 96 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!


gocyclo94%

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.


golint58%

Golint is a linter for Go source code.

    • u-bmc/pkg/aspeed/lpc_mem.go
    • Line 30: warning: don't use underscores in Go names; struct field wr_time should be wrTime (golint)
    • Line 31: warning: don't use underscores in Go names; struct field rd_time should be rdTime (golint)
    • Line 32: warning: don't use underscores in Go names; struct field wr_count should be wrCount (golint)
    • Line 33: warning: don't use underscores in Go names; struct field rd_count should be rdCount (golint)
    • Line 34: warning: don't use underscores in Go names; struct field cached_wr_count should be cachedWrCount (golint)
    • u-bmc/pkg/aspeed/wdt.go
    • Line 8: warning: exported const WDT1_RLD_CTR should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported method Ast.DisableWdt should have comment or be unexported (golint)
    • Line 22: warning: exported method Ast.EnableWdt should have comment or be unexported (golint)
    • Line 32: warning: exported method Ast.ResetCpu should have comment or be unexported (golint)
    • u-bmc/pkg/mtd/mtd.go
    • Line 17: warning: exported const MEMGETINFO should have comment (or a comment on this block) or be unexported (golint)
    • Line 59: warning: exported function Open should have comment or be unexported (golint)
    • u-bmc/pkg/aspeed/scu.go
    • Line 65: warning: comment on exported const SCU_PASSWORD should be of the form "SCU_PASSWORD ..." (golint)
    • Line 71: warning: exported const SCU_BASE should have comment (or a comment on this block) or be unexported (golint)
    • Line 86: warning: exported method Ast.GetHardwareStrapping should have comment or be unexported (golint)
    • Line 91: warning: exported method Ast.GetSiliconRevision should have comment or be unexported (golint)
    • Line 96: warning: exported method Ast.ModelName should have comment or be unexported (golint)
    • Line 132: warning: exported method Ast.IsSpiMaster should have comment or be unexported (golint)
    • Line 136: warning: exported method Ast.SetSpiMaster should have comment or be unexported (golint)
    • Line 163: warning: exported method Ast.FreezeCpu should have comment or be unexported (golint)
    • Line 168: warning: exported method Ast.UnfreezeCpu should have comment or be unexported (golint)
    • Line 173: warning: exported method Ast.SetResetControl should have comment or be unexported (golint)
    • Line 180: warning: exported function ScuRegisterToFunction should have comment or be unexported (golint)
    • u-bmc/pkg/aspeed/gpio_reg.go
    • Line 28: warning: exported type LineState should have comment or be unexported (golint)
    • Line 281: warning: exported var LINE_STATE_INPUT should have comment or be unexported (golint)
    • Line 287: warning: comment on exported var LINE_STATE_BECAME_LOW should be of the form "LINE_STATE_BECAME_LOW ..." (golint)
    • Line 290: warning: comment on exported var LINE_STATE_SCU should be of the form "LINE_STATE_SCU ..." (golint)
    • Line 295: warning: exported type State should have comment or be unexported (golint)
    • Line 300: warning: exported method State.List should have comment or be unexported (golint)
    • Line 371: warning: exported method State.PortValue should have comment or be unexported (golint)
    • Line 388: warning: exported method State.PortDirection should have comment or be unexported (golint)
    • Line 405: warning: exported method State.Equal should have comment or be unexported (golint)
    • Line 427: warning: exported method State.Diff should have comment or be unexported (golint)
    • Line 431: warning: exported method Ast.SnapshotGpio should have comment or be unexported (golint)
    • Line 449: warning: comment on exported function GpioPort should be of the form "GpioPort ..." (golint)
    • Line 482: warning: exported function GpioPortToName should have comment or be unexported (golint)
    • Line 487: warning: exported function GpioPortToFunction should have comment or be unexported (golint)
    • u-bmc/pkg/bmc/gpio.go
    • Line 20: warning: exported const GPIO_INVERTED should have comment (or a comment on this block) or be unexported (golint)
    • Line 27: warning: exported type GpioPlatform should have comment or be unexported (golint)
    • Line 47: warning: exported type GpioSystem should have comment or be unexported (golint)
    • Line 54: warning: exported type GpioCallback should have comment or be unexported (golint)
    • Line 69: warning: exported function LogGpio should have comment or be unexported (golint)
    • Line 128: warning: exported method GpioSystem.Monitor should have comment or be unexported (golint)
    • Line 145: warning: exported method GpioSystem.Hog should have comment or be unexported (golint)
    • Line 173: warning: exported method GpioSystem.Button should have comment or be unexported (golint)
    • Line 183: warning: exported method GpioSystem.PressButton should have comment or be unexported (golint)
    • Line 219: warning: exported method GpioSystem.ManageButton should have comment or be unexported (golint)
    • Line 265: warning: exported function NewGpioSystem should have comment or be unexported (golint)
    • u-bmc/platform/aspeed-ast2500evb/pkg/gpio/platform.go
    • Line 14: warning: exported type Gpio should have comment or be unexported (golint)
    • Line 24: warning: exported method Gpio.GpioNameToPort should have comment or be unexported (golint)
    • Line 24: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 29: warning: exported method Gpio.GpioPortToName should have comment or be unexported (golint)
    • Line 29: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • u-bmc/pkg/roughtime/client.go
    • Line 17: warning: package comment should be of the form "Package roughtime ..." (golint)
    • Line 37: warning: exported const DefaultQueryAttempts should have comment (or a comment on this block) or be unexported (golint)
    • u-bmc/config/config.go
    • Line 11: warning: exported type Version should have comment or be unexported (golint)
    • Line 16: warning: exported type ACME should have comment or be unexported (golint)
    • Line 23: warning: exported type Config should have comment or be unexported (golint)
    • Line 33: warning: exported var DefaultConfig should have comment or be unexported (golint)
    • u-bmc/pkg/bmc/gpio_linux.go
    • Line 16: warning: don't use underscores in Go names; type gpiochip_info should be gpiochipInfo (golint)
    • Line 22: warning: don't use underscores in Go names; type gpioline_info should be gpiolineInfo (golint)
    • Line 23: warning: don't use underscores in Go names; struct field line_offset should be lineOffset (golint)
    • Line 29: warning: don't use underscores in Go names; type gpiohandle_request should be gpiohandleRequest (golint)
    • Line 32: warning: don't use underscores in Go names; struct field default_values should be defaultValues (golint)
    • Line 33: warning: don't use underscores in Go names; struct field consumer_label should be consumerLabel (golint)
    • Line 38: warning: don't use underscores in Go names; type gpiohandle_data should be gpiohandleData (golint)
    • Line 42: warning: don't use underscores in Go names; type gpioevent_request should be gpioeventRequest (golint)
    • Line 46: warning: don't use underscores in Go names; struct field consumer_label should be consumerLabel (golint)
    • Line 50: warning: don't use underscores in Go names; type gpioevent_data should be gpioeventData (golint)
    • Line 58: warning: exported const GPIO_GET_CHIPINFO_IOCTL should have comment (or a comment on this block) or be unexported (golint)
    • u-bmc/pkg/bmc/rdnss.go
    • Line 23: warning: exported const ND_ROUTER_ADVERT should have comment (or a comment on this block) or be unexported (golint)
    • Line 45: warning: exported type NDUserOpt should have comment or be unexported (golint)
    • Line 53: warning: exported type RDNSSOption should have comment or be unexported (golint)
    • u-bmc/pkg/bmc/ttime/roughtime.go
    • Line 20: warning: exported const KEY_TYPE_ED25519 should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type RoughtimeServer should have comment or be unexported (golint)
    • Line 32: warning: exported type NtpServer should have comment or be unexported (golint)
    • Line 73: warning: exported method NtpServer.Server should have comment or be unexported (golint)
    • Line 77: warning: exported function AcquireTime should have comment or be unexported (golint)
    • u-bmc/pkg/gpiowatcher/main.go
    • Line 15: warning: exported type GpioPlatform should have comment or be unexported (golint)
    • Line 33: warning: exported function NewAstPlatform should have comment or be unexported (golint)
    • Line 51: warning: exported function Gpiowatcher should have comment or be unexported (golint)
    • u-bmc/pkg/bmc/cert/load.go
    • Line 30: warning: exported type ACMEHandler should have comment or be unexported (golint)
    • Line 34: warning: exported type Manager should have comment or be unexported (golint)
    • Line 41: warning: exported method Manager.MaybeRenew should have comment or be unexported (golint)
    • Line 83: warning: exported function SaveKeyPair should have comment or be unexported (golint)
    • Line 91: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 100: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 141: warning: exported function LoadOrGenerateKey should have comment or be unexported (golint)
    • u-bmc/integration/utils/acme.go
    • Line 30: warning: exported type CAServer should have comment or be unexported (golint)
    • Line 38: warning: exported function NewTestCA should have comment or be unexported (golint)
    • Line 73: warning: exported method CAServer.Run should have comment or be unexported (golint)
    • u-bmc/integration/utils/roughtime.go
    • Line 19: warning: exported type RoughtimeServer should have comment or be unexported (golint)
    • Line 25: warning: exported function NewTestRoughtimeServer should have comment or be unexported (golint)
    • Line 52: warning: exported method RoughtimeServer.Run should have comment or be unexported (golint)
    • u-bmc/pkg/bmc/fan.go
    • Line 14: warning: exported type FanPlatform should have comment or be unexported (golint)
    • Line 19: warning: exported type FanSystem should have comment or be unexported (golint)
    • Line 60: warning: exported method FanSystem.ReadFanRpm should have comment or be unexported (golint)
    • Line 64: warning: exported method FanSystem.FanCount should have comment or be unexported (golint)
    • Line 68: warning: exported method FanSystem.ReadFanPercentage should have comment or be unexported (golint)
    • u-bmc/pkg/bmc/system.go
    • Line 77: warning: exported type Platform should have comment or be unexported (golint)
    • Line 84: warning: exported type RPCServer should have comment or be unexported (golint)
    • Line 219: warning: error should be the last type when returning multiple items (golint)
    • Line 219: warning: exported function Startup should have comment or be unexported (golint)
    • Line 223: warning: error should be the last type when returning multiple items (golint)
    • Line 223: warning: exported function StartupWithConfig should have comment or be unexported (golint)
    • Line 416: warning: exported function Shell should have comment or be unexported (golint)
    • Line 432: warning: exported function Reboot should have comment or be unexported (golint)
    • u-bmc/platform/qemu-virt-a15/pkg/gpio/gpio.go
    • Line 14: warning: exported type Gpio should have comment or be unexported (golint)
    • Line 24: warning: exported method Gpio.GpioNameToPort should have comment or be unexported (golint)
    • Line 24: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 29: warning: exported method Gpio.GpioPortToName should have comment or be unexported (golint)
    • Line 29: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • u-bmc/platform/qemu-virt-a72/pkg/gpio/gpio.go
    • Line 14: warning: exported type Gpio should have comment or be unexported (golint)
    • Line 24: warning: exported method Gpio.GpioNameToPort should have comment or be unexported (golint)
    • Line 24: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 29: warning: exported method Gpio.GpioPortToName should have comment or be unexported (golint)
    • Line 29: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • u-bmc/platform/quanta-f06-leopard-ddr3/pkg/gpio/platform.go
    • Line 63: warning: exported type Gpio should have comment or be unexported (golint)
    • Line 73: warning: exported method Gpio.GpioNameToPort should have comment or be unexported (golint)
    • Line 73: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • Line 78: warning: exported method Gpio.GpioPortToName should have comment or be unexported (golint)
    • Line 78: warning: receiver name should not be an underscore, omit the name if it is unused (golint)
    • u-bmc/pkg/aspeed/ast.go
    • Line 31: warning: exported type Ast should have comment or be unexported (golint)
    • Line 35: warning: exported function Open should have comment or be unexported (golint)
    • Line 45: warning: exported function OpenWithMemory should have comment or be unexported (golint)
    • Line 49: warning: exported method Ast.Close should have comment or be unexported (golint)
    • u-bmc/pkg/aspeed/flash.go
    • Line 13: warning: exported const CS0_CTRL should have comment (or a comment on this block) or be unexported (golint)
    • Line 39: warning: exported type Flash should have comment or be unexported (golint)
    • Line 91: warning: exported method Ast.SystemFlash should have comment or be unexported (golint)
    • Line 108: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • u-bmc/pkg/aspeed/pwm.go
    • Line 12: warning: exported const PWM_BASE should have comment (or a comment on this block) or be unexported (golint)
    • Line 15: warning: exported method Ast.DumpPwm should have comment or be unexported (golint)
    • Line 41: warning: exported method Ast.MeasureFanRpm should have comment or be unexported (golint)
    • Line 64: warning: exported method Ast.SetFanDutyCycle should have comment or be unexported (golint)
    • u-bmc/pkg/bmc/interface_test.go
    • Line 13: warning: don't use underscores in Go names; var ip_ok should be ipOk (golint)
    • Line 14: warning: don't use underscores in Go names; var ip_wrong should be ipWrong (golint)
    • Line 15: warning: don't use underscores in Go names; var mac_ok should be macOk (golint)
    • Line 16: warning: don't use underscores in Go names; var mac_wrong should be macWrong (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!


misspell97%

Misspell Finds commonly misspelled English words