Preparing report...

Report for github.com/codeactual/transplant

A+    Excellent!    Found 64 issues across 109 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!


gocyclo90%

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.

    • transplant/internal/transplant/audit.go
    • Line 1602: warning: cyclomatic complexity 55 of function (*Audit).findUsedDepGlobals() is high (> 15) (gocyclo)
    • Line 423: warning: cyclomatic complexity 33 of function (*Audit).finalizeConfig() is high (> 15) (gocyclo)
    • Line 1066: warning: cyclomatic complexity 31 of function (*Audit).findUsedDepPkgs() is high (> 15) (gocyclo)
    • Line 1457: warning: cyclomatic complexity 28 of function (*Audit).findDepUsage() is high (> 15) (gocyclo)
    • Line 927: warning: cyclomatic complexity 21 of function (*Audit).findFiles() is high (> 15) (gocyclo)

golint44%

Golint is a linter for Go source code.

    • transplant/internal/cage/go/build/pkgcache.go
    • Line 44: warning: exported type PackageCache should have comment or be unexported (golint)
    • Line 50: warning: exported function NewPackageCache should have comment or be unexported (golint)
    • Line 57: warning: exported method PackageCache.SrcDirInKey should have comment or be unexported (golint)
    • Line 61: warning: exported method PackageCache.SetContext should have comment or be unexported (golint)
    • Line 65: warning: exported method PackageCache.Import should have comment or be unexported (golint)
    • Line 102: warning: exported method PackageCache.GetDeps should have comment or be unexported (golint)
    • transplant/internal/cage/strings/strings.go
    • Line 15: warning: comment on exported function TruncateAppendHint should be of the form "TruncateAppendHint ..." (golint)
    • Line 23: warning: comment on exported function TruncatePrependHint should be of the form "TruncatePrependHint ..." (golint)
    • Line 66: warning: exported function SliceOfSlice should have comment or be unexported (golint)
    • Line 82: warning: exported function SortStable should have comment or be unexported (golint)
    • Line 86: warning: exported function SortReverseStable should have comment or be unexported (golint)
    • Line 90: warning: comment on exported function StringKeyPtr should be of the form "StringKeyPtr ..." (golint)
    • transplant/internal/cage/graph/dag/dag.go
    • Line 40: warning: exported function NewGraph should have comment or be unexported (golint)
    • Line 46: warning: exported method Graph.Add should have comment or be unexported (golint)
    • Line 56: warning: exported method Graph.HasVertex should have comment or be unexported (golint)
    • Line 60: warning: exported method Graph.HasEdge should have comment or be unexported (golint)
    • Line 64: warning: exported method Graph.VerticesFrom should have comment or be unexported (golint)
    • Line 72: warning: exported method Graph.Connect should have comment or be unexported (golint)
    • Line 84: warning: exported method Graph.HasPathDepthFirst should have comment or be unexported (golint)
    • Line 131: warning: exported method Graph.Copy should have comment or be unexported (golint)
    • Line 145: warning: exported method Graph.DebugLogEvents should have comment or be unexported (golint)
    • transplant/internal/cage/cli/handler/mixin/log/pprof/pprof.go
    • Line 26: warning: exported type Mixin should have comment or be unexported (golint)
    • Line 33: warning: comment on exported method Mixin.BindCobraFlags should be of the form "BindCobraFlags ..." (golint)
    • Line 40: warning: comment on exported method Mixin.Name should be of the form "Name ..." (golint)
    • Line 45: warning: comment on exported method Mixin.PreRun should be of the form "PreRun ..." (golint)
    • Line 63: warning: comment on exported method Mixin.PostRun should be of the form "PostRun ..." (golint)
    • Line 82: warning: exported method Mixin.Do should have comment or be unexported (golint)
    • transplant/internal/cage/go/ast/ast.go
    • Line 35: warning: exported function FileSetNodeToString should have comment or be unexported (golint)
    • Line 40: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 45: warning: exported function FileSetNodeToStringShort should have comment or be unexported (golint)
    • Line 50: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 55: warning: exported function PositionStringShort should have comment or be unexported (golint)
    • Line 112: warning: exported function DotImportPaths should have comment or be unexported (golint)
    • transplant/internal/cage/os/exec/exec.go
    • Line 7: warning: package comment should be of the form "Package exec ..." (golint)
    • Line 31: warning: exported const SigIntDelay should have comment (or a comment on this block) or be unexported (golint)
    • Line 35: warning: exported type Result should have comment or be unexported (golint)
    • Line 52: warning: exported type PipelineResult should have comment or be unexported (golint)
    • Line 406: warning: exported function ArgToCmd should have comment or be unexported (golint)
    • transplant/internal/cage/cli/handler/handler.go
    • Line 7: warning: package comment should be of the form "Package handler ..." (golint)
    • Line 38: warning: exported type Mixin should have comment or be unexported (golint)
    • Line 110: warning: exported method DefaultSession.Err should have comment or be unexported (golint)
    • Line 117: warning: exported method DefaultSession.Out should have comment or be unexported (golint)
    • Line 124: warning: exported method DefaultSession.In should have comment or be unexported (golint)
    • Line 144: warning: exported method DefaultSession.SetErr should have comment or be unexported (golint)
    • Line 148: warning: exported method DefaultSession.SetOut should have comment or be unexported (golint)
    • Line 152: warning: exported method DefaultSession.SetIn should have comment or be unexported (golint)
    • Line 156: warning: exported method DefaultSession.OnSignal should have comment or be unexported (golint)
    • Line 176: warning: exported method DefaultSession.ExitOnErr should have comment or be unexported (golint)
    • Line 190: warning: exported method DefaultSession.ExitOnErrShort should have comment or be unexported (golint)
    • Line 204: warning: exported method DefaultSession.ExitOnErrsShort should have comment or be unexported (golint)
    • Line 219: warning: exported method DefaultSession.Exitf should have comment or be unexported (golint)
    • Line 230: warning: exported function Version should have comment or be unexported (golint)
    • transplant/internal/cage/os/file/file.go
    • Line 47: warning: exported function Readdir should have comment or be unexported (golint)
    • Line 59: warning: exported function Readdirnames should have comment or be unexported (golint)
    • Line 72: warning: exported function ValidateRemove should have comment or be unexported (golint)
    • Line 87: warning: exported function RemoveAllSafer should have comment or be unexported (golint)
    • Line 94: warning: exported function RemoveSafer should have comment or be unexported (golint)
    • transplant/internal/cage/structs/structs.go
    • Line 13: warning: exported type MergeMode should have comment or be unexported (golint)
    • Line 16: warning: exported const MergeModeCombine should have comment (or a comment on this block) or be unexported (golint)
    • Line 20: warning: exported function ToStringMap should have comment or be unexported (golint)
    • Line 28: warning: exported function MergeStringMap should have comment or be unexported (golint)
    • Line 48: warning: exported function MergeAsStringMap should have comment or be unexported (golint)
    • transplant/internal/cage/strings/set.go
    • Line 11: warning: exported type Set should have comment or be unexported (golint)
    • Line 26: warning: exported method Set.Add should have comment or be unexported (golint)
    • Line 39: warning: exported method Set.AddSet should have comment or be unexported (golint)
    • Line 52: warning: exported method Set.AddSlice should have comment or be unexported (golint)
    • Line 65: warning: exported method Set.Remove should have comment or be unexported (golint)
    • Line 77: warning: exported method Set.Contains should have comment or be unexported (golint)
    • Line 85: warning: exported method Set.Len should have comment or be unexported (golint)
    • Line 92: warning: exported method Set.Slice should have comment or be unexported (golint)
    • Line 103: warning: exported method Set.Copy should have comment or be unexported (golint)
    • Line 114: warning: exported method Set.Equals should have comment or be unexported (golint)
    • Line 134: warning: exported method Set.Clear should have comment or be unexported (golint)
    • Line 143: warning: exported method Set.SortedSlice should have comment or be unexported (golint)
    • Line 151: warning: exported method Set.SortedReverseSlice should have comment or be unexported (golint)
    • transplant/internal/cage/os/file/finder.go
    • Line 19: warning: exported type FinderFile should have comment or be unexported (golint)
    • Line 24: warning: exported type DirMatcher should have comment or be unexported (golint)
    • Line 25: warning: exported type FileMatcher should have comment or be unexported (golint)
    • Line 33: warning: exported type Finder should have comment or be unexported (golint)
    • Line 40: warning: exported function NewFinder should have comment or be unexported (golint)
    • Line 64: warning: exported method Finder.Clear should have comment or be unexported (golint)
    • Line 71: warning: exported method Finder.WalkHiddenDir should have comment or be unexported (golint)
    • Line 76: warning: exported method Finder.Dir should have comment or be unexported (golint)
    • Line 81: warning: exported method Finder.DirMatcher should have comment or be unexported (golint)
    • Line 156: warning: exported method Finder.GetFileMatches should have comment or be unexported (golint)
    • Line 199: warning: exported method Finder.GetFilenameMatches should have comment or be unexported (golint)
    • Line 213: warning: exported method Finder.GetFileObjectMatches should have comment or be unexported (golint)
    • transplant/internal/cage/testkit/os/file/file.go
    • Line 24: warning: exported function FixtureDataDir should have comment or be unexported (golint)
    • Line 28: warning: exported function DynamicDataDir should have comment or be unexported (golint)
    • Line 32: warning: exported function DynamicDataDirAbs should have comment or be unexported (golint)
    • Line 85: warning: exported function MustOpen should have comment or be unexported (golint)
    • Line 91: warning: exported function MustOpenFixturePath should have comment or be unexported (golint)
    • transplant/internal/transplant/audit.go
    • Line 38: warning: exported function NewReplaceStringFiles should have comment or be unexported (golint)
    • Line 59: warning: exported function NewConfigMatcher should have comment or be unexported (golint)
    • Line 94: warning: exported function NewFromFinderOutput should have comment or be unexported (golint)
    • Line 288: warning: exported function NewEgressAudit should have comment or be unexported (golint)
    • Line 297: warning: exported function NewIngressAudit should have comment or be unexported (golint)
    • Line 360: warning: exported method Audit.Op should have comment or be unexported (golint)
    • Line 367: warning: comment on exported method Audit.Generate should be of the form "Generate ..." (golint)
    • Line 2169: warning: exported method Audit.IsDepGlobalUsedInLocal should have comment or be unexported (golint)
    • Line 2252: warning: exported method Audit.PrintUnconfiguredDirs should have comment or be unexported (golint)
    • transplant/internal/cage/go/packages/inspector.go
    • Line 20: warning: exported type TraitType should have comment or be unexported (golint)
    • Line 40: warning: exported type UnsupportedTrait should have comment or be unexported (golint)
    • Line 55: warning: exported const GlobalIdSeparator should have comment (or a comment on this block) or be unexported (golint)
    • Line 58: warning: exported type GlobalNode should have comment or be unexported (golint)
    • Line 63: warning: exported type Node should have comment or be unexported (golint)
    • Line 68: warning: exported type InspectFunc should have comment or be unexported (golint)
    • Line 119: warning: exported method IdToNode.SortedIds should have comment or be unexported (golint)
    • Line 128: warning: exported method IdToNode.Contains should have comment or be unexported (golint)
    • Line 198: warning: exported method IdToGlobalNode.GetByBaseName should have comment or be unexported (golint)
    • Line 224: warning: exported type FuncDeclShadows should have comment or be unexported (golint)
    • Line 251: warning: exported type Inspector should have comment or be unexported (golint)
    • Line 464: warning: exported method Inspector.SetPackageCache should have comment or be unexported (golint)
    • Line 1252: warning: exported method Inspector.NodeToFilename should have comment or be unexported (golint)
    • Line 1256: warning: exported method Inspector.NodeToString should have comment or be unexported (golint)
    • transplant/internal/cage/io/io.go
    • Line 17: warning: exported type SyncCloser should have comment or be unexported (golint)
    • Line 32: warning: exported function SyncClose should have comment or be unexported (golint)
    • Line 42: warning: exported function Rewind should have comment or be unexported (golint)
    • transplant/internal/cage/go/packages/cache.go
    • Line 23: warning: exported type CacheValue should have comment or be unexported (golint)
    • Line 95: warning: exported function NewCache should have comment or be unexported (golint)
    • Line 474: warning: exported method Cache.Data should have comment or be unexported (golint)
    • Line 508: warning: exported function NewCacheKey should have comment or be unexported (golint)
    • transplant/internal/cage/os/file/stage/stage.go
    • Line 30: warning: exported type Plan should have comment or be unexported (golint)
    • Line 42: warning: exported type Stage should have comment or be unexported (golint)
    • Line 65: warning: exported function NewPlan should have comment or be unexported (golint)
    • Line 73: warning: exported function NewStage should have comment or be unexported (golint)
    • Line 99: warning: exported type CopyConfig should have comment or be unexported (golint)
    • Line 111: warning: exported method Stage.Output should have comment or be unexported (golint)
    • Line 127: warning: comment on exported method Stage.Copy should be of the form "Copy ..." (golint)
    • Line 396: warning: exported method Stage.Path should have comment or be unexported (golint)
    • transplant/cmd/transplant/why/why.go
    • Line 22: warning: exported function FileQuery should have comment or be unexported (golint)
    • Line 31: warning: exported function FileSiblingQuery should have comment or be unexported (golint)
    • Line 42: warning: exported function PrintLog should have comment or be unexported (golint)
    • transplant/internal/cage/go/packages/global_id_list.go
    • Line 11: warning: exported type GlobalIdList should have comment or be unexported (golint)
    • Line 15: warning: exported function NewGlobalIdList should have comment or be unexported (golint)
    • Line 26: warning: exported method GlobalIdList.Add should have comment or be unexported (golint)
    • Line 31: warning: exported method GlobalIdList.SortedSlice should have comment or be unexported (golint)
    • transplant/internal/cage/errors/errors.go
    • Line 51: warning: exported type Location should have comment or be unexported (golint)
    • Line 60: warning: exported type Error should have comment or be unexported (golint)
    • Line 74: warning: exported type Config should have comment or be unexported (golint)
    • Line 92: warning: exported function DefaultConfig should have comment or be unexported (golint)
    • Line 100: warning: exported function NewConfiguredEvent should have comment or be unexported (golint)
    • Line 104: warning: exported function NewEvent should have comment or be unexported (golint)
    • Line 223: warning: exported function WriteErrList should have comment or be unexported (golint)
    • Line 233: warning: exported function Append should have comment or be unexported (golint)
    • transplant/internal/cage/go/mod/mod.go
    • Line 96: warning: exported type Mod should have comment or be unexported (golint)
    • Line 119: warning: exported function NewModFromFile should have comment or be unexported (golint)
    • Line 129: warning: exported function NewMod should have comment or be unexported (golint)
    • Line 265: warning: exported method Mod.DelRequire should have comment or be unexported (golint)
    • Line 279: warning: exported method Mod.GetRequire should have comment or be unexported (golint)
    • Line 295: warning: comment on exported method Mod.Requires should be of the form "Requires ..." (golint)
    • Line 303: warning: comment on exported method Mod.Replaces should be of the form "Replaces ..." (golint)
    • Line 311: warning: exported type SumLine should have comment or be unexported (golint)
    • Line 317: warning: exported type Sum should have comment or be unexported (golint)
    • Line 325: warning: exported function NewSum should have comment or be unexported (golint)
    • Line 355: warning: exported method Sum.GetHash should have comment or be unexported (golint)
    • Line 362: warning: comment on exported method Sum.GetLines should be of the form "GetLines ..." (golint)
    • transplant/internal/cage/go/packages/import.go
    • Line 16: warning: exported type Import should have comment or be unexported (golint)
    • Line 44: warning: exported method Import.SetUsedName should have comment or be unexported (golint)
    • Line 52: warning: exported type ImportList should have comment or be unexported (golint)
    • Line 57: warning: exported function NewImportList should have comment or be unexported (golint)
    • Line 63: warning: exported method ImportList.Add should have comment or be unexported (golint)
    • Line 71: warning: exported method ImportList.Has should have comment or be unexported (golint)
    • Line 76: warning: exported method ImportList.Get should have comment or be unexported (golint)
    • Line 80: warning: exported method ImportList.SortedSlice should have comment or be unexported (golint)
    • Line 86: warning: exported method ImportList.Paths should have comment or be unexported (golint)
    • Line 111: warning: exported method ImportList.Pop should have comment or be unexported (golint)
    • transplant/internal/cage/testkit/testify/require/require.go
    • Line 38: warning: exported function FilesMatch should have comment or be unexported (golint)
    • Line 48: warning: exported function ReadersMatch should have comment or be unexported (golint)
    • Line 68: warning: exported function DirsMatch should have comment or be unexported (golint)
    • Line 116: warning: exported function StringSortedSliceExactly should have comment or be unexported (golint)
    • Line 128: warning: exported function StringSliceExactly should have comment or be unexported (golint)
    • Line 134: warning: exported function MatchRegexp should have comment or be unexported (golint)
    • Line 144: warning: exported function StringContains should have comment or be unexported (golint)
    • Line 154: warning: exported function ReaderStringContains should have comment or be unexported (golint)
    • Line 160: warning: exported function FileStringContains should have comment or be unexported (golint)
    • transplant/internal/cage/go/packages/global_id.go
    • Line 27: warning: exported type GlobalId should have comment or be unexported (golint)
    • Line 41: warning: exported function NewGlobalId should have comment or be unexported (golint)
    • Line 66: warning: exported method GlobalId.MethodType should have comment or be unexported (golint)
    • Line 80: warning: exported method GlobalId.Dir should have comment or be unexported (golint)
    • Line 165: warning: exported function GlobalIdNameBase should have comment or be unexported (golint)
    • transplant/internal/cage/graph/dag/debug_log.go
    • Line 9: warning: exported type DebugEventType should have comment or be unexported (golint)
    • Line 12: warning: exported const AddEvent should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: exported type DebugEvent should have comment or be unexported (golint)
    • Line 21: warning: exported type DebugLog should have comment or be unexported (golint)
    • Line 25: warning: exported method DebugLog.Add should have comment or be unexported (golint)
    • Line 29: warning: exported method DebugLog.All should have comment or be unexported (golint)
    • Line 35: warning: exported method DebugLog.Len should have comment or be unexported (golint)
    • transplant/internal/cage/go/packages/inspector_find.go
    • Line 42: warning: exported method Inspector.FindGlobalInAstNode should have comment or be unexported (golint)
    • Line 345: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 350: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 370: warning: exported method Inspector.BlankImportsInFile should have comment or be unexported (golint)
    • Line 382: warning: exported method Inspector.DotImportsInFile should have comment or be unexported (golint)
    • transplant/internal/cage/go/packages/packages.go
    • Line 43: warning: exported type Package should have comment or be unexported (golint)
    • Line 64: warning: exported method Package.IdentTypesObj should have comment or be unexported (golint)
    • Line 71: warning: exported function StdSdump should have comment or be unexported (golint)
    • Line 154: warning: exported type Config should have comment or be unexported (golint)
    • Line 158: warning: exported function NewConfig should have comment or be unexported (golint)
    • Line 164: warning: exported method Config.Copy should have comment or be unexported (golint)
    • Line 296: warning: exported function LoadModeString should have comment or be unexported (golint)
    • transplant/internal/cage/cli/handler/mixin/log/zap/zap.go
    • Line 36: warning: exported type Mixin should have comment or be unexported (golint)
    • Line 46: warning: comment on exported method Mixin.BindCobraFlags should be of the form "BindCobraFlags ..." (golint)
    • Line 54: warning: comment on exported method Mixin.Name should be of the form "Name ..." (golint)
    • Line 59: warning: comment on exported method Mixin.PreRun should be of the form "PreRun ..." (golint)
    • Line 133: warning: exported method Mixin.ErrToFile should have comment or be unexported (golint)
    • Line 152: warning: comment on exported method Mixin.PostRun should be of the form "PostRun ..." (golint)
    • Line 159: warning: exported method Mixin.ExitOnErr should have comment or be unexported (golint)
    • transplant/internal/cage/os/file/matcher/matcher.go
    • Line 16: warning: exported function InvertDir should have comment or be unexported (golint)
    • Line 26: warning: exported function InvertFile should have comment or be unexported (golint)
    • Line 36: warning: exported function GoDir should have comment or be unexported (golint)
    • Line 45: warning: exported function PopulatedDir should have comment or be unexported (golint)
    • Line 49: warning: exported function DirWithFile should have comment or be unexported (golint)
    • Line 58: warning: exported function GoFile should have comment or be unexported (golint)
    • Line 62: warning: exported function MatchAnyDir should have comment or be unexported (golint)
    • Line 76: warning: exported function MatchAnyFile should have comment or be unexported (golint)
    • transplant/internal/cage/cache/cache.go
    • Line 9: warning: exported type DebugEventType should have comment or be unexported (golint)
    • Line 12: warning: exported const MissEvent should have comment (or a comment on this block) or be unexported (golint)
    • Line 17: warning: exported type DebugEvent should have comment or be unexported (golint)
    • Line 23: warning: exported type DebugLog should have comment or be unexported (golint)
    • Line 27: warning: exported method DebugLog.Add should have comment or be unexported (golint)
    • Line 31: warning: exported method DebugLog.All should have comment or be unexported (golint)
    • Line 37: warning: exported method DebugLog.Len should have comment or be unexported (golint)

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!


misspell95%

Misspell Finds commonly misspelled English words