Preparing report...

Report for github.com/apptainer/apptainer

(v1.3.3)

A+    Excellent!    Found 80 issues across 543 files

Tweet

gofmt99%

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!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo85%

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.

    • cmd/internal/cli/inspect.go
    • Line 268: warning: cyclomatic complexity 19 of function (*command).setAttribute() is high (> 15) (gocyclo)
    • Line 333: warning: cyclomatic complexity 16 of function (*command).getMetadata() is high (> 15) (gocyclo)
    • e2e/internal/e2e/imageverify.go
    • Line 85: warning: cyclomatic complexity 27 of function DefinitionImageVerify() is high (> 15) (gocyclo)
    • Line 182: warning: cyclomatic complexity 22 of function appDetailImageVerify() is high (> 15) (gocyclo)
    • pkg/cmdline/flag.go
    • Line 198: warning: cyclomatic complexity 18 of function (*flagManager).updateCmdFlagFromEnv() is high (> 15) (gocyclo)
    • internal/pkg/runtime/engine/oci/create_linux.go
    • Line 165: warning: cyclomatic complexity 54 of function (*EngineOperations).CreateContainer() is high (> 15) (gocyclo)
    • Line 489: warning: cyclomatic complexity 33 of function (*container).addCgroups() is high (> 15) (gocyclo)
    • Line 665: warning: cyclomatic complexity 27 of function (*container).addDefaultDevices() is high (> 15) (gocyclo)
    • Line 884: warning: cyclomatic complexity 25 of function (*container).mount() is high (> 15) (gocyclo)
    • Line 416: warning: cyclomatic complexity 18 of function (*EngineOperations).updateState() is high (> 15) (gocyclo)
    • internal/pkg/build/build.go
    • Line 80: warning: cyclomatic complexity 30 of function newBuild() is high (> 15) (gocyclo)
    • Line 332: warning: cyclomatic complexity 27 of function (*Build).Full() is high (> 15) (gocyclo)
    • internal/pkg/runtime/engine/apptainer/container_linux.go
    • Line 101: warning: cyclomatic complexity 68 of function create() is high (> 15) (gocyclo)
    • Line 693: warning: cyclomatic complexity 54 of function (*container).mountGeneric() is high (> 15) (gocyclo)
    • Line 1520: warning: cyclomatic complexity 48 of function (*container).addDevMount() is high (> 15) (gocyclo)
    • Line 1130: warning: cyclomatic complexity 37 of function (*container).addOverlayMount() is high (> 15) (gocyclo)
    • Line 2660: warning: cyclomatic complexity 34 of function (*container).prepareNetworkSetup() is high (> 15) (gocyclo)
    • Line 1290: warning: cyclomatic complexity 26 of function (*container).addImageBindMount() is high (> 15) (gocyclo)
    • Line 2312: warning: cyclomatic complexity 25 of function (*container).createCwdDir() is high (> 15) (gocyclo)
    • Line 1989: warning: cyclomatic complexity 23 of function (*container).addUserbindsMount() is high (> 15) (gocyclo)
    • Line 900: warning: cyclomatic complexity 23 of function (*container).mountImage() is high (> 15) (gocyclo)
    • Line 1738: warning: cyclomatic complexity 23 of function (*container).addBindsMount() is high (> 15) (gocyclo)
    • Line 2079: warning: cyclomatic complexity 20 of function (*container).addTmpMount() is high (> 15) (gocyclo)
    • Line 2863: warning: cyclomatic complexity 17 of function (*container).addFuseMount() is high (> 15) (gocyclo)
    • Line 2513: warning: cyclomatic complexity 17 of function (*container).addIdentityMount() is high (> 15) (gocyclo)
    • Line 3021: warning: cyclomatic complexity 16 of function (*container).gocryptfsMount() is high (> 15) (gocyclo)
    • Line 477: warning: cyclomatic complexity 16 of function (*container).setupImageDriver() is high (> 15) (gocyclo)
    • internal/pkg/runtime/engine/oci/process_linux.go
    • Line 44: warning: cyclomatic complexity 32 of function (*EngineOperations).StartProcess() is high (> 15) (gocyclo)
    • Line 420: warning: cyclomatic complexity 19 of function (*EngineOperations).handleControl() is high (> 15) (gocyclo)
    • Line 170: warning: cyclomatic complexity 16 of function (*EngineOperations).PreStartProcess() is high (> 15) (gocyclo)
    • internal/pkg/runtime/engine/apptainer/process_linux.go
    • Line 66: warning: cyclomatic complexity 69 of function (*EngineOperations).StartProcess() is high (> 15) (gocyclo)
    • Line 849: warning: cyclomatic complexity 22 of function runActionScript() is high (> 15) (gocyclo)
    • Line 343: warning: cyclomatic complexity 21 of function (*EngineOperations).PostStartProcess() is high (> 15) (gocyclo)
    • internal/pkg/runtime/launch/launcher_linux.go
    • Line 98: warning: cyclomatic complexity 64 of function (*Launcher).Exec() is high (> 15) (gocyclo)
    • Line 1112: warning: cyclomatic complexity 19 of function (*Launcher).prepareImage() is high (> 15) (gocyclo)
    • Line 1048: warning: cyclomatic complexity 16 of function (*Launcher).setCgroups() is high (> 15) (gocyclo)
    • Line 919: warning: cyclomatic complexity 16 of function (*Launcher).setNamespaces() is high (> 15) (gocyclo)
    • cmd/internal/cli/cgroups_test.go
    • Line 268: warning: cyclomatic complexity 28 of function Test_getMemoryLimits() is high (> 15) (gocyclo)
    • Line 20: warning: cyclomatic complexity 20 of function Test_getBlkioLimits() is high (> 15) (gocyclo)
    • Line 150: warning: cyclomatic complexity 20 of function Test_getCpuLimits() is high (> 15) (gocyclo)
    • cmd/internal/cli/build_linux.go
    • Line 225: warning: cyclomatic complexity 33 of function runBuildLocal() is high (> 15) (gocyclo)
    • Line 45: warning: cyclomatic complexity 23 of function fakerootExec() is high (> 15) (gocyclo)
    • Line 408: warning: cyclomatic complexity 22 of function getEncryptionMaterial() is high (> 15) (gocyclo)
    • Line 144: warning: cyclomatic complexity 20 of function runBuild() is high (> 15) (gocyclo)
    • pkg/image/sif.go
    • Line 60: warning: cyclomatic complexity 21 of function (*sifFormat).initializer() is high (> 15) (gocyclo)
    • internal/pkg/runtime/engine/apptainer/prepare_linux.go
    • Line 680: warning: cyclomatic complexity 54 of function (*EngineOperations).prepareInstanceJoinConfig() is high (> 15) (gocyclo)
    • Line 1113: warning: cyclomatic complexity 44 of function (*EngineOperations).loadImages() is high (> 15) (gocyclo)
    • Line 1357: warning: cyclomatic complexity 41 of function (*EngineOperations).loadImage() is high (> 15) (gocyclo)
    • Line 72: warning: cyclomatic complexity 34 of function (*EngineOperations).PrepareConfig() is high (> 15) (gocyclo)
    • Line 541: warning: cyclomatic complexity 27 of function (*EngineOperations).prepareContainerConfig() is high (> 15) (gocyclo)
    • Line 331: warning: cyclomatic complexity 21 of function (*EngineOperations).prepareRootCaps() is high (> 15) (gocyclo)
    • Line 227: warning: cyclomatic complexity 21 of function (*EngineOperations).prepareUserCaps() is high (> 15) (gocyclo)
    • Line 1029: warning: cyclomatic complexity 20 of function (*EngineOperations).setSessionLayer() is high (> 15) (gocyclo)
    • Line 456: warning: cyclomatic complexity 16 of function (*EngineOperations).prepareAutofs() is high (> 15) (gocyclo)
    • internal/pkg/build/files/copy_test.go
    • Line 86: warning: cyclomatic complexity 20 of function TestCopyFromHost() is high (> 15) (gocyclo)
    • Line 472: warning: cyclomatic complexity 20 of function TestCopyFromStage() is high (> 15) (gocyclo)
    • Line 769: warning: cyclomatic complexity 18 of function TestCopyFromStageNested() 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!