Preparing report...

Report for github.com/srl-labs/containerlab

A    Great!    Found 29 issues across 64 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!


gocyclo95%

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.


golint57%

Golint is a linter for Go source code.

    • containerlab/runtime/docker/docker.go
    • Line 45: warning: exported type DockerRuntime should have comment or be unexported (golint)
    • Line 53: warning: exported method DockerRuntime.Init should have comment or be unexported (golint)
    • Line 66: warning: exported method DockerRuntime.WithConfig should have comment or be unexported (golint)
    • Line 75: warning: exported method DockerRuntime.WithMgmtNet should have comment or be unexported (golint)
    • Line 79: warning: comment on exported method DockerRuntime.CreateNet should be of the form "CreateNet ..." (golint)
    • Line 316: warning: exported method DockerRuntime.PullImageIfRequired should have comment or be unexported (golint)
    • Line 548: warning: exported method DockerRuntime.StopContainer should have comment or be unexported (golint)
    • containerlab/types/node_definition.go
    • Line 33: warning: exported method NodeDefinition.GetKind should have comment or be unexported (golint)
    • Line 40: warning: exported method NodeDefinition.GetGroup should have comment or be unexported (golint)
    • Line 47: warning: exported method NodeDefinition.GetType should have comment or be unexported (golint)
    • Line 54: warning: exported method NodeDefinition.GetConfig should have comment or be unexported (golint)
    • Line 61: warning: exported method NodeDefinition.GetImage should have comment or be unexported (golint)
    • Line 68: warning: exported method NodeDefinition.GetLicense should have comment or be unexported (golint)
    • Line 75: warning: exported method NodeDefinition.GetPostion should have comment or be unexported (golint)
    • Line 82: warning: exported method NodeDefinition.GetCmd should have comment or be unexported (golint)
    • Line 89: warning: exported method NodeDefinition.GetBinds should have comment or be unexported (golint)
    • Line 96: warning: exported method NodeDefinition.GetPorts should have comment or be unexported (golint)
    • Line 103: warning: exported method NodeDefinition.GetMgmtIPv4 should have comment or be unexported (golint)
    • Line 110: warning: exported method NodeDefinition.GetMgmtIPv6 should have comment or be unexported (golint)
    • Line 117: warning: exported method NodeDefinition.GetPublish should have comment or be unexported (golint)
    • Line 124: warning: exported method NodeDefinition.GetEnv should have comment or be unexported (golint)
    • Line 131: warning: exported method NodeDefinition.GetUser should have comment or be unexported (golint)
    • Line 138: warning: exported method NodeDefinition.GetLabels should have comment or be unexported (golint)
    • Line 145: warning: exported method NodeDefinition.GetNetworkMode should have comment or be unexported (golint)
    • containerlab/clab/clab.go
    • Line 15: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 17: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 22: warning: exported type CLab should have comment or be unexported (golint)
    • Line 36: warning: exported type Directory should have comment or be unexported (golint)
    • Line 43: warning: exported type ClabOption should have comment or be unexported (golint)
    • Line 45: warning: exported function WithDebug should have comment or be unexported (golint)
    • Line 51: warning: exported function WithTimeout should have comment or be unexported (golint)
    • Line 57: warning: exported function WithRuntime should have comment or be unexported (golint)
    • Line 88: warning: exported function WithTopoFile should have comment or be unexported (golint)
    • Line 105: warning: exported function WithGracefulShutdown should have comment or be unexported (golint)
    • Line 153: warning: exported method CLab.CreateNodes should have comment or be unexported (golint)
    • Line 250: warning: exported method CLab.DeleteNodes should have comment or be unexported (golint)
    • containerlab/utils/file.go
    • Line 14: warning: exported function FileExists should have comment or be unexported (golint)
    • Line 50: warning: comment on exported function CopyFileContents should be of the form "CopyFileContents ..." (golint)
    • Line 77: warning: exported function CreateFile should have comment or be unexported (golint)
    • Line 98: warning: exported function ReadFileContent should have comment or be unexported (golint)
    • containerlab/utils/env.go
    • Line 7: warning: comment on exported function ConvertEnvs should be of the form "ConvertEnvs ..." (golint)
    • Line 16: warning: comment on exported function MergeStringMaps should be of the form "MergeStringMaps ..." (golint)
    • Line 37: warning: exported function StringInSlice should have comment or be unexported (golint)
    • containerlab/utils/netlink.go
    • Line 16: warning: exported function BridgeByName should have comment or be unexported (golint)
    • Line 28: warning: comment on exported function LinkContainerNS should be of the form "LinkContainerNS ..." (golint)
    • Line 43: warning: comment on exported function DefaultNetMTU should be of the form "DefaultNetMTU ..." (golint)
    • Line 60: warning: comment on exported function DeleteNetnsSymlink should be of the form "DeleteNetnsSymlink ..." (golint)
    • containerlab/utils/containers.go
    • Line 12: warning: comment on exported function GetCanonicalImageName should be of the form "GetCanonicalImageName ..." (golint)
    • Line 45: warning: exported function GetCNIBinaryPath should have comment or be unexported (golint)
    • containerlab/types/types.go
    • Line 37: warning: comment on exported type MgmtNet should be of the form "MgmtNet ..." (with optional leading article) (golint)
    • Line 118: warning: exported function DisableTxOffload should have comment or be unexported (golint)
    • Line 139: warning: comment on exported type GenericContainer should be of the form "GenericContainer ..." (with optional leading article) (golint)
    • Line 152: warning: exported type GenericMgmtIPs should have comment or be unexported (golint)
    • Line 160: warning: exported type GenericFilter should have comment or be unexported (golint)
    • Line 171: warning: exported function FilterFromLabelStrings should have comment or be unexported (golint)
    • containerlab/runtime/runtime.go
    • Line 15: warning: exported const DockerRuntime should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported type ContainerRuntime should have comment or be unexported (golint)
    • Line 50: warning: exported type Initializer should have comment or be unexported (golint)
    • Line 52: warning: exported type RuntimeOption should have comment or be unexported (golint)
    • Line 54: warning: exported type RuntimeConfig should have comment or be unexported (golint)
    • Line 60: warning: exported var ContainerRuntimes should have comment or be unexported (golint)
    • Line 62: warning: exported function Register should have comment or be unexported (golint)
    • Line 66: warning: exported function WithConfig should have comment or be unexported (golint)
    • Line 72: warning: exported function WithMgmtNet should have comment or be unexported (golint)
    • containerlab/utils/ethtool.go
    • Line 14: warning: exported const SIOCETHTOOL should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: comment on exported type IFReqData should be of the form "IFReqData ..." (with optional leading article) (golint)
    • Line 26: warning: comment on exported type EthtoolValue should be of the form "EthtoolValue ..." (with optional leading article) (golint)
    • containerlab/types/topology.go
    • Line 20: warning: exported function NewTopology should have comment or be unexported (golint)
    • Line 29: warning: exported type LinkConfig should have comment or be unexported (golint)
    • Line 34: warning: exported method Topology.GetDefaults should have comment or be unexported (golint)
    • Line 41: warning: exported method Topology.GetKind should have comment or be unexported (golint)
    • Line 51: warning: exported method Topology.GetKinds should have comment or be unexported (golint)
    • Line 58: warning: exported method Topology.GetNodeKind should have comment or be unexported (golint)
    • Line 71: warning: exported method Topology.GetNodeBinds should have comment or be unexported (golint)
    • Line 84: warning: exported method Topology.GetNodePorts should have comment or be unexported (golint)
    • Line 102: warning: exported method Topology.GetNodeEnv should have comment or be unexported (golint)
    • Line 112: warning: exported method Topology.GetNodePublish should have comment or be unexported (golint)
    • Line 127: warning: exported method Topology.GetNodeLabels should have comment or be unexported (golint)
    • Line 137: warning: exported method Topology.GetNodeConfig should have comment or be unexported (golint)
    • Line 160: warning: exported method Topology.GetNodeLicense should have comment or be unexported (golint)
    • Line 183: warning: exported method Topology.GetNodeImage should have comment or be unexported (golint)
    • Line 196: warning: exported method Topology.GetNodeGroup should have comment or be unexported (golint)
    • Line 209: warning: exported method Topology.GetNodeType should have comment or be unexported (golint)
    • Line 222: warning: exported method Topology.GetNodePosition should have comment or be unexported (golint)
    • Line 235: warning: exported method Topology.GetNodeCmd should have comment or be unexported (golint)
    • Line 248: warning: exported method Topology.GetNodeUser should have comment or be unexported (golint)
    • Line 261: warning: exported method Topology.GetNodeNetworkMode should have comment or be unexported (golint)
    • containerlab/runtime/containerd/containerd.go
    • Line 47: warning: exported method ContainerdRuntime.Init should have comment or be unexported (golint)
    • Line 68: warning: exported type ContainerdRuntime should have comment or be unexported (golint)
    • Line 76: warning: exported method ContainerdRuntime.WithConfig should have comment or be unexported (golint)
    • Line 85: warning: exported method ContainerdRuntime.WithMgmtNet should have comment or be unexported (golint)
    • Line 96: warning: exported method ContainerdRuntime.CreateNet should have comment or be unexported (golint)
    • Line 100: warning: exported method ContainerdRuntime.DeleteNet should have comment or be unexported (golint)
    • Line 105: warning: exported method ContainerdRuntime.PullImageIfRequired should have comment or be unexported (golint)
    • Line 125: warning: exported method ContainerdRuntime.CreateContainer should have comment or be unexported (golint)
    • Line 376: warning: exported function WithSysctls should have comment or be unexported (golint)
    • Line 391: warning: exported method ContainerdRuntime.StartContainer should have comment or be unexported (golint)
    • Line 406: warning: exported method ContainerdRuntime.StopContainer should have comment or be unexported (golint)
    • Line 478: warning: exported method ContainerdRuntime.ListContainers should have comment or be unexported (golint)
    • Line 608: warning: exported method ContainerdRuntime.GetNSPath should have comment or be unexported (golint)
    • Line 616: warning: exported method ContainerdRuntime.Exec should have comment or be unexported (golint)
    • Line 620: warning: exported method ContainerdRuntime.ExecNotWait should have comment or be unexported (golint)
    • Line 636: warning: don't use underscores in Go names; var cio_opt should be cioOpt (golint)
    • Line 706: warning: exported method ContainerdRuntime.DeleteContainer should have comment or be unexported (golint)
    • containerlab/nodes/node.go
    • Line 15: warning: comment on exported const VrDefConnMode should be of the form "VrDefConnMode ..." (golint)
    • Line 19: warning: exported var NodeKind should have comment or be unexported (golint)
    • Line 22: warning: exported const NodeKindBridge should have comment (or a comment on this block) or be unexported (golint)
    • Line 40: warning: exported type Node should have comment or be unexported (golint)
    • Line 49: warning: exported var Nodes should have comment or be unexported (golint)
    • Line 51: warning: exported type Initializer should have comment or be unexported (golint)
    • Line 53: warning: exported function Register should have comment or be unexported (golint)
    • Line 57: warning: exported type NodeOption should have comment or be unexported (golint)
    • Line 59: warning: exported function WithMgmtNet should have comment or be unexported (golint)
    • Line 69: warning: exported var DefaultConfigTemplates should have comment or be unexported (golint)
    • containerlab/cert/cert.go
    • Line 28: warning: exported type Certificates should have comment or be unexported (golint)
    • Line 83: warning: exported var NodeCSRTempl should have comment or be unexported (golint)
    • containerlab/cmd/tools_veth.go
    • Line 20: warning: exported var AEnd should have comment or be unexported (golint)
    • Line 21: warning: exported var BEnd should have comment or be unexported (golint)
    • Line 22: warning: exported var MTU should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign0%

IneffAssign detects ineffectual assignments in Go code.

An error occurred while running this test (exit status 2)


misspell98%

Misspell Finds commonly misspelled English words