Preparing report...

Report for github.com/aquasecurity/fanal

A+    Excellent!    Found 51 issues across 125 files

Tweet

gofmt100%

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

No problems detected. Good job!


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!


gocyclo99%

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.


golint60%

Golint is a linter for Go source code.

    • fanal/cache/s3.go
    • Line 18: warning: exported type S3Cache should have comment or be unexported (golint)
    • Line 25: warning: exported function NewS3Cache should have comment or be unexported (golint)
    • Line 34: warning: exported method S3Cache.PutArtifact should have comment or be unexported (golint)
    • Line 42: warning: exported method S3Cache.PutBlob should have comment or be unexported (golint)
    • Line 75: warning: exported method S3Cache.GetBlob should have comment or be unexported (golint)
    • Line 92: warning: exported method S3Cache.GetArtifact should have comment or be unexported (golint)
    • Line 119: warning: exported method S3Cache.MissingBlobs should have comment or be unexported (golint)
    • Line 153: warning: exported method S3Cache.Close should have comment or be unexported (golint)
    • Line 157: warning: exported method S3Cache.Clear should have comment or be unexported (golint)
    • fanal/applier/applier.go
    • Line 10: warning: exported type Applier should have comment or be unexported (golint)
    • Line 14: warning: exported function NewApplier should have comment or be unexported (golint)
    • Line 18: warning: exported method Applier.ApplyLayers should have comment or be unexported (golint)
    • fanal/config/scanner/scanner.go
    • Line 5: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 19: warning: exported type Scanner should have comment or be unexported (golint)
    • Line 24: warning: exported function New should have comment or be unexported (golint)
    • Line 40: warning: exported method Scanner.ScanConfigs should have comment or be unexported (golint)
    • fanal/artifact/image/image.go
    • Line 30: warning: exported type Artifact should have comment or be unexported (golint)
    • Line 38: warning: exported function NewArtifact should have comment or be unexported (golint)
    • Line 61: warning: exported method Artifact.Inspect should have comment or be unexported (golint)
    • fanal/analyzer/config/hcl/hcl.go
    • Line 21: warning: exported type ConfigAnalyzer should have comment or be unexported (golint)
    • Line 27: warning: exported function NewConfigAnalyzer should have comment or be unexported (golint)
    • Line 73: warning: exported method ConfigAnalyzer.Required should have comment or be unexported (golint)
    • Line 87: warning: exported method ConfigAnalyzer.Type should have comment or be unexported (golint)
    • Line 91: warning: exported method ConfigAnalyzer.Version should have comment or be unexported (golint)
    • fanal/analyzer/const.go
    • Line 3: warning: exported type Type should have comment or be unexported (golint)
    • Line 6: warning: comment on exported const TypeAlpine should be of the form "TypeAlpine ..." (golint)
    • Line 8: warning: exported const TypeAmazon should have comment (or a comment on this block) or be unexported (golint)
    • Line 18: warning: comment on exported const TypeApk should be of the form "TypeApk ..." (golint)
    • Line 23: warning: comment on exported const TypeBundler should be of the form "TypeBundler ..." (golint)
    • Line 36: warning: comment on exported const TypeApkCommand should be of the form "TypeApkCommand ..." (golint)
    • Line 39: warning: comment on exported const TypeYaml should be of the form "TypeYaml ..." (golint)
    • fanal/types/artifact.go
    • Line 9: warning: exported type OS should have comment or be unexported (golint)
    • Line 14: warning: exported type Layer should have comment or be unexported (golint)
    • Line 19: warning: exported type Package should have comment or be unexported (golint)
    • Line 33: warning: exported type SrcPackage should have comment or be unexported (golint)
    • Line 39: warning: exported type PackageInfo should have comment or be unexported (golint)
    • Line 44: warning: exported type LibraryInfo should have comment or be unexported (golint)
    • Line 49: warning: exported type Application should have comment or be unexported (golint)
    • Line 55: warning: exported type Config should have comment or be unexported (golint)
    • fanal/types/const.go
    • Line 4: warning: exported const ArtifactJSONSchemaVersion should have comment (or a comment on this block) or be unexported (golint)
    • Line 9: warning: comment on exported const Bundler should be of the form "Bundler ..." (golint)
    • Line 11: warning: exported const Cargo should have comment (or a comment on this block) or be unexported (golint)
    • Line 22: warning: comment on exported const YAML should be of the form "YAML ..." (golint)
    • fanal/analyzer/config/toml/toml.go
    • Line 19: warning: exported type ConfigAnalyzer should have comment or be unexported (golint)
    • Line 24: warning: exported function NewConfigAnalyzer should have comment or be unexported (golint)
    • Line 31: warning: exported method ConfigAnalyzer.Analyze should have comment or be unexported (golint)
    • Line 48: warning: exported method ConfigAnalyzer.Required should have comment or be unexported (golint)
    • Line 62: warning: exported method ConfigAnalyzer.Type should have comment or be unexported (golint)
    • Line 66: warning: exported method ConfigAnalyzer.Version should have comment or be unexported (golint)
    • fanal/image/image.go
    • Line 19: warning: exported type Image should have comment or be unexported (golint)
    • Line 25: warning: exported method Image.Name should have comment or be unexported (golint)
    • Line 29: warning: exported method Image.ID should have comment or be unexported (golint)
    • Line 37: warning: exported method Image.ConfigBlob should have comment or be unexported (golint)
    • Line 41: warning: exported method Image.LayerIDs should have comment or be unexported (golint)
    • Line 54: warning: exported method Image.LayerByDiffID should have comment or be unexported (golint)
    • Line 58: warning: exported function NewDockerImage should have comment or be unexported (golint)
    • Line 109: warning: exported function NewArchiveImage should have comment or be unexported (golint)
    • fanal/analyzer/config/docker/docker.go
    • Line 20: warning: exported type ConfigAnalyzer should have comment or be unexported (golint)
    • Line 25: warning: exported function NewConfigAnalyzer should have comment or be unexported (golint)
    • Line 32: warning: exported method ConfigAnalyzer.Analyze should have comment or be unexported (golint)
    • Line 68: warning: exported method ConfigAnalyzer.Type should have comment or be unexported (golint)
    • Line 72: warning: exported method ConfigAnalyzer.Version should have comment or be unexported (golint)
    • fanal/applier/docker.go
    • Line 11: warning: exported type Config should have comment or be unexported (golint)
    • Line 20: warning: exported type History should have comment or be unexported (golint)
    • Line 68: warning: exported function ApplyLayers should have comment or be unexported (golint)
    • fanal/image/token/gcr/gcr.go
    • Line 16: warning: exported type GCR should have comment or be unexported (golint)
    • Line 23: warning: exported method GCR.CheckOptions should have comment or be unexported (golint)
    • Line 34: warning: exported method GCR.GetCredential should have comment or be unexported (golint)
    • fanal/test/integration/docker/docker.go
    • Line 19: warning: exported type RegistryConfig should have comment or be unexported (golint)
    • Line 25: warning: exported method RegistryConfig.GetAuthConfig should have comment or be unexported (golint)
    • Line 33: warning: exported method RegistryConfig.GetRegistryAuth should have comment or be unexported (golint)
    • Line 45: warning: exported method RegistryConfig.GetBasicAuthorization should have comment or be unexported (golint)
    • Line 49: warning: exported type Docker should have comment or be unexported (golint)
    • Line 53: warning: exported function New should have comment or be unexported (golint)
    • Line 63: warning: exported method Docker.Login should have comment or be unexported (golint)
    • Line 68: warning: exported method Docker.Logout should have comment or be unexported (golint)
    • fanal/analyzer/config/config.go
    • Line 21: warning: exported type ScannerOption should have comment or be unexported (golint)
    • Line 28: warning: exported method ScannerOption.Sort should have comment or be unexported (golint)
    • Line 40: warning: exported function RegisterConfigAnalyzers should have comment or be unexported (golint)
    • fanal/analyzer/config/yaml/yaml.go
    • Line 19: warning: exported type ConfigAnalyzer should have comment or be unexported (golint)
    • Line 24: warning: exported function NewConfigAnalyzer should have comment or be unexported (golint)
    • Line 31: warning: exported method ConfigAnalyzer.Analyze should have comment or be unexported (golint)
    • Line 57: warning: exported method ConfigAnalyzer.Required should have comment or be unexported (golint)
    • Line 71: warning: exported method ConfigAnalyzer.Type should have comment or be unexported (golint)
    • Line 75: warning: exported method ConfigAnalyzer.Version should have comment or be unexported (golint)
    • fanal/log/log.go
    • Line 7: warning: exported var Logger should have comment or be unexported (golint)
    • Line 14: warning: exported function SetLogger should have comment or be unexported (golint)
    • fanal/image/token/token.go
    • Line 23: warning: exported type Registry should have comment or be unexported (golint)
    • Line 28: warning: exported function RegisterRegistry should have comment or be unexported (golint)
    • Line 32: warning: exported function GetToken should have comment or be unexported (golint)
    • fanal/image/token/ecr/ecr.go
    • Line 21: warning: exported type ECR should have comment or be unexported (golint)
    • Line 48: warning: exported method ECR.CheckOptions should have comment or be unexported (golint)
    • Line 58: warning: exported method ECR.GetCredential should have comment or be unexported (golint)
    • fanal/types/misconf.go
    • Line 3: warning: exported type Misconfiguration should have comment or be unexported (golint)
    • Line 13: warning: exported type MisconfResult should have comment or be unexported (golint)
    • Line 19: warning: exported type MisconfResults should have comment or be unexported (golint)
    • Line 21: warning: exported type PolicyMetadata should have comment or be unexported (golint)
    • Line 28: warning: exported type PolicyInputOption should have comment or be unexported (golint)
    • Line 33: warning: exported type PolicyInputSelector should have comment or be unexported (golint)
    • fanal/artifact/local/fs.go
    • Line 19: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 32: warning: exported type Artifact should have comment or be unexported (golint)
    • Line 40: warning: exported function NewArtifact should have comment or be unexported (golint)
    • Line 60: warning: exported method Artifact.Inspect should have comment or be unexported (golint)
    • fanal/cache/fs.go
    • Line 15: warning: exported type FSCache should have comment or be unexported (golint)
    • Line 20: warning: exported function NewFSCache should have comment or be unexported (golint)
    • fanal/cache/fs_test.go
    • Line 276: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 352: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 469: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • fanal/analyzer/config/json/json.go
    • Line 19: warning: exported type ConfigAnalyzer should have comment or be unexported (golint)
    • Line 24: warning: exported function NewConfigAnalyzer should have comment or be unexported (golint)
    • Line 31: warning: exported method ConfigAnalyzer.Analyze should have comment or be unexported (golint)
    • Line 48: warning: exported method ConfigAnalyzer.Required should have comment or be unexported (golint)
    • Line 62: warning: exported method ConfigAnalyzer.Type should have comment or be unexported (golint)
    • Line 66: warning: exported method ConfigAnalyzer.Version should have comment or be unexported (golint)
    • fanal/analyzer/analyzer.go
    • Line 30: warning: exported type AnalysisTarget should have comment or be unexported (golint)
    • Line 49: warning: exported function RegisterAnalyzer should have comment or be unexported (golint)
    • Line 53: warning: exported function RegisterConfigAnalyzer should have comment or be unexported (golint)
    • Line 57: warning: exported type Opener should have comment or be unexported (golint)
    • Line 59: warning: exported type AnalysisResult should have comment or be unexported (golint)
    • Line 71: warning: exported method AnalysisResult.Sort should have comment or be unexported (golint)
    • Line 96: warning: exported method AnalysisResult.Merge should have comment or be unexported (golint)
    • Line 127: warning: exported type Analyzer should have comment or be unexported (golint)
    • Line 133: warning: exported function NewAnalyzer should have comment or be unexported (golint)
    • Line 183: warning: exported method Analyzer.AnalyzeFile should have comment or be unexported (golint)
    • Line 218: warning: exported method Analyzer.AnalyzeImageConfig should have comment or be unexported (golint)
    • Line 242: warning: exported function CheckPackage should have comment or be unexported (golint)
    • fanal/cache/redis.go
    • Line 20: warning: exported type RedisCache should have comment or be unexported (golint)
    • Line 24: warning: exported function NewRedisCache should have comment or be unexported (golint)
    • Line 30: warning: exported method RedisCache.PutArtifact should have comment or be unexported (golint)
    • Line 42: warning: exported method RedisCache.PutBlob should have comment or be unexported (golint)
    • Line 54: warning: exported method RedisCache.GetArtifact should have comment or be unexported (golint)
    • Line 71: warning: exported method RedisCache.GetBlob should have comment or be unexported (golint)
    • Line 87: warning: exported method RedisCache.MissingBlobs should have comment or be unexported (golint)
    • Line 113: warning: exported method RedisCache.Close should have comment or be unexported (golint)
    • Line 117: warning: exported method RedisCache.Clear should have comment or be unexported (golint)
    • fanal/analyzer/os/const.go
    • Line 43: warning: comment on exported const SLES should be of the form "SLES ..." (golint)
    • Line 53: warning: exported var AnalyzeOSError should have comment or be unexported (golint)
    • fanal/utils/utils.go
    • Line 11: warning: exported var PathSeparator should have comment or be unexported (golint)
    • Line 14: warning: exported function CacheDir should have comment or be unexported (golint)
    • Line 22: warning: exported function StringInSlice should have comment or be unexported (golint)
    • Line 31: warning: exported function IsCommandAvailable should have comment or be unexported (golint)
    • Line 38: warning: exported function IsGzip should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign98%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!