Showing 1,468 of 1,914 total issues
Method Builder.performCopy
has 8 return statements (exceeds 4 allowed). Open
Open
func (b *Builder) performCopy(ctx context.Context, req dispatchRequest, inst copyInstruction) error {
state := req.state
srcHash := getSourceHashFromInfos(inst.infos)
var chownComment string
Method Config.CopyStreams
has 8 return statements (exceeds 4 allowed). Open
Open
func (c *Config) CopyStreams(ctx context.Context, cfg *AttachConfig) <-chan error {
var group errgroup.Group
// Connect stdin of container to the attach stdin stream.
if cfg.Stdin != nil {
Method Builder.dispatchDockerfileWithCancellation
has 8 return statements (exceeds 4 allowed). Open
Open
func (b *Builder) dispatchDockerfileWithCancellation(ctx context.Context, parseResult []instructions.Stage, metaArgs []instructions.ArgCommand, escapeToken rune, source builder.Source) (*dispatchState, error) {
dispatchRequest := dispatchRequest{}
buildArgs := NewBuildArgs(b.options.BuildArgs)
totalCommands := len(metaArgs) + len(parseResult)
currentCommandIndex := 1
Method Daemon.initNetworkController
has 8 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) initNetworkController(daemonCfg *config.Config, activeSandboxes map[string]interface{}) error {
netOptions, err := daemon.networkOptions(daemonCfg, nil, daemon.id, nil)
if err != nil {
return err
}
Function ReplaceContainer
has 8 return statements (exceeds 4 allowed). Open
Open
func ReplaceContainer(ctx context.Context, client types.Client, id string, spec *specs.Spec, shim string, runtimeOptions interface{}, opts ...containerd.NewContainerOpts) (types.Container, error) {
newContainer := func() (types.Container, error) {
return client.NewContainer(ctx, id, spec, shim, runtimeOptions, opts...)
}
ctr, err := newContainer()
Method ImageService.ImportImage
has 8 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) ImportImage(ctx context.Context, ref reference.Named, platform *ocispec.Platform, msg string, layerReader io.Reader, changes []string) (image.ID, error) {
refString := ""
if ref != nil {
refString = ref.String()
}
Function handleMACAddressBC
has 8 return statements (exceeds 4 allowed). Open
Open
func handleMACAddressBC(config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, version string) (string, error) {
deprecatedMacAddress := config.MacAddress //nolint:staticcheck // ignore SA1019: field is deprecated, but still used on API < v1.44.
// For older versions of the API, migrate the container-wide MAC address to EndpointsConfig.
if versions.LessThan(version, "1.44") {
Method Cluster.GetTasks
has 8 return statements (exceeds 4 allowed). Open
Open
func (c *Cluster) GetTasks(options apitypes.TaskListOptions) ([]types.Task, error) {
var r *swarmapi.ListTasksResponse
err := c.lockedManagerAction(func(ctx context.Context, state nodeState) error {
filterTransform := func(filter filters.Args) error {
Method Cluster.resolveSystemAddr
has 8 return statements (exceeds 4 allowed). Open
Open
func (c *Cluster) resolveSystemAddr() (net.IP, error) {
// Use the system's only device IP address, or fail if there are
// multiple addresses to choose from.
interfaces, err := nlwrap.LinkList()
if err != nil {
Method controller.Logs
has 8 return statements (exceeds 4 allowed). Open
Open
func (r *controller) Logs(ctx context.Context, publisher exec.LogPublisher, options api.LogSubscriptionOptions) error {
if err := r.checkClosed(); err != nil {
return err
}
Method ImageService.CreateImage
has 8 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) CreateImage(ctx context.Context, config []byte, parent string, layerDigest digest.Digest) (builder.Image, error) {
imgToCreate, err := dimage.NewFromJSON(config)
if err != nil {
return nil, err
}
Method rwlayer.Commit
has 8 return statements (exceeds 4 allowed). Open
Open
func (rw *rwlayer) Commit() (_ builder.ROLayer, outErr error) {
snapshotter := rw.c.SnapshotService(rw.snapshotter)
key := stringid.GenerateRandomID()
Method ImageService.CommitImage
has 8 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) CommitImage(ctx context.Context, cc backend.CommitConfig) (image.ID, error) {
container := i.containers.Get(cc.ContainerID)
cs := i.content
var parentManifest ocispec.Manifest
Method ImageService.TagImage
has 8 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) TagImage(ctx context.Context, imageID image.ID, newTag reference.Named) error {
targetImage, err := i.resolveImage(ctx, imageID.String())
if err != nil {
return errors.Wrapf(err, "failed to resolve image id %q to a descriptor", imageID.String())
}
Method Cluster.Leave
has 8 return statements (exceeds 4 allowed). Open
Open
func (c *Cluster) Leave(ctx context.Context, force bool) error {
c.controlMutex.Lock()
defer c.controlMutex.Unlock()
c.mu.Lock()
Method reader.initialSeekTail
has 8 return statements (exceeds 4 allowed). Open
Open
func (r *reader) initialSeekTail() (bool, error) {
var err error
if r.config.Until.IsZero() {
err = r.j.SeekTail()
} else {
Function ValidateLogOpts
has 8 return statements (exceeds 4 allowed). Open
Open
func ValidateLogOpts(name string, cfg map[string]string) error {
if name == "none" {
return nil
}
Method reader.readLogs
has 8 return statements (exceeds 4 allowed). Open
Open
func (r *reader) readLogs(ctx context.Context) {
defer close(r.logWatcher.Msg)
// Make sure the ready channel is closed in the event of an early
// return.
Method Cluster.Join
has 8 return statements (exceeds 4 allowed). Open
Open
func (c *Cluster) Join(req types.JoinRequest) error {
c.controlMutex.Lock()
defer c.controlMutex.Unlock()
c.mu.Lock()
if c.nr != nil {
Method pluginAdapterWithRead.ReadLogs
has 8 return statements (exceeds 4 allowed). Open
Open
func (a *pluginAdapterWithRead) ReadLogs(ctx context.Context, config ReadConfig) *LogWatcher {
watcher := NewLogWatcher()
go func() {
defer close(watcher.Msg)