Preparing report...

Report for github.com/hydroscan/hydroscan-api

A    Great!    Found 28 issues across 32 files

Tweet

gofmt87%

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!


gocyclo96%

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.


golint12%

Golint is a linter for Go source code.

    • hydroscan-api/models/connection.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 11: warning: exported var DB should have comment or be unexported (golint)
    • Line 14: warning: exported function Connect should have comment or be unexported (golint)
    • Line 27: warning: exported function Close should have comment or be unexported (golint)
    • hydroscan-api/api/v1/token_service.go
    • Line 12: warning: exported type TopToken should have comment or be unexported (golint)
    • Line 21: warning: exported type TokensQuery should have comment or be unexported (golint)
    • Line 30: warning: exported type TokenRes should have comment or be unexported (golint)
    • Line 48: warning: exported type TokensRes should have comment or be unexported (golint)
    • Line 74: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 93: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • hydroscan-api/task/trade_price_fetcher.go
    • Line 18: warning: exported type MissingTime should have comment or be unexported (golint)
    • Line 23: warning: exported type CoinmarketcapHistoryPrice should have comment or be unexported (golint)
    • Line 27: warning: exported function UpdateHistoryTradePrice should have comment or be unexported (golint)
    • Line 82: warning: exported function UpdateOnlyVolumeUSD should have comment or be unexported (golint)
    • hydroscan-api/task/contract.go
    • Line 3: warning: exported const ProtocolV1 should have comment or be unexported (golint)
    • Line 4: warning: exported const ProtocolV1_1 should have comment or be unexported (golint)
    • Line 5: warning: exported const ProtocolV2 should have comment or be unexported (golint)
    • Line 7: warning: exported const HydroStartBlockNumberV1 should have comment or be unexported (golint)
    • Line 8: warning: exported const HydroExchangeAddressV1 should have comment or be unexported (golint)
    • Line 9: warning: exported const HydroMatchTopicV1 should have comment or be unexported (golint)
    • Line 10: warning: exported const HydroExchangeABIV1 should have comment or be unexported (golint)
    • Line 32: warning: exported const HydroStartBlockNumberV1_1 should have comment or be unexported (golint)
    • Line 33: warning: exported const HydroExchangeAddressV1_1 should have comment or be unexported (golint)
    • Line 34: warning: exported const HydroMatchTopicV1_1 should have comment or be unexported (golint)
    • Line 35: warning: exported const HydroExchangeABIV1_1 should have comment or be unexported (golint)
    • Line 72: warning: exported const HydroStartBlockNumberV2 should have comment or be unexported (golint)
    • Line 73: warning: exported const HydroExchangeAddressV2 should have comment or be unexported (golint)
    • Line 74: warning: exported const HydroMatchTopicV2 should have comment or be unexported (golint)
    • hydroscan-api/config/config.go
    • Line 7: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 11: warning: exported function Load should have comment or be unexported (golint)
    • Line 29: warning: don't use underscores in Go names; var etcd_url should be etcdURL (golint)
    • Line 31: warning: don't use underscores in Go names; var etcd_config_file should be etcdConfigFile (golint)
    • hydroscan-api/task/token_fetcher.go
    • Line 18: warning: exported type TokenPrice should have comment or be unexported (golint)
    • Line 23: warning: exported type TokenInfo should have comment or be unexported (golint)
    • Line 33: warning: exported function GetToken should have comment or be unexported (golint)
    • Line 59: warning: exported function UpdateTokenPrices should have comment or be unexported (golint)
    • Line 83: warning: exported function GetTokenInfo should have comment or be unexported (golint)
    • hydroscan-api/task/token_stats.go
    • Line 14: warning: exported type TokenTrades24hData should have comment or be unexported (golint)
    • Line 22: warning: exported function UpdateTokenVolume24h should have comment or be unexported (golint)
    • Line 57: warning: exported function UpdateTokenVolume7d should have comment or be unexported (golint)
    • Line 88: warning: exported function UpdateTokenVolume1m should have comment or be unexported (golint)
    • Line 119: warning: exported function UpdateTokenVolumeAll should have comment or be unexported (golint)
    • Line 136: warning: exported function UpdateTokenTrades24h should have comment or be unexported (golint)
    • Line 209: warning: exported function GetTokenTrades24hData should have comment or be unexported (golint)
    • hydroscan-api/api/v1/trade.go
    • Line 14: warning: exported function GetTrades should have comment or be unexported (golint)
    • Line 53: warning: exported function GetTrade should have comment or be unexported (golint)
    • Line 63: warning: exported function GetTrader should have comment or be unexported (golint)
    • Line 75: warning: exported function GetTradesChart should have comment or be unexported (golint)
    • Line 84: warning: exported function GetTradesIndicators should have comment or be unexported (golint)
    • Line 94: warning: exported function GetTradesSearch should have comment or be unexported (golint)
    • hydroscan-api/task/event_fetcher.go
    • Line 17: warning: exported type MatchEventV1 should have comment or be unexported (golint)
    • Line 32: warning: exported type OrderAddressSet should have comment or be unexported (golint)
    • Line 38: warning: exported type MatchResult should have comment or be unexported (golint)
    • Line 51: warning: exported type MatchEventV1_1 should have comment or be unexported (golint)
    • Line 56: warning: exported function FetchHistoricalLogs should have comment or be unexported (golint)
    • Line 87: warning: exported function FetchRecentLogs should have comment or be unexported (golint)
    • hydroscan-api/task/relayer_fetcher.go
    • Line 13: warning: exported type RelayerInfo should have comment or be unexported (golint)
    • Line 20: warning: exported function UpdateRelayers should have comment or be unexported (golint)
    • Line 46: warning: exported function CreateRelayerByAddressIfNotExist should have comment or be unexported (golint)
    • hydroscan-api/task/relayer_stats.go
    • Line 14: warning: exported type RelayerTrades24hData should have comment or be unexported (golint)
    • Line 21: warning: exported function UpdateRelayerVolume24h should have comment or be unexported (golint)
    • Line 56: warning: exported function UpdateRelayerTrades24h should have comment or be unexported (golint)
    • Line 120: warning: exported function GetRelayerTrades24hData should have comment or be unexported (golint)
    • hydroscan-api/models/trade.go
    • Line 12: warning: exported type Trade should have comment or be unexported (golint)
    • Line 41: warning: exported method Trade.TableName should have comment or be unexported (golint)
    • Line 45: warning: exported method Trade.BeforeCreate should have comment or be unexported (golint)
    • hydroscan-api/api/v1/relayer.go
    • Line 11: warning: exported function GetRelayers should have comment or be unexported (golint)
    • Line 17: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • Line 26: warning: exported function GetRelayer should have comment or be unexported (golint)
    • hydroscan-api/api/v1/trade_service.go
    • Line 10: warning: exported type TradesQuery should have comment or be unexported (golint)
    • Line 21: warning: exported type TradesChartQuery should have comment or be unexported (golint)
    • Line 28: warning: exported type TraderRes should have comment or be unexported (golint)
    • Line 40: warning: exported type ChartItem should have comment or be unexported (golint)
    • Line 194: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • hydroscan-api/task/task_initializer.go
    • Line 12: warning: exported var ResourcePath should have comment or be unexported (golint)
    • Line 13: warning: exported var EthClient should have comment or be unexported (golint)
    • Line 20: warning: exported const MaxReties should have comment or be unexported (golint)
    • Line 22: warning: exported function InitEthClient should have comment or be unexported (golint)
    • hydroscan-api/utils/validator.go
    • Line 10: warning: exported function IsAddress should have comment or be unexported (golint)
    • Line 21: warning: exported function IsTransaction should have comment or be unexported (golint)
    • Line 32: warning: exported function IsToken should have comment or be unexported (golint)
    • Line 41: warning: exported function IsTrader should have comment or be unexported (golint)
    • Line 53: warning: exported function IsRelayer should have comment or be unexported (golint)
    • Line 62: warning: exported function IsTokenName should have comment or be unexported (golint)
    • Line 71: warning: exported function IsTokenSymbol should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign93%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!