Showing 1,468 of 1,914 total issues
Function RepoTagReference
has 6 return statements (exceeds 4 allowed). Open
Open
func RepoTagReference(repo, tag string) (reference.NamedTagged, error) {
if repo == "" {
return nil, nil
}
Method containerRouter.postCommit
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *containerRouter) postCommit(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
Function FromError
has 6 return statements (exceeds 4 allowed). Open
Open
func FromError(err error) int {
if err == nil {
log.G(context.TODO()).WithError(err).Error("unexpected HTTP error handling")
return http.StatusInternalServerError
}
Method executor.Controller
has 6 return statements (exceeds 4 allowed). Open
Open
func (e *executor) Controller(t *api.Task) (exec.Controller, error) {
dependencyGetter := template.NewTemplatedDependencyGetter(agent.Restrict(e.dependencies, t), t, nil)
// Get the node description from the executor field
e.mutex.Lock()
Method containerAdapter.pullImage
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *containerAdapter) pullImage(ctx context.Context) error {
spec := c.container.spec()
// Skip pulling if the image is referenced by image ID.
if _, err := digest.Parse(spec.Image); err == nil {
Function validateMounts
has 6 return statements (exceeds 4 allowed). Open
Open
func validateMounts(mounts []api.Mount) error {
for _, mount := range mounts {
// Target must always be absolute
// except if target is Windows named pipe
if !filepath.IsAbs(mount.Target) && mount.Type != api.MountTypeNamedPipe {
Method Cluster.GetServices
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *Cluster) GetServices(options types.ServiceListOptions) ([]swarm.Service, error) {
c.mu.RLock()
defer c.mu.RUnlock()
state := c.currentNodeState()
Method Controller.Prepare
has 6 return statements (exceeds 4 allowed). Open
Open
func (p *Controller) Prepare(ctx context.Context) (err error) {
p.logger.Debug("Prepare")
remote, err := reference.ParseNormalizedNamed(p.spec.Remote)
if err != nil {
Method ImageService.walkReachableImageManifests
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) walkReachableImageManifests(ctx context.Context, img containerdimages.Image, handler func(img *ImageManifest) error) error {
desc := img.Target
handleManifest := func(ctx context.Context, d ocispec.Descriptor) error {
platformImg, err := i.NewImageManifest(ctx, img, d)
Function writeContentsForImage
has 6 return statements (exceeds 4 allowed). Open
Open
func writeContentsForImage(ctx context.Context, snName string, cs content.Store,
newConfig imagespec.DockerOCIImage, layers []ocispec.Descriptor,
containerConfig container.Config,
) (
manifestDesc ocispec.Descriptor,
Method ImageService.imageDeleteHelper
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) imageDeleteHelper(ctx context.Context, img images.Image, all []images.Image, records *[]imagetypes.DeleteResponse, extra conflictType) error {
// First, determine if this image has any conflicts. Ignore soft conflicts
// if force is true.
c := conflictHard | extra
Method ImageService.checkImageDeleteConflict
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) checkImageDeleteConflict(ctx context.Context, imgID image.ID, all []images.Image, mask conflictType) error {
if mask&conflictRunningContainer != 0 {
running := func(c *container.Container) bool {
return c.ImageID == imgID && c.IsRunning()
}
Method ImageService.unleaseSnapshotsFromDeletedConfigs
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) unleaseSnapshotsFromDeletedConfigs(ctx context.Context, possiblyDeletedConfigs map[digest.Digest]struct{}) error {
all, err := i.images.List(ctx)
if err != nil {
return errors.Wrap(err, "failed to list images during snapshot lease removal")
}
Method ImageService.applyDiffLayer
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) applyDiffLayer(ctx context.Context, name string, containerID string, sn snapshots.Snapshotter, differ diff.Applier, diffDesc ocispec.Descriptor) (retErr error) {
// Let containerd know that this snapshot is only for diff-applying.
key := snapshots.UnpackKeyPrefix + "-" + uniquePart() + "-" + name
info, err := sn.Stat(ctx, containerID)
Method ImageService.createImageOCI
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) createImageOCI(ctx context.Context, imgToCreate imagespec.DockerOCIImage,
parentDigest digest.Digest, layers []ocispec.Descriptor,
containerConfig container.Config,
) (dimage.ID, error) {
// Necessary to prevent the contents from being GC'd
Method ImageService.walkImageManifests
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) walkImageManifests(ctx context.Context, img containerdimages.Image, handler func(img *ImageManifest) error) error {
desc := img.Target
handleManifest := func(ctx context.Context, d ocispec.Descriptor) error {
platformImg, err := i.NewImageManifest(ctx, img, d)
Method containerAdapter.create
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *containerAdapter) create(ctx context.Context) error {
hostConfig := c.container.hostConfig(c.dependencies.Volumes())
netConfig := c.container.createNetworkingConfig(c.backend)
// We need to make sure no empty string or "default" NetworkMode is
Method Cluster.resolveAdvertiseAddr
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *Cluster) resolveAdvertiseAddr(advertiseAddr, listenAddrPort string) (string, string, error) {
// Approach:
// - If an advertise address is specified, use that. Resolve the
// interface's address if an interface was specified in
// advertiseAddr. Fill in the port from listenAddrPort if necessary.
Function newAWSLogsClient
has 6 return statements (exceeds 4 allowed). Open
Open
func newAWSLogsClient(info logger.Info, configOpts ...func(*config.LoadOptions) error) (*cloudwatchlogs.Client, error) {
ctx := context.TODO()
var region, endpoint *string
if os.Getenv(regionEnvKey) != "" {
region = aws.String(os.Getenv(regionEnvKey))
Method Daemon.getExecConfig
has 6 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) getExecConfig(name string) (*container.ExecConfig, error) {
ec := daemon.execCommands.Get(name)
if ec == nil {
return nil, errExecNotFound(name)
}