Preparing report...

Report for github.com/containers/libpod

(v1.9.3)

A    Great!    Found 319 issues across 826 files

Tweet

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!


gofmt71%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo86%

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.

    • libpod/container_graph.go
    • Line 195: warning: cyclomatic complexity 20 of function startNode() is high (> 15) (gocyclo)
    • Line 97: warning: cyclomatic complexity 16 of function detectCycles() is high (> 15) (gocyclo)
    • pkg/spec/spec.go
    • Line 39: warning: cyclomatic complexity 100 of function (*CreateConfig).createConfigToOCISpec() is high (> 15) (gocyclo)
    • libpod/boltdb_state_internal.go
    • Line 497: warning: cyclomatic complexity 51 of function (*BoltState).addContainer() is high (> 15) (gocyclo)
    • Line 714: warning: cyclomatic complexity 39 of function (*BoltState).removeContainer() is high (> 15) (gocyclo)
    • libpod/runtime_ctr.go
    • Line 144: warning: cyclomatic complexity 51 of function (*Runtime).setupContainer() is high (> 15) (gocyclo)
    • Line 380: warning: cyclomatic complexity 48 of function (*Runtime).removeContainer() is high (> 15) (gocyclo)
    • Line 603: warning: cyclomatic complexity 26 of function (*Runtime).evictContainer() is high (> 15) (gocyclo)
    • pkg/spec/namespaces.go
    • Line 21: warning: cyclomatic complexity 24 of function (*NetworkConfig).ToCreateOptions() is high (> 15) (gocyclo)
    • Line 104: warning: cyclomatic complexity 16 of function (*NetworkConfig).ConfigureGenerator() is high (> 15) (gocyclo)
    • pkg/adapter/pods.go
    • Line 541: warning: cyclomatic complexity 53 of function (*LocalRuntime).PlayKubeYAML() is high (> 15) (gocyclo)
    • Line 259: warning: cyclomatic complexity 29 of function (*LocalRuntime).CreatePod() is high (> 15) (gocyclo)
    • Line 865: warning: cyclomatic complexity 23 of function kubeContainerToCreateConfig() is high (> 15) (gocyclo)
    • Line 812: warning: cyclomatic complexity 16 of function setupSecurityContext() is high (> 15) (gocyclo)
    • pkg/spec/security.go
    • Line 102: warning: cyclomatic complexity 26 of function (*SecurityConfig).ConfigureGenerator() is high (> 15) (gocyclo)
    • cmd/podman/shared/create.go
    • Line 296: warning: cyclomatic complexity 119 of function ParseCreateOpts() is high (> 15) (gocyclo)
    • Line 38: warning: cyclomatic complexity 46 of function CreateContainer() is high (> 15) (gocyclo)
    • Line 254: warning: cyclomatic complexity 23 of function configurePod() is high (> 15) (gocyclo)
    • libpod/reset.go
    • Line 16: warning: cyclomatic complexity 30 of function (*Runtime).Reset() is high (> 15) (gocyclo)
    • libpod/runtime_volume_linux.go
    • Line 31: warning: cyclomatic complexity 20 of function (*Runtime).newVolume() is high (> 15) (gocyclo)
    • Line 119: warning: cyclomatic complexity 18 of function (*Runtime).removeVolume() is high (> 15) (gocyclo)
    • libpod/runtime_pod_linux.go
    • Line 151: warning: cyclomatic complexity 53 of function (*Runtime).removePod() is high (> 15) (gocyclo)
    • Line 23: warning: cyclomatic complexity 34 of function (*Runtime).NewPod() is high (> 15) (gocyclo)
    • pkg/varlinkapi/images.go
    • Line 142: warning: cyclomatic complexity 20 of function (*VarlinkAPI).BuildImage() is high (> 15) (gocyclo)
    • Line 810: warning: cyclomatic complexity 19 of function (*VarlinkAPI).ImageSave() is high (> 15) (gocyclo)
    • Line 348: warning: cyclomatic complexity 16 of function (*VarlinkAPI).PushImage() is high (> 15) (gocyclo)
    • pkg/domain/infra/abi/containers.go
    • Line 217: warning: cyclomatic complexity 18 of function (*ContainerEngine).ContainerRm() is high (> 15) (gocyclo)
    • Line 646: warning: cyclomatic complexity 16 of function (*ContainerEngine).ContainerRun() is high (> 15) (gocyclo)
    • libpod/networking_linux.go
    • Line 179: warning: cyclomatic complexity 18 of function (*Runtime).setupRootlessNetNS() is high (> 15) (gocyclo)
    • Line 643: warning: cyclomatic complexity 16 of function resultToBasicNetworkConfig() is high (> 15) (gocyclo)
    • pkg/specgen/generate/storage.go
    • Line 397: warning: cyclomatic complexity 33 of function getBindMount() is high (> 15) (gocyclo)
    • Line 519: warning: cyclomatic complexity 21 of function getTmpfsMount() is high (> 15) (gocyclo)
    • Line 596: warning: cyclomatic complexity 18 of function getNamedVolume() is high (> 15) (gocyclo)
    • libpod/container_exec.go
    • Line 224: warning: cyclomatic complexity 24 of function (*Container).ExecStartAndAttach() is high (> 15) (gocyclo)
    • Line 142: warning: cyclomatic complexity 18 of function (*Container).ExecCreate() is high (> 15) (gocyclo)
    • libpod/container_internal_linux.go
    • Line 219: warning: cyclomatic complexity 73 of function (*Container).generateSpec() is high (> 15) (gocyclo)
    • Line 836: warning: cyclomatic complexity 55 of function (*Container).restore() is high (> 15) (gocyclo)
    • Line 1073: warning: cyclomatic complexity 41 of function (*Container).makeBindMounts() is high (> 15) (gocyclo)
    • Line 1243: warning: cyclomatic complexity 27 of function (*Container).generateResolvConf() is high (> 15) (gocyclo)
    • Line 599: warning: cyclomatic complexity 22 of function (*Container).exportCheckpoint() is high (> 15) (gocyclo)
    • Line 67: warning: cyclomatic complexity 18 of function (*Container).prepare() is high (> 15) (gocyclo)
    • Line 737: warning: cyclomatic complexity 16 of function (*Container).checkpoint() is high (> 15) (gocyclo)
    • libpod/info.go
    • Line 63: warning: cyclomatic complexity 21 of function (*Runtime).hostInfo() is high (> 15) (gocyclo)
    • libpod/image/pull.go
    • Line 277: warning: cyclomatic complexity 20 of function (*Runtime).doPullImage() is high (> 15) (gocyclo)
    • Line 117: warning: cyclomatic complexity 19 of function (*Runtime).pullGoalFromImageReference() is high (> 15) (gocyclo)
    • libpod/oci_conmon_linux.go
    • Line 1107: warning: cyclomatic complexity 35 of function (*ConmonOCIRuntime).createOCIContainer() is high (> 15) (gocyclo)
    • Line 624: warning: cyclomatic complexity 31 of function (*ConmonOCIRuntime).ExecContainer() is high (> 15) (gocyclo)
    • Line 1723: warning: cyclomatic complexity 21 of function httpAttachNonTerminalCopy() is high (> 15) (gocyclo)
    • Line 245: warning: cyclomatic complexity 20 of function (*ConmonOCIRuntime).UpdateContainerStatus() is high (> 15) (gocyclo)
    • Line 1280: warning: cyclomatic complexity 18 of function prepareProcessExec() is high (> 15) (gocyclo)
    • Line 487: warning: cyclomatic complexity 18 of function (*ConmonOCIRuntime).HTTPAttach() is high (> 15) (gocyclo)
    • libpod/runtime.go
    • Line 240: warning: cyclomatic complexity 56 of function makeRuntime() is high (> 15) (gocyclo)
    • Line 764: warning: cyclomatic complexity 25 of function (*Runtime).mergeDBConfig() is high (> 15) (gocyclo)
    • cmd/podman/cp.go
    • Line 76: warning: cyclomatic complexity 37 of function copyBetweenHostAndContainer() is high (> 15) (gocyclo)
    • Line 268: warning: cyclomatic complexity 22 of function copy() is high (> 15) (gocyclo)
    • pkg/spec/storage.go
    • Line 39: warning: cyclomatic complexity 43 of function (*CreateConfig).parseVolumes() is high (> 15) (gocyclo)
    • Line 389: warning: cyclomatic complexity 33 of function getBindMount() is high (> 15) (gocyclo)
    • Line 511: warning: cyclomatic complexity 21 of function getTmpfsMount() is high (> 15) (gocyclo)
    • Line 225: warning: cyclomatic complexity 20 of function (*CreateConfig).getVolumesFrom() is high (> 15) (gocyclo)
    • Line 588: warning: cyclomatic complexity 18 of function getNamedVolume() is high (> 15) (gocyclo)
    • cmd/podman/shared/container.go
    • Line 302: warning: cyclomatic complexity 43 of function GenerateContainerFilterFuncs() is high (> 15) (gocyclo)
    • Line 118: warning: cyclomatic complexity 28 of function NewBatchContainer() is high (> 15) (gocyclo)
    • pkg/ps/ps.go
    • Line 75: warning: cyclomatic complexity 17 of function ListContainerBatch() is high (> 15) (gocyclo)
    • libpod/storage.go
    • Line 69: warning: cyclomatic complexity 17 of function (*storageService).CreateContainerStorage() is high (> 15) (gocyclo)
    • pkg/util/utils.go
    • Line 88: warning: cyclomatic complexity 47 of function GetImageConfig() is high (> 15) (gocyclo)
    • Line 324: warning: cyclomatic complexity 36 of function ParseIDMapping() is high (> 15) (gocyclo)
    • libpod/boltdb_state.go
    • Line 143: warning: cyclomatic complexity 35 of function (*BoltState).Refresh() is high (> 15) (gocyclo)
    • Line 2286: warning: cyclomatic complexity 27 of function (*BoltState).AddPod() is high (> 15) (gocyclo)
    • Line 2506: warning: cyclomatic complexity 25 of function (*BoltState).RemovePodContainers() is high (> 15) (gocyclo)
    • Line 2410: warning: cyclomatic complexity 20 of function (*BoltState).RemovePod() is high (> 15) (gocyclo)
    • Line 1403: warning: cyclomatic complexity 18 of function (*BoltState).LookupPod() is high (> 15) (gocyclo)
    • Line 1757: warning: cyclomatic complexity 16 of function (*BoltState).AddVolume() is high (> 15) (gocyclo)
    • pkg/adapter/containers.go
    • Line 393: warning: cyclomatic complexity 28 of function (*LocalRuntime).Run() is high (> 15) (gocyclo)
    • Line 653: warning: cyclomatic complexity 24 of function (*LocalRuntime).Start() is high (> 15) (gocyclo)
    • Line 1243: warning: cyclomatic complexity 21 of function (*LocalRuntime).GenerateSystemd() is high (> 15) (gocyclo)
    • Line 195: warning: cyclomatic complexity 19 of function (*LocalRuntime).RemoveContainers() is high (> 15) (gocyclo)
    • Line 947: warning: cyclomatic complexity 17 of function (*LocalRuntime).ExecContainer() is high (> 15) (gocyclo)
    • libpod/container_inspect.go
    • Line 400: warning: cyclomatic complexity 100 of function (*Container).generateInspectContainerHostConfig() is high (> 15) (gocyclo)
    • Line 118: warning: cyclomatic complexity 20 of function (*Container).getContainerInspectData() is high (> 15) (gocyclo)
    • libpod/in_memory_state.go
    • Line 1068: warning: cyclomatic complexity 20 of function (*InMemoryState).AddContainerToPod() is high (> 15) (gocyclo)
    • Line 234: warning: cyclomatic complexity 17 of function (*InMemoryState).AddContainer() is high (> 15) (gocyclo)
    • Line 1166: warning: cyclomatic complexity 16 of function (*InMemoryState).RemoveContainerFromPod() is high (> 15) (gocyclo)
    • libpod/container_internal.go
    • Line 366: warning: cyclomatic complexity 23 of function (*Container).setupStorage() is high (> 15) (gocyclo)
    • Line 1450: warning: cyclomatic complexity 20 of function (*Container).cleanupStorage() is high (> 15) (gocyclo)
    • Line 210: warning: cyclomatic complexity 20 of function (*Container).handleRestartPolicy() is high (> 15) (gocyclo)
    • Line 1256: warning: cyclomatic complexity 17 of function (*Container).restartWithTimeout() is high (> 15) (gocyclo)
    • Line 1323: warning: cyclomatic complexity 17 of function (*Container).mountStorage() is high (> 15) (gocyclo)
    • Line 592: warning: cyclomatic complexity 16 of function (*Container).removeIPv4Allocations() is high (> 15) (gocyclo)
    • Line 913: warning: cyclomatic complexity 16 of function (*Container).completeNetworkSetup() 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!