Showing 1,904 of 1,904 total issues
Consider simplifying this complex logical expression. Open
Open
if s != "paused" &&
s != "restarting" &&
s != "removing" &&
s != "running" &&
s != "dead" &&
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 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 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 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
}
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"
}
Function validateHostConfig
has 10 return statements (exceeds 4 allowed). Open
Open
func validateHostConfig(hostConfig *containertypes.HostConfig) error {
if hostConfig == nil {
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
}
Function New
has 10 return statements (exceeds 4 allowed). Open
Open
func New(info logger.Info) (logger.Logger, error) {
// parse gelf address
address, err := parseAddress(info.Config["gelf-address"])
if err != nil {
return nil, err
Consider simplifying this complex logical expression. Open
Open
if !splunkURL.IsAbs() ||
(splunkURL.Scheme != "http" && splunkURL.Scheme != "https") ||
(splunkURL.Path != "" && splunkURL.Path != "/") ||
splunkURL.RawQuery != "" ||
splunkURL.Fragment != "" {
Function waitUntilFlushedImpl
has 10 return statements (exceeds 4 allowed). Open
Open
func waitUntilFlushedImpl(s *journald) error {
if s.readSyncTimeout == 0 {
return nil
}
Consider simplifying this complex logical expression. Open
Open
if path[1] == ':' &&
('0' <= c && c <= '9' || 'a' <= c && c <= 'z' ||
'A' <= c && c <= 'Z') {
Method Daemon.containerExtractToDir
has 10 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) containerExtractToDir(container *container.Container, path string, copyUIDGID, noOverwriteDirNonDir bool, content io.Reader) (err error) {
container.Lock()
defer container.Unlock()
cfs, err := daemon.openContainerFS(container)
Method Daemon.createNetwork
has 10 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) createNetwork(cfg *config.Config, create networktypes.CreateRequest, id string, agent bool) (*networktypes.CreateResponse, error) {
if network.IsPredefined(create.Name) {
return nil, PredefinedNetworkError(create.Name)
}
Method ImageService.GetImageAndReleasableLayer
has 10 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) GetImageAndReleasableLayer(ctx context.Context, refOrID string, opts backend.GetImageAndLayerOptions) (builder.Image, builder.ROLayer, error) {
if refOrID == "" { // FROM scratch
if runtime.GOOS == "windows" {
return nil, nil, fmt.Errorf(`"FROM scratch" is not supported on Windows`)
}
Function New
has 10 return statements (exceeds 4 allowed). Open
Open
func New(name string, config Options) (Driver, error) {
ctx := context.TODO()
if name != "" {
log.G(ctx).Infof("[graphdriver] trying configured driver: %s", name)
if err := checkRemoved(name); err != nil {
Function Validate
has 10 return statements (exceeds 4 allowed). Open
Open
func Validate(config *Config) error {
// validate log-level
if config.LogLevel != "" {
// FIXME(thaJeztah): find a better way for this; this depends on knowledge of containerd's log package internals.
// Alternatively: try log.SetLevel(config.LogLevel), and restore the original level, but this also requires internal knowledge.
Consider simplifying this complex logical expression. Open
Open
if oldStat.Mode() != newStat.Mode() ||
oldStat.UID() != newStat.UID() ||
oldStat.GID() != newStat.GID() ||
oldStat.Rdev() != newStat.Rdev() ||
// Don't look at size or modification time for dirs, its not a good
Function changes
has 10 return statements (exceeds 4 allowed). Open
Open
func changes(layers []string, rw string, dc deleteChange, sc skipChange) ([]Change, error) {
var (
changes []Change
changedDirs = make(map[string]struct{})
)