Preparing report...

Report for github.com/grailbio/reflow

A    Great!    Found 110 issues across 309 files

Tweet

gofmt95%

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!


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.

    • reflow/lang/reflow.go
    • Line 108: warning: cyclomatic complexity 64 of function (*Expr).Type() is high (> 15) (gocyclo)
    • Line 322: warning: cyclomatic complexity 45 of function (*Expr).Eval() is high (> 15) (gocyclo)
    • reflow/local/docker.go
    • Line 326: warning: cyclomatic complexity 23 of function (*dockerExec).wait() is high (> 15) (gocyclo)
    • Line 147: warning: cyclomatic complexity 18 of function (*dockerExec).create() is high (> 15) (gocyclo)
    • reflow/syntax/module.go
    • Line 333: warning: cyclomatic complexity 29 of function (*ModuleImpl).Flags() is high (> 15) (gocyclo)
    • Line 200: warning: cyclomatic complexity 22 of function (*ModuleImpl).Init() is high (> 15) (gocyclo)
    • Line 521: warning: cyclomatic complexity 19 of function (*ModuleImpl).Make() is high (> 15) (gocyclo)
    • Line 441: warning: cyclomatic complexity 18 of function (*ModuleImpl).flagEnv() is high (> 15) (gocyclo)
    • reflow/pool/server/server.go
    • Line 125: warning: cyclomatic complexity 21 of function (allocNode).Walk() is high (> 15) (gocyclo)
    • Line 358: warning: cyclomatic complexity 17 of function (execNode).Walk() is high (> 15) (gocyclo)
    • reflow/batch/batch.go
    • Line 456: warning: cyclomatic complexity 20 of function (*Batch).read() is high (> 15) (gocyclo)
    • Line 187: warning: cyclomatic complexity 18 of function (*Run).flow() is high (> 15) (gocyclo)
    • reflow/assoc/dydbassoc/dydbassoc_test.go
    • Line 533: warning: cyclomatic complexity 24 of function TestAssocScanValidEntries() is high (> 15) (gocyclo)
    • Line 330: warning: cyclomatic complexity 17 of function TestParallelBatchGetItem() is high (> 15) (gocyclo)
    • Line 701: warning: cyclomatic complexity 17 of function TestCollectWithThreshold() is high (> 15) (gocyclo)
    • reflow/local/executor_test.go
    • Line 62: warning: cyclomatic complexity 21 of function TestExec() is high (> 15) (gocyclo)
    • Line 146: warning: cyclomatic complexity 19 of function TestProfileContextTimeOut() is high (> 15) (gocyclo)
    • Line 266: warning: cyclomatic complexity 17 of function TestExecRestore() is high (> 15) (gocyclo)
    • reflow/assoc/dydbassoc/dydbassoc.go
    • Line 348: warning: cyclomatic complexity 35 of function (*Assoc).Get() is high (> 15) (gocyclo)
    • Line 463: warning: cyclomatic complexity 27 of function (*Assoc).BatchGet() is high (> 15) (gocyclo)
    • Line 280: warning: cyclomatic complexity 16 of function (*Assoc).getUpdateComponents() is high (> 15) (gocyclo)
    • reflow/lang/yaccpar
    • Line 156: warning: cyclomatic complexity 65 of function (*yyParserImpl).Parse() is high (> 15) (gocyclo)
    • Line 53: warning: cyclomatic complexity 20 of function yyErrorMessage() is high (> 15) (gocyclo)
    • reflow/tool/info.go
    • Line 319: warning: cyclomatic complexity 22 of function (*Cmd).printExec() is high (> 15) (gocyclo)
    • Line 33: warning: cyclomatic complexity 21 of function (*Cmd).info() is high (> 15) (gocyclo)
    • Line 133: warning: cyclomatic complexity 20 of function (*Cmd).printRunInfo() is high (> 15) (gocyclo)
    • reflow/syntax/digest.go
    • Line 53: warning: cyclomatic complexity 54 of function (*Expr).digest() is high (> 15) (gocyclo)
    • Line 237: warning: cyclomatic complexity 19 of function (*Expr).digest1() is high (> 15) (gocyclo)
    • reflow/syntax/eval_test.go
    • Line 153: warning: cyclomatic complexity 17 of function TestExec() is high (> 15) (gocyclo)
    • Line 266: warning: cyclomatic complexity 16 of function evalDecls() is high (> 15) (gocyclo)
    • reflow/errors/errors.go
    • Line 209: warning: cyclomatic complexity 24 of function E() is high (> 15) (gocyclo)
    • Line 81: warning: cyclomatic complexity 18 of function (Kind).String() is high (> 15) (gocyclo)
    • reflow/syntax/switch.go
    • Line 436: warning: cyclomatic complexity 31 of function (caseUniv).IntersectOne() is high (> 15) (gocyclo)
    • Line 327: warning: cyclomatic complexity 22 of function (caseUniv).Complement() is high (> 15) (gocyclo)
    • Line 561: warning: cyclomatic complexity 21 of function (*Pat).checkMatch() is high (> 15) (gocyclo)
    • reflow/ec2cluster/instance.go
    • Line 262: warning: cyclomatic complexity 63 of function (*instance).Go() is high (> 15) (gocyclo)
    • Line 658: warning: cyclomatic complexity 20 of function (*instance).launch() is high (> 15) (gocyclo)
    • reflow/syntax/expr.go
    • Line 360: warning: cyclomatic complexity 198 of function (*Expr).init() is high (> 15) (gocyclo)
    • Line 1067: warning: cyclomatic complexity 59 of function (*Expr).Equal() is high (> 15) (gocyclo)
    • Line 1203: warning: cyclomatic complexity 44 of function (*Expr).String() is high (> 15) (gocyclo)
    • Line 1365: warning: cyclomatic complexity 37 of function (*Expr).Abbrev() is high (> 15) (gocyclo)
    • Line 1004: warning: cyclomatic complexity 16 of function (*Expr).initResources() is high (> 15) (gocyclo)
    • reflow/syntax/eval.go
    • Line 71: warning: cyclomatic complexity 156 of function (*Expr).eval() is high (> 15) (gocyclo)
    • Line 1123: warning: cyclomatic complexity 39 of function (*Expr).evalBinop() is high (> 15) (gocyclo)
    • Line 714: warning: cyclomatic complexity 31 of function (*Expr).exec() is high (> 15) (gocyclo)
    • Line 1283: warning: cyclomatic complexity 22 of function (*Expr).evalCompr() is high (> 15) (gocyclo)
    • Line 1030: warning: cyclomatic complexity 19 of function (*Expr).evalEq() is high (> 15) (gocyclo)
    • reflow/syntax/pat.go
    • Line 242: warning: cyclomatic complexity 29 of function (*Pat).BindTypes() is high (> 15) (gocyclo)
    • Line 76: warning: cyclomatic complexity 20 of function (*Pat).Equal() is high (> 15) (gocyclo)
    • Line 319: warning: cyclomatic complexity 19 of function (*Pat).BindValues() is high (> 15) (gocyclo)
    • Line 601: warning: cyclomatic complexity 17 of function (Path).Match() is high (> 15) (gocyclo)
    • Line 381: warning: cyclomatic complexity 16 of function (*Pat).Remove() is high (> 15) (gocyclo)
    • reflow/sched/scheduler_test.go
    • Line 709: warning: cyclomatic complexity 20 of function TestSchedulerLoadFailRetryTask() is high (> 15) (gocyclo)
    • Line 612: warning: cyclomatic complexity 19 of function TestSchedulerLoadUnloadExtern() is high (> 15) (gocyclo)
    • Line 822: warning: cyclomatic complexity 17 of function TestSchedulerLoadUnloadFiles() is high (> 15) (gocyclo)
    • Line 74: warning: cyclomatic complexity 16 of function TestSchedulerBasic() is high (> 15) (gocyclo)
    • reflow/values/values.go
    • Line 261: warning: cyclomatic complexity 43 of function Less() is high (> 15) (gocyclo)
    • Line 419: warning: cyclomatic complexity 32 of function Sprint() is high (> 15) (gocyclo)
    • Line 546: warning: cyclomatic complexity 31 of function WriteDigest() is high (> 15) (gocyclo)
    • reflow/sched/scheduler.go
    • Line 169: warning: cyclomatic complexity 37 of function (*Scheduler).Do() is high (> 15) (gocyclo)
    • Line 443: warning: cyclomatic complexity 36 of function (*Scheduler).run() is high (> 15) (gocyclo)
    • reflow/types/types.go
    • Line 966: warning: cyclomatic complexity 47 of function Unify() is high (> 15) (gocyclo)
    • Line 746: warning: cyclomatic complexity 31 of function (*T).Sub() is high (> 15) (gocyclo)
    • Line 675: warning: cyclomatic complexity 31 of function (*T).equal() is high (> 15) (gocyclo)
    • Line 538: warning: cyclomatic complexity 26 of function (*T).String() is high (> 15) (gocyclo)

