Showing 1,468 of 1,914 total issues
Method pluginRouter.upgradePlugin
has 6 return statements (exceeds 4 allowed). Open
Open
func (pr *pluginRouter) upgradePlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return errors.Wrap(err, "failed to parse form")
}
Method imageRouter.postImagesTag
has 6 return statements (exceeds 4 allowed). Open
Open
func (ir *imageRouter) postImagesTag(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
Method networkRouter.postNetworkCreate
has 6 return statements (exceeds 4 allowed). Open
Open
func (n *networkRouter) postNetworkCreate(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
Method session.searchRepositories
has 6 return statements (exceeds 4 allowed). Open
Open
func (r *session) searchRepositories(term string, limit int) (*registry.SearchResults, error) {
if limit == 0 {
limit = defaultSearchLimit
}
if limit < 1 || limit > 100 {
Function newV1Endpoint
has 6 return statements (exceeds 4 allowed). Open
Open
func newV1Endpoint(index *registry.IndexInfo, headers http.Header) (*v1Endpoint, error) {
tlsConfig, err := newTLSConfig(index.Name, index.Secure)
if err != nil {
return nil, err
}
Method Builder.Prune
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *Builder) Prune(ctx context.Context, opts types.BuildCachePruneOptions) (int64, []string, error) {
ch := make(chan *controlapi.UsageRecord)
eg, ctx := errgroup.WithContext(ctx)
Method containerManager.Run
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *containerManager) Run(ctx context.Context, cID string, stdout, stderr io.Writer) (err error) {
attached := make(chan struct{})
errCh := make(chan error, 1)
go func() {
errCh <- c.backend.ContainerAttachRaw(cID, nil, stdout, stderr, true, attached)
Method pluginRouter.pullPlugin
has 6 return statements (exceeds 4 allowed). Open
Open
func (pr *pluginRouter) pullPlugin(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return errors.Wrap(err, "failed to parse form")
}
Function notifyClosed
has 6 return statements (exceeds 4 allowed). Open
Open
func notifyClosed(ctx context.Context, conn net.Conn, notify func()) {
sc, ok := conn.(syscall.Conn)
if !ok {
log.G(ctx).Debug("notifyClosed: conn does not support close notifications")
return
Method Service.searchUnfiltered
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *Service) searchUnfiltered(ctx context.Context, term string, limit int, authConfig *registry.AuthConfig, headers http.Header) (*registry.SearchResults, error) {
// TODO Use ctx when searching for repositories
if hasScheme(term) {
return nil, invalidParamf("invalid repository name: repository name (%s) should not have a scheme", term)
}
Function dispatch
has 6 return statements (exceeds 4 allowed). Open
Open
func dispatch(ctx context.Context, d dispatchRequest, cmd instructions.Command) (err error) {
if c, ok := cmd.(instructions.PlatformSpecific); ok {
err := c.CheckPlatform(d.state.operatingSystem)
if err != nil {
return errdefs.InvalidParameter(err)
Method Worker.GetRemotes
has 6 return statements (exceeds 4 allowed). Open
Open
func (w *Worker) GetRemotes(ctx context.Context, ref cache.ImmutableRef, createIfNeeded bool, _ cacheconfig.RefConfig, all bool, s session.Group) ([]*solver.Remote, error) {
if ref == nil {
return nil, nil
}
var diffIDs []layer.DiffID
Consider simplifying this complex logical expression. Open
Open
if d.state.operatingSystem == "windows" &&
d.state.runConfig.ArgsEscaped != argsEscaped &&
((len(runConfig.Cmd) == 1 && strings.ToLower(runConfig.Cmd[0]) != `c:\windows\system32\cmd.exe` && len(runConfig.Shell) == 0) || (len(runConfig.Cmd) > 1)) {
Method Builder.DiskUsage
has 6 return statements (exceeds 4 allowed). Open
Open
func (b *Builder) DiskUsage(ctx context.Context) ([]*types.BuildCache, error) {
duResp, err := b.controller.DiskUsage(ctx, &controlapi.DiskUsageRequest{})
if err != nil {
return nil, err
}
Method systemRouter.getDiskUsage
has 6 return statements (exceeds 4 allowed). Open
Open
func (s *systemRouter) getDiskUsage(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
Function ReadJSON
has 6 return statements (exceeds 4 allowed). Open
Open
func ReadJSON(r *http.Request, out interface{}) error {
err := CheckForJSON(r)
if err != nil {
return err
}
Method containerRouter.postContainersAttach
has 6 return statements (exceeds 4 allowed). Open
Open
func (c *containerRouter) postContainersAttach(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
err := httputils.ParseForm(r)
if err != nil {
return err
}
Function handleSysctlBC
has 6 return statements (exceeds 4 allowed). Open
Open
func handleSysctlBC(
hostConfig *container.HostConfig,
netConfig *network.NetworkingConfig,
version string,
) (string, error) {
Method Daemon.SystemDiskUsage
has 6 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) SystemDiskUsage(ctx context.Context, opts system.DiskUsageOptions) (*types.DiskUsage, error) {
eg, ctx := errgroup.WithContext(ctx)
var containers []*container.Summary
if opts.Containers {
Method task.Exec
has 6 return statements (exceeds 4 allowed). Open
Open
func (t *task) Exec(ctx context.Context, processID string, spec *specs.Process, withStdin bool, attachStdio libcontainerdtypes.StdioCallback) (libcontainerdtypes.Process, error) {
var (
p containerd.Process
rio cio.IO
stdinCloseSync = make(chan containerd.Process, 1)