Showing 1,468 of 1,914 total issues
Method PluginSpec.MarshalToSizedBuffer
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (m *PluginSpec) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
Method container.createIO
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *container) createIO(fifos *cio.FIFOSet, stdinCloseSync chan containerd.Process, attachStdio libcontainerdtypes.StdioCallback) (cio.IO, error) {
var (
io *cio.DirectIO
err error
)
Method process.reap
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (p *process) reap() {
logger := p.ctr.client.logger.WithFields(log.Fields{
"container": p.ctr.id,
"process": p.id,
})
Function ServiceFromGRPC
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func ServiceFromGRPC(s swarmapi.Service) (types.Service, error) {
curSpec, err := serviceSpecFromGRPC(&s.Spec)
if err != nil {
return types.Service{}, err
}
Method follow.Do
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (fl *follow) Do(ctx context.Context, f *os.File, read logPos) {
fl.log = log.G(ctx).WithFields(log.Fields{
"module": "logger",
"file": f.Name(),
})
Method logStream.collectBatch
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (l *logStream) collectBatch(created chan bool) {
// Wait for the logstream/group to be created
<-created
flushInterval := l.forceFlushInterval
if flushInterval <= 0 {
Function New
has 52 lines of code (exceeds 50 allowed). Consider refactoring. 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 {
Method ImageService.GetImage
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (i *ImageService) GetImage(ctx context.Context, refOrID string, options backend.GetImageOpts) (retImg *image.Image, retErr error) {
defer func() {
if retErr != nil || retImg == nil || options.Platform == nil {
return
}
Function detectManifestBlobMediaType
has 51 lines of code (exceeds 50 allowed). Consider refactoring. 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
Function Go
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func Go(flags int, setupfn func() error, fn func()) error {
started := make(chan error)
maskedFlags := flags
for f := range reversibleSetnsFlags {
Method Client.ContainerCreate
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (cli *Client) ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, platform *ocispec.Platform, containerName string) (container.CreateResponse, error) {
var response container.CreateResponse
// Make sure we negotiated (if the client is configured to do so),
// as code below contains API-version specific handling of options.
Function serviceSpecFromGRPC
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func serviceSpecFromGRPC(spec *swarmapi.ServiceSpec) (*types.ServiceSpec, error) {
if spec == nil {
return nil, nil
}
Method Daemon.ContainerInspect
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (daemon *Daemon) ContainerInspect(ctx context.Context, name string, options backend.ContainerInspectOptions) (*containertypes.InspectResponse, error) {
ctr, err := daemon.GetContainer(name)
if err != nil {
return nil, err
}
Function newStreamConfig
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func newStreamConfig(info logger.Info) (*logStreamConfig, error) {
logGroupName := info.Config[logGroupKey]
logStreamName, err := loggerutils.ParseLogTag(info, "{{.FullID}}")
if err != nil {
return nil, err
Function MergeSwarmSpecToGRPC
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func MergeSwarmSpecToGRPC(s types.Spec, spec swarmapi.ClusterSpec) (swarmapi.ClusterSpec, error) {
// We take the initSpec (either created from scratch, or returned by swarmkit),
// and will only change the value if the one taken from types.Spec is not nil or 0.
// In other words, if the value taken from types.Spec is nil or 0, we will maintain the status quo.
if s.Annotations.Name != "" {
Method Cluster.Info
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (c *Cluster) Info(ctx context.Context) types.Info {
info := types.Info{
NodeAddr: c.GetAdvertiseAddress(),
}
c.mu.RLock()
Method LocalRegistry.Scan
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (l *LocalRegistry) Scan() ([]string, error) {
var names []string
dirEntries, err := os.ReadDir(l.socketsPath)
if err != nil && !os.IsNotExist(err) {
return nil, errors.Wrap(err, "error reading dir entries")
Method puller.pullSchema1
has 10 return statements (exceeds 4 allowed). Open
Open
func (p *puller) pullSchema1(ctx context.Context, ref reference.Reference, unverifiedManifest *schema1.SignedManifest, platform *ocispec.Platform) (id digest.Digest, manifestDigest digest.Digest, err error) {
if platform != nil {
// Early bath if the requested OS doesn't match that of the configuration.
// This avoids doing the download, only to potentially fail later.
if err := image.CheckOS(platform.OS); err != nil {
Method Manager.Pull
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
func (pm *Manager) Pull(ctx context.Context, ref reference.Named, name string, metaHeader http.Header, authConfig *registry.AuthConfig, privileges types.PluginPrivileges, outStream io.Writer, opts ...CreateOpt) (err error) {
Method tarexporter.legacyLoad
has 10 return statements (exceeds 4 allowed). Open
Open
func (l *tarexporter) legacyLoad(tmpDir string, outStream io.Writer, progressOutput progress.Output) error {
if runtime.GOOS == "windows" {
return errors.New("Windows does not support legacy loading of images")
}