Preparing report...

Report for github.com/src-d/go-git

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


golint83%

Golint is a linter for Go source code.

    • go-git/config/refspec.go
    • Line 17: warning: exported var ErrRefSpecMalformedSeparator should have comment or be unexported (golint)
    • Line 130: warning: exported method RefSpec.Reverse should have comment or be unexported (golint)
    • go-git/plumbing/object/commit.go
    • Line 112: warning: exported var ErrParentNotFound should have comment or be unexported (golint)
    • Line 234: warning: receiver name b should be consistent with previous receiver name c for Commit (golint)
    • Line 239: warning: receiver name b should be consistent with previous receiver name c for Commit (golint)
    • Line 243: warning: receiver name b should be consistent with previous receiver name c for Commit (golint)
    • go-git/plumbing/object.go
    • Line 1: warning: package comment should be of the form "Package plumbing ..." (golint)
    • Line 10: warning: exported var ErrObjectNotFound should have comment or be unexported (golint)
    • Line 15: warning: comment on exported type EncodedObject should be of the form "EncodedObject ..." (with optional leading article) (golint)
    • Line 43: warning: exported const InvalidObject should have comment (or a comment on this block) or be unexported (golint)
    • Line 48: warning: comment on exported const OFSDeltaObject should be of the form "OFSDeltaObject ..." (golint)
    • Line 76: warning: exported method ObjectType.Bytes should have comment or be unexported (golint)
    • go-git/plumbing/object/change.go
    • Line 88: warning: comment on exported method Change.PatchContext should be of the form "PatchContext ..." (golint)
    • Line 151: warning: comment on exported method Changes.PatchContext should be of the form "PatchContext ..." (golint)
    • go-git/plumbing/transport/common.go
    • Line 32: warning: exported var ErrRepositoryNotFound should have comment or be unexported (golint)
    • Line 42: warning: exported const UploadPackServiceName should have comment (or a comment on this block) or be unexported (golint)
    • Line 55: warning: exported type Session should have comment or be unexported (golint)
    • Line 64: warning: exported type AuthMethod should have comment or be unexported (golint)
    • Line 160: warning: exported function NewEndpoint should have comment or be unexported (golint)
    • go-git/plumbing/reference.go
    • Line 30: warning: exported var ErrReferenceNotFound should have comment or be unexported (golint)
    • Line 37: warning: exported const InvalidReference should have comment (or a comment on this block) or be unexported (golint)
    • Line 127: warning: exported const HEAD should have comment (or a comment on this block) or be unexported (golint)
    • go-git/plumbing/cache/common.go
    • Line 6: warning: exported const Byte should have comment (or a comment on this block) or be unexported (golint)
    • Line 12: warning: exported type FileSize should have comment or be unexported (golint)
    • Line 14: warning: exported const DefaultMaxSize should have comment or be unexported (golint)
    • go-git/plumbing/hash.go
    • Line 35: warning: exported method Hash.IsZero should have comment or be unexported (golint)
    • Line 44: warning: exported type Hasher should have comment or be unexported (golint)
    • Line 48: warning: exported function NewHasher should have comment or be unexported (golint)
    • Line 57: warning: exported method Hasher.Sum should have comment or be unexported (golint)
    • go-git/storage/filesystem/object.go
    • Line 20: warning: exported type ObjectStorage should have comment or be unexported (golint)
    • Line 92: warning: exported method ObjectStorage.NewEncodedObject should have comment or be unexported (golint)
    • Line 96: warning: exported method ObjectStorage.PackfileWriter should have comment or be unexported (golint)
    • Line 789: warning: exported method ObjectStorage.ForEachObjectHash should have comment or be unexported (golint)
    • Line 797: warning: exported method ObjectStorage.LooseObjectTime should have comment or be unexported (golint)
    • Line 805: warning: exported method ObjectStorage.DeleteLooseObject should have comment or be unexported (golint)
    • Line 809: warning: exported method ObjectStorage.ObjectPacks should have comment or be unexported (golint)
    • Line 813: warning: exported method ObjectStorage.DeleteOldObjectPackAndIndex should have comment or be unexported (golint)
    • go-git/plumbing/format/diff/unified_encoder.go
    • Line 46: warning: exported const DefaultContextLines should have comment (or a comment on this block) or be unexported (golint)
    • Line 63: warning: exported function NewUnifiedEncoder should have comment or be unexported (golint)
    • Line 67: warning: exported method UnifiedEncoder.Encode should have comment or be unexported (golint)
    • go-git/plumbing/protocol/packp/ulreq.go
    • Line 36: warning: exported method DepthCommits.IsZero should have comment or be unexported (golint)
    • Line 45: warning: exported method DepthSince.IsZero should have comment or be unexported (golint)
    • Line 54: warning: exported method DepthReference.IsZero should have comment or be unexported (golint)
    • go-git/cli/go-git/upload_pack.go
    • Line 11: warning: exported type CmdUploadPack should have comment or be unexported (golint)
    • Line 19: warning: exported method CmdUploadPack.Usage should have comment or be unexported (golint)
    • Line 25: warning: exported method CmdUploadPack.Execute should have comment or be unexported (golint)
    • go-git/plumbing/error.go
    • Line 5: warning: exported type PermanentError should have comment or be unexported (golint)
    • Line 9: warning: exported function NewPermanentError should have comment or be unexported (golint)
    • Line 21: warning: exported type UnexpectedError should have comment or be unexported (golint)
    • Line 25: warning: exported function NewUnexpectedError should have comment or be unexported (golint)
    • go-git/cli/go-git/version.go
    • Line 8: warning: exported type CmdVersion should have comment or be unexported (golint)
    • Line 10: warning: exported method CmdVersion.Execute should have comment or be unexported (golint)
    • go-git/storage/filesystem/dotgit/dotgit.go
    • Line 1: warning: package comment should be of the form "Package dotgit ..." (golint)
    • Line 301: warning: exported method DotGit.DeleteOldObjectPackAndIndex should have comment or be unexported (golint)
    • Line 611: warning: exported method DotGit.SetRef should have comment or be unexported (golint)
    • Line 937: warning: exported method DotGit.CountLooseRefs should have comment or be unexported (golint)
    • go-git/plumbing/object/tree.go
    • Line 307: warning: receiver name from should be consistent with previous receiver name t for Tree (golint)
    • Line 311: warning: comment on exported method Tree.DiffContext should be of the form "DiffContext ..." (golint)
    • Line 314: warning: receiver name from should be consistent with previous receiver name t for Tree (golint)
    • Line 320: warning: receiver name from should be consistent with previous receiver name t for Tree (golint)
    • Line 324: warning: comment on exported method Tree.PatchContext should be of the form "PatchContext ..." (golint)
    • Line 328: warning: receiver name from should be consistent with previous receiver name t for Tree (golint)
    • go-git/storage/test/storage_suite.go
    • Line 16: warning: should not use dot imports (golint)
    • Line 20: warning: exported type Storer should have comment or be unexported (golint)
    • Line 29: warning: exported type TestObject should have comment or be unexported (golint)
    • Line 35: warning: exported type BaseStorageSuite should have comment or be unexported (golint)
    • Line 42: warning: exported function NewBaseStorageSuite should have comment or be unexported (golint)
    • Line 68: warning: exported method BaseStorageSuite.SetUpTest should have comment or be unexported (golint)
    • Line 72: warning: exported method BaseStorageSuite.TearDownTest should have comment or be unexported (golint)
    • Line 76: warning: exported method BaseStorageSuite.TestSetEncodedObjectAndEncodedObject should have comment or be unexported (golint)
    • Line 104: warning: exported method BaseStorageSuite.TestSetEncodedObjectInvalid should have comment or be unexported (golint)
    • Line 112: warning: exported method BaseStorageSuite.TestIterEncodedObjects should have comment or be unexported (golint)
    • Line 155: warning: exported method BaseStorageSuite.TestPackfileWriter should have comment or be unexported (golint)
    • Line 182: warning: exported method BaseStorageSuite.TestObjectStorerTxSetEncodedObjectAndCommit should have comment or be unexported (golint)
    • Line 215: warning: exported method BaseStorageSuite.TestObjectStorerTxSetObjectAndGetObject should have comment or be unexported (golint)
    • Line 233: warning: exported method BaseStorageSuite.TestObjectStorerTxGetObjectNotFound should have comment or be unexported (golint)
    • Line 245: warning: exported method BaseStorageSuite.TestObjectStorerTxSetObjectAndRollback should have comment or be unexported (golint)
    • Line 267: warning: exported method BaseStorageSuite.TestSetReferenceAndGetReference should have comment or be unexported (golint)
    • Line 283: warning: exported method BaseStorageSuite.TestCheckAndSetReference should have comment or be unexported (golint)
    • Line 300: warning: exported method BaseStorageSuite.TestCheckAndSetReferenceNil should have comment or be unexported (golint)
    • Line 317: warning: exported method BaseStorageSuite.TestCheckAndSetReferenceError should have comment or be unexported (golint)
    • Line 334: warning: exported method BaseStorageSuite.TestRemoveReference should have comment or be unexported (golint)
    • Line 347: warning: exported method BaseStorageSuite.TestRemoveReferenceNonExistent should have comment or be unexported (golint)
    • Line 361: warning: exported method BaseStorageSuite.TestGetReferenceNotFound should have comment or be unexported (golint)
    • Line 367: warning: exported method BaseStorageSuite.TestIterReferences should have comment or be unexported (golint)
    • Line 385: warning: exported method BaseStorageSuite.TestSetShallowAndShallow should have comment or be unexported (golint)
    • Line 400: warning: exported method BaseStorageSuite.TestSetConfigAndConfig should have comment or be unexported (golint)
    • Line 418: warning: exported method BaseStorageSuite.TestIndex should have comment or be unexported (golint)
    • Line 427: warning: exported method BaseStorageSuite.TestSetIndexAndIndex should have comment or be unexported (golint)
    • Line 439: warning: exported method BaseStorageSuite.TestSetConfigInvalid should have comment or be unexported (golint)
    • Line 447: warning: exported method BaseStorageSuite.TestModule should have comment or be unexported (golint)
    • Line 457: warning: exported method BaseStorageSuite.TestDeltaObjectStorer should have comment or be unexported (golint)
    • go-git/config/config.go
    • Line 29: warning: exported var ErrInvalid should have comment or be unexported (golint)
    • Line 405: warning: exported method RemoteConfig.IsFirstURLLocal should have comment or be unexported (golint)
    • go-git/plumbing/protocol/packp/shallowupd.go
    • Line 17: warning: exported type ShallowUpdate should have comment or be unexported (golint)
    • Line 22: warning: exported method ShallowUpdate.Decode should have comment or be unexported (golint)
    • Line 76: warning: exported method ShallowUpdate.Encode should have comment or be unexported (golint)
    • go-git/storage/filesystem/config.go
    • Line 12: warning: exported type ConfigStorage should have comment or be unexported (golint)
    • Line 16: warning: exported method ConfigStorage.Config should have comment or be unexported (golint)
    • Line 42: warning: exported method ConfigStorage.SetConfig should have comment or be unexported (golint)
    • go-git/plumbing/format/packfile/object_pack.go
    • Line 102: warning: exported method ObjectToPack.Type should have comment or be unexported (golint)
    • Line 122: warning: exported method ObjectToPack.Hash should have comment or be unexported (golint)
    • Line 139: warning: exported method ObjectToPack.Size should have comment or be unexported (golint)
    • Line 156: warning: exported method ObjectToPack.IsDelta should have comment or be unexported (golint)
    • Line 160: warning: exported method ObjectToPack.SetDelta should have comment or be unexported (golint)
    • go-git/plumbing/format/config/section.go
    • Line 35: warning: exported type Subsection should have comment or be unexported (golint)
    • Line 40: warning: exported type Sections should have comment or be unexported (golint)
    • Line 42: warning: exported method Sections.GoString should have comment or be unexported (golint)
    • Line 51: warning: exported type Subsections should have comment or be unexported (golint)
    • Line 53: warning: exported method Subsections.GoString should have comment or be unexported (golint)
    • Line 86: warning: comment on exported method Section.RemoveOption should be of the form "RemoveOption ..." (golint)
    • go-git/storage/filesystem/reference.go
    • Line 9: warning: exported type ReferenceStorage should have comment or be unexported (golint)
    • Line 13: warning: exported method ReferenceStorage.SetReference should have comment or be unexported (golint)
    • Line 17: warning: exported method ReferenceStorage.CheckAndSetReference should have comment or be unexported (golint)
    • Line 21: warning: exported method ReferenceStorage.Reference should have comment or be unexported (golint)
    • Line 25: warning: exported method ReferenceStorage.IterReferences should have comment or be unexported (golint)
    • Line 34: warning: exported method ReferenceStorage.RemoveReference should have comment or be unexported (golint)
    • Line 38: warning: exported method ReferenceStorage.CountLooseRefs should have comment or be unexported (golint)
    • Line 42: warning: exported method ReferenceStorage.PackRefs should have comment or be unexported (golint)
    • go-git/storage/memory/storage.go
    • Line 15: warning: exported var ErrUnsupportedObjectType should have comment or be unexported (golint)
    • Line 47: warning: exported type ConfigStorage should have comment or be unexported (golint)
    • Line 51: warning: exported method ConfigStorage.SetConfig should have comment or be unexported (golint)
    • Line 60: warning: exported method ConfigStorage.Config should have comment or be unexported (golint)
    • Line 68: warning: exported type IndexStorage should have comment or be unexported (golint)
    • Line 72: warning: exported method IndexStorage.SetIndex should have comment or be unexported (golint)
    • Line 77: warning: exported method IndexStorage.Index should have comment or be unexported (golint)
    • Line 85: warning: exported type ObjectStorage should have comment or be unexported (golint)
    • Line 93: warning: exported method ObjectStorage.NewEncodedObject should have comment or be unexported (golint)
    • Line 97: warning: exported method ObjectStorage.SetEncodedObject should have comment or be unexported (golint)
    • Line 117: warning: exported method ObjectStorage.HasEncodedObject should have comment or be unexported (golint)
    • Line 124: warning: exported method ObjectStorage.EncodedObjectSize should have comment or be unexported (golint)
    • Line 134: warning: exported method ObjectStorage.EncodedObject should have comment or be unexported (golint)
    • Line 143: warning: exported method ObjectStorage.IterEncodedObjects should have comment or be unexported (golint)
    • Line 169: warning: exported method ObjectStorage.Begin should have comment or be unexported (golint)
    • Line 176: warning: exported method ObjectStorage.ForEachObjectHash should have comment or be unexported (golint)
    • Line 189: warning: exported method ObjectStorage.ObjectPacks should have comment or be unexported (golint)
    • Line 192: warning: exported method ObjectStorage.DeleteOldObjectPackAndIndex should have comment or be unexported (golint)
    • Line 198: warning: exported method ObjectStorage.LooseObjectTime should have comment or be unexported (golint)
    • Line 198: warning: receiver name s should be consistent with previous receiver name o for ObjectStorage (golint)
    • Line 201: warning: exported method ObjectStorage.DeleteLooseObject should have comment or be unexported (golint)
    • Line 201: warning: receiver name s should be consistent with previous receiver name o for ObjectStorage (golint)
    • Line 205: warning: exported type TxObjectStorage should have comment or be unexported (golint)
    • Line 210: warning: exported method TxObjectStorage.SetEncodedObject should have comment or be unexported (golint)
    • Line 217: warning: exported method TxObjectStorage.EncodedObject should have comment or be unexported (golint)
    • Line 226: warning: exported method TxObjectStorage.Commit should have comment or be unexported (golint)
    • Line 237: warning: exported method TxObjectStorage.Rollback should have comment or be unexported (golint)
    • Line 242: warning: exported type ReferenceStorage should have comment or be unexported (golint)
    • Line 244: warning: exported method ReferenceStorage.SetReference should have comment or be unexported (golint)
    • Line 252: warning: exported method ReferenceStorage.CheckAndSetReference should have comment or be unexported (golint)
    • Line 267: warning: exported method ReferenceStorage.Reference should have comment or be unexported (golint)
    • Line 276: warning: exported method ReferenceStorage.IterReferences should have comment or be unexported (golint)
    • Line 285: warning: exported method ReferenceStorage.CountLooseRefs should have comment or be unexported (golint)
    • Line 289: warning: exported method ReferenceStorage.PackRefs should have comment or be unexported (golint)
    • Line 293: warning: exported method ReferenceStorage.RemoveReference should have comment or be unexported (golint)
    • Line 298: warning: exported type ShallowStorage should have comment or be unexported (golint)
    • Line 300: warning: exported method ShallowStorage.SetShallow should have comment or be unexported (golint)
    • Line 305: warning: exported method ShallowStorage.Shallow should have comment or be unexported (golint)
    • Line 309: warning: exported type ModuleStorage should have comment or be unexported (golint)
    • Line 311: warning: exported method ModuleStorage.Module should have comment or be unexported (golint)
    • go-git/plumbing/transport/ssh/auth_method.go
    • Line 21: warning: exported const DefaultUsername should have comment or be unexported (golint)
    • Line 52: warning: exported method KeyboardInteractive.Name should have comment or be unexported (golint)
    • Line 60: warning: exported method KeyboardInteractive.ClientConfig should have comment or be unexported (golint)
    • Line 76: warning: exported method Password.Name should have comment or be unexported (golint)
    • Line 84: warning: exported method Password.ClientConfig should have comment or be unexported (golint)
    • Line 99: warning: exported method PasswordCallback.Name should have comment or be unexported (golint)
    • Line 107: warning: exported method PasswordCallback.ClientConfig should have comment or be unexported (golint)
    • Line 160: warning: exported method PublicKeys.Name should have comment or be unexported (golint)
    • Line 168: warning: exported method PublicKeys.ClientConfig should have comment or be unexported (golint)
    • Line 221: warning: exported method PublicKeysCallback.Name should have comment or be unexported (golint)
    • Line 229: warning: exported method PublicKeysCallback.ClientConfig should have comment or be unexported (golint)
    • go-git/storage/filesystem/index.go
    • Line 12: warning: exported type IndexStorage should have comment or be unexported (golint)
    • Line 16: warning: exported method IndexStorage.SetIndex should have comment or be unexported (golint)
    • Line 35: warning: exported method IndexStorage.Index should have comment or be unexported (golint)
    • go-git/plumbing/protocol/packp/updreq.go
    • Line 13: warning: exported var ErrEmptyCommands should have comment or be unexported (golint)
    • Line 30: warning: comment on exported function NewReferenceUpdateRequest should be of the form "NewReferenceUpdateRequest ..." (golint)
    • Line 85: warning: exported type Action should have comment or be unexported (golint)
    • Line 88: warning: exported const Create should have comment (or a comment on this block) or be unexported (golint)
    • Line 94: warning: exported type Command should have comment or be unexported (golint)
    • Line 100: warning: exported method Command.Action should have comment or be unexported (golint)
    • go-git/plumbing/object/patch.go
    • Line 21: warning: exported var ErrCanceled should have comment or be unexported (golint)
    • Line 118: warning: comment on exported type Patch should be of the form "Patch ..." (with optional leading article) (golint)
    • Line 124: warning: exported method Patch.FilePatches should have comment or be unexported (golint)
    • Line 128: warning: exported method Patch.Message should have comment or be unexported (golint)
    • Line 132: warning: exported method Patch.Encode should have comment or be unexported (golint)
    • Line 132: warning: receiver name p should be consistent with previous receiver name t for Patch (golint)
    • Line 138: warning: exported method Patch.Stats should have comment or be unexported (golint)
    • Line 138: warning: receiver name p should be consistent with previous receiver name t for Patch (golint)
    • Line 142: warning: receiver name p should be consistent with previous receiver name t for Patch (golint)
    • Line 201: warning: receiver name t should be consistent with previous receiver name tf for textFilePatch (golint)
    • Line 205: warning: receiver name t should be consistent with previous receiver name tf for textFilePatch (golint)
    • go-git/cli/go-git/receive_pack.go
    • Line 11: warning: exported type CmdReceivePack should have comment or be unexported (golint)
    • Line 19: warning: exported method CmdReceivePack.Usage should have comment or be unexported (golint)
    • Line 24: warning: exported method CmdReceivePack.Execute should have comment or be unexported (golint)

gocyclo96%

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.

    • go-git/remote.go
    • Line 82: warning: cyclomatic complexity 25 of function (*Remote).PushContext() is high (> 15) (gocyclo)
    • Line 871: warning: cyclomatic complexity 19 of function (*Remote).updateLocalReferenceStorage() is high (> 15) (gocyclo)
    • go-git/worktree.go
    • Line 64: warning: cyclomatic complexity 16 of function (*Worktree).PullContext() is high (> 15) (gocyclo)
    • go-git/internal/revision/parser.go
    • Line 182: warning: cyclomatic complexity 32 of function (*Parser).validateFullRevision() is high (> 15) (gocyclo)
    • Line 391: warning: cyclomatic complexity 28 of function (*Parser).parseCaretBraces() is high (> 15) (gocyclo)
    • Line 252: warning: cyclomatic complexity 24 of function (*Parser).parseAt() is high (> 15) (gocyclo)
    • Line 598: warning: cyclomatic complexity 19 of function (*Parser).checkRefFormat() is high (> 15) (gocyclo)

ineffassign99%

IneffAssign detects ineffectual assignments in Go code.


license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


misspell0%

Misspell Finds commonly misspelled English words

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