dotcloud/docker

View on GitHub
daemon/images/image_import.go

Summary

Maintainability
A
2 hrs
Test Coverage

Method ImageService.ImportImage has 54 lines of code (exceeds 50 allowed). Consider refactoring.
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
    }
Severity: Minor
Found in daemon/images/image_import.go - About 1 hr to fix

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

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

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

        There are no issues that match your filters.

        Category
        Status