Preparing report...

Report for github.com/TrustWallet/watchmarket

A    Great!    Found 52 issues across 86 files

Tweet

gofmt98%

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!


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.


golint41%

Golint is a linter for Go source code.

    • watchmarket/services/cache/memory/base.go
    • Line 13: warning: exported type Instance should have comment or be unexported (golint)
    • Line 20: warning: exported function Init should have comment or be unexported (golint)
    • Line 24: warning: exported method Instance.GetID should have comment or be unexported (golint)
    • Line 28: warning: exported method Instance.GenerateKey should have comment or be unexported (golint)
    • Line 33: warning: exported method Instance.Set should have comment or be unexported (golint)
    • Line 38: warning: exported method Instance.Get should have comment or be unexported (golint)
    • Line 46: warning: exported method Instance.SetWithTime should have comment or be unexported (golint)
    • Line 50: warning: exported method Instance.GetWithTime should have comment or be unexported (golint)
    • Line 54: warning: exported method Instance.GetLenOfSavedItems should have comment or be unexported (golint)
    • watchmarket/services/controllers/charts/base.go
    • Line 22: warning: exported type Controller should have comment or be unexported (golint)
    • Line 31: warning: exported function NewController should have comment or be unexported (golint)
    • Line 49: warning: comment on exported method Controller.HandleChartsRequest should be of the form "HandleChartsRequest ..." (golint)
    • watchmarket/db/postgres/db.go
    • Line 14: warning: exported type Instance should have comment or be unexported (golint)
    • Line 18: warning: exported function New should have comment or be unexported (golint)
    • Line 44: warning: exported function FatalWorker should have comment or be unexported (golint)
    • watchmarket/services/markets/fixer/base.go
    • Line 3: warning: exported type Provider should have comment or be unexported (golint)
    • Line 8: warning: exported function InitProvider should have comment or be unexported (golint)
    • Line 12: warning: exported method Provider.GetProvider should have comment or be unexported (golint)
    • watchmarket/api/endpoint/errors.go
    • Line 10: warning: exported type ErrorResponse should have comment or be unexported (golint)
    • Line 13: warning: exported type ErrorDetails should have comment or be unexported (golint)
    • Line 17: warning: exported type ErrorCode should have comment or be unexported (golint)
    • watchmarket/services/controllers/tickers/base.go
    • Line 17: warning: exported type Controller should have comment or be unexported (golint)
    • Line 25: warning: exported function NewController should have comment or be unexported (golint)
    • Line 40: warning: exported method Controller.HandleTickersRequest should have comment or be unexported (golint)
    • watchmarket/services/markets/coingecko/models.go
    • Line 11: warning: exported type Charts should have comment or be unexported (golint)
    • Line 17: warning: exported type Volume should have comment or be unexported (golint)
    • Line 19: warning: exported type CoinResult should have comment or be unexported (golint)
    • Line 26: warning: exported type CoinPrices should have comment or be unexported (golint)
    • Line 28: warning: exported type CoinPrice should have comment or be unexported (golint)
    • Line 44: warning: exported type Coins should have comment or be unexported (golint)
    • Line 46: warning: exported type Coin should have comment or be unexported (golint)
    • Line 53: warning: exported type Platforms should have comment or be unexported (golint)
    • watchmarket/services/controllers/controllers.go
    • Line 8: warning: exported type TickersController should have comment or be unexported (golint)
    • Line 12: warning: exported type RatesController should have comment or be unexported (golint)
    • Line 17: warning: exported type ChartsController should have comment or be unexported (golint)
    • Line 21: warning: exported type InfoController should have comment or be unexported (golint)
    • watchmarket/services/markets/markets.go
    • Line 14: warning: exported type Provider should have comment or be unexported (golint)
    • Line 18: warning: exported type RatesAPI should have comment or be unexported (golint)
    • Line 23: warning: exported type TickersAPI should have comment or be unexported (golint)
    • Line 28: warning: exported type ChartsAPI should have comment or be unexported (golint)
    • Line 34: warning: exported type Providers should have comment or be unexported (golint)
    • Line 35: warning: exported type RatesAPIs should have comment or be unexported (golint)
    • Line 36: warning: exported type TickersAPIs should have comment or be unexported (golint)
    • Line 37: warning: exported type ChartsAPIs should have comment or be unexported (golint)
    • Line 39: warning: exported type APIs should have comment or be unexported (golint)
    • Line 46: warning: exported function Init should have comment or be unexported (golint)
    • watchmarket/db/postgres/ticker.go
    • Line 12: warning: exported method Instance.AddTickers should have comment or be unexported (golint)
    • Line 62: warning: exported method Instance.GetTickers should have comment or be unexported (golint)
    • Line 74: warning: exported method Instance.GetAllTickers should have comment or be unexported (golint)
    • watchmarket/services/cache/redis/base.go
    • Line 12: warning: exported type Instance should have comment or be unexported (golint)
    • Line 20: warning: exported function Init should have comment or be unexported (golint)
    • Line 28: warning: exported method Instance.GetID should have comment or be unexported (golint)
    • Line 32: warning: exported method Instance.GenerateKey should have comment or be unexported (golint)
    • Line 37: warning: exported method Instance.Get should have comment or be unexported (golint)
    • Line 45: warning: exported method Instance.Set should have comment or be unexported (golint)
    • Line 56: warning: exported method Instance.GetLenOfSavedItems should have comment or be unexported (golint)
    • watchmarket/redis/redis.go
    • Line 10: warning: exported type Redis should have comment or be unexported (golint)
    • Line 14: warning: exported function Init should have comment or be unexported (golint)
    • Line 27: warning: exported method Redis.Get should have comment or be unexported (golint)
    • Line 38: warning: exported method Redis.Set should have comment or be unexported (golint)
    • Line 46: warning: exported method Redis.Delete should have comment or be unexported (golint)
    • Line 54: warning: exported method Redis.IsAvailable should have comment or be unexported (golint)
    • Line 58: warning: exported method Redis.Reconnect should have comment or be unexported (golint)
    • watchmarket/services/assets/client.go
    • Line 15: warning: exported type Client should have comment or be unexported (golint)
    • Line 19: warning: exported function Init should have comment or be unexported (golint)
    • Line 23: warning: exported method Client.GetCoinInfo should have comment or be unexported (golint)
    • watchmarket/api/api.go
    • Line 14: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 18: warning: exported function SetupBasicAPI should have comment or be unexported (golint)
    • Line 23: warning: exported function SetupSwaggerAPI should have comment or be unexported (golint)
    • Line 27: warning: exported function SetupInfoAPI should have comment or be unexported (golint)
    • Line 35: warning: exported function SetupChartsAPI should have comment or be unexported (golint)
    • Line 43: warning: exported function SetupTickersAPI should have comment or be unexported (golint)
    • Line 57: warning: exported function SetupRatesAPI should have comment or be unexported (golint)
    • watchmarket/api/endpoint/tickers.go
    • Line 14: warning: comment on exported function GetTickersHandler should be of the form "GetTickersHandler ..." (golint)
    • Line 48: warning: comment on exported function GetTickerHandlerV2 should be of the form "GetTickerHandlerV2 ..." (golint)
    • Line 74: warning: comment on exported function PostTickersHandlerV2 should be of the form "PostTickersHandlerV2 ..." (golint)
    • Line 109: warning: comment on exported function GetTickersHandlerV2 should be of the form "GetTickersHandlerV2 ..." (golint)
    • watchmarket/services/markets/coinmarketcap/models.go
    • Line 10: warning: exported type CoinPrices should have comment or be unexported (golint)
    • Line 15: warning: exported type Status should have comment or be unexported (golint)
    • Line 21: warning: exported type Coin should have comment or be unexported (golint)
    • Line 26: warning: exported type Data should have comment or be unexported (golint)
    • Line 35: warning: exported type Platform should have comment or be unexported (golint)
    • Line 40: warning: exported type Quote should have comment or be unexported (golint)
    • Line 44: warning: exported type USD should have comment or be unexported (golint)
    • Line 51: warning: exported type CoinMap should have comment or be unexported (golint)
    • Line 58: warning: exported type CoinResult should have comment or be unexported (golint)
    • Line 65: warning: exported type Charts should have comment or be unexported (golint)
    • Line 69: warning: exported type ChartQuotes should have comment or be unexported (golint)
    • Line 71: warning: exported type ChartQuoteValues should have comment or be unexported (golint)
    • Line 73: warning: exported type ChartInfo should have comment or be unexported (golint)
    • Line 77: warning: exported type ChartInfoData should have comment or be unexported (golint)
    • Line 85: warning: exported type ChartInfoQuote should have comment or be unexported (golint)
    • Line 91: warning: exported type CmcSlice should have comment or be unexported (golint)
    • Line 93: warning: exported type CoinMapping should have comment or be unexported (golint)
    • watchmarket/db/postgres/rate.go
    • Line 8: warning: exported method Instance.AddRates should have comment or be unexported (golint)
    • Line 29: warning: exported method Instance.GetRates should have comment or be unexported (golint)
    • Line 38: warning: exported method Instance.GetAllRates should have comment or be unexported (golint)
    • Line 46: warning: exported method Instance.GetRatesByProvider should have comment or be unexported (golint)
    • watchmarket/services/worker/worker.go
    • Line 14: warning: exported type Worker should have comment or be unexported (golint)
    • Line 23: warning: exported function Init should have comment or be unexported (golint)
    • Line 39: warning: exported method Worker.AddOperation should have comment or be unexported (golint)
    • watchmarket/api/endpoint/info.go
    • Line 12: warning: comment on exported function GetCoinInfoHandler should be of the form "GetCoinInfoHandler ..." (golint)
    • Line 49: warning: comment on exported function GetCoinInfoHandlerV2 should be of the form "GetCoinInfoHandlerV2 ..." (golint)
    • watchmarket/internal/base.go
    • Line 15: warning: exported function GetConfigPath should have comment or be unexported (golint)
    • Line 22: warning: exported function SetupGracefulShutdown should have comment or be unexported (golint)
    • watchmarket/services/controllers/rates/base.go
    • Line 16: warning: exported type Controller should have comment or be unexported (golint)
    • Line 23: warning: exported function NewController should have comment or be unexported (golint)
    • Line 37: warning: exported method Controller.HandleRatesRequest should have comment or be unexported (golint)
    • Line 54: warning: exported method Controller.GetFiatRates should have comment or be unexported (golint)
    • watchmarket/services/controllers/models.go
    • Line 13: warning: exported type TickerRequest should have comment or be unexported (golint)
    • Line 18: warning: exported type TickerRequestV2 should have comment or be unexported (golint)
    • Line 23: warning: exported type Asset should have comment or be unexported (golint)
    • Line 29: warning: exported type TickerResponse should have comment or be unexported (golint)
    • Line 34: warning: exported type TickerResponseV2 should have comment or be unexported (golint)
    • Line 39: warning: exported type RateRequest should have comment or be unexported (golint)
    • Line 45: warning: exported type RateResponse should have comment or be unexported (golint)
    • Line 49: warning: exported type FiatRate should have comment or be unexported (golint)
    • Line 54: warning: exported type FiatRates should have comment or be unexported (golint)
    • Line 56: warning: exported type TickerPrice should have comment or be unexported (golint)
    • Line 63: warning: exported type ChartRequest should have comment or be unexported (golint)
    • Line 70: warning: exported type DetailsRequest should have comment or be unexported (golint)
    • Line 75: warning: exported type InfoResponse should have comment or be unexported (golint)
    • Line 86: warning: exported function GetCoinId should have comment or be unexported (golint)
    • Line 97: warning: exported function GetCurrency should have comment or be unexported (golint)
    • Line 105: warning: exported function GetTimeStart should have comment or be unexported (golint)
    • Line 113: warning: exported function GetMaxItems should have comment or be unexported (golint)
    • watchmarket/services/cache/redis/time.go
    • Line 11: warning: exported type CachedInterval should have comment or be unexported (golint)
    • Line 17: warning: exported method Instance.GetWithTime should have comment or be unexported (golint)
    • Line 40: warning: exported method Instance.SetWithTime should have comment or be unexported (golint)
    • watchmarket/api/endpoint/charts.go
    • Line 11: warning: comment on exported function GetChartsHandler should be of the form "GetChartsHandler ..." (golint)
    • Line 53: warning: comment on exported function GetChartsHandlerV2 should be of the form "GetChartsHandlerV2 ..." (golint)
    • watchmarket/api/endpoint/rates.go
    • Line 12: warning: comment on exported function GetRate should be of the form "GetRate ..." (golint)
    • Line 46: warning: comment on exported function GetFiatRates should be of the form "GetFiatRates ..." (golint)
    • watchmarket/db/models/generic.go
    • Line 6: warning: exported type IDModel should have comment or be unexported (golint)
    • Line 10: warning: exported type CreatedAtModel should have comment or be unexported (golint)
    • Line 14: warning: exported type BasicModel should have comment or be unexported (golint)
    • Line 19: warning: exported type ExtendedModel should have comment or be unexported (golint)
    • Line 24: warning: exported type BasicTimeModel should have comment or be unexported (golint)
    • Line 29: warning: exported type ShowOption should have comment or be unexported (golint)
    • Line 33: warning: exported const Default should have comment (or a comment on this block) or be unexported (golint)
    • watchmarket/services/controllers/info/base.go
    • Line 18: warning: exported type Controller should have comment or be unexported (golint)
    • Line 26: warning: exported function NewController should have comment or be unexported (golint)
    • Line 42: warning: exported method Controller.HandleInfoRequest should have comment or be unexported (golint)
    • watchmarket/pkg/watchmarket/models.go
    • Line 9: warning: exported type Rate should have comment or be unexported (golint)
    • Line 18: warning: exported type Rates should have comment or be unexported (golint)
    • Line 20: warning: exported type CoinType should have comment or be unexported (golint)
    • Line 22: warning: exported type Ticker should have comment or be unexported (golint)
    • Line 37: warning: exported type Price should have comment or be unexported (golint)
    • Line 44: warning: exported type Tickers should have comment or be unexported (golint)
    • Line 46: warning: exported type Chart should have comment or be unexported (golint)
    • Line 52: warning: exported type ChartPrice should have comment or be unexported (golint)
    • Line 57: warning: exported type CoinDetails should have comment or be unexported (golint)
    • Line 63: warning: exported type Info should have comment or be unexported (golint)
    • Line 75: warning: exported type SocialLink should have comment or be unexported (golint)
    • Line 83: warning: exported const UnknownCoinID should have comment (or a comment on this block) or be unexported (golint)
    • Line 99: warning: exported method Chart.IsEmpty should have comment or be unexported (golint)
    • Line 103: warning: exported method CoinDetails.IsEmpty should have comment or be unexported (golint)
    • Line 114: warning: exported function TruncateWithPrecision should have comment or be unexported (golint)
    • Line 119: warning: exported function UnixToDuration should have comment or be unexported (golint)
    • Line 123: warning: exported function DurationToUnix should have comment or be unexported (golint)
    • Line 127: warning: exported function IsRespectableValue should have comment or be unexported (golint)
    • Line 131: warning: exported function IsSuitableUpdateTime should have comment or be unexported (golint)
    • Line 145: warning: exported function IsFiatRate 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!