Showing 1,468 of 1,914 total issues
Method imageRouter.postImagesPush
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (ir *imageRouter) postImagesPush(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
metaHeaders := map[string][]string{}
for k, v := range r.Header {
if strings.HasPrefix(k, "X-Meta-") {
metaHeaders[k] = v
Function withCommonOptions
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func withCommonOptions(daemon *Daemon, daemonCfg *dconfig.Config, c *container.Container) coci.SpecOpts {
return func(ctx context.Context, _ coci.Client, _ *containers.Container, s *coci.Spec) error {
if c.BaseFS == "" {
return errors.New("populateCommonSpec: BaseFS of container " + c.ID + " is unexpectedly empty")
}
Method containerRouter.wsContainersAttach
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *containerRouter) wsContainersAttach(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
containerName := vars["name"]
Method ImageService.deleteAll
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (i *ImageService) deleteAll(ctx context.Context, imgID image.ID, all []images.Image, c conflictType, prune bool) (records []imagetypes.DeleteResponse, err error) {
// Workaround for: https://github.com/moby/buildkit/issues/3797
possiblyDeletedConfigs := map[digest.Digest]struct{}{}
if len(all) > 0 && i.content != nil {
handled := map[digest.Digest]struct{}{}
Function New
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func New(info logger.Info) (logger.Logger, error) {
containerStreamConfig, err := newStreamConfig(info)
if err != nil {
return nil, err
}
Function New
has 55 lines of code (exceeds 50 allowed). Consider refactoring. 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
Method reader.readLogs
has 55 lines of code (exceeds 50 allowed). Consider refactoring. 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.
Function waitUntilFlushedImpl
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func waitUntilFlushedImpl(s *journald) error {
if s.readSyncTimeout == 0 {
return nil
}
Function SwarmFromGRPC
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func SwarmFromGRPC(c swarmapi.Cluster) types.Swarm {
swarm := types.Swarm{
ClusterInfo: types.ClusterInfo{
ID: c.ID,
Spec: types.Spec{
Function toContainerdResources
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func toContainerdResources(resources container.Resources) *libcontainerdtypes.Resources {
var r libcontainerdtypes.Resources
if resources.BlkioWeight != 0 {
r.BlockIO = &specs.LinuxBlockIO{
Method Daemon.containerCopy
has 55 lines of code (exceeds 50 allowed). Consider refactoring. 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()
Function detectManifestBlobMediaType
has 12 return statements (exceeds 4 allowed). Open
Open
func detectManifestBlobMediaType(dt []byte) (string, error) {
var mfst struct {
MediaType string `json:"mediaType"`
Manifests json.RawMessage `json:"manifests"` // oci index, manifest list
Config json.RawMessage `json:"config"` // schema2 Manifest
Method networkConfiguration.fromLabels
has 12 return statements (exceeds 4 allowed). Open
Open
func (c *networkConfiguration) fromLabels(labels map[string]string) error {
var err error
for label, value := range labels {
switch label {
case BridgeName:
Method driver.CreateNetwork
has 12 return statements (exceeds 4 allowed). Open
Open
func (d *driver) CreateNetwork(id string, option map[string]interface{}, nInfo driverapi.NetworkInfo, ipV4Data, ipV6Data []driverapi.IPAMData) error {
if _, err := d.getNetwork(id); err == nil {
return types.ForbiddenErrorf("network %s exists", id)
}
Method systemRouter.getEvents
has 12 return statements (exceeds 4 allowed). Open
Open
func (s *systemRouter) getEvents(ctx context.Context, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
if err := httputils.ParseForm(r); err != nil {
return err
}
Method ImageService.Images
has 12 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) Images(ctx context.Context, opts imagetypes.ListOptions) ([]*imagetypes.Summary, error) {
if err := opts.Filters.Validate(acceptedImageFilterTags); err != nil {
return nil, err
}
Method ImageService.pullTag
has 12 return statements (exceeds 4 allowed). 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 {
var opts []containerd.RemoteOpt
if platform != nil {
opts = append(opts, containerd.WithPlatform(platforms.Format(*platform)))
}
Method Cluster.ServiceLogs
has 12 return statements (exceeds 4 allowed). Open
Open
func (c *Cluster) ServiceLogs(ctx context.Context, selector *backend.LogSelector, config *container.LogsOptions) (<-chan *backend.LogMessage, error) {
c.mu.RLock()
defer c.mu.RUnlock()
state := c.currentNodeState()
Method ImageService.pushRef
has 12 return statements (exceeds 4 allowed). Open
Open
func (i *ImageService) pushRef(ctx context.Context, targetRef reference.Named, platform *ocispec.Platform, metaHeaders map[string][]string, authConfig *registry.AuthConfig, out progress.Output) (retErr error) {
leasedCtx, release, err := i.client.WithLease(ctx)
if err != nil {
return err
}
Method Daemon.ContainerExecStart
has 12 return statements (exceeds 4 allowed). Open
Open
func (daemon *Daemon) ContainerExecStart(ctx context.Context, name string, options backend.ExecStartConfig) (err error) {
var (
cStdin io.ReadCloser
cStdout, cStderr io.Writer
)