Preparing report...

Report for github.com/purpleidea/mgmt

(v0.0.0-20230830074419-b60d222c816d)

A+    Excellent!    Found 93 issues across 354 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!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


gocyclo73%

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.

    • engine/resources/virt.go
    • Line 298: warning: cyclomatic complexity 39 of function (*VirtRes).Watch() is high (> 15) (gocyclo)
    • Line 755: warning: cyclomatic complexity 35 of function (*VirtRes).CheckApply() is high (> 15) (gocyclo)
    • Line 1169: warning: cyclomatic complexity 26 of function (*VirtRes).Cmp() is high (> 15) (gocyclo)
    • Line 589: warning: cyclomatic complexity 26 of function (*VirtRes).attrCheckApply() is high (> 15) (gocyclo)
    • Line 508: warning: cyclomatic complexity 21 of function (*VirtRes).stateCheckApply() is high (> 15) (gocyclo)
    • Line 172: warning: cyclomatic complexity 17 of function (*VirtRes).Init() is high (> 15) (gocyclo)
    • Line 912: warning: cyclomatic complexity 16 of function (*VirtRes).getDomainXML() is high (> 15) (gocyclo)
    • lang/funcs/structlookup_func.go
    • Line 72: warning: cyclomatic complexity 27 of function (*StructLookupFunc).Unify() is high (> 15) (gocyclo)
    • Line 311: warning: cyclomatic complexity 23 of function (*StructLookupFunc).Polymorphisms() is high (> 15) (gocyclo)
    • lang/funcs/core/fmt/printf_func.go
    • Line 91: warning: cyclomatic complexity 22 of function (*PrintfFunc).Unify() is high (> 15) (gocyclo)
    • Line 373: warning: cyclomatic complexity 17 of function (*PrintfFunc).Polymorphisms() is high (> 15) (gocyclo)
    • lang/ast/structs.go
    • Line 3347: warning: cyclomatic complexity 65 of function (*StmtProg).SetScope() is high (> 15) (gocyclo)
    • Line 7757: warning: cyclomatic complexity 50 of function (*ExprCall).Unify() is high (> 15) (gocyclo)
    • Line 875: warning: cyclomatic complexity 48 of function (*StmtRes).metaparams() is high (> 15) (gocyclo)
    • Line 7516: warning: cyclomatic complexity 26 of function (*ExprCall).SetScope() is high (> 15) (gocyclo)
    • Line 6970: warning: cyclomatic complexity 26 of function (*ExprFunc).Unify() is high (> 15) (gocyclo)
    • Line 747: warning: cyclomatic complexity 25 of function (*StmtRes).edges() is high (> 15) (gocyclo)
    • Line 7686: warning: cyclomatic complexity 25 of function (*ExprCall).Type() is high (> 15) (gocyclo)
    • Line 2825: warning: cyclomatic complexity 23 of function (*StmtProg).Ordering() is high (> 15) (gocyclo)
    • Line 2030: warning: cyclomatic complexity 21 of function (*StmtEdge).Unify() is high (> 15) (gocyclo)
    • Line 3062: warning: cyclomatic complexity 21 of function (*StmtProg).importSystemScope() is high (> 15) (gocyclo)
    • Line 6887: warning: cyclomatic complexity 21 of function (*ExprFunc).Type() is high (> 15) (gocyclo)
    • Line 2930: warning: cyclomatic complexity 21 of function (*StmtProg).importScope() is high (> 15) (gocyclo)
    • Line 8162: warning: cyclomatic complexity 20 of function (*ExprCall).Graph() is high (> 15) (gocyclo)
    • Line 668: warning: cyclomatic complexity 18 of function (*StmtRes).resource() is high (> 15) (gocyclo)
    • Line 4320: warning: cyclomatic complexity 17 of function (*StmtInclude).SetScope() is high (> 15) (gocyclo)
    • Line 1742: warning: cyclomatic complexity 17 of function (*StmtResMeta).Unify() is high (> 15) (gocyclo)
    • Line 1584: warning: cyclomatic complexity 17 of function (*StmtResMeta).Init() is high (> 15) (gocyclo)
    • Line 6599: warning: cyclomatic complexity 17 of function (*ExprFunc).Init() is high (> 15) (gocyclo)
    • lang/funcs/maplookup_func.go
    • Line 71: warning: cyclomatic complexity 49 of function (*MapLookupFunc).Unify() is high (> 15) (gocyclo)
    • Line 371: warning: cyclomatic complexity 25 of function (*MapLookupFunc).Polymorphisms() is high (> 15) (gocyclo)
    • lang/funcs/core/world/schedule_func.go
    • Line 525: warning: cyclomatic complexity 42 of function (*ScheduleFunc).Stream() is high (> 15) (gocyclo)
    • Line 112: warning: cyclomatic complexity 21 of function (*ScheduleFunc).Unify() is high (> 15) (gocyclo)
    • Line 401: warning: cyclomatic complexity 21 of function (*ScheduleFunc).Build() is high (> 15) (gocyclo)
    • Line 313: warning: cyclomatic complexity 18 of function (*ScheduleFunc).Polymorphisms() is high (> 15) (gocyclo)
    • etcd/tasks.go
    • Line 100: warning: cyclomatic complexity 19 of function (*EmbdEtcd).runTaskQueue() is high (> 15) (gocyclo)
    • engine/resources/hetzner_vm.go
    • Line 438: warning: cyclomatic complexity 19 of function (*HetznerVMRes).checkApplyServerState() is high (> 15) (gocyclo)
    • Line 612: warning: cyclomatic complexity 17 of function (*HetznerVMRes).Cmp() is high (> 15) (gocyclo)
    • etcd/callback.go
    • Line 262: warning: cyclomatic complexity 37 of function (*EmbdEtcd).volunteerCb() is high (> 15) (gocyclo)
    • Line 104: warning: cyclomatic complexity 23 of function (*EmbdEtcd).nominateCb() is high (> 15) (gocyclo)
    • lang/gapi/gapi.go
    • Line 149: warning: cyclomatic complexity 34 of function (*GAPI).Cli() is high (> 15) (gocyclo)
    • Line 503: warning: cyclomatic complexity 23 of function (*GAPI).Next() is high (> 15) (gocyclo)
    • engine/resources/user.go
    • Line 172: warning: cyclomatic complexity 35 of function (*UserRes).CheckApply() is high (> 15) (gocyclo)
    • Line 292: warning: cyclomatic complexity 22 of function (*UserRes).Cmp() is high (> 15) (gocyclo)
    • etcd/server.go
    • Line 96: warning: cyclomatic complexity 27 of function (*EmbdEtcd).runServer() is high (> 15) (gocyclo)
    • lang/types/value.go
    • Line 252: warning: cyclomatic complexity 41 of function Into() is high (> 15) (gocyclo)
    • Line 79: warning: cyclomatic complexity 29 of function ValueOf() is high (> 15) (gocyclo)
    • engine/graph/actions.go
    • Line 247: warning: cyclomatic complexity 58 of function (*Engine).Worker() is high (> 15) (gocyclo)
    • Line 62: warning: cyclomatic complexity 41 of function (*Engine).Process() is high (> 15) (gocyclo)
    • engine/cmp.go
    • Line 29: warning: cyclomatic complexity 44 of function ResCmp() is high (> 15) (gocyclo)
    • Line 173: warning: cyclomatic complexity 40 of function AdaptCmp() is high (> 15) (gocyclo)
    • lang/lang.go
    • Line 80: warning: cyclomatic complexity 30 of function (*Lang).Init() is high (> 15) (gocyclo)
    • engine/resources/http.go
    • Line 515: warning: cyclomatic complexity 21 of function (*HTTPServerRes).handler() is high (> 15) (gocyclo)
    • Line 376: warning: cyclomatic complexity 20 of function (*HTTPServerRes).Cmp() is high (> 15) (gocyclo)
    • Line 233: warning: cyclomatic complexity 18 of function (*HTTPServerRes).Watch() is high (> 15) (gocyclo)
    • lib/main.go
    • Line 199: warning: cyclomatic complexity 130 of function (*Main).Run() is high (> 15) (gocyclo)
    • etcd/etcd.go
    • Line 620: warning: cyclomatic complexity 125 of function (*EmbdEtcd).Run() is high (> 15) (gocyclo)
    • Line 432: warning: cyclomatic complexity 21 of function (*EmbdEtcd).Init() is high (> 15) (gocyclo)
    • Line 376: warning: cyclomatic complexity 19 of function (*EmbdEtcd).Validate() is high (> 15) (gocyclo)
    • Line 1245: warning: cyclomatic complexity 18 of function (*EmbdEtcd).runEndpoints() is high (> 15) (gocyclo)
    • lang/types/type.go
    • Line 1005: warning: cyclomatic complexity 74 of function (*Type).ComplexCmp() is high (> 15) (gocyclo)
    • Line 300: warning: cyclomatic complexity 61 of function NewType() is high (> 15) (gocyclo)
    • Line 658: warning: cyclomatic complexity 47 of function (*Type).Cmp() is high (> 15) (gocyclo)
    • Line 143: warning: cyclomatic complexity 29 of function ConfigurableTypeOf() is high (> 15) (gocyclo)
    • Line 917: warning: cyclomatic complexity 29 of function (*Type).HasVariant() is high (> 15) (gocyclo)
    • Line 579: warning: cyclomatic complexity 24 of function (*Type).String() is high (> 15) (gocyclo)
    • Line 817: warning: cyclomatic complexity 24 of function (*Type).Reflect() is high (> 15) (gocyclo)
    • engine/resources/dhcp.go
    • Line 537: warning: cyclomatic complexity 25 of function (*DHCPServerRes).Cmp() is high (> 15) (gocyclo)
    • Line 141: warning: cyclomatic complexity 22 of function (*DHCPServerRes).getServerID() is high (> 15) (gocyclo)
    • Line 249: warning: cyclomatic complexity 21 of function (*DHCPServerRes).Validate() is high (> 15) (gocyclo)
    • Line 794: warning: cyclomatic complexity 20 of function (*DHCPServerRes).handler4() is high (> 15) (gocyclo)
    • lib/deploy.go
    • Line 46: warning: cyclomatic complexity 22 of function deploy() is high (> 15) (gocyclo)
    • integration/instance.go
    • Line 158: warning: cyclomatic complexity 20 of function (*Instance).Run() is high (> 15) (gocyclo)
    • Line 342: warning: cyclomatic complexity 16 of function (*Instance).Wait() is high (> 15) (gocyclo)
    • lang/funcs/engine.go
    • Line 323: warning: cyclomatic complexity 46 of function (*Engine).Run() is high (> 15) (gocyclo)
    • Line 186: warning: cyclomatic complexity 30 of function (*Engine).Validate() is high (> 15) (gocyclo)
    • lang/parser/lexparse_test.go
    • Line 40: warning: cyclomatic complexity 19 of function TestLexParse0() is high (> 15) (gocyclo)
    • Line 2347: warning: cyclomatic complexity 18 of function TestImportParsing0() is high (> 15) (gocyclo)
    • lib/run.go
    • Line 37: warning: cyclomatic complexity 26 of function run() is high (> 15) (gocyclo)
    • etcd/fs/fs.go
    • Line 663: warning: cyclomatic complexity 22 of function (*Fs).Rename() is high (> 15) (gocyclo)
    • Line 585: warning: cyclomatic complexity 20 of function (*Fs).RemoveAll() is high (> 15) (gocyclo)
    • Line 209: warning: cyclomatic complexity 18 of function (*Fs).mount() is high (> 15) (gocyclo)
    • engine/copy.go
    • Line 28: warning: cyclomatic complexity 20 of function ResCopy() is high (> 15) (gocyclo)
    • lang/unification/simplesolver.go
    • Line 183: warning: cyclomatic complexity 243 of function SimpleInvariantSolver() is high (> 15) (gocyclo)
    • Line 76: warning: cyclomatic complexity 31 of function DebugSolverState() is high (> 15) (gocyclo)
    • lang/funcs/core/iter/map_func.go
    • Line 84: warning: cyclomatic complexity 38 of function (*MapFunc).Unify() is high (> 15) (gocyclo)
    • Line 370: warning: cyclomatic complexity 24 of function (*MapFunc).Polymorphisms() is high (> 15) (gocyclo)
    • Line 455: warning: cyclomatic complexity 19 of function (*MapFunc).Build() is high (> 15) (gocyclo)
    • lang/funcs/operator_func.go
    • Line 502: warning: cyclomatic complexity 28 of function (*OperatorFunc).Unify() is high (> 15) (gocyclo)
    • Line 836: warning: cyclomatic complexity 19 of function (*OperatorFunc).Stream() is high (> 15) (gocyclo)
    • lang/interpret_test.go
    • Line 1003: warning: cyclomatic complexity 128 of function TestAstFunc2() is high (> 15) (gocyclo)
    • Line 556: warning: cyclomatic complexity 84 of function TestAstFunc1() is high (> 15) (gocyclo)
    • Line 88: warning: cyclomatic complexity 24 of function TestAstFunc0() is high (> 15) (gocyclo)
    • engine/resources/exec.go
    • Line 280: warning: cyclomatic complexity 33 of function (*ExecRes).CheckApply() is high (> 15) (gocyclo)
    • Line 509: warning: cyclomatic complexity 17 of function (*ExecRes).Cmp() is high (> 15) (gocyclo)
    • Line 180: warning: cyclomatic complexity 16 of function (*ExecRes).Watch() is high (> 15) (gocyclo)
    • puppet/gapi.go
    • Line 171: warning: cyclomatic complexity 21 of function (*GAPI).Init() is high (> 15) (gocyclo)
    • Line 89: warning: cyclomatic complexity 17 of function (*GAPI).Cli() is high (> 15) (gocyclo)
    • engine/resources/file.go
    • Line 254: warning: cyclomatic complexity 49 of function (*FileRes).Validate() is high (> 15) (gocyclo)
    • Line 729: warning: cyclomatic complexity 48 of function (*FileRes).syncCheckApply() is high (> 15) (gocyclo)
    • Line 537: warning: cyclomatic complexity 39 of function (*FileRes).fileCheckApply() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 32 of function (*FileRes).Watch() is high (> 15) (gocyclo)
    • Line 1521: warning: cyclomatic complexity 24 of function (*FileRes).Reversed() is high (> 15) (gocyclo)
    • Line 1266: warning: cyclomatic complexity 18 of function (*FileRes).Cmp() is high (> 15) (gocyclo)
    • Line 913: warning: cyclomatic complexity 17 of function (*FileRes).stateCheckApply() is high (> 15) (gocyclo)
    • pgraph/pgraph_test.go
    • Line 941: warning: cyclomatic complexity 32 of function TestLookupEdge1() is high (> 15) (gocyclo)
    • Line 305: warning: cyclomatic complexity 17 of function TestTopoSort1() is high (> 15) (gocyclo)
    • util/util_test.go
    • Line 918: warning: cyclomatic complexity 29 of function TestRebasePath0() is high (> 15) (gocyclo)
    • Line 854: warning: cyclomatic complexity 21 of function TestRemoveBasePath0() is high (> 15) (gocyclo)
    • engine/resources/svc.go
    • Line 241: warning: cyclomatic complexity 28 of function (*SvcRes).CheckApply() is high (> 15) (gocyclo)
    • Line 93: warning: cyclomatic complexity 27 of function (*SvcRes).Watch() is high (> 15) (gocyclo)
    • engine/resources/aws_ec2.go
    • Line 628: warning: cyclomatic complexity 27 of function (*AwsEc2Res).CheckApply() is high (> 15) (gocyclo)
    • Line 864: warning: cyclomatic complexity 20 of function (*AwsEc2Res).snsPostHandler() is high (> 15) (gocyclo)
    • Line 438: warning: cyclomatic complexity 18 of function (*AwsEc2Res).longpollWatch() is high (> 15) (gocyclo)
    • Line 281: warning: cyclomatic complexity 17 of function (*AwsEc2Res).Validate() is high (> 15) (gocyclo)
    • Line 538: warning: cyclomatic complexity 16 of function (*AwsEc2Res).snsWatch() is high (> 15) (gocyclo)
    • engine/util/mode.go
    • Line 228: warning: cyclomatic complexity 23 of function ParseSymbolicModes() is high (> 15) (gocyclo)
    • Line 63: warning: cyclomatic complexity 17 of function modeAssigned() is high (> 15) (gocyclo)
    • Line 155: warning: cyclomatic complexity 16 of function modeSubtracted() is high (> 15) (gocyclo)
    • engine/resources/docker_container.go
    • Line 217: warning: cyclomatic complexity 25 of function (*DockerContainerRes).CheckApply() is high (> 15) (gocyclo)
    • Line 103: warning: cyclomatic complexity 20 of function (*DockerContainerRes).Validate() 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!