Showing 1,468 of 1,914 total issues
Function deleteVxlanByVNI
has 6 return statements (exceeds 4 allowed). Open
Open
func deleteVxlanByVNI(path string, vni uint32) error {
nlh := ns.NlHandle()
if path != "" {
ns, err := netns.GetFromPath(path)
if err != nil {
Method driver.DeleteEndpoint
has 6 return statements (exceeds 4 allowed). Open
Open
func (d *driver) DeleteEndpoint(nid, eid string) error {
nlh := ns.NlHandle()
if err := validateID(nid, eid); err != nil {
return err
Consider simplifying this complex logical expression. Open
Open
if (newKey != nil && newIdx == -1) ||
(primary != nil && priIdx == -1) ||
(pruneKey != nil && delIdx == -1) {
Method driver.DeleteEndpoint
has 6 return statements (exceeds 4 allowed). Open
Open
func (d *driver) DeleteEndpoint(nid, eid string) error {
var err error
// Get the network handler and make sure it exists
d.Lock()
Method NetworkDB.bulkSyncNode
has 6 return statements (exceeds 4 allowed). Open
Open
func (nDB *NetworkDB) bulkSyncNode(networks []string, node string, unsolicited bool) error {
var msgs [][]byte
var unsolMsg string
if unsolicited {
Method driver.programInput
has 6 return statements (exceeds 4 allowed). Open
Open
func (d *driver) programInput(vni uint32, add bool) error {
var (
plainVxlan = matchVXLAN(overlayutils.VXLANUDPPort(), vni)
chain = "INPUT"
msg = "add"
Method driver.DiscoverNew
has 6 return statements (exceeds 4 allowed). Open
Open
func (d *driver) DiscoverNew(dType discoverapi.DiscoveryType, data interface{}) error {
switch dType {
case discoverapi.NodeDiscovery:
nodeData, ok := data.(discoverapi.NodeDiscoveryData)
if !ok {
Method cnmNetworkAllocator.IsTaskAllocated
has 6 return statements (exceeds 4 allowed). Open
Open
func (na *cnmNetworkAllocator) IsTaskAllocated(t *api.Task) bool {
// If the task is not found in the allocated set, then it is
// not allocated.
if _, ok := na.tasks[t.ID]; !ok {
return false
Method cnmNetworkAllocator.deallocateVIP
has 6 return statements (exceeds 4 allowed). Open
Open
func (na *cnmNetworkAllocator) deallocateVIP(vip *api.Endpoint_VirtualIP) error {
localNet := na.getNetwork(vip.NetworkID)
if localNet == nil {
return errors.New("networkallocator: could not find local network state")
}
Function createIPVlan
has 6 return statements (exceeds 4 allowed). Open
Open
func createIPVlan(containerIfName, parent, ipvlanMode, ipvlanFlag string) (string, error) {
// Set the ipvlan mode and flag. Default is L2 bridge
mode, err := setIPVlanMode(ipvlanMode)
if err != nil {
return "", fmt.Errorf("Unsupported %s ipvlan mode: %v", ipvlanMode, err)
Method cnmNetworkAllocator.allocateNetworkIPs
has 6 return statements (exceeds 4 allowed). Open
Open
func (na *cnmNetworkAllocator) allocateNetworkIPs(nAttach *api.NetworkAttachment) error {
var ip *net.IPNet
var opts map[string]string
ipam, _, _, err := na.resolveIPAM(nAttach.Network)
Method driver.parseNetworkOptions
has 6 return statements (exceeds 4 allowed). Open
Open
func (d *driver) parseNetworkOptions(id string, genericOptions map[string]string) (*networkConfiguration, error) {
config := &networkConfiguration{Type: d.name}
for label, value := range genericOptions {
switch label {
Method linuxParser.ParseVolumesFrom
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *linuxParser) ParseVolumesFrom(spec string) (string, string, error) {
if len(spec) == 0 {
return "", "", fmt.Errorf("volumes-from specification cannot be an empty string")
}
Method Client.checkResponseErr
has 6 return statements (exceeds 4 allowed). Open
Open
func (cli *Client) checkResponseErr(serverResp serverResponse) error {
if serverResp.statusCode >= 200 && serverResp.statusCode < 400 {
return nil
}
Function setupIPTablesInternal
has 6 return statements (exceeds 4 allowed). Open
Open
func setupIPTablesInternal(ipVer iptables.IPVersion, config *networkConfiguration, addr *net.IPNet, hairpin, enable bool) error {
var (
address = addr.String()
skipDNAT = iptRule{ipv: ipVer, table: iptables.Nat, chain: DockerChain, args: []string{"-i", config.BridgeName, "-j", "RETURN"}}
outRule = iptRule{ipv: ipVer, table: iptables.Filter, chain: "FORWARD", args: []string{"-i", config.BridgeName, "!", "-o", config.BridgeName, "-j", "ACCEPT"}}
Method Client.checkPluginPermissions
has 6 return statements (exceeds 4 allowed). Open
Open
func (cli *Client) checkPluginPermissions(ctx context.Context, query url.Values, options types.PluginInstallOptions) (types.PluginPrivileges, error) {
resp, err := cli.tryPluginPrivileges(ctx, query, options.RegistryAuth)
if errdefs.IsUnauthorized(err) && options.PrivilegeFunc != nil {
// todo: do inspect before to check existing name before checking privileges
newAuthHeader, privilegeErr := options.PrivilegeFunc(ctx)
Method Client.Events
has 6 return statements (exceeds 4 allowed). Open
Open
func (cli *Client) Events(ctx context.Context, options events.ListOptions) (<-chan events.Message, <-chan error) {
messages := make(chan events.Message)
errs := make(chan error, 1)
started := make(chan struct{})
Function getMountOptions
has 6 return statements (exceeds 4 allowed). Open
Open
func getMountOptions(opts *optsConfig, resolveIP func(string, string) (*net.IPAddr, error)) (mountDevice string, mountOpts string, _ error) {
if opts.MountDevice == "" {
return "", "", fmt.Errorf("missing device in volume options")
}
Method cnmNetworkAllocator.allocatePools
has 6 return statements (exceeds 4 allowed). Open
Open
func (na *cnmNetworkAllocator) allocatePools(n *api.Network) (map[string]string, error) {
ipam, dName, dOptions, err := na.resolveIPAM(n)
if err != nil {
return nil, err
}
Function withDockerfileFromContext
has 6 return statements (exceeds 4 allowed). Open
Open
func withDockerfileFromContext(c modifiableContext, dockerfilePath string) (builder.Source, *parser.Result, error) {
df, err := openAt(c, dockerfilePath)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
if dockerfilePath == builder.DefaultDockerfileName {