Showing 1,468 of 1,914 total issues
Function parseConfig
has 12 return statements (exceeds 4 allowed). Open
Open
func parseConfig(cfg map[string]string) (fluent.Config, error) {
var config fluent.Config
loc, err := parseAddress(cfg[addressKey])
if err != nil {
Method Daemon.ProcessEvent
has 12 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) ProcessEvent(id string, e libcontainerdtypes.EventType, ei libcontainerdtypes.EventInfo) error {
c, err := daemon.GetContainer(id)
if err != nil {
return errors.Wrapf(err, "could not find container %s", id)
}
Method Daemon.registerMountPoints
has 12 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) registerMountPoints(container *container.Container, hostConfig *containertypes.HostConfig, defaultReadOnlyNonRecursive bool) (retErr error) {
binds := map[string]bool{}
mountPoints := map[string]*volumemounts.MountPoint{}
parser := volumemounts.NewParser()
Function splitConfigRootFSFromTar
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func splitConfigRootFSFromTar(in io.ReadCloser, config *[]byte) io.ReadCloser {
pr, pw := io.Pipe()
go func() {
tarReader := tar.NewReader(in)
tarWriter := tar.NewWriter(pw)
Method Sandbox.delete
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (sb *Sandbox) delete(ctx context.Context, force bool) error {
sb.mu.Lock()
if sb.inDelete {
sb.mu.Unlock()
return types.ForbiddenErrorf("another sandbox delete in progress")
Method networkConfiguration.fromLabels
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *networkConfiguration) fromLabels(labels map[string]string) error {
var err error
for label, value := range labels {
switch label {
case BridgeName:
Method Builder.dispatchDockerfileWithCancellation
has 54 lines of code (exceeds 50 allowed). Consider refactoring. 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
Function toBuildkitPruneInfo
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func toBuildkitPruneInfo(opts types.BuildCachePruneOptions) (client.PruneInfo, error) {
var until time.Duration
untilValues := opts.Filters.Get("until") // canonical
unusedForValues := opts.Filters.Get("unused-for") // deprecated synonym for "until" filter
Method buildRouter.postBuild
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (br *buildRouter) postBuild(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
var (
notVerboseBuffer = bytes.NewBuffer(nil)
version = httputils.VersionFromContext(ctx)
)
Function withCgroups
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func withCgroups(daemon *Daemon, daemonCfg *dconfig.Config, c *container.Container) coci.SpecOpts {
return func(ctx context.Context, _ coci.Client, _ *containers.Container, s *coci.Spec) error {
var cgroupsPath string
scopePrefix := "docker"
parent := "/docker"
Method Daemon.ContainerTop
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (daemon *Daemon) ContainerTop(name string, psArgs string) (*container.ContainerTopOKBody, error) {
if psArgs == "" {
psArgs = "-ef"
}
Method pullProgress.UpdateProgress
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (p pullProgress) UpdateProgress(ctx context.Context, ongoing *jobs, out progress.Output, start time.Time) error {
actives, err := p.store.ListStatuses(ctx, "")
if err != nil {
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
return err
Method Cluster.GetTasks
has 54 lines of code (exceeds 50 allowed). Consider refactoring. 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 {
Function writeContentsForImage
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func writeContentsForImage(ctx context.Context, snName string, cs content.Store,
newConfig imagespec.DockerOCIImage, layers []ocispec.Descriptor,
containerConfig container.Config,
) (
manifestDesc ocispec.Descriptor,
Method ImageService.pruneAll
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (i *ImageService) pruneAll(ctx context.Context, imagesToPrune map[string]containerdimages.Image) (*image.PruneReport, error) {
report := image.PruneReport{}
ctx, span := tracing.StartSpan(ctx, "ImageService.pruneAll")
span.SetAttributes(tracing.Attribute("count", len(imagesToPrune)))
Method ImageService.ImportImage
has 54 lines of code (exceeds 50 allowed). Consider refactoring. 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
}
Method Daemon.update
has 54 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (daemon *Daemon) update(name string, hostConfig *container.HostConfig) error {
if hostConfig == nil {
return nil
}
Method Controller.rmServiceBinding
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (c *Controller) rmServiceBinding(svcName, svcID, nID, eID, containerName string, vip net.IP, ingressPorts []*PortConfig, serviceAliases []string, taskAliases []string, ip net.IP, method string, deleteSvcRecords bool, fullRemove bool) error {
Function kubernetesSafeOpen
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func kubernetesSafeOpen(base, subpath string) (int, error) {
// syscall.Openat flags used to traverse directories not following symlinks
const nofollowFlags = unix.O_RDONLY | unix.O_NOFOLLOW
// flags for getting file descriptor without following the symlink
const openFDFlags = unix.O_NOFOLLOW | unix.O_PATH
Method transferManager.transfer
has 53 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (tm *transferManager) transfer(key string, xferFunc doFunc, progressOutput progress.Output) (transfer, *watcher) {
tm.mu.Lock()
defer tm.mu.Unlock()
for {