Showing 1,904 of 1,904 total issues
Method client.NewContainer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (c *client) NewContainer(_ context.Context, id string, spec *specs.Spec, shim string, runtimeOptions interface{}, opts ...containerd.NewContainerOpts) (libcontainerdtypes.Container, error) {
Method ImageService.pullForBuilder
has 7 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) pullForBuilder(ctx context.Context, name string, authConfigs map[string]registry.AuthConfig, output io.Writer, platform *ocispec.Platform) (*ocispec.Descriptor, error) {
ref, err := reference.ParseNormalizedNamed(name)
if err != nil {
return nil, err
}
Avoid deeply nested control flow statements. Open
Open
} else if !allTags {
if tagged, ok := repoRef.(reference.Tagged); ok {
if tag == "" {
tag = tagged.Tag()
} else if tag != tagged.Tag() {
Method Cluster.resolveSystemAddrViaSubnetCheck
has 7 return statements (exceeds 4 allowed). Open
Open
func (c *Cluster) resolveSystemAddrViaSubnetCheck() (net.IP, error) {
// Use the system's only IP address, or fail if there are
// multiple addresses to choose from. Skip interfaces which
// are managed by docker via subnet check.
interfaces, err := net.Interfaces()
Function initClusterSpec
has 7 return statements (exceeds 4 allowed). Open
Open
func initClusterSpec(node *swarmnode.Node, spec types.Spec) error {
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
defer cancel()
for conn := range node.ListenControlSocket(ctx) {
if ctx.Err() != nil {
Function newController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func newController(b executorpkg.Backend, i executorpkg.ImageBackend, v executorpkg.VolumeBackend, task *api.Task, node *api.NodeDescription, dependencies exec.DependencyGetter) (*controller, error) {
Method ImageManifest.IsPseudoImage
has 7 return statements (exceeds 4 allowed). Open
Open
func (im *ImageManifest) IsPseudoImage(ctx context.Context) (bool, error) {
if im.IsAttestation() {
return true, nil
}
Function resolveInterfaceAddr
has 7 return statements (exceeds 4 allowed). Open
Open
func resolveInterfaceAddr(specifiedInterface string) (net.IP, error) {
// Use a specific interface's IP address.
intf, err := net.InterfaceByName(specifiedInterface)
if err != nil {
return nil, errNoSuchInterface
Avoid deeply nested control flow statements. Open
Open
} else if ctnr.State.ExitCode != 0 {
return &exitError{code: ctnr.State.ExitCode, cause: healthErr}
}
Function writeContentsForImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func writeContentsForImage(ctx context.Context, snName string, cs content.Store,
newConfig imagespec.DockerOCIImage, layers []ocispec.Descriptor,
containerConfig container.Config,
Method ImageService.PullImage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (i *ImageService) PullImage(ctx context.Context, baseRef reference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registrytypes.AuthConfig, outStream io.Writer) (retErr error) {
Avoid deeply nested control flow statements. Open
Open
if isLastManager(reachable, unreachable) {
msg += "Removing the last manager erases all current state of the swarm. Use `--force` to ignore this message. "
return errors.WithStack(notAvailableError(msg))
}
Method ImageService.pullTag
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (i *ImageService) pullTag(ctx context.Context, ref reference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registrytypes.AuthConfig, out progress.Output) error {
Function newContainerAdapter
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func newContainerAdapter(b executorpkg.Backend, i executorpkg.ImageBackend, v executorpkg.VolumeBackend, task *api.Task, node *api.NodeDescription, dependencies exec.DependencyGetter) (*containerAdapter, error) {
Function newNetworkAttacherController
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func newNetworkAttacherController(b executorpkg.Backend, i executorpkg.ImageBackend, v executorpkg.VolumeBackend, task *api.Task, node *api.NodeDescription, dependencies exec.DependencyGetter) (*networkAttacherController, error) {
Function validateHealthCheck
has 7 return statements (exceeds 4 allowed). Open
Open
func validateHealthCheck(healthConfig *containertypes.HealthConfig) error {
if healthConfig == nil {
return nil
}
if healthConfig.Interval != 0 && healthConfig.Interval < containertypes.MinimumDuration {
Avoid deeply nested control flow statements. Open
Open
if firstPartial {
msg.Timestamp = time.Now().UTC()
partialTS = msg.Timestamp
partialid = stringid.GenerateRandomID()
ordinal = 1
Method Daemon.Kill
has 7 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) Kill(container *containerpkg.Container) error {
if !container.IsRunning() {
return errNotRunning(container.ID)
}
Avoid deeply nested control flow statements. Open
Open
if path[n] == '.' {
break
}
Function ValidateLogOpt
has 7 return statements (exceeds 4 allowed). Open
Open
func ValidateLogOpt(cfg map[string]string) error {
address, err := parseAddress(cfg["gelf-address"])
if err != nil {
return err
}