Showing 1,468 of 1,914 total issues
Function Push
has 6 return statements (exceeds 4 allowed). Open
Open
func Push(ctx context.Context, ref reference.Named, config *ImagePushConfig) error {
// FIXME: Allow to interrupt current push when new push of same image is done.
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := config.RegistryService.ResolveRepository(ref)
Function parseTCPAddr
has 6 return statements (exceeds 4 allowed). Open
Open
func parseTCPAddr(address string, strict bool) (*url.URL, error) {
if !strict && !strings.Contains(address, "://") {
address = "tcp://" + address
}
parsedURL, err := url.Parse(address)
Function pullEndpoints
has 6 return statements (exceeds 4 allowed). Open
Open
func pullEndpoints(ctx context.Context, registryService RegistryResolver, ref reference.Named,
f func(context.Context, registry.RepositoryInfo, registry.APIEndpoint) error,
) (*registry.RepositoryInfo, error) {
// Resolve the Repository name from fqn to RepositoryInfo
repoInfo, err := registryService.ResolveRepository(ref)
Method pushDescriptor.uploadUsingSession
has 6 return statements (exceeds 4 allowed). Open
Open
func (pd *pushDescriptor) uploadUsingSession(
ctx context.Context,
progressOutput progress.Output,
diffID layer.DiffID,
layerUpload distribution.BlobWriter,
Function verifySchema1Manifest
has 6 return statements (exceeds 4 allowed). Open
Open
func verifySchema1Manifest(signedManifest *schema1.SignedManifest, ref reference.Reference) (m *schema1.Manifest, err error) {
// If pull by digest, then verify the manifest digest. NOTE: It is
// important to do this first, before any other content validation. If the
// digest cannot be verified, don't even bother with those other things.
if digested, isCanonical := ref.(reference.Canonical); isCanonical {
Function fixManifestLayers
has 6 return statements (exceeds 4 allowed). Open
Open
func fixManifestLayers(m *schema1.Manifest) error {
imgs := make([]*image.V1Image, len(m.FSLayers))
for i := range m.FSLayers {
img := &image.V1Image{}
Method pusher.pushRepository
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *pusher) pushRepository(ctx context.Context) (err error) {
if namedTagged, isNamedTagged := p.ref.(reference.NamedTagged); isNamedTagged {
imageID, err := p.config.ReferenceStore.Get(p.ref)
if err != nil {
return fmt.Errorf("tag does not exist: %s", reference.FamiliarString(p.ref))
Method IPAMData.UnmarshalJSON
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *IPAMData) UnmarshalJSON(data []byte) error {
var (
m map[string]interface{}
err error
)
Method Endpoint.Delete
has 6 return statements (exceeds 4 allowed). Open
Open
func (ep *Endpoint) Delete(ctx context.Context, force bool) error {
var err error
n, err := ep.getNetworkFromStore()
if err != nil {
return fmt.Errorf("failed to get network during Delete: %v", err)
Method Controller.handleKeyChange
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *Controller) handleKeyChange(keys []*types.EncryptionKey) error {
drvEnc := discoverapi.DriverEncryptionUpdate{}
agent := c.getAgent()
if agent == nil {
Method Namespace.AddNeighbor
has 6 return statements (exceeds 4 allowed). Open
Open
func (n *Namespace) AddNeighbor(dstIP net.IP, dstMac net.HardwareAddr, force bool, options ...NeighOption) error {
var (
iface netlink.Link
err error
neighborAlreadyPresent bool
Method Endpoint.deleteServiceInfoFromCluster
has 6 return statements (exceeds 4 allowed). Open
Open
func (ep *Endpoint) deleteServiceInfoFromCluster(sb *Sandbox, fullRemove bool, method string) error {
if len(ep.dnsNames) == 0 {
return nil
}
Method EndpointInterface.UnmarshalJSON
has 6 return statements (exceeds 4 allowed). Open
Open
func (epi *EndpointInterface) UnmarshalJSON(b []byte) error {
var (
err error
epMap map[string]interface{}
)
Function addEpToResolverImpl
has 6 return statements (exceeds 4 allowed). Open
Open
func addEpToResolverImpl(
ctx context.Context,
netName, epName string,
epIface *EndpointInterface,
resolvers []*Resolver,
Method Sandbox.clearNetworkResources
has 6 return statements (exceeds 4 allowed). Open
Open
func (sb *Sandbox) clearNetworkResources(origEp *Endpoint) error {
ep := sb.GetEndpoint(origEp.id)
if ep == nil {
return fmt.Errorf("could not find the sandbox endpoint data for endpoint %s",
origEp.id)
Function UserModified
has 6 return statements (exceeds 4 allowed). Open
Open
func UserModified(rcPath, rcHashPath string) (bool, error) {
currRCHash, err := os.ReadFile(rcHashPath)
if err != nil {
// If the hash file doesn't exist, can only assume it hasn't been written
// yet (so, the user hasn't modified the file it hashes).
Method Sandbox.SetKey
has 6 return statements (exceeds 4 allowed). Open
Open
func (sb *Sandbox) SetKey(ctx context.Context, basePath string) error {
start := time.Now()
defer func() {
log.G(ctx).Debugf("sandbox set key processing took %s for container %s", time.Since(start), sb.ContainerID())
}()
Function getIPInterface
has 6 return statements (exceeds 4 allowed). Open
Open
func getIPInterface(name string) (string, error) {
ifaces, err := net.Interfaces()
if err != nil {
return "", err
}
Method driver.EndpointOperInfo
has 6 return statements (exceeds 4 allowed). Open
Open
func (d *driver) EndpointOperInfo(nid, eid string) (map[string]interface{}, error) {
// Get the network handler and make sure it exists
d.Lock()
n, ok := d.networks[nid]
d.Unlock()
Method PortDriverClient.AddPort
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *PortDriverClient) AddPort(
ctx context.Context,
proto string,
hostIP netip.Addr,
childIP netip.Addr,