Preparing report...

Report for kubeshield.dev/bpf-opa-demo

A+    Excellent!    Found 5 issues across 11 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.


golint54%

Golint is a linter for Go source code.

    • /kubeshield.dev/bpf-opa-demo/kubernetes.go
    • Line 36: warning: exported var PodMapMutex should have comment or be unexported (golint)
    • Line 40: warning: exported function SetupPodWatcher should have comment or be unexported (golint)
    • Line 68: warning: exported type PodWatcher should have comment or be unexported (golint)
    • Line 73: warning: exported method PodWatcher.SetupWithManager should have comment or be unexported (golint)
    • Line 85: warning: exported method PodWatcher.Reconcile should have comment or be unexported (golint)
    • /kubeshield.dev/bpf-opa-demo/parser.go
    • Line 34: warning: exported const UNIX_SOCKET should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: don't use underscores in Go names; const IPv4_SOCKET should be IPv4SOCKET (golint)
    • Line 36: warning: don't use underscores in Go names; const IPv6_SOCKET should be IPv6SOCKET (golint)
    • Line 444: warning: don't use underscores in Go names; var source_ip should be sourceIP (golint)
    • Line 447: warning: don't use underscores in Go names; var source_port should be sourcePort (golint)
    • Line 450: warning: don't use underscores in Go names; var destination_ip should be destinationIP (golint)
    • Line 453: warning: don't use underscores in Go names; var destination_port should be destinationPort (golint)
    • Line 475: warning: don't use underscores in Go names; var socket_fd should be socketFd (golint)
    • Line 504: warning: don't use underscores in Go names; var source_ip should be sourceIP (golint)
    • Line 507: warning: don't use underscores in Go names; var source_port should be sourcePort (golint)
    • Line 510: warning: don't use underscores in Go names; var destination_ip should be destinationIP (golint)
    • Line 514: warning: don't use underscores in Go names; var destination_port should be destinationPort (golint)
    • Line 576: warning: don't use underscores in Go names; func add_socket should be addSocket (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!


misspell90%

Misspell Finds commonly misspelled English words