Preparing report...

Report for github.com/bytedance/vArmor

(v0.6.0)

A+    Excellent!    Found 19 issues across 107 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!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo82%

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.

    • internal/policy/update.go
    • Line 41: warning: cyclomatic complexity 58 of function modifyDeploymentAnnotationsAndEnv() is high (> 15) (gocyclo)
    • Line 178: warning: cyclomatic complexity 58 of function modifyStatefulSetAnnotationsAndEnv() is high (> 15) (gocyclo)
    • Line 315: warning: cyclomatic complexity 58 of function modifyDaemonSetAnnotationsAndEnv() is high (> 15) (gocyclo)
    • Line 452: warning: cyclomatic complexity 34 of function updateWorkloadAnnotationsAndEnv() is high (> 15) (gocyclo)
    • internal/status/api/v1/data.go
    • Line 75: warning: cyclomatic complexity 53 of function mergeAppArmorResult() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 16 of function (*StatusManager).syncData() is high (> 15) (gocyclo)
    • internal/agent/agent.go
    • Line 92: warning: cyclomatic complexity 24 of function NewAgent() is high (> 15) (gocyclo)
    • Line 367: warning: cyclomatic complexity 22 of function (*Agent).handleCreateOrUpdateArmorProfile() is high (> 15) (gocyclo)
    • internal/status/api/v1/utils.go
    • Line 233: warning: cyclomatic complexity 17 of function UpdateVarmorClusterPolicyStatus() is high (> 15) (gocyclo)
    • Line 150: warning: cyclomatic complexity 17 of function UpdateVarmorPolicyStatus() is high (> 15) (gocyclo)
    • internal/policy/policy_controller.go
    • Line 184: warning: cyclomatic complexity 17 of function (*PolicyController).ignoreAdd() is high (> 15) (gocyclo)
    • Line 320: warning: cyclomatic complexity 17 of function (*PolicyController).ignoreUpdate() is high (> 15) (gocyclo)
    • internal/profile/bpf/bpf.go
    • Line 83: warning: cyclomatic complexity 77 of function generateHardeningRules() is high (> 15) (gocyclo)
    • Line 640: warning: cyclomatic complexity 62 of function generateRawNetworkSocketRule() is high (> 15) (gocyclo)
    • Line 390: warning: cyclomatic complexity 50 of function generateAttackProtectionRules() is high (> 15) (gocyclo)
    • Line 837: warning: cyclomatic complexity 42 of function generateRawMountRule() is high (> 15) (gocyclo)
    • Line 1004: warning: cyclomatic complexity 18 of function GenerateEnhanceProtectProfile() is high (> 15) (gocyclo)
    • Line 946: warning: cyclomatic complexity 17 of function generateCustomRules() is high (> 15) (gocyclo)
    • pkg/auditor/bpf.go
    • Line 117: warning: cyclomatic complexity 23 of function (*Auditor).readFromAuditEventRingBuf() is high (> 15) (gocyclo)
    • pkg/lsm/bpfenforcer/enforcer.go
    • Line 295: warning: cyclomatic complexity 18 of function (*BpfEnforcer).eventHandler() is high (> 15) (gocyclo)
    • Line 85: warning: cyclomatic complexity 18 of function (*BpfEnforcer).initBPF() is high (> 15) (gocyclo)
    • internal/behavior/preprocessor/apparmor.go
    • Line 282: warning: cyclomatic complexity 54 of function (*DataPreprocessor).parseAppArmorEventForTree() is high (> 15) (gocyclo)
    • Line 140: warning: cyclomatic complexity 38 of function (*DataPreprocessor).opType() is high (> 15) (gocyclo)
    • Line 189: warning: cyclomatic complexity 26 of function (*DataPreprocessor).trimPath() is high (> 15) (gocyclo)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!