Showing 1,468 of 1,914 total issues
Method Cluster.UnlockSwarm
has 8 return statements (exceeds 4 allowed). Open
Open
func (c *Cluster) UnlockSwarm(req types.UnlockRequest) error {
c.controlMutex.Lock()
defer c.controlMutex.Unlock()
c.mu.RLock()
Method Daemon.cleanupContainer
has 8 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) cleanupContainer(container *container.Container, config backend.ContainerRmConfig) error {
if container.IsRunning() {
if !config.ForceRemove {
if state := container.StateString(); state == "paused" {
return errdefs.Conflict(fmt.Errorf("cannot remove container %q: container is %s and must be unpaused first", container.Name, state))
Method Daemon.setupSecretDir
has 8 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) setupSecretDir(ctr *container.Container) (setupErr error) {
if len(ctr.SecretReferences) == 0 {
return nil
}
Function ValidateLogOpt
has 8 return statements (exceeds 4 allowed). Open
Open
func ValidateLogOpt(cfg map[string]string) error {
for key := range cfg {
switch key {
case logGroupKey:
case logStreamKey:
Method Daemon.containerCopy
has 8 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) containerCopy(container *container.Container, resource string) (rc io.ReadCloser, err error) {
if resource[0] == '/' || resource[0] == '\\' {
resource = resource[1:]
}
container.Lock()
Method ImageService.SquashImage
has 8 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) SquashImage(id, parent string) (string, error) {
var (
img *image.Image
err error
)
Method Daemon.containerArchivePath
has 8 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) containerArchivePath(container *container.Container, path string) (content io.ReadCloser, stat *containertypes.PathStat, err error) {
container.Lock()
defer func() {
if err != nil {
Method ImageService.ImportImage
has 8 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) ImportImage(ctx context.Context, newRef reference.Named, platform *ocispec.Platform, msg string, layerReader io.Reader, changes []string) (image.ID, error) {
if platform == nil {
def := platforms.DefaultSpec()
platform = &def
}
Function collectFileInfo
has 8 return statements (exceeds 4 allowed). Open
Open
func collectFileInfo(sourceDir string) (*FileInfo, error) {
root := newRootFileInfo()
err := filepath.WalkDir(sourceDir, func(path string, _ os.DirEntry, err error) error {
if err != nil {
Function parseUintList
has 8 return statements (exceeds 4 allowed). Open
Open
func parseUintList(val string, maximum int) (map[int]bool, error) {
if val == "" {
return map[int]bool{}, nil
}
Method layerStore.loadLayer
has 8 return statements (exceeds 4 allowed). Open
Open
func (ls *layerStore) loadLayer(layer ChainID) (*roLayer, error) {
cl, ok := ls.layerMap[layer]
if ok {
return cl, nil
}
Function listenFD
has 8 return statements (exceeds 4 allowed). Open
Open
func listenFD(addr string, tlsConfig *tls.Config) ([]net.Listener, error) {
var (
err error
listeners []net.Listener
)
Function CopyInfoDestinationPath
has 8 return statements (exceeds 4 allowed). Open
Open
func CopyInfoDestinationPath(path string) (info CopyInfo, err error) {
maxSymlinkIter := 10 // filepath.EvalSymlinks uses 255, but 10 already seems like a lot.
path = normalizePath(path)
originalPath := path
Method layerStore.ReleaseRWLayer
has 8 return statements (exceeds 4 allowed). Open
Open
func (ls *layerStore) ReleaseRWLayer(l RWLayer) ([]Metadata, error) {
name := l.Name()
ls.locker.Lock(name)
defer ls.locker.Unlock(name)
Function mkdirAs
has 8 return statements (exceeds 4 allowed). Open
Open
func mkdirAs(path string, mode os.FileMode, owner Identity, mkAll, chownExisting bool) error {
path, err := filepath.Abs(path)
if err != nil {
return err
}
Method tarexporter.loadLayer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (l *tarexporter) loadLayer(ctx context.Context, filename string, rootFS image.RootFS, id string, foreignSrc distribution.Descriptor, progressOutput progress.Output) (_ layer.Layer, outErr error) {
Function isValidParent
has 7 return statements (exceeds 4 allowed). Open
Open
func isValidParent(img, parent *image.Image) bool {
if len(img.History) == 0 {
return false
}
if parent == nil || len(parent.History) == 0 && len(parent.RootFS.DiffIDs) == 0 {
Method pushDescriptor.layerAlreadyExists
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ctx context.Context,
progressOutput progress.Output,
diffID layer.DiffID,
checkOtherRepositories bool,
maxExistenceCheckAttempts int,
Method Manager.fetch
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (pm *Manager) fetch(ctx context.Context, ref reference.Named, auth *registry.AuthConfig, out progress.Output, metaHeader http.Header, handlers ...images.Handler) (err error) {
Function calcSize
has 7 return statements (exceeds 4 allowed). Open
Open
func calcSize(ctx context.Context, dir string) (int64, error) {
var size int64
err := filepath.Walk(dir, func(d string, fileInfo os.FileInfo, err error) error {
if err != nil {
// if dir/x disappeared while walking, Size() ignores dir/x.