Preparing report...

Report for github.com/containerd/cgroups

A+    Excellent!    Found 31 issues across 59 files

Tweet

gofmt98%

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!


golint52%

Golint is a linter for Go source code.

    • cgroups/cpu.go
    • Line 29: warning: exported function NewCpu should have comment or be unexported (golint)
    • cgroups/perf_event.go
    • Line 21: warning: exported function NewPerfEvent should have comment or be unexported (golint)
    • Line 27: warning: exported type PerfEventController should have comment or be unexported (golint)
    • Line 31: warning: exported method PerfEventController.Name should have comment or be unexported (golint)
    • Line 35: warning: exported method PerfEventController.Path should have comment or be unexported (golint)
    • cgroups/v2/hugetlb.go
    • Line 21: warning: exported type HugeTlb should have comment or be unexported (golint)
    • Line 23: warning: exported type HugeTlbEntry should have comment or be unexported (golint)
    • Line 28: warning: exported method HugeTlb.Values should have comment or be unexported (golint)
    • cgroups/v2/io.go
    • Line 21: warning: exported type IOType should have comment or be unexported (golint)
    • Line 24: warning: exported const ReadBPS should have comment (or a comment on this block) or be unexported (golint)
    • Line 30: warning: exported type BFQ should have comment or be unexported (golint)
    • Line 34: warning: exported type Entry should have comment or be unexported (golint)
    • Line 45: warning: exported type IO should have comment or be unexported (golint)
    • Line 50: warning: exported method IO.Values should have comment or be unexported (golint)
    • cgroups/systemd.go
    • Line 30: warning: exported const SystemdDbus should have comment (or a comment on this block) or be unexported (golint)
    • Line 39: warning: exported function Systemd should have comment or be unexported (golint)
    • Line 56: warning: exported function Slice should have comment or be unexported (golint)
    • Line 65: warning: exported function NewSystemd should have comment or be unexported (golint)
    • Line 71: warning: exported type SystemdController should have comment or be unexported (golint)
    • Line 76: warning: exported method SystemdController.Name should have comment or be unexported (golint)
    • Line 80: warning: exported method SystemdController.Create should have comment or be unexported (golint)
    • Line 129: warning: exported method SystemdController.Delete should have comment or be unexported (golint)
    • cgroups/v2/memory.go
    • Line 19: warning: exported type Memory should have comment or be unexported (golint)
    • Line 26: warning: exported method Memory.Values should have comment or be unexported (golint)
    • cgroups/v2/state.go
    • Line 29: warning: exported const Unknown should have comment (or a comment on this block) or be unexported (golint)
    • Line 37: warning: exported method State.Values should have comment or be unexported (golint)
    • cgroups/paths.go
    • Line 26: warning: exported type Path should have comment or be unexported (golint)
    • Line 28: warning: exported function RootPath should have comment or be unexported (golint)
    • cgroups/state.go
    • Line 23: warning: exported const Unknown should have comment (or a comment on this block) or be unexported (golint)
    • cgroups/v2/cpu.go
    • Line 25: warning: exported type CPUMax should have comment or be unexported (golint)
    • Line 27: warning: exported function NewCPUMax should have comment or be unexported (golint)
    • Line 35: warning: exported type CPU should have comment or be unexported (golint)
    • Line 57: warning: exported method CPU.Values should have comment or be unexported (golint)
    • cgroups/v2/pids.go
    • Line 21: warning: exported type Pids should have comment or be unexported (golint)
    • Line 25: warning: exported method Pids.Values should have comment or be unexported (golint)
    • cgroups/v2/rdma.go
    • Line 23: warning: exported type RDMA should have comment or be unexported (golint)
    • Line 27: warning: exported type RDMAEntry should have comment or be unexported (golint)
    • Line 37: warning: exported method RDMA.Values should have comment or be unexported (golint)
    • cgroups/subsystem.go
    • Line 31: warning: exported const Devices should have comment (or a comment on this block) or be unexported (golint)
    • Line 71: warning: exported type Subsystem should have comment or be unexported (golint)
    • cgroups/v2/manager.go
    • Line 50: warning: exported type Event should have comment or be unexported (golint)
    • Line 169: warning: exported function NewManager should have comment or be unexported (golint)
    • Line 196: warning: exported function LoadManager should have comment or be unexported (golint)
    • Line 207: warning: exported type Manager should have comment or be unexported (golint)
    • Line 224: warning: exported method Manager.RootControllers should have comment or be unexported (golint)
    • Line 232: warning: exported method Manager.Controllers should have comment or be unexported (golint)
    • Line 240: warning: exported type ControllerToggle should have comment or be unexported (golint)
    • Line 243: warning: exported const Enable should have comment (or a comment on this block) or be unexported (golint)
    • Line 255: warning: exported method Manager.ToggleControllers should have comment or be unexported (golint)
    • Line 295: warning: exported method Manager.NewChild should have comment or be unexported (golint)
    • Line 314: warning: exported method Manager.AddProc should have comment or be unexported (golint)
    • Line 322: warning: exported method Manager.Delete should have comment or be unexported (golint)
    • Line 326: warning: exported method Manager.Procs should have comment or be unexported (golint)
    • Line 357: warning: exported method Manager.Stat should have comment or be unexported (golint)
    • Line 525: warning: exported method Manager.Freeze should have comment or be unexported (golint)
    • Line 529: warning: exported method Manager.Thaw should have comment or be unexported (golint)
    • Line 566: warning: exported method Manager.EventChan should have comment or be unexported (golint)
    • Line 661: warning: exported function NewSystemd should have comment or be unexported (golint)
    • Line 751: warning: exported function LoadSystemd should have comment or be unexported (golint)
    • Line 761: warning: exported method Manager.DeleteSystemd should have comment or be unexported (golint)
    • cgroups/control.go
    • Line 39: warning: exported type Process should have comment or be unexported (golint)
    • Line 48: warning: exported type Task should have comment or be unexported (golint)

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.

    • cgroups/v2/manager.go
    • Line 661: warning: cyclomatic complexity 20 of function NewSystemd() is high (> 15) (gocyclo)
    • Line 574: warning: cyclomatic complexity 16 of function (*Manager).waitForEvents() is high (> 15) (gocyclo)

ineffassign96%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell96%

Misspell Finds commonly misspelled English words