Preparing report...

Report for github.com/aquasecurity/harbor-scanner-trivy

A+    Excellent!    Found 23 issues across 40 files

Tweet

gofmt97%

Gofmt formats Go programs. We run gofmt -s on your code, where -s is for the "simplify" command


go_vet100%

go vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string.

No problems detected. Good job!


gocyclo100%

Gocyclo calculates cyclomatic complexities of functions in Go source code. The cyclomatic complexity of a function is calculated according to the following rules: 1 is the base complexity of a function +1 for each 'if', 'for', 'case', '&&' or '||' Go Report Card warns on functions with cyclomatic complexity > 15.

No problems detected. Good job!


golint45%

Golint is a linter for Go source code.

    • harbor-scanner-trivy/pkg/ext/ambassador_mock.go
    • Line 11: warning: exported type FakeFile should have comment or be unexported (golint)
    • Line 26: warning: exported method FakeFile.Name should have comment or be unexported (golint)
    • Line 34: warning: exported type MockAmbassador should have comment or be unexported (golint)
    • Line 38: warning: exported function NewMockAmbassador should have comment or be unexported (golint)
    • Line 42: warning: exported method MockAmbassador.Environ should have comment or be unexported (golint)
    • Line 47: warning: exported method MockAmbassador.LookPath should have comment or be unexported (golint)
    • Line 52: warning: exported method MockAmbassador.RunCmd should have comment or be unexported (golint)
    • Line 57: warning: exported method MockAmbassador.TempFile should have comment or be unexported (golint)
    • Line 62: warning: exported method MockAmbassador.Remove should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/http/api/server.go
    • Line 16: warning: exported type Server should have comment or be unexported (golint)
    • Line 21: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 75: warning: exported method Server.ListenAndServe should have comment or be unexported (golint)
    • Line 98: warning: exported method Server.Shutdown should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/mock/transformer.go
    • Line 9: warning: exported type Transformer should have comment or be unexported (golint)
    • Line 13: warning: exported function NewTransformer should have comment or be unexported (golint)
    • Line 17: warning: exported method Transformer.Transform should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/mock/enqueuer.go
    • Line 9: warning: exported type Enqueuer should have comment or be unexported (golint)
    • Line 13: warning: exported function NewEnqueuer should have comment or be unexported (golint)
    • Line 17: warning: exported method Enqueuer.Enqueue should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/mock/store.go
    • Line 9: warning: exported type Store should have comment or be unexported (golint)
    • Line 13: warning: exported function NewStore should have comment or be unexported (golint)
    • Line 17: warning: exported method Store.Create should have comment or be unexported (golint)
    • Line 22: warning: exported method Store.Get should have comment or be unexported (golint)
    • Line 27: warning: exported method Store.UpdateStatus should have comment or be unexported (golint)
    • Line 32: warning: exported method Store.UpdateReport should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/trivy/model.go
    • Line 12: warning: exported type ScanReport should have comment or be unexported (golint)
    • Line 17: warning: exported type Metadata should have comment or be unexported (golint)
    • Line 22: warning: exported type VersionInfo should have comment or be unexported (golint)
    • Line 27: warning: exported type Layer should have comment or be unexported (golint)
    • Line 32: warning: exported type CVSSInfo should have comment or be unexported (golint)
    • Line 39: warning: exported type Vulnerability should have comment or be unexported (golint)
    • Line 54: warning: exported function ScanReportFrom should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/harbor/model.go
    • Line 63: warning: exported type Registry should have comment or be unexported (golint)
    • Line 68: warning: exported type Artifact should have comment or be unexported (golint)
    • Line 74: warning: exported type ScanRequest should have comment or be unexported (golint)
    • Line 101: warning: exported type ScanResponse should have comment or be unexported (golint)
    • Line 105: warning: exported type ScanReport should have comment or be unexported (golint)
    • Line 113: warning: exported type Layer should have comment or be unexported (golint)
    • Line 118: warning: comment on exported type CVSSInfo should be of the form "CVSSInfo ..." (with optional leading article) (golint)
    • Line 127: warning: exported type CVSSDetails should have comment or be unexported (golint)
    • Line 151: warning: exported type ScannerAdapterMetadata should have comment or be unexported (golint)
    • Line 157: warning: exported type Scanner should have comment or be unexported (golint)
    • Line 163: warning: exported type Capability should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/trivy/wrapper.go
    • Line 19: warning: exported type ImageRef should have comment or be unexported (golint)
    • Line 29: warning: exported type NoAuth should have comment or be unexported (golint)
    • Line 32: warning: exported type BasicAuth should have comment or be unexported (golint)
    • Line 37: warning: exported type BearerAuth should have comment or be unexported (golint)
    • Line 41: warning: exported type Wrapper should have comment or be unexported (golint)
    • Line 51: warning: exported function NewWrapper should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/trivy/wrapper_mock.go
    • Line 7: warning: exported type MockWrapper should have comment or be unexported (golint)
    • Line 11: warning: exported method MockWrapper.GetVersion should have comment or be unexported (golint)
    • Line 16: warning: exported function NewMockWrapper should have comment or be unexported (golint)
    • Line 20: warning: exported method MockWrapper.Scan should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/job/model.go
    • Line 7: warning: exported type ScanJobStatus should have comment or be unexported (golint)
    • Line 10: warning: exported const Queued should have comment (or a comment on this block) or be unexported (golint)
    • Line 23: warning: exported type ScanJob should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/etc/config.go
    • Line 12: warning: exported type BuildInfo should have comment or be unexported (golint)
    • Line 18: warning: exported type Config should have comment or be unexported (golint)
    • Line 26: warning: exported type Trivy should have comment or be unexported (golint)
    • Line 39: warning: exported type API should have comment or be unexported (golint)
    • Line 49: warning: exported method API.IsTLSEnabled should have comment or be unexported (golint)
    • Line 53: warning: exported type RedisStore should have comment or be unexported (golint)
    • Line 58: warning: exported type JobQueue should have comment or be unexported (golint)
    • Line 63: warning: exported type RedisPool should have comment or be unexported (golint)
    • Line 73: warning: exported function GetLogLevel should have comment or be unexported (golint)
    • Line 84: warning: exported function GetConfig should have comment or be unexported (golint)
    • Line 100: warning: exported function GetScannerMetadata should have comment or be unexported (golint)
    • harbor-scanner-trivy/pkg/http/api/base_handler.go
    • Line 14: warning: exported const HeaderContentType should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: exported type MimeTypeParams should have comment or be unexported (golint)
    • Line 20: warning: exported var MimeTypeVersion should have comment or be unexported (golint)
    • Line 22: warning: exported var MimeTypeOCIImageManifest should have comment or be unexported (golint)
    • Line 23: warning: exported var MimeTypeDockerImageManifestV2 should have comment or be unexported (golint)
    • Line 25: warning: exported var MimeTypeScanResponse should have comment or be unexported (golint)
    • Line 27: warning: comment on exported var MimeTypeHarborVulnerabilityReport should be of the form "MimeTypeHarborVulnerabilityReport ..." (golint)
    • Line 29: warning: exported var MimeTypeSecurityVulnerabilityReport should have comment or be unexported (golint)
    • Line 30: warning: exported var MimeTypeMetadata should have comment or be unexported (golint)
    • Line 31: warning: exported var MimeTypeError should have comment or be unexported (golint)
    • Line 33: warning: exported type MimeType should have comment or be unexported (golint)
    • Line 51: warning: exported method MimeType.FromAcceptHeader should have comment or be unexported (golint)
    • Line 67: warning: exported type BaseHandler should have comment or be unexported (golint)
    • Line 70: warning: exported method BaseHandler.WriteJSON should have comment or be unexported (golint)
    • Line 82: warning: exported method BaseHandler.WriteJSONError should have comment or be unexported (golint)
    • Line 90: warning: exported method BaseHandler.SendInternalServerError should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!