Preparing report...

Report for github.com/gocrane/fadvisor

(v0.1.0)

A    Great!    Found 22 issues across 27 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!


gocyclo92%

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.


golint22%

Golint is a linter for Go source code.

    • pkg/cost-exporter/cloudprice/defaultcloud/defaultcloud.go
    • Line 15: warning: exported type DefaultCloud should have comment or be unexported (golint)
    • Line 21: warning: exported method DefaultCloud.OnNodeDelete should have comment or be unexported (golint)
    • Line 25: warning: exported method DefaultCloud.OnNodeAdd should have comment or be unexported (golint)
    • Line 29: warning: exported method DefaultCloud.OnNodeUpdate should have comment or be unexported (golint)
    • Line 33: warning: exported method DefaultCloud.IsVirtualNode should have comment or be unexported (golint)
    • Line 37: warning: exported method DefaultCloud.WarmUp should have comment or be unexported (golint)
    • Line 41: warning: exported method DefaultCloud.Refresh should have comment or be unexported (golint)
    • Line 44: warning: exported function NewDefaultCloud should have comment or be unexported (golint)
    • Line 88: warning: exported method DefaultCloud.GetNodesCost should have comment or be unexported (golint)
    • Line 114: warning: exported method DefaultCloud.GetPodsCost should have comment or be unexported (golint)
    • Line 150: warning: exported method DefaultCloud.GetNodesPricing should have comment or be unexported (golint)
    • pkg/log/log.go
    • Line 17: warning: exported function Logger should have comment or be unexported (golint)
    • Line 25: warning: exported function GenerateKey should have comment or be unexported (golint)
    • Line 29: warning: exported function GenerateObj should have comment or be unexported (golint)
    • pkg/cloudsdk/qcloud/consts/const.go
    • Line 6: warning: exported const LIMITS should have comment (or a comment on this block) or be unexported (golint)
    • Line 13: warning: comment on exported const INSTANCECHARGETYPE_PREPAID should be of the form "INSTANCECHARGETYPE_PREPAID ..." (golint)
    • pkg/cloudsdk/qcloud/credential/fake.go
    • Line 11: warning: exported type FakeCred should have comment or be unexported (golint)
    • Line 20: warning: exported function NewFakeCred should have comment or be unexported (golint)
    • Line 27: warning: exported method FakeCred.GetQCloudAssumedCredential should have comment or be unexported (golint)
    • Line 34: warning: exported method FakeCred.GetQCloudCustomCredential should have comment or be unexported (golint)
    • Line 44: warning: exported method FakeCred.GetQCloudCredential should have comment or be unexported (golint)
    • Line 53: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 58: warning: exported method FakeCred.UpdateQCloudCustomCredential should have comment or be unexported (golint)
    • pkg/cost-exporter/cloudprice/tencentcloud/tencentcloud.go
    • Line 67: warning: exported type TencentCloud should have comment or be unexported (golint)
    • Line 86: warning: exported function NewTencentCloud should have comment or be unexported (golint)
    • Line 111: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 243: warning: exported method TencentCloud.GetNodesCost should have comment or be unexported (golint)
    • Line 274: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 398: warning: exported method TencentCloud.GetPodsCost should have comment or be unexported (golint)
    • Line 438: warning: exported method TencentCloud.GetKey should have comment or be unexported (golint)
    • Line 463: warning: exported method TencentCloud.GetNodesPricing should have comment or be unexported (golint)
    • Line 500: warning: exported method TencentCloud.IsVirtualNode should have comment or be unexported (golint)
    • Line 532: warning: exported const ValueNodeTypeEKLet should have comment (or a comment on this block) or be unexported (golint)
    • pkg/util/annotation.go
    • Line 7: warning: exported function GetRegion should have comment or be unexported (golint)
    • Line 17: warning: exported function GetZone should have comment or be unexported (golint)
    • Line 27: warning: exported function GetInstanceType should have comment or be unexported (golint)
    • Line 37: warning: exported function GetOperatingSystem should have comment or be unexported (golint)
    • pkg/cloudsdk/qcloud/metrics/metrics.go
    • Line 11: warning: exported var ComponentRequestTotal should have comment or be unexported (golint)
    • Line 30: warning: exported function ComponentRequestStatics should have comment or be unexported (golint)
    • Line 36: warning: exported function ComponentWrongRequestStatics should have comment or be unexported (golint)
    • pkg/cost-exporter/cloudprice/providerconfig.go
    • Line 15: warning: exported type CustomPricing should have comment or be unexported (golint)
    • Line 23: warning: exported type ProviderConfig should have comment or be unexported (golint)
    • Line 28: warning: exported type ProviderType should have comment or be unexported (golint)
    • Line 31: warning: exported const TencentCloud should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported function DetectRegion should have comment or be unexported (golint)
    • Line 41: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 48: warning: exported function DetectProvider should have comment or be unexported (golint)
    • Line 52: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 57: warning: exported function NewProviderConfig should have comment or be unexported (golint)
    • Line 84: warning: exported function SetCustomPricing should have comment or be unexported (golint)
    • pkg/cloudsdk/qcloud/credential/credential.go
    • Line 10: warning: exported type QCloudCredential should have comment or be unexported (golint)
    • Line 24: warning: exported function NewQCloudCredential should have comment or be unexported (golint)
    • Line 31: warning: exported method CustomCredential.GetQCloudCustomCredential should have comment or be unexported (golint)
    • Line 43: warning: exported method CustomCredential.GetQCloudCredential should have comment or be unexported (golint)
    • Line 53: warning: exported method CustomCredential.UpdateQCloudCustomCredential should have comment or be unexported (golint)
    • pkg/cloudsdk/qcloud/cvm/cvm.go
    • Line 24: warning: exported type CVM should have comment or be unexported (golint)
    • Line 28: warning: exported type CVMClient should have comment or be unexported (golint)
    • Line 37: warning: exported function NewCVMClient should have comment or be unexported (golint)
    • Line 48: warning: exported method CVMClient.UpdateCredential should have comment or be unexported (golint)
    • Line 54: warning: exported method CVMClient.ExponentialRetryCall should have comment or be unexported (golint)
    • Line 79: warning: exported method CVMClient.UpdateCred should have comment or be unexported (golint)
    • Line 85: warning: exported method CVMClient.UpdateCustomCredential should have comment or be unexported (golint)
    • Line 91: warning: exported method CVMClient.EnableDebug should have comment or be unexported (golint)
    • Line 98: warning: exported method CVMClient.DebugModeNoLock should have comment or be unexported (golint)
    • Line 176: warning: exported method CVMClient.InquiryDescribeInstancesWithRetry should have comment or be unexported (golint)
    • Line 200: warning: exported method CVMClient.InquiryPriceRunInstancesWithRetry should have comment or be unexported (golint)
    • Line 224: warning: exported method CVMClient.DescribeZoneInstanceConfigInfosWithRetry should have comment or be unexported (golint)
    • Line 315: warning: exported method CVMClient.GetCVMInstances should have comment or be unexported (golint)
    • Line 358: warning: exported type QCloudInstancePrice should have comment or be unexported (golint)
    • Line 363: warning: exported method CVMClient.GetCVMInstancesPrice should have comment or be unexported (golint)
    • Line 425: warning: exported method CVMClient.GetCVMInstancesInquiryPrice should have comment or be unexported (golint)
    • pkg/consts/const.go
    • Line 6: warning: exported const CraneNamespace should have comment (or a comment on this block) or be unexported (golint)
    • Line 19: warning: exported const GB should have comment (or a comment on this block) or be unexported (golint)
    • pkg/cost-exporter/cloudprice/provider.go
    • Line 7: warning: exported type PriceItem should have comment or be unexported (golint)
    • Line 29: warning: exported type Price should have comment or be unexported (golint)
    • Line 37: warning: comment on exported type CloudPrice should be of the form "CloudPrice ..." (with optional leading article) (golint)
    • Line 86: warning: exported type ChargeType should have comment or be unexported (golint)
    • Line 88: warning: exported type BaseInstancePrice should have comment or be unexported (golint)
    • Line 107: warning: exported type Node should have comment or be unexported (golint)
    • Line 111: warning: exported type Pod should have comment or be unexported (golint)
    • pkg/cost-exporter/cloudprice/tencentcloud/price_cache.go
    • Line 16: warning: exported var QCloudProviderIdRegex should have comment or be unexported (golint)
    • Line 96: warning: comment on exported function ParseID should be of the form "ParseID ..." (golint)
    • Line 110: warning: exported method TencentCloud.WarmUp should have comment or be unexported (golint)
    • Line 125: warning: exported method TencentCloud.Refresh should have comment or be unexported (golint)
    • Line 140: warning: exported method TencentCloud.GetInstancePrice should have comment or be unexported (golint)
    • Line 157: warning: exported method TencentCloud.OnNodeDelete should have comment or be unexported (golint)
    • Line 168: warning: exported method TencentCloud.OnNodeAdd should have comment or be unexported (golint)
    • Line 195: warning: exported method TencentCloud.OnNodeUpdate should have comment or be unexported (golint)
    • pkg/cost-exporter/server.go
    • Line 1: warning: don't use an underscore in package name (golint)
    • Line 21: warning: exported function NewServer should have comment or be unexported (golint)
    • Line 30: warning: exported type Server should have comment or be unexported (golint)
    • Line 37: warning: exported method Server.RegisterHandlers should have comment or be unexported (golint)
    • Line 46: warning: exported method Server.Serve should have comment or be unexported (golint)
    • Line 80: warning: exported method Server.NodesCostHandler should have comment or be unexported (golint)
    • Line 98: warning: exported method Server.NodesPriceHandler should have comment or be unexported (golint)
    • pkg/cloudsdk/qcloud/client.go
    • Line 13: warning: exported var QcloudRegions should have comment or be unexported (golint)
    • Line 56: warning: exported var ShortName2region should have comment or be unexported (golint)
    • Line 317: warning: exported var Region2shortNameRegion should have comment or be unexported (golint)
    • Line 578: warning: exported type QCloudClientProfile should have comment or be unexported (golint)
    • Line 588: warning: exported type QCloudClientConfig should have comment or be unexported (golint)
    • Line 596: warning: comment on exported const INSTANCECHARGETYPE_PREPAID should be of the form "INSTANCECHARGETYPE_PREPAID ..." (golint)
    • Line 598: warning: exported const INSTANCECHARGETYPE_POSTPAID_BY_HOUR should have comment (or a comment on this block) or be unexported (golint)
    • pkg/util/client.go
    • Line 28: warning: exported type ClientCreator should have comment or be unexported (golint)
    • Line 30: warning: comment on exported function CreateK8sClient should be of the form "CreateK8sClient ..." (golint)
    • Line 166: warning: comment on exported type EventRecorderSet should be of the form "EventRecorderSet ..." (with optional leading article) (golint)
    • Line 171: warning: exported method EventRecorderSet.Eventf should have comment or be unexported (golint)

license0%

Checks whether your project has a LICENSE file.


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!