Preparing report...

Report for github.com/jaypipes/ghw

(v0.8.0)

A+    Excellent!    Found 51 issues across 101 files

Tweet

gofmt84%

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!


gocyclo96%

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.


golint72%

Golint is a linter for Go source code.

    • ghw/pkg/pci/pci.go
    • Line 24: warning: comment on exported type Address should be of the form "Address ..." (with optional leading article) (golint)
    • Line 27: warning: comment on exported var AddressFromString should be of the form "AddressFromString ..." (golint)
    • Line 36: warning: exported type Device should have comment or be unexported (golint)
    • Line 70: warning: comment on exported method Device.MarshalJSON should be of the form "MarshalJSON ..." (golint)
    • Line 128: warning: exported type Info should have comment or be unexported (golint)
    • Line 181: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • ghw/pkg/context/context.go
    • Line 14: warning: comment on exported type Context should be of the form "Context ..." (with optional leading article) (golint)
    • Line 126: warning: exported method Context.Warn should have comment or be unexported (golint)
    • ghw/pkg/chassis/chassis.go
    • Line 113: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • Line 119: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • ghw/host.go
    • Line 131: warning: receiver name i should be consistent with previous receiver name info for HostInfo (golint)
    • Line 137: warning: receiver name i should be consistent with previous receiver name info for HostInfo (golint)
    • ghw/pkg/pci/pci_linux.go
    • Line 275: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • Line 305: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • Line 313: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • Line 355: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • ghw/pkg/memory/memory_cache.go
    • Line 17: warning: exported type CacheType should have comment or be unexported (golint)
    • Line 20: warning: exported const CACHE_TYPE_UNIFIED should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: comment on exported method CacheType.MarshalJSON should be of the form "MarshalJSON ..." (golint)
    • Line 44: warning: exported type SortByCacheLevelTypeFirstProcessor should have comment or be unexported (golint)
    • Line 63: warning: exported type SortByLogicalProcessorId should have comment or be unexported (golint)
    • Line 69: warning: exported type Cache should have comment or be unexported (golint)
    • ghw/pkg/bios/bios.go
    • Line 69: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • Line 75: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • ghw/pkg/topology/topology.go
    • Line 26: warning: comment on exported const ARCHITECTURE_SMP should be of the form "ARCHITECTURE_SMP ..." (golint)
    • Line 28: warning: comment on exported const ARCHITECTURE_NUMA should be of the form "ARCHITECTURE_NUMA ..." (golint)
    • Line 43: warning: comment on exported method Architecture.MarshalJSON should be of the form "MarshalJSON ..." (golint)
    • ghw/pkg/util/util.go
    • Line 20: warning: exported const UNKNOWN should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported function SafeClose should have comment or be unexported (golint)
    • Line 35: warning: comment on exported function SafeIntFromFile should be of the form "SafeIntFromFile ..." (golint)
    • ghw/pkg/net/net.go
    • Line 17: warning: exported type NICCapability should have comment or be unexported (golint)
    • Line 23: warning: exported type NIC should have comment or be unexported (golint)
    • Line 44: warning: exported type Info should have comment or be unexported (golint)
    • ghw/pkg/memory/memory.go
    • Line 20: warning: exported type Module should have comment or be unexported (golint)
    • Line 28: warning: exported type Info should have comment or be unexported (golint)
    • Line 37: warning: exported function New should have comment or be unexported (golint)
    • ghw/pkg/marshal/marshal.go
    • Line 16: warning: comment on exported function SafeYAML should be of the form "SafeYAML ..." (golint)
    • Line 31: warning: comment on exported function SafeJSON should be of the form "SafeJSON ..." (golint)
    • ghw/pkg/pci/address/address.go
    • Line 20: warning: exported type Address should have comment or be unexported (golint)
    • Line 32: warning: comment on exported function FromString should be of the form "FromString ..." (golint)
    • ghw/doc.go
    • Line 7: warning: package comment should be of the form "Package ghw ..." (golint)
    • Line 7: warning: package comment should not have leading space (golint)
    • ghw/pkg/linuxpath/path_linux.go
    • Line 15: warning: exported type Paths should have comment or be unexported (golint)
    • Line 51: warning: exported method Paths.NodeCPU should have comment or be unexported (golint)
    • Line 59: warning: exported method Paths.NodeCPUCache should have comment or be unexported (golint)
    • Line 66: warning: exported method Paths.NodeCPUCacheIndex should have comment or be unexported (golint)
    • ghw/pkg/gpu/gpu.go
    • Line 19: warning: exported type GraphicsCard should have comment or be unexported (golint)
    • Line 51: warning: exported type Info should have comment or be unexported (golint)
    • ghw/pkg/baseboard/baseboard.go
    • Line 76: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • Line 82: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • ghw/pkg/snapshot/unpack.go
    • Line 21: warning: exported const TargetRoot should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: comment on exported const OwnTargetDirectory should be of the form "OwnTargetDirectory ..." (golint)
    • Line 30: warning: comment on exported function Cleanup should be of the form "Cleanup ..." (golint)
    • ghw/pkg/block/block.go
    • Line 25: warning: exported const DRIVE_TYPE_UNKNOWN should have comment (or a comment on this block) or be unexported (golint)
    • Line 46: warning: comment on exported method DriveType.MarshalJSON should be of the form "MarshalJSON ..." (golint)
    • Line 61: warning: exported const STORAGE_CONTROLLER_UNKNOWN should have comment (or a comment on this block) or be unexported (golint)
    • Line 84: warning: comment on exported method StorageController.MarshalJSON should be of the form "MarshalJSON ..." (golint)
    • ghw/pkg/product/product.go
    • Line 92: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • Line 98: warning: receiver name info should be consistent with previous receiver name i for Info (golint)
    • ghw/alias.go
    • Line 25: warning: exported type WithOption should have comment or be unexported (golint)
    • Line 28: warning: exported var WithChroot should have comment or be unexported (golint)
    • Line 32: warning: comment on exported var WithDisableWarnings should be of the form "WithDisableWarnings ..." (golint)
    • Line 37: warning: exported type SnapshotOptions should have comment or be unexported (golint)
    • Line 39: warning: exported type CPUInfo should have comment or be unexported (golint)
    • Line 42: warning: exported var CPU should have comment or be unexported (golint)
    • Line 45: warning: exported type MemoryInfo should have comment or be unexported (golint)
    • Line 46: warning: exported type MemoryCacheType should have comment or be unexported (golint)
    • Line 47: warning: exported type MemoryModule should have comment or be unexported (golint)
    • Line 50: warning: exported const MEMORY_CACHE_TYPE_UNIFIED should have comment (or a comment on this block) or be unexported (golint)
    • Line 56: warning: exported var Memory should have comment or be unexported (golint)
    • Line 59: warning: exported type BlockInfo should have comment or be unexported (golint)
    • Line 60: warning: exported type Disk should have comment or be unexported (golint)
    • Line 61: warning: exported type Partition should have comment or be unexported (golint)
    • Line 64: warning: exported var Block should have comment or be unexported (golint)
    • Line 67: warning: exported type DriveType should have comment or be unexported (golint)
    • Line 70: warning: exported const DRIVE_TYPE_UNKNOWN should have comment (or a comment on this block) or be unexported (golint)
    • Line 77: warning: exported type StorageController should have comment or be unexported (golint)
    • Line 80: warning: exported const STORAGE_CONTROLLER_UNKNOWN should have comment (or a comment on this block) or be unexported (golint)
    • Line 88: warning: exported type NetworkInfo should have comment or be unexported (golint)
    • Line 89: warning: exported type NIC should have comment or be unexported (golint)
    • Line 90: warning: exported type NICCapability should have comment or be unexported (golint)
    • Line 93: warning: exported var Network should have comment or be unexported (golint)
    • Line 96: warning: exported type BIOSInfo should have comment or be unexported (golint)
    • Line 99: warning: exported var BIOS should have comment or be unexported (golint)
    • Line 102: warning: exported type ChassisInfo should have comment or be unexported (golint)
    • Line 105: warning: exported var Chassis should have comment or be unexported (golint)
    • Line 108: warning: exported type BaseboardInfo should have comment or be unexported (golint)
    • Line 111: warning: exported var Baseboard should have comment or be unexported (golint)
    • Line 114: warning: exported type TopologyInfo should have comment or be unexported (golint)
    • Line 115: warning: exported type TopologyNode should have comment or be unexported (golint)
    • Line 118: warning: exported var Topology should have comment or be unexported (golint)
    • Line 121: warning: exported type Architecture should have comment or be unexported (golint)
    • Line 124: warning: exported const ARCHITECTURE_SMP should have comment (or a comment on this block) or be unexported (golint)
    • Line 128: warning: exported type PCIInfo should have comment or be unexported (golint)
    • Line 129: warning: exported type PCIAddress should have comment or be unexported (golint)
    • Line 130: warning: exported type PCIDevice should have comment or be unexported (golint)
    • Line 133: warning: exported var PCI should have comment or be unexported (golint)
    • Line 137: warning: exported type ProductInfo should have comment or be unexported (golint)
    • Line 140: warning: exported var Product should have comment or be unexported (golint)
    • Line 143: warning: exported type GPUInfo should have comment or be unexported (golint)
    • Line 144: warning: exported type GraphicsCard should have comment or be unexported (golint)
    • Line 147: warning: exported var GPU should have comment or be unexported (golint)
    • ghw/pkg/option/option.go
    • Line 35: warning: exported var NullAlerter should have comment or be unexported (golint)
    • Line 155: warning: exported function WithChroot should have comment or be unexported (golint)
    • Line 182: warning: don't use underscores in Go names; var false_ should be false (golint)
    • Line 190: warning: exported function Merge should have comment or be unexported (golint)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell95%

Misspell Finds commonly misspelled English words