Preparing report...

Report for github.com/miraclesu/uniswap-sdk-go

A+    Excellent!    Found 18 issues across 25 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!


gocyclo80%

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.


golint40%

Golint is a linter for Go source code.

    • uniswap-sdk-go/entities/fraction.go
    • Line 13: warning: exported var ZeroFraction should have comment or be unexported (golint)
    • Line 16: warning: exported type Fraction should have comment or be unexported (golint)
    • Line 23: warning: exported function NewFraction should have comment or be unexported (golint)
    • Line 33: warning: comment on exported method Fraction.Quotient should be of the form "Quotient ..." (golint)
    • Line 39: warning: comment on exported method Fraction.Remainder should be of the form "Remainder ..." (golint)
    • Line 45: warning: exported method Fraction.Invert should have comment or be unexported (golint)
    • Line 49: warning: comment on exported method Fraction.Add should be of the form "Add ..." (golint)
    • Line 64: warning: comment on exported method Fraction.Subtract should be of the form "Subtract ..." (golint)
    • Line 79: warning: exported method Fraction.LessThan should have comment or be unexported (golint)
    • Line 84: warning: exported method Fraction.EqualTo should have comment or be unexported (golint)
    • Line 89: warning: exported method Fraction.GreaterThan should have comment or be unexported (golint)
    • Line 94: warning: exported method Fraction.Multiply should have comment or be unexported (golint)
    • Line 101: warning: exported method Fraction.Divide should have comment or be unexported (golint)
    • Line 108: warning: exported method Fraction.ToSignificant should have comment or be unexported (golint)
    • Line 121: warning: exported method Fraction.ToFixed should have comment or be unexported (golint)
    • uniswap-sdk-go/entities/percent.go
    • Line 11: warning: exported var Percent100 should have comment or be unexported (golint)
    • Line 14: warning: exported type Percent should have comment or be unexported (golint)
    • Line 18: warning: exported function NewPercent should have comment or be unexported (golint)
    • Line 24: warning: exported method Percent.ToSignificant should have comment or be unexported (golint)
    • Line 28: warning: exported method Percent.ToFixed should have comment or be unexported (golint)
    • uniswap-sdk-go/entities/trade.go
    • Line 10: warning: exported var ErrInvalidSlippageTolerance should have comment or be unexported (golint)
    • Line 13: warning: comment on exported type Trade should be of the form "Trade ..." (with optional leading article) (golint)
    • Line 48: warning: exported method Trade.InputAmount should have comment or be unexported (golint)
    • Line 52: warning: exported method Trade.OutputAmount should have comment or be unexported (golint)
    • Line 56: warning: comment on exported function ExactIn should be of the form "ExactIn ..." (golint)
    • Line 65: warning: comment on exported function ExactOut should be of the form "ExactOut ..." (golint)
    • Line 158: warning: comment on exported method Trade.MinimumAmountOut should be of the form "MinimumAmountOut ..." (golint)
    • Line 178: warning: comment on exported method Trade.MaximumAmountIn should be of the form "MaximumAmountIn ..." (golint)
    • uniswap-sdk-go/entities/currency.go
    • Line 19: warning: exported var ErrInvalidCurrency should have comment or be unexported (golint)
    • Line 22: warning: comment on exported type Currency should be of the form "Currency ..." (with optional leading article) (golint)
    • Line 49: warning: exported method Currency.Equals should have comment or be unexported (golint)
    • uniswap-sdk-go/entities/trade_best.go
    • Line 10: warning: exported var ErrInvalidOption should have comment or be unexported (golint)
    • Line 14: warning: exported type BestTradeOptions should have comment or be unexported (golint)
    • Line 21: warning: exported function NewDefaultBestTradeOptions should have comment or be unexported (golint)
    • Line 28: warning: exported method BestTradeOptions.ReduceHops should have comment or be unexported (golint)
    • Line 35: warning: comment on exported type InputOutput should be of the form "InputOutput ..." (with optional leading article) (golint)
    • Line 41: warning: comment on exported function InputOutputComparator should be of the form "InputOutputComparator ..." (golint)
    • Line 69: warning: comment on exported function TradeComparator should be of the form "TradeComparator ..." (golint)
    • Line 87: warning: comment on exported function SortedInsert should be of the form "SortedInsert ..." (golint)
    • Line 129: warning: comment on exported function BestTradeExactIn should be of the form "BestTradeExactIn ..." (golint)
    • Line 232: warning: comment on exported function BestTradeExactOut should be of the form "BestTradeExactOut ..." (golint)
    • uniswap-sdk-go/number/option.go
    • Line 10: warning: exported type Options should have comment or be unexported (golint)
    • Line 53: warning: exported type Option should have comment or be unexported (golint)
    • Line 65: warning: exported method Options.Apply should have comment or be unexported (golint)
    • Line 77: warning: exported function WithDecimalSeparator should have comment or be unexported (golint)
    • Line 83: warning: exported function WithGroupSeparator should have comment or be unexported (golint)
    • Line 89: warning: exported function WithGroupSize should have comment or be unexported (golint)
    • Line 95: warning: exported function WithSecondaryGroupSize should have comment or be unexported (golint)
    • Line 101: warning: exported function WithFractionGroupSeparator should have comment or be unexported (golint)
    • Line 107: warning: exported function WithFractionGroupSize should have comment or be unexported (golint)
    • Line 113: warning: exported function WithDecimalPlaces should have comment or be unexported (golint)
    • Line 119: warning: exported function WithRoundingMode should have comment or be unexported (golint)
    • Line 125: warning: exported function WithRoundingPrecision should have comment or be unexported (golint)
    • uniswap-sdk-go/entities/price.go
    • Line 12: warning: exported type Price should have comment or be unexported (golint)
    • Line 19: warning: exported function NewPriceFromRoute should have comment or be unexported (golint)
    • Line 42: warning: comment on exported function NewPrice should be of the form "NewPrice ..." (golint)
    • Line 53: warning: exported method Price.Raw should have comment or be unexported (golint)
    • Line 57: warning: exported method Price.Adjusted should have comment or be unexported (golint)
    • Line 62: warning: exported method Price.Invert should have comment or be unexported (golint)
    • Line 66: warning: exported method Price.Multiply should have comment or be unexported (golint)
    • Line 76: warning: comment on exported method Price.Quote should be of the form "Quote ..." (golint)
    • Line 85: warning: exported method Price.ToSignificant should have comment or be unexported (golint)
    • Line 89: warning: exported method Price.ToFixed should have comment or be unexported (golint)
    • uniswap-sdk-go/entities/pair.go
    • Line 20: warning: exported var ErrInvalidLiquidity should have comment or be unexported (golint)
    • Line 24: warning: exported type TokenAmounts should have comment or be unexported (golint)
    • Line 26: warning: exported type Tokens should have comment or be unexported (golint)
    • Line 28: warning: exported function NewTokenAmounts should have comment or be unexported (golint)
    • Line 39: warning: exported type PairAddressCache should have comment or be unexported (golint)
    • Line 81: warning: exported type Pair should have comment or be unexported (golint)
    • Line 87: warning: exported function NewPair should have comment or be unexported (golint)
    • Line 101: warning: exported method Pair.GetAddress should have comment or be unexported (golint)
    • Line 105: warning: comment on exported method Pair.InvolvesToken should be of the form "InvolvesToken ..." (golint)
    • Line 113: warning: comment on exported method Pair.Token0Price should be of the form "Token0Price ..." (golint)
    • Line 120: warning: comment on exported method Pair.Token1Price should be of the form "Token1Price ..." (golint)
    • Line 127: warning: comment on exported method Pair.PriceOf should be of the form "PriceOf ..." (golint)
    • Line 142: warning: comment on exported method Pair.ChainID should be of the form "ChainID ..." (golint)
    • Line 149: warning: exported method Pair.Token0 should have comment or be unexported (golint)
    • Line 153: warning: exported method Pair.Token1 should have comment or be unexported (golint)
    • Line 157: warning: exported method Pair.Reserve0 should have comment or be unexported (golint)
    • Line 161: warning: exported method Pair.Reserve1 should have comment or be unexported (golint)
    • Line 165: warning: exported method Pair.ReserveOf should have comment or be unexported (golint)
    • Line 176: warning: exported method Pair.GetOutputAmount should have comment or be unexported (golint)
    • Line 225: warning: exported method Pair.GetInputAmount should have comment or be unexported (golint)
    • Line 275: warning: exported method Pair.GetLiquidityMinted should have comment or be unexported (golint)
    • Line 311: warning: exported method Pair.GetLiquidityValue should have comment or be unexported (golint)
    • uniswap-sdk-go/entities/route.go
    • Line 10: warning: exported var ErrInvalidPairs should have comment or be unexported (golint)
    • Line 17: warning: exported type Route should have comment or be unexported (golint)
    • Line 25: warning: exported function NewRoute should have comment or be unexported (golint)
    • Line 72: warning: exported method Route.ChainID should have comment or be unexported (golint)
    • uniswap-sdk-go/constants/const.go
    • Line 10: warning: exported type TradeType should have comment or be unexported (golint)
    • Line 13: warning: exported const ExactInput should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type Rounding should have comment or be unexported (golint)
    • Line 20: warning: exported const RoundDown should have comment (or a comment on this block) or be unexported (golint)
    • Line 33: warning: exported const Decimals18 should have comment (or a comment on this block) or be unexported (golint)
    • Line 39: warning: exported var MinimumLiquidity should have comment or be unexported (golint)
    • Line 53: warning: exported type SolidityType should have comment or be unexported (golint)
    • Line 56: warning: exported const Uint8 should have comment (or a comment on this block) or be unexported (golint)
    • Line 61: warning: exported var SolidityTypeMaxima should have comment or be unexported (golint)
    • Line 68: warning: exported var FactoryAddress should have comment or be unexported (golint)
    • uniswap-sdk-go/entities/currency_amount.go
    • Line 12: warning: exported var ErrInsufficientReserves should have comment or be unexported (golint)
    • Line 16: warning: exported type CurrencyAmount should have comment or be unexported (golint)
    • Line 21: warning: comment on exported function NewCurrencyAmount should be of the form "NewCurrencyAmount ..." (golint)
    • Line 34: warning: exported method CurrencyAmount.Raw should have comment or be unexported (golint)
    • Line 38: warning: comment on exported function NewEther should be of the form "NewEther ..." (golint)
    • uniswap-sdk-go/entities/trade_test.go
    • Line 19: warning: don't use underscores in Go names; var tokenAmount_0_100 should be tokenAmount0_100 (golint)
    • Line 20: warning: don't use underscores in Go names; var tokenAmount_0_1000 should be tokenAmount0_1000 (golint)
    • Line 21: warning: don't use underscores in Go names; var tokenAmount_1_1000 should be tokenAmount1_1000 (golint)
    • Line 22: warning: don't use underscores in Go names; var tokenAmount_1_1200 should be tokenAmount1_1200 (golint)
    • Line 23: warning: don't use underscores in Go names; var tokenAmount_2_1000 should be tokenAmount2_1000 (golint)
    • Line 24: warning: don't use underscores in Go names; var tokenAmount_2_1100 should be tokenAmount2_1100 (golint)
    • Line 25: warning: don't use underscores in Go names; var tokenAmount_3_900 should be tokenAmount3_900 (golint)
    • Line 26: warning: don't use underscores in Go names; var tokenAmount_3_1300 should be tokenAmount3_1300 (golint)
    • Line 28: warning: don't use underscores in Go names; var pair_0_1 should be pair0_1 (golint)
    • Line 29: warning: don't use underscores in Go names; var pair_0_2 should be pair0_2 (golint)
    • Line 30: warning: don't use underscores in Go names; var pair_0_3 should be pair0_3 (golint)
    • Line 31: warning: don't use underscores in Go names; var pair_1_2 should be pair1_2 (golint)
    • Line 32: warning: don't use underscores in Go names; var pair_1_3 should be pair1_3 (golint)
    • Line 37: warning: don't use underscores in Go names; var tokenAmount_0_weth should be tokenAmount0Weth (golint)
    • Line 38: warning: don't use underscores in Go names; var pair_weth_0 should be pairWeth0 (golint)
    • Line 40: warning: don't use underscores in Go names; var tokenAmount_0_0 should be tokenAmount0_0 (golint)
    • Line 41: warning: don't use underscores in Go names; var tokenAmount_1_0 should be tokenAmount1_0 (golint)
    • Line 42: warning: don't use underscores in Go names; var empty_pair_0_1 should be emptyPair0_1 (golint)
    • Line 184: warning: don't use underscores in Go names; var tokenAmount_2_99 should be tokenAmount2_99 (golint)
    • Line 185: warning: don't use underscores in Go names; var tokenAmount_2_69 should be tokenAmount2_69 (golint)
    • Line 616: warning: don't use underscores in Go names; var tokenAmount_1_100 should be tokenAmount1_100 (golint)
    • Line 617: warning: don't use underscores in Go names; var tokenAmount_2_100 should be tokenAmount2_100 (golint)
    • Line 680: warning: don't use underscores in Go names; var tokenAmount_0_101 should be tokenAmount0_101 (golint)
    • Line 681: warning: don't use underscores in Go names; var tokenAmount_0_156 should be tokenAmount0_156 (golint)
    • uniswap-sdk-go/entities/token.go
    • Line 14: warning: exported var ErrDiffChainID should have comment or be unexported (golint)
    • Line 49: warning: comment on exported type Token should be of the form "Token ..." (with optional leading article) (golint)
    • Line 59: warning: exported function NewToken should have comment or be unexported (golint)
    • Line 72: warning: comment on exported method Token.Equals should be of the form "Equals ..." (golint)
    • Line 84: warning: comment on exported method Token.SortsBefore should be of the form "SortsBefore ..." (golint)
    • uniswap-sdk-go/entities/token_amount.go
    • Line 5: warning: exported type TokenAmount should have comment or be unexported (golint)
    • Line 10: warning: comment on exported function NewTokenAmount should be of the form "NewTokenAmount ..." (golint)
    • Line 23: warning: exported method TokenAmount.Add should have comment or be unexported (golint)
    • Line 31: warning: exported method TokenAmount.Subtract should have comment or be unexported (golint)
    • Line 39: warning: exported method TokenAmount.Equals 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!