Preparing report...

Report for github.com/stellar/kelp

A+    Excellent!    Found 45 issues across 175 files

Tweet

gofmt90%

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!


golint89%

Golint is a linter for Go source code.

    • kelp/tests/testsupport.go
    • Line 8: warning: exported function RandomString should have comment or be unexported (golint)
    • Line 12: warning: exported function RandomStringWithLen should have comment or be unexported (golint)
    • Line 21: warning: exported function RandomInt should have comment or be unexported (golint)
    • Line 25: warning: exported function RandomIntWithMax should have comment or be unexported (golint)
    • Line 29: warning: exported function RandomDuration should have comment or be unexported (golint)
    • kelp/api/priceFeed.go
    • Line 10: warning: comment on exported type FeedPair should be of the form "FeedPair ..." (with optional leading article) (golint)
    • kelp/gui/backend/jwt_middleware.go
    • Line 14: warning: exported type Response should have comment or be unexported (golint)
    • Line 18: warning: exported type Jwks should have comment or be unexported (golint)
    • Line 22: warning: exported type JSONWebKeys should have comment or be unexported (golint)
    • Line 31: warning: exported var Auth0ConfigVarJWT should have comment or be unexported (golint)
    • Line 33: warning: exported var JWTMiddlewareVar should have comment or be unexported (golint)
    • Line 76: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • kelp/kelpdb/schema.go
    • Line 3: warning: comment on exported const SqlMarketsTableCreate should be of the form "SqlMarketsTableCreate ..." (golint)
    • Line 7: warning: exported const SqlTradesTableCreate should have comment or be unexported (golint)
    • Line 8: warning: exported const SqlTradesTableAlter1 should have comment or be unexported (golint)
    • Line 9: warning: exported const SqlStrategyMirrorTradeTriggersTableCreate should have comment or be unexported (golint)
    • Line 10: warning: exported const SqlTradesTableAlter2 should have comment or be unexported (golint)
    • Line 12: warning: comment on exported const SqlTradesIndexCreate should be of the form "SqlTradesIndexCreate ..." (golint)
    • Line 16: warning: exported const SqlTradesIndexDrop should have comment or be unexported (golint)
    • Line 17: warning: exported const SqlTradesIndexCreate2 should have comment or be unexported (golint)
    • Line 19: warning: comment on exported const SqlTradesIndexCreate3 should be of the form "SqlTradesIndexCreate3 ..." (golint)
    • Line 24: warning: comment on exported const SqlMarketsInsertTemplate should be of the form "SqlMarketsInsertTemplate ..." (golint)
    • Line 36: warning: comment on exported const SqlQueryMarketsById should be of the form "SqlQueryMarketsById ..." (golint)
    • kelp/scripts/fs_bin_gen/fs_bin_gen.go
    • Line 12: warning: don't use underscores in Go names; const fsDev_filename should be fsDevFilename (golint)
    • Line 13: warning: don't use underscores in Go names; const fs_filename should be fsFilename (golint)
    • Line 29: warning: don't use underscores in Go names; func generateWeb_Release should be generateWebRelease (golint)
    • Line 42: warning: don't use underscores in Go names; func generateWeb_Dev should be generateWebDev (golint)
    • kelp/plugins/fillDBWriter.go
    • Line 11: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 72: warning: receiver name m should be consistent with previous receiver name t for tradingMarket (golint)
    • kelp/support/kelpos/bot_state.go
    • Line 5: warning: exported type BotState should have comment or be unexported (golint)
    • Line 8: warning: exported const BotStateInitializing should have comment (or a comment on this block) or be unexported (golint)
    • kelp/plugins/binanceExchange_ws.go
    • Line 18: warning: exported const STREAM_TICKER_FMT should have comment (or a comment on this block) or be unexported (golint)
    • Line 28: warning: exported var ErrConversionWsMarketEvent should have comment or be unexported (golint)
    • Line 32: warning: exported type Subscriber should have comment or be unexported (golint)
    • kelp/gui/backend/generate_bot_name.go
    • Line 13: warning: don't use underscores in Go names; var idx_name should be idxName (golint)
    • Line 14: warning: don't use underscores in Go names; var idx_adjectives should be idxAdjectives (golint)
    • Line 15: warning: don't use underscores in Go names; var idx_animals should be idxAnimals (golint)
    • Line 394: warning: don't use underscores in Go names; var ocean_animals should be oceanAnimals (golint)
    • kelp/plugins/fiatFeed.go
    • Line 24: warning: exported const FiatErrorCodeInvalidAPIKey should have comment or be unexported (golint)
    • Line 25: warning: exported const FiatErrorCodeAccountInactive should have comment or be unexported (golint)
    • Line 26: warning: exported const FiatErrorCodeExhaustedAPIKey should have comment or be unexported (golint)
    • kelp/support/database/schema.go
    • Line 9: warning: comment on exported const SqlDbVersionTableCreate should be of the form "SqlDbVersionTableCreate ..." (golint)
    • Line 13: warning: exported const SqlDbVersionTableAlter1 should have comment or be unexported (golint)
    • Line 21: warning: comment on exported function QueryDbVersion should be of the form "QueryDbVersion ..." (golint)

gocyclo94%

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.

    • kelp/plugins/sdex.go
    • Line 646: warning: cyclomatic complexity 30 of function (*SDEX).getOrderAction() is high (> 15) (gocyclo)
    • Line 519: warning: cyclomatic complexity 22 of function (*SDEX).GetTradeHistory() is high (> 15) (gocyclo)
    • kelp/cmd/trade.go
    • Line 567: warning: cyclomatic complexity 30 of function runTradeCmd() is high (> 15) (gocyclo)
    • Line 424: warning: cyclomatic complexity 17 of function makeBot() is high (> 15) (gocyclo)
    • kelp/gui/backend/upsert_bot_config.go
    • Line 133: warning: cyclomatic complexity 29 of function (*APIServer).validateConfigs() is high (> 15) (gocyclo)
    • Line 368: warning: cyclomatic complexity 25 of function (*APIServer).checkAddTrustline() is high (> 15) (gocyclo)
    • kelp/plugins/mirrorStrategy.go
    • Line 141: warning: cyclomatic complexity 37 of function makeMirrorStrategy() is high (> 15) (gocyclo)
    • Line 591: warning: cyclomatic complexity 22 of function (*mirrorStrategy).updateLevels() is high (> 15) (gocyclo)

ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell93%

Misspell Finds commonly misspelled English words