Preparing report...

Report for github.com/learninto/gopkg

A+    Excellent!    Found 46 issues across 85 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.

    • gopkg/cronexpr/cronexpr.go
    • Line 153: warning: cyclomatic complexity 31 of function (*Expression).Validate() is high (> 15) (gocyclo)
    • Line 42: warning: cyclomatic complexity 23 of function Parse() is high (> 15) (gocyclo)

golint47%

Golint is a linter for Go source code.

    • gopkg/namedlib/namedlib.go
    • Line 33: warning: comment on exported function Marshal should be of the form "Marshal ..." (golint)
    • Line 59: warning: comment on exported function UnMarshal should be of the form "UnMarshal ..." (golint)
    • gopkg/stringlib/stringlib.go
    • Line 8: warning: comment on exported function ToHungary should be of the form "ToHungary ..." (golint)
    • Line 21: warning: comment on exported function ToCamel should be of the form "ToCamel ..." (golint)
    • Line 34: warning: comment on exported function ToPascal should be of the form "ToPascal ..." (golint)
    • Line 119: warning: comment on exported function ToInt should be of the form "ToInt ..." (golint)
    • Line 128: warning: comment on exported function ToInt64 should be of the form "ToInt64 ..." (golint)
    • Line 134: warning: comment on exported function ToFloat64 should be of the form "ToFloat64 ..." (golint)
    • gopkg/stringx/replacer.go
    • Line 6: warning: exported type Replacer should have comment or be unexported (golint)
    • Line 16: warning: exported function NewReplacer should have comment or be unexported (golint)
    • gopkg/mr/mapreduce.go
    • Line 19: warning: exported var ErrCancelWithNil should have comment or be unexported (golint)
    • Line 24: warning: exported type GenerateFunc should have comment or be unexported (golint)
    • Line 25: warning: exported type MapFunc should have comment or be unexported (golint)
    • Line 26: warning: exported type VoidMapFunc should have comment or be unexported (golint)
    • Line 27: warning: exported type MapperFunc should have comment or be unexported (golint)
    • Line 28: warning: exported type ReducerFunc should have comment or be unexported (golint)
    • Line 29: warning: exported type VoidReducerFunc should have comment or be unexported (golint)
    • Line 30: warning: exported type Option should have comment or be unexported (golint)
    • Line 36: warning: exported type Writer should have comment or be unexported (golint)
    • Line 41: warning: exported function Finish should have comment or be unexported (golint)
    • Line 60: warning: exported function FinishVoid should have comment or be unexported (golint)
    • Line 75: warning: exported function Map should have comment or be unexported (golint)
    • Line 86: warning: exported function MapReduce should have comment or be unexported (golint)
    • Line 91: warning: exported function MapReduceWithSource should have comment or be unexported (golint)
    • Line 139: warning: exported function MapReduceVoid should have comment or be unexported (golint)
    • Line 149: warning: exported function MapVoid should have comment or be unexported (golint)
    • Line 155: warning: exported function WithWorkers should have comment or be unexported (golint)
    • Line 276: warning: exported function RunSafe should have comment or be unexported (golint)
    • Line 282: warning: exported function Recover should have comment or be unexported (golint)
    • gopkg/syncx/barrier.go
    • Line 5: warning: exported type Barrier should have comment or be unexported (golint)
    • Line 9: warning: exported method Barrier.Guard should have comment or be unexported (golint)
    • gopkg/syncx/refresource.go
    • Line 8: warning: exported var ErrUseOfCleaned should have comment or be unexported (golint)
    • Line 10: warning: exported type RefResource should have comment or be unexported (golint)
    • Line 17: warning: exported function NewRefResource should have comment or be unexported (golint)
    • Line 23: warning: exported method RefResource.Use should have comment or be unexported (golint)
    • Line 35: warning: exported method RefResource.Clean should have comment or be unexported (golint)
    • gopkg/interfacelib/interfacelib.go
    • Line 7: warning: exported function ToFloat64 should have comment or be unexported (golint)
    • Line 52: warning: exported function ToInt64 should have comment or be unexported (golint)
    • Line 96: warning: exported function ToString should have comment or be unexported (golint)
    • Line 147: warning: exported function StringToFloat64 should have comment or be unexported (golint)
    • Line 152: warning: exported function StringToInt64 should have comment or be unexported (golint)
    • gopkg/mathx/unstable.go
    • Line 9: warning: exported type Unstable should have comment or be unexported (golint)
    • Line 15: warning: exported function NewUnstable should have comment or be unexported (golint)
    • Line 29: warning: exported method Unstable.AroundDuration should have comment or be unexported (golint)
    • Line 36: warning: exported method Unstable.AroundInt should have comment or be unexported (golint)
    • gopkg/syncx/immutableresource.go
    • Line 13: warning: exported type ImmutableResourceOption should have comment or be unexported (golint)
    • Line 15: warning: exported type ImmutableResource should have comment or be unexported (golint)
    • Line 25: warning: exported function NewImmutableResource should have comment or be unexported (golint)
    • Line 38: warning: exported method ImmutableResource.Get should have comment or be unexported (golint)
    • Line 72: warning: comment on exported function WithRefreshIntervalOnFailure should be of the form "WithRefreshIntervalOnFailure ..." (golint)
    • gopkg/mathx/proba.go
    • Line 9: warning: exported type Proba should have comment or be unexported (golint)
    • Line 15: warning: exported function NewProba should have comment or be unexported (golint)
    • Line 21: warning: exported method Proba.TrueOnProba should have comment or be unexported (golint)
    • gopkg/floatlib/floatlib.go
    • Line 11: warning: comment on exported function Decimal should be of the form "Decimal ..." (golint)
    • Line 23: warning: comment on exported function Decimal2 should be of the form "Decimal2 ..." (golint)
    • Line 36: warning: exported function IsEqual should have comment or be unexported (golint)
    • gopkg/syncx/atomicduration.go
    • Line 8: warning: exported type AtomicDuration should have comment or be unexported (golint)
    • Line 10: warning: exported function NewAtomicDuration should have comment or be unexported (golint)
    • Line 14: warning: exported function ForAtomicDuration should have comment or be unexported (golint)
    • Line 20: warning: exported method AtomicDuration.CompareAndSwap should have comment or be unexported (golint)
    • Line 24: warning: exported method AtomicDuration.Load should have comment or be unexported (golint)
    • Line 28: warning: exported method AtomicDuration.Set should have comment or be unexported (golint)
    • gopkg/syncx/managedresource.go
    • Line 5: warning: exported type ManagedResource should have comment or be unexported (golint)
    • Line 12: warning: exported function NewManagedResource should have comment or be unexported (golint)
    • Line 19: warning: exported method ManagedResource.MarkBroken should have comment or be unexported (golint)
    • Line 28: warning: exported method ManagedResource.Take should have comment or be unexported (golint)
    • gopkg/syncx/pool.go
    • Line 11: warning: exported type PoolOption should have comment or be unexported (golint)
    • Line 19: warning: exported type Pool should have comment or be unexported (golint)
    • Line 31: warning: exported function NewPool should have comment or be unexported (golint)
    • Line 52: warning: exported method Pool.Get should have comment or be unexported (golint)
    • Line 78: warning: exported method Pool.Put should have comment or be unexported (golint)
    • Line 94: warning: exported function WithMaxAge should have comment or be unexported (golint)
    • gopkg/errorx/atomicerror.go
    • Line 5: warning: exported type AtomicError should have comment or be unexported (golint)
    • Line 10: warning: exported method AtomicError.Set should have comment or be unexported (golint)
    • Line 16: warning: exported method AtomicError.Load should have comment or be unexported (golint)
    • gopkg/errorx/batcherror.go
    • Line 6: warning: exported type BatchError should have comment or be unexported (golint)
    • Line 13: warning: exported method BatchError.Add should have comment or be unexported (golint)
    • Line 19: warning: exported method BatchError.Err should have comment or be unexported (golint)
    • Line 30: warning: exported method BatchError.NotNil should have comment or be unexported (golint)
    • gopkg/netx/ip.go
    • Line 5: warning: exported function InternalIp should have comment or be unexported (golint)
    • gopkg/cmdline/input.go
    • Line 10: warning: exported function EnterToContinue should have comment or be unexported (golint)
    • Line 15: warning: exported function ReadLine should have comment or be unexported (golint)
    • gopkg/stringx/trie.go
    • Line 8: warning: exported type TrieOption should have comment or be unexported (golint)
    • Line 10: warning: exported type Trie should have comment or be unexported (golint)
    • Line 26: warning: exported function NewTrie should have comment or be unexported (golint)
    • Line 133: warning: exported function WithMask should have comment or be unexported (golint)
    • gopkg/syncx/atomicfloat64.go
    • Line 8: warning: exported type AtomicFloat64 should have comment or be unexported (golint)
    • Line 10: warning: exported function NewAtomicFloat64 should have comment or be unexported (golint)
    • Line 14: warning: exported function ForAtomicFloat64 should have comment or be unexported (golint)
    • Line 20: warning: exported method AtomicFloat64.Add should have comment or be unexported (golint)
    • Line 30: warning: exported method AtomicFloat64.CompareAndSwap should have comment or be unexported (golint)
    • Line 34: warning: exported method AtomicFloat64.Load should have comment or be unexported (golint)
    • Line 38: warning: exported method AtomicFloat64.Set should have comment or be unexported (golint)
    • gopkg/syncx/resourcemanager.go
    • Line 10: warning: exported type ResourceManager should have comment or be unexported (golint)
    • Line 16: warning: exported function NewResourceManager should have comment or be unexported (golint)
    • Line 23: warning: exported method ResourceManager.Close should have comment or be unexported (golint)
    • Line 37: warning: exported method ResourceManager.GetResource should have comment or be unexported (golint)
    • gopkg/stringx/random.go
    • Line 45: warning: exported function Rand should have comment or be unexported (golint)
    • Line 49: warning: exported function RandId should have comment or be unexported (golint)
    • Line 59: warning: exported function Randn should have comment or be unexported (golint)
    • Line 77: warning: exported function Seed should have comment or be unexported (golint)
    • gopkg/stringx/strings.go
    • Line 10: warning: exported var ErrInvalidStartPosition should have comment or be unexported (golint)
    • Line 14: warning: exported function Contains should have comment or be unexported (golint)
    • Line 24: warning: exported function Filter should have comment or be unexported (golint)
    • Line 39: warning: exported function HasEmpty should have comment or be unexported (golint)
    • Line 49: warning: exported function NotEmpty should have comment or be unexported (golint)
    • Line 53: warning: exported function Remove should have comment or be unexported (golint)
    • Line 70: warning: exported function Reverse should have comment or be unexported (golint)
    • Line 96: warning: exported function TakeOne should have comment or be unexported (golint)
    • Line 99: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 104: warning: exported function TakeWithPriority should have comment or be unexported (golint)
    • Line 115: warning: exported function Union should have comment or be unexported (golint)
    • gopkg/timex/relativetime.go
    • Line 8: warning: exported function Now should have comment or be unexported (golint)
    • Line 12: warning: exported function Since should have comment or be unexported (golint)
    • Line 16: warning: exported function Time should have comment or be unexported (golint)
    • gopkg/syncx/cond.go
    • Line 10: warning: exported type Cond should have comment or be unexported (golint)
    • Line 14: warning: exported function NewCond should have comment or be unexported (golint)
    • gopkg/syncx/limit.go
    • Line 9: warning: exported var ErrReturn should have comment or be unexported (golint)
    • Line 11: warning: exported type Limit should have comment or be unexported (golint)
    • Line 15: warning: exported function NewLimit should have comment or be unexported (golint)
    • Line 21: warning: exported method Limit.Borrow should have comment or be unexported (golint)
    • Line 35: warning: exported method Limit.TryBorrow should have comment or be unexported (golint)
    • gopkg/syncx/onceguard.go
    • Line 5: warning: exported type OnceGuard should have comment or be unexported (golint)
    • Line 9: warning: exported method OnceGuard.Taken should have comment or be unexported (golint)
    • Line 13: warning: exported method OnceGuard.Take should have comment or be unexported (golint)
    • gopkg/util.go
    • Line 9: warning: exported function RowsToStruct should have comment or be unexported (golint)
    • Line 116: warning: exported function JsonToStruct should have comment or be unexported (golint)
    • gopkg/timex/ticker.go
    • Line 11: warning: exported type Ticker should have comment or be unexported (golint)
    • Line 16: warning: exported type FakeTicker should have comment or be unexported (golint)
    • Line 33: warning: exported function NewTicker should have comment or be unexported (golint)
    • Line 43: warning: exported function NewFakeTicker should have comment or be unexported (golint)
    • gopkg/syncx/donechan.go
    • Line 9: warning: exported type DoneChan should have comment or be unexported (golint)
    • Line 14: warning: exported function NewDoneChan should have comment or be unexported (golint)
    • Line 20: warning: exported method DoneChan.Close should have comment or be unexported (golint)
    • Line 26: warning: exported method DoneChan.Done should have comment or be unexported (golint)
    • gopkg/syncx/spinlock.go
    • Line 8: warning: exported type SpinLock should have comment or be unexported (golint)
    • Line 12: warning: exported method SpinLock.Lock should have comment or be unexported (golint)
    • Line 18: warning: exported method SpinLock.TryLock should have comment or be unexported (golint)
    • Line 22: warning: exported method SpinLock.Unlock should have comment or be unexported (golint)
    • gopkg/mathx/int.go
    • Line 3: warning: exported function MaxInt should have comment or be unexported (golint)
    • Line 6: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 11: warning: exported function MinInt should have comment or be unexported (golint)
    • Line 14: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • gopkg/cryptox/cryptox.go
    • Line 11: warning: comment on exported function Sha256Encode should be of the form "Sha256Encode ..." (golint)
    • Line 20: warning: comment on exported function Crc32IEEE should be of the form "Crc32IEEE ..." (golint)
    • Line 25: warning: comment on exported function Md5Encode should be of the form "Md5Encode ..." (golint)
    • gopkg/syncx/atomicbool.go
    • Line 5: warning: exported type AtomicBool should have comment or be unexported (golint)
    • Line 7: warning: exported function NewAtomicBool should have comment or be unexported (golint)
    • Line 11: warning: exported function ForAtomicBool should have comment or be unexported (golint)
    • Line 17: warning: exported method AtomicBool.CompareAndSwap should have comment or be unexported (golint)
    • Line 28: warning: exported method AtomicBool.Set should have comment or be unexported (golint)
    • Line 36: warning: exported method AtomicBool.True should have comment or be unexported (golint)
    • gopkg/syncx/timeoutlimit.go
    • Line 8: warning: exported var ErrTimeout should have comment or be unexported (golint)
    • Line 10: warning: exported type TimeoutLimit should have comment or be unexported (golint)
    • Line 15: warning: exported function NewTimeoutLimit should have comment or be unexported (golint)
    • Line 22: warning: exported method TimeoutLimit.Borrow should have comment or be unexported (golint)
    • Line 40: warning: exported method TimeoutLimit.Return should have comment or be unexported (golint)
    • Line 49: warning: exported method TimeoutLimit.TryBorrow should have comment or be unexported (golint)
    • gopkg/bytelib/bytelib.go
    • Line 9: warning: comment on exported function IntToBytes should be of the form "IntToBytes ..." (golint)
    • Line 18: warning: comment on exported function BytesToInt should be of the form "BytesToInt ..." (golint)
    • gopkg/lang/lang.go
    • Line 3: warning: exported var Placeholder should have comment or be unexported (golint)
    • Line 6: warning: exported type GenericType should have comment or be unexported (golint)
    • Line 7: warning: exported type PlaceholderType 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!