golint85%

Golint is a linter for Go source code.

    • reflow/predictor/predictor.go
    • Line 19: warning: package comment is detached; there should be no blank lines between it and the package statement (golint)
    • Line 254: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • reflow/ec2cluster/ec2cluster.go
    • Line 527: warning: exported method Cluster.Notify should have comment or be unexported (golint)
    • Line 531: warning: exported method Cluster.Refresh should have comment or be unexported (golint)
    • Line 608: warning: exported method Cluster.InstancePriceUSD should have comment or be unexported (golint)
    • Line 613: warning: exported method Cluster.CheapestInstancePriceUSD should have comment or be unexported (golint)
    • reflow/tool/runner.go
    • Line 631: warning: exported function Rundir should have comment or be unexported (golint)
    • Line 648: warning: exported function Runbase should have comment or be unexported (golint)
    • reflow/pool/resourcepool.go
    • Line 51: warning: exported function NewResourcePool should have comment or be unexported (golint)
    • Line 55: warning: exported method ResourcePool.Init should have comment or be unexported (golint)
    • Line 65: warning: exported method ResourcePool.Resources should have comment or be unexported (golint)
    • Line 262: warning: comment on exported method ResourcePool.StopIfIdleFor should be of the form "StopIfIdleFor ..." (golint)
    • reflow/assertion.go
    • Line 562: warning: comment on exported type AssertionGeneratorMux should be of the form "AssertionGeneratorMux ..." (with optional leading article) (golint)
    • reflow/executor.go
    • Line 212: warning: exported type RemoteLogsType should have comment or be unexported (golint)
    • Line 215: warning: exported const RemoteLogsTypeUnknown should have comment (or a comment on this block) or be unexported (golint)
    • reflow/filesetjson.go
    • Line 15: warning: exported type FilesetLimiter should have comment or be unexported (golint)
    • Line 26: warning: exported method FilesetLimiter.Limit should have comment or be unexported (golint)
    • Line 53: warning: exported function GetFilesetOpLimiter should have comment or be unexported (golint)
    • reflow/pool/alloc.go
    • Line 19: warning: exported const MaxKeepaliveInterval should have comment (or a comment on this block) or be unexported (golint)
    • reflow/tool/main.go
    • Line 16: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • reflow/test/infra/test.go
    • Line 6: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 10: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 14: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • reflow/flow/flow.go
    • Line 13: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • reflow/trace/localtrace/localtracer.go
    • Line 25: warning: exported type LocalTracer should have comment or be unexported (golint)
    • Line 52: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • Line 196: warning: context.Context should be the first parameter of a function (golint)
    • reflow/test/testutil/executor.go
    • Line 59: warning: comment on exported method Exec.Result should be of the form "Result ..." (golint)
    • Line 97: warning: exported method Exec.RemoteLogs should have comment or be unexported (golint)
    • Line 218: warning: exported method Executor.Resolve should have comment or be unexported (golint)
    • reflow/fileset.go
    • Line 133: warning: exported method File.Short should have comment or be unexported (golint)
    • Line 136: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • reflow/tool/eval.go
    • Line 202: warning: comment on exported method Eval.ResolveImages should be of the form "ResolveImages ..." (golint)
    • reflow/infra/infra.go
    • Line 155: warning: exported type Ssh should have comment or be unexported (golint)
    • Line 183: warning: exported method SshKey.Flags should have comment or be unexported (golint)
    • Line 192: warning: exported method SshKey.Keys should have comment or be unexported (golint)
    • Line 195: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 333: warning: exported method Logger.Flags should have comment or be unexported (golint)
    • Line 419: warning: exported var DefaultReflowletConfig should have comment or be unexported (golint)
    • Line 443: warning: comment on exported method ReflowletConfig.InstanceConfig should be of the form "InstanceConfig ..." (golint)
    • Line 498: warning: exported var DefaultPredictorConfig should have comment or be unexported (golint)
    • Line 532: warning: exported type PredictorTestConfig should have comment or be unexported (golint)
    • Line 536: warning: exported var DefaultPredictorTestConfig should have comment or be unexported (golint)
    • reflow/sched/internal/utiltest/utiltest.go
    • Line 52: warning: exported function NewTask should have comment or be unexported (golint)
    • Line 64: warning: exported function SetLogger should have comment or be unexported (golint)
    • Line 69: warning: exported function NewRequirements should have comment or be unexported (golint)
    • Line 76: warning: exported function RandomFileset should have comment or be unexported (golint)
    • Line 99: warning: exported function RandomRepoFileset should have comment or be unexported (golint)
    • Line 118: warning: exported type TestClusterAllocReply should have comment or be unexported (golint)
    • Line 129: warning: exported type TestCluster should have comment or be unexported (golint)
    • Line 134: warning: exported function NewTestCluster should have comment or be unexported (golint)
    • Line 141: warning: exported method TestCluster.Req should have comment or be unexported (golint)
    • Line 145: warning: exported method TestCluster.CanAllocate should have comment or be unexported (golint)
    • Line 152: warning: exported method TestCluster.Allocate should have comment or be unexported (golint)
    • Line 235: warning: exported type TestPool should have comment or be unexported (golint)
    • Line 240: warning: exported function NewTestPool should have comment or be unexported (golint)
    • Line 247: warning: exported method TestPool.Name should have comment or be unexported (golint)
    • Line 251: warning: exported method TestPool.New should have comment or be unexported (golint)
    • Line 259: warning: exported method TestPool.Kill should have comment or be unexported (golint)
    • Line 264: warning: exported type TestAlloc should have comment or be unexported (golint)
    • Line 283: warning: exported function NewTestAlloc should have comment or be unexported (golint)
    • Line 287: warning: exported function NewTestAllocWithId should have comment or be unexported (golint)
    • Line 300: warning: exported method TestAlloc.ID should have comment or be unexported (golint)
    • Line 304: warning: exported method TestAlloc.Resources should have comment or be unexported (golint)
    • Line 308: warning: exported method TestAlloc.Repository should have comment or be unexported (golint)
    • Line 312: warning: exported method TestAlloc.Load should have comment or be unexported (golint)
    • Line 398: warning: exported method TestAlloc.Unload should have comment or be unexported (golint)
    • Line 416: warning: exported method TestAlloc.Put should have comment or be unexported (golint)
    • Line 426: warning: exported method TestAlloc.Keepalive should have comment or be unexported (golint)
    • Line 444: warning: exported method TestAlloc.Inspect should have comment or be unexported (golint)
    • Line 456: warning: exported method TestAlloc.Free should have comment or be unexported (golint)
    • Line 461: warning: exported method TestAlloc.RefCount should have comment or be unexported (golint)
    • Line 471: warning: exported method TestAlloc.RefCountInc should have comment or be unexported (golint)
    • Line 477: warning: exported method TestAlloc.Exec should have comment or be unexported (golint)
    • Line 486: warning: exported method TestAlloc.NExecs should have comment or be unexported (golint)
    • reflow/test/testutil/repository.go
    • Line 64: warning: exported function GetInMemoryRepository should have comment or be unexported (golint)
    • Line 153: warning: comment on exported type InmemoryLocatorRepository should be of the form "InmemoryLocatorRepository ..." (with optional leading article) (golint)
    • Line 168: warning: exported method InmemoryLocatorRepository.SetLocation should have comment or be unexported (golint)
    • Line 174: warning: comment on exported method InmemoryLocatorRepository.Location should be of the form "Location ..." (golint)
    • Line 380: warning: receiver name w should be consistent with previous receiver name r for WaitRepository (golint)
    • Line 390: warning: receiver name w should be consistent with previous receiver name r for WaitRepository (golint)
    • Line 401: warning: receiver name w should be consistent with previous receiver name r for WaitRepository (golint)
    • Line 416: warning: receiver name w should be consistent with previous receiver name r for WaitRepository (golint)
    • Line 421: warning: receiver name w should be consistent with previous receiver name r for WaitRepository (golint)
    • Line 426: warning: receiver name w should be consistent with previous receiver name r for WaitRepository (golint)
    • Line 432: warning: receiver name w should be consistent with previous receiver name r for WaitRepository (golint)
    • reflow/digester.go
    • Line 9: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 14: warning: exported var Digester should have comment or be unexported (golint)
    • reflow/sched/scheduler.go
    • Line 766: warning: if block ends with a return statement, so drop this else and outdent its block (move short variable declaration to its own line if necessary) (golint)
    • reflow/sched/internal/execstate.go
    • Line 11: warning: exported type ExecState should have comment or be unexported (golint)
    • Line 14: warning: exported const StateLoad should have comment (or a comment on this block) or be unexported (golint)
    • Line 53: warning: exported method ExecState.TraceKind should have comment or be unexported (golint)
    • reflow/bootstrap/bootstrap.go
    • Line 20: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • Line 59: warning: exported function Flags should have comment or be unexported (golint)
    • reflow/taskdb/dynamodbtask/dynamodb.go
    • Line 59: warning: exported const ID should have comment (or a comment on this block) or be unexported (golint)
    • Line 686: warning: comment on exported method TaskDB.KeepIDAlive should be of the form "KeepIDAlive ..." (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign0%

IneffAssign detects ineffectual assignments in Go code.

An error occurred while running this test (exit status 3)


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!