Showing 1,468 of 1,914 total issues
Method sharedTempFileConverter.convert
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *sharedTempFileConverter) convert(f *os.File) (converted *os.File, size int64, err error) {
dst, err := os.CreateTemp(c.TempDir, "dockerdtemp.*")
if err != nil {
return nil, 0, err
}
Method reader.readJournal
has 6 return statements (exceeds 4 allowed). Open
Open
func (r *reader) readJournal(ctx context.Context) error {
caughtUp := r.s.ordinal.Load()
if more, err := r.drainJournal(ctx); err != nil || !more {
return err
}
Method Daemon.ContainerExport
has 6 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) ContainerExport(ctx context.Context, name string, out io.Writer) error {
ctr, err := daemon.GetContainer(name)
if err != nil {
return err
}
Method Daemon.GetContainer
has 6 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) GetContainer(prefixOrName string) (*container.Container, error) {
if len(prefixOrName) == 0 {
return nil, errors.WithStack(invalidIdentifier(prefixOrName))
}
Method Daemon.initializeNetworking
has 6 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) initializeNetworking(ctx context.Context, cfg *config.Config, ctr *container.Container) error {
if ctr.HostConfig.NetworkMode.IsContainer() {
// we need to get the hosts files from the container to join
nc, err := daemon.getNetworkedContainer(ctr.ID, ctr.HostConfig.NetworkMode.ConnectedContainer())
if err != nil {
Function buildCreateEndpointOptions
has 6 return statements (exceeds 4 allowed). Open
Open
func buildCreateEndpointOptions(c *container.Container, n *libnetwork.Network, epConfig *network.EndpointSettings, sb *libnetwork.Sandbox, daemonDNS []string) ([]libnetwork.EndpointOption, error) {
var createOptions []libnetwork.EndpointOption
genericOptions := make(options.Generic)
nwName := n.Name()
Method Daemon.getInspectData
has 6 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) getInspectData(daemonCfg *config.Config, container *container.Container) (*containertypes.ContainerJSONBase, error) {
// make a copy to play with
hostConfig := *container.HostConfig
children := daemon.children(container)
Function FilterNetworks
has 6 return statements (exceeds 4 allowed). Open
Open
func FilterNetworks(nws []network.Inspect, filter filters.Args) ([]network.Inspect, error) {
// if filter is empty, return original network list
if filter.Len() == 0 {
return nws, nil
}
Method Daemon.ContainerAttach
has 6 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) ContainerAttach(prefixOrName string, req *backend.ContainerAttachConfig) error {
keys := []byte{}
var err error
if req.DetachKeys != "" {
keys, err = term.ToBytes(req.DetachKeys)
Method ImageService.ImagesPrune
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) ImagesPrune(ctx context.Context, pruneFilters filters.Args) (*imagetypes.PruneReport, error) {
if !i.pruneRunning.CompareAndSwap(false, true) {
return nil, errPruneRunning
}
defer i.pruneRunning.Store(false)
Method ImageService.imageDeleteHelper
has 6 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) imageDeleteHelper(imgID image.ID, records *[]imagetypes.DeleteResponse, force, prune, quiet bool) error {
// First, determine if this image has any conflicts. Ignore soft conflicts
// if force is true.
c := conflictHard
if !force {
Function getEndpointPortMapInfo
has 6 return statements (exceeds 4 allowed). Open
Open
func getEndpointPortMapInfo(ep *libnetwork.Endpoint) (nat.PortMap, error) {
pm := nat.PortMap{}
driverInfo, err := ep.DriverInfo()
if err != nil {
return pm, err
Method Daemon.ContainersPrune
has 6 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) ContainersPrune(ctx context.Context, pruneFilters filters.Args) (*container.PruneReport, error) {
if !daemon.pruneRunning.CompareAndSwap(false, true) {
return nil, errPruneRunning
}
defer daemon.pruneRunning.Store(false)
Function FrozenImagesLinux
has 6 return statements (exceeds 4 allowed). Open
Open
func FrozenImagesLinux(ctx context.Context, client client.APIClient, images ...string) error {
ctx, span := otel.Tracer("").Start(ctx, "LoadFrozenImages")
defer span.End()
var loadImages []struct{ srcName, destName string }
Method layerStore.loadMount
has 6 return statements (exceeds 4 allowed). Open
Open
func (ls *layerStore) loadMount(mount string) error {
ls.mountL.Lock()
defer ls.mountL.Unlock()
if _, ok := ls.mounts[mount]; ok {
return nil
Method Daemon.containerStop
has 6 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) containerStop(ctx context.Context, ctr *container.Container, options containertypes.StopOptions) (retErr error) {
// Cancelling the request should not cancel the stop.
ctx = context.WithoutCancel(ctx)
if !ctr.IsRunning() {
Method layerStore.CreateRWLayer
has 6 return statements (exceeds 4 allowed). Open
Open
func (ls *layerStore) CreateRWLayer(name string, parent ChainID, opts *CreateRWLayerOpts) (_ RWLayer, err error) {
var (
storageOpt map[string]string
initFunc MountInit
mountLabel string
Function storeLayer
has 6 return statements (exceeds 4 allowed). Open
Open
func storeLayer(tx *fileMetadataTransaction, layer *roLayer) error {
if err := tx.SetDiffID(layer.diffID); err != nil {
return err
}
if err := tx.SetSize(layer.size); err != nil {
Function parseExpr
has 6 return statements (exceeds 4 allowed). Open
Open
func parseExpr(e ast.Expr) (parsedExpr, error) {
var parsed parsedExpr
switch i := e.(type) {
case *ast.Ident:
parsed.value += i.Name
Method Config.ValidatePlatformConfig
has 6 return statements (exceeds 4 allowed). Open
Open
func (conf *Config) ValidatePlatformConfig() error {
if conf.EnableUserlandProxy {
if conf.UserlandProxyPath == "" {
return errors.New("invalid userland-proxy-path: userland-proxy is enabled, but userland-proxy-path is not set")
}