Showing 1,468 of 1,914 total issues
Method Store.Get
has 8 return statements (exceeds 4 allowed). Open
Open
func (ps *Store) Get(name, capability string, mode int) (plugingetter.CompatPlugin, error) {
// Lookup using new model.
if ps != nil {
p, err := ps.GetV2Plugin(name)
if err == nil {
Method store.Create
has 8 return statements (exceeds 4 allowed). Open
Open
func (is *store) Create(config []byte) (ID, error) {
var img *Image
img, err := NewFromJSON(config)
if err != nil {
return "", err
Function calcSize
has 8 return statements (exceeds 4 allowed). Open
Open
func calcSize(ctx context.Context, dir string) (int64, error) {
var size int64
data := make(map[uint64]struct{})
err := filepath.Walk(dir, func(d string, fileInfo os.FileInfo, err error) error {
if err != nil {
Method Executor.Restore
has 8 return statements (exceeds 4 allowed). Open
Open
func (e *Executor) Restore(id string, stdout, stderr io.WriteCloser) (bool, error) {
ctx := context.Background()
p := c8dPlugin{log: log.G(ctx).WithField("plugin", id)}
ctr, err := e.client.LoadContainer(ctx, id)
if err != nil {
Method pushDescriptor.Upload
has 8 return statements (exceeds 4 allowed). Open
Open
func (pd *pushDescriptor) Upload(ctx context.Context, progressOutput progress.Output) (distribution.Descriptor, error) {
// Skip foreign layers unless this registry allows nondistributable artifacts.
if !pd.endpoint.AllowNondistributableArtifacts {
if fs, ok := pd.layer.(distribution.Describable); ok {
if d := fs.Descriptor(); len(d.URLs) > 0 {
Method Sandbox.populateNetworkResources
has 8 return statements (exceeds 4 allowed). Open
Open
func (sb *Sandbox) populateNetworkResources(ctx context.Context, ep *Endpoint) error {
ctx, span := otel.Tracer("").Start(ctx, "libnetwork.Sandbox.populateNetworkResources", trace.WithAttributes(
attribute.String("endpoint.Name", ep.Name())))
defer span.End()
Method Endpoint.addServiceInfoToCluster
has 8 return statements (exceeds 4 allowed). Open
Open
func (ep *Endpoint) addServiceInfoToCluster(sb *Sandbox) error {
if len(ep.dnsNames) == 0 || ep.Iface() == nil || ep.Iface().Address() == nil {
return nil
}
Method NetworkDB.handleNodeEvent
has 8 return statements (exceeds 4 allowed). Open
Open
func (nDB *NetworkDB) handleNodeEvent(nEvent *NodeEvent) bool {
// Update our local clock if the received messages has newer
// time.
nDB.networkClock.Witness(nEvent.LTime)
Method driver.CreateNetwork
has 8 return statements (exceeds 4 allowed). Open
Open
func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
if len(ipV4Data) == 0 || ipV4Data[0].Pool.String() == "0.0.0.0/0" {
return types.InvalidParameterErrorf("ipv4 pool is empty")
}
// Sanity checks
Function cmpPortBinding
has 8 return statements (exceeds 4 allowed). Open
Open
func cmpPortBinding(a, b types.PortBinding) int {
// Exact host port < host port range.
aIsRange := a.HostPort == 0 || a.HostPort != a.HostPortEnd
bIsRange := b.HostPort == 0 || b.HostPort != b.HostPortEnd
if aIsRange != bIsRange {
Method driver.ProgramExternalConnectivity
has 8 return statements (exceeds 4 allowed). Open
Open
func (d *driver) ProgramExternalConnectivity(ctx context.Context, nid, eid string, options map[string]interface{}) error {
ctx, span := otel.Tracer("").Start(ctx, "libnetwork.drivers.bridge.ProgramExternalConnectivity", trace.WithAttributes(
attribute.String("nid", nid),
attribute.String("eid", eid)))
defer span.End()
Method driver.Join
has 8 return statements (exceeds 4 allowed). Open
Open
func (d *driver) Join(ctx context.Context, nid, eid string, sboxKey string, jinfo driverapi.JoinInfo, options map[string]interface{}) error {
ctx, span := otel.Tracer("").Start(ctx, "libnetwork.drivers.bridge.Join", trace.WithAttributes(
attribute.String("nid", nid),
attribute.String("eid", eid),
attribute.String("sboxKey", sboxKey)))
Method driver.CreateEndpoint
has 8 return statements (exceeds 4 allowed). Open
Open
func (d *driver) CreateEndpoint(_ context.Context, nid, eid string, ifInfo driverapi.InterfaceInfo, epOptions map[string]interface{}) (retErr error) {
if ifInfo == nil {
return errors.New("must not be called with nil InterfaceInfo")
}
Method cnmNetworkAllocator.allocateVIP
has 8 return statements (exceeds 4 allowed). Open
Open
func (na *cnmNetworkAllocator) allocateVIP(vip *api.Endpoint_VirtualIP) error {
var opts map[string]string
localNet := na.getNetwork(vip.NetworkID)
if localNet == nil {
return errors.New("networkallocator: could not find local network state")
Method Client.imageBuildOptionsToQuery
has 8 return statements (exceeds 4 allowed). Open
Open
func (cli *Client) imageBuildOptionsToQuery(ctx context.Context, options types.ImageBuildOptions) (url.Values, error) {
query := url.Values{}
if len(options.Tags) > 0 {
query["t"] = options.Tags
}
Method Client.doRequest
has 8 return statements (exceeds 4 allowed). Open
Open
func (cli *Client) doRequest(req *http.Request) (serverResponse, error) {
serverResp := serverResponse{statusCode: -1, reqURL: req.URL}
resp, err := cli.client.Do(req)
if err != nil {
Method cnmNetworkAllocator.IsAttachmentAllocated
has 8 return statements (exceeds 4 allowed). Open
Open
func (na *cnmNetworkAllocator) IsAttachmentAllocated(node *api.Node, networkAttachment *api.NetworkAttachment) bool {
if node == nil {
return false
}
Method driver.EventNotify
has 8 return statements (exceeds 4 allowed). Open
Open
func (d *driver) EventNotify(etype driverapi.EventType, nid, tableName, key string, value []byte) {
if tableName != ovPeerTable {
log.G(context.TODO()).Errorf("Unexpected table notification for table %s received", tableName)
return
}
Method driver.CreateNetwork
has 8 return statements (exceeds 4 allowed). Open
Open
func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
var (
networkName string
interfaceName string
staleNetworks []string
Method Root.validateOpts
has 8 return statements (exceeds 4 allowed). Open
Open
func (r *Root) validateOpts(opts map[string]string) error {
if len(opts) == 0 {
return nil
}
for opt := range opts {