Preparing report...

Report for github.com/anchore/harbor-scanner-adapter

A    Great!    Found 14 issues across 18 files

Tweet

gofmt88%

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!


gocyclo83%

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.


golint38%

Golint is a linter for Go source code.

    • harbor-scanner-adapter/pkg/model/anchore/model.go
    • Line 1: warning: package comment should be of the form "Package anchore ..." (golint)
    • Line 6: warning: comment on exported type ImageVulnerabilityReport should be of the form "ImageVulnerabilityReport ..." (with optional leading article) (golint)
    • Line 12: warning: exported type Vulnerability should have comment or be unexported (golint)
    • Line 29: warning: exported type NvdObject should have comment or be unexported (golint)
    • Line 35: warning: exported type CVSSScore should have comment or be unexported (golint)
    • Line 41: warning: exported type VendorData should have comment or be unexported (golint)
    • Line 47: warning: comment on exported type Image should be of the form "Image ..." (with optional leading article) (golint)
    • Line 53: warning: exported type ImageList should have comment or be unexported (golint)
    • Line 55: warning: exported type FeedGroup should have comment or be unexported (golint)
    • Line 62: warning: exported type FeedStatus should have comment or be unexported (golint)
    • Line 70: warning: exported type FeedStatuses should have comment or be unexported (golint)
    • Line 72: warning: exported type DigestSource should have comment or be unexported (golint)
    • Line 78: warning: comment on exported type ImageSource should be of the form "ImageSource ..." (with optional leading article) (golint)
    • Line 83: warning: exported type ImageScanRequest should have comment or be unexported (golint)
    • Line 89: warning: exported type Error should have comment or be unexported (golint)
    • Line 95: warning: exported type NamespacedVulnerability should have comment or be unexported (golint)
    • Line 102: warning: exported type VulnerabilityQueryResults should have comment or be unexported (golint)
    • Line 109: warning: comment on exported type ApplicationJsonError should be of the form "ApplicationJsonError ..." (with optional leading article) (golint)
    • Line 118: warning: exported type RegistryConfiguration should have comment or be unexported (golint)
    • harbor-scanner-adapter/pkg/adapter/anchore/client/client.go
    • Line 22: warning: exported const CHUNKSIZE should have comment (or a comment on this block) or be unexported (golint)
    • Line 34: warning: exported type ClientConfig should have comment or be unexported (golint)
    • Line 88: warning: exported function AnalyzeImage should have comment or be unexported (golint)
    • Line 111: warning: comment on exported function GetVulnerabilityDescriptions should be of the form "GetVulnerabilityDescriptions ..." (golint)
    • Line 224: warning: comment on exported function QueryVulnerabilityRecords should be of the form "QueryVulnerabilityRecords ..." (golint)
    • Line 235: warning: don't use underscores in Go names; var more_pages should be morePages (golint)
    • Line 254: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 301: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 307: warning: comment on exported function GetImageVulnerabilities should be of the form "GetImageVulnerabilities ..." (golint)
    • Line 330: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 336: warning: exported function GetImage should have comment or be unexported (golint)
    • Line 363: warning: exported function GetVulnDbUpdateTime should have comment or be unexported (golint)
    • Line 409: warning: comment on exported function StringToTime should be of the form "StringToTime ..." (golint)
    • Line 424: warning: comment on exported function ExtractRegistryFromUrl should be of the form "ExtractRegistryFromUrl ..." (golint)
    • Line 433: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 438: warning: comment on exported function RegistryNameFromRepo should be of the form "RegistryNameFromRepo ..." (golint)
    • Line 459: warning: comment on exported function AddRegistryCredential should be of the form "AddRegistryCredential ..." (golint)
    • Line 477: warning: comment on exported function UpdateRegistryCredential should be of the form "UpdateRegistryCredential ..." (golint)
    • harbor-scanner-adapter/pkg/adapter/anchore/adapter.go
    • Line 21: warning: exported const DescriptionFormatString should have comment (or a comment on this block) or be unexported (golint)
    • Line 25: warning: exported type HarborScannerAdapter should have comment or be unexported (golint)
    • Line 33: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 44: warning: comment on exported function GenerateScanId should be of the form "GenerateScanId ..." (golint)
    • Line 50: warning: exported function ScanIdToRegistryDigest should have comment or be unexported (golint)
    • Line 65: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 73: warning: exported function ScanToAnchoreRequest should have comment or be unexported (golint)
    • Line 102: warning: comment on exported function GetUsernamePassword should be of the form "GetUsernamePassword ..." (golint)
    • Line 128: warning: comment on exported method HarborScannerAdapter.EnsureRegistryCredentials should be of the form "EnsureRegistryCredentials ..." (golint)
    • Line 173: warning: exported method HarborScannerAdapter.Scan should have comment or be unexported (golint)
    • Line 216: warning: comment on exported method HarborScannerAdapter.GetHarborVulnerabilityReport should be of the form "GetHarborVulnerabilityReport ..." (golint)
    • Line 227: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 294: warning: exported method HarborScannerAdapter.GetAnchoreVulnReport should have comment or be unexported (golint)
    • Line 300: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 311: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 333: warning: comment on exported method HarborScannerAdapter.GetRawVulnerabilityReport should be of the form "GetRawVulnerabilityReport ..." (golint)
    • Line 343: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 350: warning: comment on exported function ToHarborDescription should be of the form "ToHarborDescription ..." (golint)
    • Line 380: warning: exported method HarborScannerAdapter.ToHarborScanResult should have comment or be unexported (golint)
    • Line 447: warning: exported method HarborScannerAdapter.GetMetadata should have comment or be unexported (golint)
    • harbor-scanner-adapter/pkg/model/harbor/model.go
    • Line 15: warning: exported const SevNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 24: warning: exported var SeverityNames should have comment or be unexported (golint)
    • Line 42: warning: exported function ToHarborSeverity should have comment or be unexported (golint)
    • Line 64: warning: comment on exported method Severity.MarshalJSON should be of the form "MarshalJSON ..." (golint)
    • Line 73: warning: comment on exported type Registry should be of the form "Registry ..." (with optional leading article) (golint)
    • Line 86: warning: exported type ScanRequest should have comment or be unexported (golint)
    • Line 91: warning: comment on exported type ScanResponse should be of the form "ScanResponse ..." (with optional leading article) (golint)
    • Line 96: warning: exported type RawReport should have comment or be unexported (golint)
    • Line 98: warning: comment on exported type VulnerabilityReport should be of the form "VulnerabilityReport ..." (with optional leading article) (golint)
    • Line 107: warning: comment on exported type VulnerableItem should be of the form "VulnerableItem ..." (with optional leading article) (golint)
    • Line 118: warning: comment on exported type ScannerAdapterMetadata should be of the form "ScannerAdapterMetadata ..." (with optional leading article) (golint)
    • Line 125: warning: exported type Scanner should have comment or be unexported (golint)
    • Line 131: warning: exported type Capability should have comment or be unexported (golint)
    • Line 141: warning: exported type ErrorResponse should have comment or be unexported (golint)
    • harbor-scanner-adapter/pkg/http/api/v1/handler.go
    • Line 17: warning: exported const AcceptHeader should have comment (or a comment on this block) or be unexported (golint)
    • Line 36: warning: exported type APIHandler should have comment or be unexported (golint)
    • Line 41: warning: exported function NewAPIHandler should have comment or be unexported (golint)
    • Line 64: warning: comment on exported method APIHandler.AuthenticationMiddleware should be of the form "AuthenticationMiddleware ..." (golint)
    • Line 77: warning: comment on exported method APIHandler.LoggerMiddleware should be of the form "LoggerMiddleware ..." (golint)
    • Line 89: warning: exported function UnmarshallScanRequest should have comment or be unexported (golint)
    • Line 113: warning: exported function ValidateScanRequest should have comment or be unexported (golint)
    • Line 129: warning: exported method APIHandler.CreateScan should have comment or be unexported (golint)
    • Line 168: warning: exported method APIHandler.GetScanReport should have comment or be unexported (golint)
    • Line 225: warning: exported method APIHandler.GetHarborVulnerabilityReport should have comment or be unexported (golint)
    • Line 229: warning: exported method APIHandler.GetRawScanReport should have comment or be unexported (golint)
    • Line 233: warning: exported function ValidateMetadataRequest should have comment or be unexported (golint)
    • Line 241: warning: comment on exported method APIHandler.GetMetadata should be of the form "GetMetadata ..." (golint)
    • Line 261: warning: exported function SendJsonResponse should have comment or be unexported (golint)
    • Line 272: warning: exported function SendErrorResponse should have comment or be unexported (golint)
    • harbor-scanner-adapter/pkg/adapter/anchore/cache.go
    • Line 10: warning: comment on exported type TimestampedEntry should be of the form "TimestampedEntry ..." (with optional leading article) (golint)
    • Line 16: warning: exported type CacheConfiguration should have comment or be unexported (golint)
    • Line 27: warning: exported type ConcurrentCache should have comment or be unexported (golint)
    • Line 33: warning: exported type LockingTTLCache should have comment or be unexported (golint)
    • Line 40: warning: exported var DescriptionCache should have comment or be unexported (golint)
    • Line 41: warning: exported var ReportCache should have comment or be unexported (golint)
    • Line 42: warning: exported var UpdateTimestampCache should have comment or be unexported (golint)
    • Line 44: warning: exported function NewCache should have comment or be unexported (golint)
    • Line 56: warning: exported method LockingTTLCache.Get should have comment or be unexported (golint)
    • Line 77: warning: comment on exported method LockingTTLCache.Add should be of the form "Add ..." (golint)
    • Line 89: warning: comment on exported method LockingTTLCache.Flush should be of the form "Flush ..." (golint)
    • Line 96: warning: exported function InitCaches should have comment or be unexported (golint)
    • harbor-scanner-adapter/pkg/adapter/anchore/config.go
    • Line 15: warning: exported type AdapterConfig should have comment or be unexported (golint)
    • Line 33: warning: exported const DefaultTimeoutSeconds should have comment (or a comment on this block) or be unexported (golint)
    • Line 72: warning: comment on exported var DefaultCacheConfig should be of the form "DefaultCacheConfig ..." (golint)
    • Line 84: warning: comment on exported function GetEnvBoolean should be of the form "GetEnvBoolean ..." (golint)
    • Line 106: warning: comment on exported function GetConfig should be of the form "GetConfig ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign83%

IneffAssign detects ineffectual assignments in Go code.


misspell94%

Misspell Finds commonly misspelled English words