Preparing report...

Report for github.com/itering/subscan

A+    Excellent!    Found 49 issues across 89 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!


gocyclo98%

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.


golint44%

Golint is a linter for Go source code.

    • subscan/internal/dao/chainExtrinsic.go
    • Line 12: warning: exported method Dao.CreateExtrinsic should have comment or be unexported (golint)
    • Line 42: warning: exported method Dao.DropExtrinsicNotFinalizedData should have comment or be unexported (golint)
    • Line 54: warning: exported method Dao.GetExtrinsicsByBlockNum should have comment or be unexported (golint)
    • Line 68: warning: exported method Dao.GetExtrinsicList should have comment or be unexported (golint)
    • Line 106: warning: exported method Dao.GetExtrinsicsByHash should have comment or be unexported (golint)
    • Line 118: warning: exported method Dao.GetExtrinsicsDetailByHash should have comment or be unexported (golint)
    • Line 125: warning: exported method Dao.GetExtrinsicsDetailByIndex should have comment or be unexported (golint)
    • Line 166: warning: exported method Dao.ExtrinsicsAsJson should have comment or be unexported (golint)
    • subscan/internal/service/runtime.go
    • Line 15: warning: exported method Service.SubstrateRuntimeList should have comment or be unexported (golint)
    • Line 19: warning: exported method Service.SubstrateRuntimeInfo should have comment or be unexported (golint)
    • subscan/plugins/system/system.go
    • Line 15: warning: exported type System should have comment or be unexported (golint)
    • Line 19: warning: exported function New should have comment or be unexported (golint)
    • Line 23: warning: exported method System.InitDao should have comment or be unexported (golint)
    • Line 29: warning: exported method System.InitHttp should have comment or be unexported (golint)
    • Line 33: warning: exported method System.ProcessExtrinsic should have comment or be unexported (golint)
    • Line 37: warning: exported method System.ProcessEvent should have comment or be unexported (golint)
    • Line 47: warning: exported method System.Migrate should have comment or be unexported (golint)
    • Line 53: warning: exported method System.Version should have comment or be unexported (golint)
    • Line 57: warning: exported method System.SubscribeExtrinsic should have comment or be unexported (golint)
    • Line 61: warning: exported method System.SubscribeEvent should have comment or be unexported (golint)
    • Line 65: warning: exported method System.UiConf should have comment or be unexported (golint)
    • subscan/plugins/system/dao/dao.go
    • Line 11: warning: exported function CreateExtrinsicError should have comment or be unexported (golint)
    • Line 24: warning: exported function ExtrinsicError should have comment or be unexported (golint)
    • Line 30: warning: exported function CheckExtrinsicError should have comment or be unexported (golint)
    • subscan/util/slice.go
    • Line 3: warning: exported function StringInSlice should have comment or be unexported (golint)
    • Line 12: warning: exported function MapStringToSlice should have comment or be unexported (golint)
    • Line 20: warning: exported function ContinuousNums should have comment or be unexported (golint)
    • subscan/internal/dao/db.go
    • Line 23: warning: exported type DbStorage should have comment or be unexported (golint)
    • Line 28: warning: exported method DbStorage.SetPrefix should have comment or be unexported (golint)
    • Line 32: warning: exported method DbStorage.GetPrefix should have comment or be unexported (golint)
    • Line 38: warning: exported method DbStorage.SpecialMetadata should have comment or be unexported (golint)
    • Line 57: warning: exported method DbStorage.RPCPool should have comment or be unexported (golint)
    • Line 70: warning: exported method DbStorage.FindBy should have comment or be unexported (golint)
    • Line 105: warning: exported method DbStorage.AutoMigration should have comment or be unexported (golint)
    • Line 113: warning: exported method DbStorage.AddIndex should have comment or be unexported (golint)
    • Line 121: warning: exported method DbStorage.AddUniqueIndex should have comment or be unexported (golint)
    • Line 129: warning: exported method DbStorage.Create should have comment or be unexported (golint)
    • Line 133: 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 138: warning: exported method DbStorage.Update should have comment or be unexported (golint)
    • Line 142: 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 147: warning: exported method DbStorage.Delete should have comment or be unexported (golint)
    • Line 151: 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 163: warning: comment on exported type GormDB should be of the form "GormDB ..." (with optional leading article) (golint)
    • Line 169: warning: exported method Dao.DbCommit should have comment or be unexported (golint)
    • Line 180: warning: exported method Dao.DbRollback should have comment or be unexported (golint)
    • Line 191: warning: comment on exported method Dao.DbBegin should be of the form "DbBegin ..." (golint)
    • subscan/plugins/balance/http/http.go
    • Line 16: warning: exported function Router should have comment or be unexported (golint)
    • Line 41: warning: exported type J should have comment or be unexported (golint)
    • Line 48: warning: exported method J.Render should have comment or be unexported (golint)
    • Line 56: warning: exported method J.WriteContentType should have comment or be unexported (golint)
    • subscan/util/interface.go
    • Line 9: warning: comment on exported function CallerName should be of the form "CallerName ..." (golint)
    • Line 15: warning: exported function GetFuncName should have comment or be unexported (golint)
    • Line 20: warning: comment on exported function BoolFromInterface should be of the form "BoolFromInterface ..." (golint)
    • Line 31: warning: exported function ToString should have comment or be unexported (golint)
    • Line 45: warning: exported function UnmarshalAny should have comment or be unexported (golint)
    • subscan/util/string.go
    • Line 9: warning: comment on exported function CamelString should be of the form "CamelString ..." (golint)
    • Line 14: warning: exported function UpperCamel should have comment or be unexported (golint)
    • Line 22: warning: comment on exported function StringsExclude should be of the form "StringsExclude ..." (golint)
    • Line 34: warning: exported function StringsIntersection should have comment or be unexported (golint)
    • subscan/internal/dao/chainBlock.go
    • Line 12: warning: comment on exported method Dao.CreateBlock should be of the form "CreateBlock ..." (golint)
    • Line 26: warning: exported method Dao.SaveFillAlreadyBlockNum should have comment or be unexported (golint)
    • Line 35: warning: exported method Dao.SaveFillAlreadyFinalizedBlockNum should have comment or be unexported (golint)
    • Line 47: warning: exported method Dao.GetFillBestBlockNum should have comment or be unexported (golint)
    • Line 54: warning: exported method Dao.GetFillFinalizedBlockNum should have comment or be unexported (golint)
    • Line 61: warning: exported method Dao.GetBlockList should have comment or be unexported (golint)
    • Line 96: warning: exported method Dao.GetBlockByHash should have comment or be unexported (golint)
    • Line 108: warning: exported method Dao.GetBlockByNum should have comment or be unexported (golint)
    • Line 117: warning: exported method Dao.BlockAsJson should have comment or be unexported (golint)
    • Line 136: warning: exported method Dao.UpdateEventAndExtrinsic should have comment or be unexported (golint)
    • Line 155: warning: exported method Dao.GetNearBlock should have comment or be unexported (golint)
    • Line 164: warning: exported method Dao.SetBlockFinalized should have comment or be unexported (golint)
    • Line 168: warning: exported method Dao.BlocksReverseByNum should have comment or be unexported (golint)
    • subscan/internal/dao/runtimeVersion.go
    • Line 8: warning: exported method Dao.CreateRuntimeVersion should have comment or be unexported (golint)
    • Line 16: warning: exported method Dao.SetRuntimeData should have comment or be unexported (golint)
    • Line 24: warning: exported method Dao.RuntimeVersionList should have comment or be unexported (golint)
    • Line 30: warning: exported method Dao.RuntimeVersionRecent should have comment or be unexported (golint)
    • Line 39: warning: exported method Dao.RuntimeVersionRaw should have comment or be unexported (golint)
    • subscan/plugins/balance/balance.go
    • Line 19: warning: exported type Balance should have comment or be unexported (golint)
    • Line 23: warning: exported function New should have comment or be unexported (golint)
    • Line 27: warning: exported method Balance.InitDao should have comment or be unexported (golint)
    • Line 33: warning: exported method Balance.InitHttp should have comment or be unexported (golint)
    • Line 37: warning: exported method Balance.ProcessExtrinsic should have comment or be unexported (golint)
    • Line 41: warning: exported method Balance.ProcessEvent should have comment or be unexported (golint)
    • Line 56: warning: exported method Balance.SubscribeExtrinsic should have comment or be unexported (golint)
    • Line 60: warning: exported method Balance.SubscribeEvent should have comment or be unexported (golint)
    • Line 64: warning: exported method Balance.Version should have comment or be unexported (golint)
    • Line 68: warning: exported method Balance.UiConf should have comment or be unexported (golint)
    • Line 83: warning: exported method Balance.Migrate should have comment or be unexported (golint)
    • subscan/model/substrate_json.go
    • Line 5: warning: exported type ChainBlockJson should have comment or be unexported (golint)
    • Line 24: warning: exported type SampleBlockJson should have comment or be unexported (golint)
    • Line 36: warning: exported type ChainExtrinsicJson should have comment or be unexported (golint)
    • Line 52: warning: exported type ExtrinsicDetail should have comment or be unexported (golint)
    • Line 69: warning: exported type ChainEventJson should have comment or be unexported (golint)
    • Line 81: warning: exported type ChainLogJson should have comment or be unexported (golint)
    • Line 89: warning: exported type TransferJson should have comment or be unexported (golint)
    • Line 102: warning: exported type ExtrinsicsJson should have comment or be unexported (golint)
    • Line 118: warning: exported type EventRecord should have comment or be unexported (golint)
    • subscan/plugins/balance/dao/account.go
    • Line 12: warning: exported function GetAccountList should have comment or be unexported (golint)
    • Line 19: warning: exported function NewAccount should have comment or be unexported (golint)
    • Line 25: warning: exported function AfterAccountCreate should have comment or be unexported (golint)
    • subscan/plugins/system/service/service.go
    • Line 10: warning: exported type Service should have comment or be unexported (golint)
    • Line 14: warning: exported function New should have comment or be unexported (golint)
    • Line 20: warning: exported method Service.GetExtrinsicError should have comment or be unexported (golint)
    • Line 24: warning: exported method Service.ExtrinsicFailed should have comment or be unexported (golint)
    • subscan/internal/dao/chainEvent.go
    • Line 11: warning: exported method Dao.CreateEvent should have comment or be unexported (golint)
    • Line 33: warning: exported method Dao.DropEventNotFinalizedData should have comment or be unexported (golint)
    • Line 42: warning: exported method Dao.GetEventByBlockNum should have comment or be unexported (golint)
    • Line 55: warning: exported method Dao.GetEventList should have comment or be unexported (golint)
    • Line 89: warning: exported method Dao.GetEventsByIndex should have comment or be unexported (golint)
    • Line 100: warning: exported method Dao.GetEventByIdx should have comment or be unexported (golint)
    • subscan/internal/dao/dao.go
    • Line 11: warning: exported var DaemonAction should have comment or be unexported (golint)
    • Line 14: warning: comment on exported type Dao should be of the form "Dao ..." (with optional leading article) (golint)
    • subscan/configs/conf.go
    • Line 12: warning: exported type MysqlConf should have comment or be unexported (golint)
    • Line 23: warning: exported type RedisConf should have comment or be unexported (golint)
    • Line 35: warning: exported method MysqlConf.MergeConf should have comment or be unexported (golint)
    • Line 40: warning: exported method RedisConf.MergeConf should have comment or be unexported (golint)
    • subscan/model/substrate.go
    • Line 10: warning: comment on exported var SplitTableBlockNum should be of the form "SplitTableBlockNum ..." (golint)
    • Line 13: warning: exported type ChainBlock should have comment or be unexported (golint)
    • Line 32: warning: exported method ChainBlock.TableName should have comment or be unexported (golint)
    • Line 39: warning: exported method ChainBlock.AsPlugin should have comment or be unexported (golint)
    • Line 50: warning: exported type ChainEvent should have comment or be unexported (golint)
    • Line 63: warning: exported method ChainEvent.TableName should have comment or be unexported (golint)
    • Line 70: warning: exported method ChainEvent.AsPlugin should have comment or be unexported (golint)
    • Line 82: warning: exported type ChainExtrinsic should have comment or be unexported (golint)
    • Line 104: warning: exported method ChainExtrinsic.TableName should have comment or be unexported (golint)
    • Line 111: warning: exported method ChainExtrinsic.AsPlugin should have comment or be unexported (golint)
    • Line 127: warning: exported type RuntimeVersion should have comment or be unexported (golint)
    • Line 135: warning: exported type ChainLog should have comment or be unexported (golint)
    • Line 144: warning: exported method ChainLog.TableName should have comment or be unexported (golint)
    • Line 151: warning: exported type ExtrinsicParam should have comment or be unexported (golint)
    • Line 158: warning: exported type EventParam should have comment or be unexported (golint)
    • subscan/util/env.go
    • Line 8: warning: exported var CurrentRuntimeSpecVersion should have comment or be unexported (golint)
    • Line 18: warning: exported function GetEnv should have comment or be unexported (golint)
    • subscan/util/hex.go
    • Line 9: warning: comment on exported function AddHex should be of the form "AddHex ..." (golint)
    • Line 20: warning: exported function TrimHex should have comment or be unexported (golint)
    • Line 24: warning: exported function IntToHex should have comment or be unexported (golint)
    • Line 28: warning: exported function HexToNumStr should have comment or be unexported (golint)
    • Line 32: warning: exported function HexToBytes should have comment or be unexported (golint)
    • Line 39: warning: exported function BytesToHex should have comment or be unexported (golint)
    • subscan/util/num.go
    • Line 11: warning: comment on exported function IntToString should be of the form "IntToString ..." (golint)
    • Line 16: warning: comment on exported function StringToInt should be of the form "StringToInt ..." (golint)
    • Line 24: warning: exported function InsertInts should have comment or be unexported (golint)
    • Line 32: warning: exported function IntInSlice should have comment or be unexported (golint)
    • Line 41: warning: exported function U256 should have comment or be unexported (golint)
    • Line 48: warning: comment on exported function IntFromInterface should be of the form "IntFromInterface ..." (golint)
    • Line 65: warning: exported function Int64FromInterface should have comment or be unexported (golint)
    • Line 82: warning: exported function DecimalFromInterface should have comment or be unexported (golint)
    • subscan/internal/dao/chainLog.go
    • Line 9: warning: exported method Dao.CreateLog should have comment or be unexported (golint)
    • Line 14: warning: exported method Dao.DropLogsNotFinalizedData should have comment or be unexported (golint)
    • Line 24: warning: exported method Dao.GetLogsByIndex should have comment or be unexported (golint)
    • Line 34: warning: exported method Dao.GetLogByBlockNum should have comment or be unexported (golint)
    • subscan/internal/dao/migration.go
    • Line 8: warning: exported method Dao.Migration should have comment or be unexported (golint)
    • Line 21: warning: exported method Dao.InternalTables should have comment or be unexported (golint)
    • Line 39: warning: exported method Dao.AddIndex should have comment or be unexported (golint)
    • subscan/plugins/registry.go
    • Line 11: warning: exported type PluginFactory should have comment or be unexported (golint)
    • Line 13: warning: exported var RegisteredPlugins should have comment or be unexported (golint)
    • Line 40: warning: exported type PluginInfo should have comment or be unexported (golint)
    • Line 46: warning: exported function List should have comment or be unexported (golint)
    • subscan/util/ss58/ss58.go
    • Line 9: warning: exported function Decode should have comment or be unexported (golint)
    • Line 50: warning: exported function Encode should have comment or be unexported (golint)
    • subscan/internal/dao/chainMetadata.go
    • Line 11: warning: exported method Dao.SetMetadata should have comment or be unexported (golint)
    • Line 29: warning: exported method Dao.IncrMetadata should have comment or be unexported (golint)
    • Line 39: warning: exported method Dao.GetMetadata should have comment or be unexported (golint)
    • Line 46: warning: exported method Dao.GetBestBlockNum should have comment or be unexported (golint)
    • Line 52: warning: exported method Dao.GetFinalizedBlockNum should have comment or be unexported (golint)
    • subscan/internal/dao/redis.go
    • Line 22: warning: exported method Dao.SetHeartBeatNow should have comment or be unexported (golint)
    • Line 26: warning: exported method Dao.DaemonHeath should have comment or be unexported (golint)
    • subscan/internal/service/block.go
    • Line 17: warning: exported method Service.CreateChainBlock should have comment or be unexported (golint)
    • Line 97: warning: exported method Service.UpdateBlockData should have comment or be unexported (golint)
    • Line 175: warning: exported method Service.GetCurrentRuntimeSpecVersion should have comment or be unexported (golint)
    • Line 185: warning: exported method Service.GetExtrinsicList should have comment or be unexported (golint)
    • Line 195: warning: exported method Service.GetBlocksSampleByNums should have comment or be unexported (golint)
    • Line 205: warning: exported method Service.GetExtrinsicByIndex should have comment or be unexported (golint)
    • Line 210: warning: exported method Service.GetExtrinsicDetailByHash should have comment or be unexported (golint)
    • Line 215: warning: exported method Service.GetExtrinsicByHash should have comment or be unexported (golint)
    • Line 220: warning: exported method Service.GetBlockByHashJson should have comment or be unexported (golint)
    • Line 229: warning: exported method Service.EventByIndex should have comment or be unexported (golint)
    • Line 233: warning: exported method Service.GetBlockByNum should have comment or be unexported (golint)
    • Line 242: warning: exported method Service.GetBlockByHash should have comment or be unexported (golint)
    • Line 251: warning: exported method Service.BlockAsSampleJson should have comment or be unexported (golint)
    • Line 264: warning: exported method Service.GetCurrentBlockNum should have comment or be unexported (golint)
    • Line 268: warning: exported method Service.ValidatorsList should have comment or be unexported (golint)
    • subscan/plugins/balance/service/service.go
    • Line 9: warning: exported type Service should have comment or be unexported (golint)
    • Line 13: warning: exported method Service.GetAccountListJson should have comment or be unexported (golint)
    • Line 17: warning: exported function New should have comment or be unexported (golint)
    • subscan/internal/service/common.go
    • Line 14: warning: exported method Service.SetHeartBeat should have comment or be unexported (golint)
    • Line 19: warning: exported method Service.DaemonHealth should have comment or be unexported (golint)
    • Line 23: warning: exported method Service.Metadata 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!