Preparing report...

Report for github.com/longhorn/longhorn-spdk-engine

(v0.0.0-20241210000947-c93635596614)

A+    Excellent!    Found 4 issues across 24 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!


gofmt100%

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

No problems detected. Good job!


gocyclo83%

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.

    • pkg/spdk/replica.go
    • Line 274: warning: cyclomatic complexity 34 of function (*Replica).validateAndUpdate() is high (> 15) (gocyclo)
    • Line 1386: warning: cyclomatic complexity 28 of function (*Replica).RebuildingDstStart() is high (> 15) (gocyclo)
    • Line 648: warning: cyclomatic complexity 25 of function (*Replica).Create() is high (> 15) (gocyclo)
    • Line 1686: warning: cyclomatic complexity 25 of function (*Replica).RebuildingDstShallowCopyCheck() is high (> 15) (gocyclo)
    • Line 757: warning: cyclomatic complexity 21 of function (*Replica).Delete() is high (> 15) (gocyclo)
    • Line 1887: warning: cyclomatic complexity 20 of function (*Replica).RebuildingDstSnapshotRevert() is high (> 15) (gocyclo)
    • Line 1068: warning: cyclomatic complexity 19 of function (*Replica).SnapshotRevert() is high (> 15) (gocyclo)
    • Line 1971: warning: cyclomatic complexity 19 of function (*Replica).BackupRestore() is high (> 15) (gocyclo)
    • Line 1590: warning: cyclomatic complexity 17 of function (*Replica).doCleanupForRebuildingDst() is high (> 15) (gocyclo)
    • Line 865: warning: cyclomatic complexity 17 of function (*Replica).SnapshotCreate() is high (> 15) (gocyclo)
    • Line 388: warning: cyclomatic complexity 16 of function compareSvcLvols() is high (> 15) (gocyclo)
    • pkg/spdk/engine.go
    • Line 1030: warning: cyclomatic complexity 32 of function (*Engine).ReplicaAdd() is high (> 15) (gocyclo)
    • Line 907: warning: cyclomatic complexity 31 of function (*Engine).validateAndUpdateFrontend() is high (> 15) (gocyclo)
    • Line 154: warning: cyclomatic complexity 30 of function (*Engine).Create() is high (> 15) (gocyclo)
    • Line 782: warning: cyclomatic complexity 26 of function (*Engine).checkAndUpdateInfoFromReplicaNoLock() is high (> 15) (gocyclo)
    • Line 672: warning: cyclomatic complexity 25 of function (*Engine).ValidateAndUpdate() is high (> 15) (gocyclo)
    • Line 407: warning: cyclomatic complexity 22 of function (*Engine).handleFrontend() is high (> 15) (gocyclo)
    • Line 2180: warning: cyclomatic complexity 21 of function (*Engine).SwitchOverTarget() is high (> 15) (gocyclo)
    • Line 1220: warning: cyclomatic complexity 20 of function (*Engine).replicaShallowCopy() is high (> 15) (gocyclo)
    • Line 1621: warning: cyclomatic complexity 19 of function (*Engine).snapshotOperationPreCheckWithoutLock() is high (> 15) (gocyclo)
    • Line 519: warning: cyclomatic complexity 16 of function (*Engine).Delete() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


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!