Showing 1,468 of 1,914 total issues
Function Join
has 10 return statements (exceeds 4 allowed). Open
Open
func Join(ctx context.Context, path, subpath string) (*SafePath, error) {
base, subpart, err := evaluatePath(path, subpath)
if err != nil {
return nil, err
}
Method Manager.Pull
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (pm *Manager) Pull(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *registry.AuthConfig, privileges types.PluginPrivileges, out io.Writer, opts ...CreateOpt) error {
Method puller.pullManifestList
has 10 return statements (exceeds 4 allowed). Open
Open
func (p *puller) pullManifestList(ctx context.Context, ref reference.Named, mfstList *manifestlist.DeserializedManifestList, pp *ocispec.Platform) (id digest.Digest, manifestListDigest digest.Digest, err error) {
manifestListDigest, err = schema2ManifestDigest(ref, mfstList)
if err != nil {
return "", "", err
}
Method addrSpace.allocatePredefinedPool
has 10 return statements (exceeds 4 allowed). Open
Open
func (aSpace *addrSpace) allocatePredefinedPool(reserved []netip.Prefix) (netip.Prefix, error) {
aSpace.mu.Lock()
defer aSpace.mu.Unlock()
var pdfID int
Method Endpoint.sbLeave
has 10 return statements (exceeds 4 allowed). Open
Open
func (ep *Endpoint) sbLeave(ctx context.Context, sb *Sandbox, force bool) error {
n, err := ep.getNetworkFromStore()
if err != nil {
return fmt.Errorf("failed to get network from store during leave: %v", err)
}
Method Resolver.setupIPTable
has 10 return statements (exceeds 4 allowed). Open
Open
func (r *Resolver) setupIPTable() error {
if r.err != nil {
return r.err
}
laddr := r.conn.LocalAddr().String()
Method bridgeNetwork.addPortMappings
has 10 return statements (exceeds 4 allowed). Open
Open
func (n *bridgeNetwork) addPortMappings(
ctx context.Context,
epAddrV4, epAddrV6 *net.IPNet,
cfg []types.PortBinding,
defHostIP net.IP,
Function setupIPChains
has 10 return statements (exceeds 4 allowed). Open
Open
func setupIPChains(config configuration, version iptables.IPVersion) (natChain *iptables.ChainInfo, filterChain *iptables.ChainInfo, isolationChain1 *iptables.ChainInfo, isolationChain2 *iptables.ChainInfo, retErr error) {
// Sanity check.
if version == iptables.IPv4 && !config.EnableIPTables {
return nil, nil, nil, nil, errors.New("cannot create new chains, iptables is disabled")
}
Function newImageBuildOptions
has 10 return statements (exceeds 4 allowed). Open
Open
func newImageBuildOptions(ctx context.Context, r *http.Request) (*types.ImageBuildOptions, error) {
options := &types.ImageBuildOptions{
Version: types.BuilderV1, // Builder V1 is the default, but can be overridden
Dockerfile: r.FormValue("dockerfile"),
SuppressOutput: httputils.BoolValue(r, "q"),
Method networkRouter.getNetwork
has 10 return statements (exceeds 4 allowed). Open
Open
func (n *networkRouter) getNetwork(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
Consider simplifying this complex logical expression. Open
Open
if s != "paused" &&
s != "restarting" &&
s != "removing" &&
s != "running" &&
s != "dead" &&
Method imageRouter.postImagesCreate
has 10 return statements (exceeds 4 allowed). Open
Open
func (ir *imageRouter) postImagesCreate(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
Method Daemon.setupMounts
has 10 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) setupMounts(ctx context.Context, c *container.Container) ([]container.Mount, func(context.Context) error, error) {
var mounts []container.Mount
// TODO: tmpfs mounts should be part of Mountpoints
tmpfsMounts := make(map[string]bool)
tmpfsMountInfo, err := c.TmpfsMounts()
Method cacheAdaptor.Get
has 10 return statements (exceeds 4 allowed). Open
Open
func (c cacheAdaptor) Get(id image.ID) (*image.Image, error) {
ctx := context.TODO()
ref := id.String()
outImg, err := c.is.GetImage(ctx, id.String(), backend.GetImageOpts{})
Method cmdProbe.run
has 10 return statements (exceeds 4 allowed). Open
Open
func (p *cmdProbe) run(ctx context.Context, d *Daemon, cntr *container.Container) (*containertypes.HealthcheckResult, error) {
startTime := time.Now()
cmdSlice := strslice.StrSlice(cntr.Config.Healthcheck.Test)[1:]
if p.shell {
cmdSlice = append(getShell(cntr), cmdSlice...)
Method Daemon.ContainerTop
has 10 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) ContainerTop(name string, psArgs string) (*container.ContainerTopOKBody, error) {
if psArgs == "" {
psArgs = "-ef"
}
Method controller.Prepare
has 10 return statements (exceeds 4 allowed). Open
Open
func (r *controller) Prepare(ctx context.Context) error {
if err := r.checkClosed(); err != nil {
return err
}
Function waitUntilFlushedImpl
has 10 return statements (exceeds 4 allowed). Open
Open
func waitUntilFlushedImpl(s *journald) error {
if s.readSyncTimeout == 0 {
return nil
}
Method Sender.Send
has 10 return statements (exceeds 4 allowed). Open
Open
func (s *Sender) Send(message string, priority journal.Priority, vars map[string]string) error {
if s.TB != nil {
s.TB.Helper()
}
var buf bytes.Buffer
Method Daemon.ContainerStats
has 10 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) ContainerStats(ctx context.Context, prefixOrName string, config *backend.ContainerStatsConfig) error {
ctr, err := daemon.GetContainer(prefixOrName)
if err != nil {
return err
}