dotcloud/docker

View on GitHub
daemon/containerd/image_import.go

Summary

Maintainability
B
6 hrs
Test Coverage

Method ImageService.ImportImage has 108 lines of code (exceeds 50 allowed). Consider refactoring.
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()
    }
Severity: Major
Found in daemon/containerd/image_import.go - About 3 hrs to fix

    Method ImageService.ImportImage has 8 return statements (exceeds 4 allowed).
    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()
        }
    Severity: Major
    Found in daemon/containerd/image_import.go - About 50 mins to fix

      Function saveArchive has 7 return statements (exceeds 4 allowed).
      Open

      func saveArchive(ctx context.Context, cs content.Store, layerReader io.Reader) (digest.Digest, digest.Digest, string, error) {
          // Wrap the reader in buffered reader to allow peeks.
          p := pools.BufioReader32KPool
          bufRd := p.Get(layerReader)
          defer p.Put(bufRd)
      Severity: Major
      Found in daemon/containerd/image_import.go - About 45 mins to fix

        Method ImageService.ImportImage has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        func (i *ImageService) ImportImage(ctx context.Context, ref reference.Named, platform *ocispec.Platform, msg string, layerReader io.Reader, changes []string) (image.ID, error) {
        Severity: Minor
        Found in daemon/containerd/image_import.go - About 45 mins to fix

          Function compressAndWriteBlob has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func compressAndWriteBlob(ctx context.Context, cs content.Store, compression archive.Compression, mediaType string, uncompressedLayerReader io.Reader) (digest.Digest, digest.Digest, error) {
          Severity: Minor
          Found in daemon/containerd/image_import.go - About 35 mins to fix

            Function storeJson has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            func storeJson(ctx context.Context, cs content.Ingester, mt string, obj interface{}, labels map[string]string) (ocispec.Descriptor, error) {
            Severity: Minor
            Found in daemon/containerd/image_import.go - About 35 mins to fix

              There are no issues that match your filters.

              Category
              Status