Preparing report...

Report for github.com/theupdateframework/go-tuf

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


gocyclo91%

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-tuf/repo_test.go
    • Line 301: warning: cyclomatic complexity 16 of function (*RepoSuite).TestAddPrivateKey() is high (> 15) (gocyclo)
    • go-tuf/client/client.go
    • Line 144: warning: cyclomatic complexity 23 of function (*Client).update() is high (> 15) (gocyclo)
    • Line 266: warning: cyclomatic complexity 17 of function (*Client).getLocalMeta() is high (> 15) (gocyclo)
    • go-tuf/repo.go
    • Line 767: warning: cyclomatic complexity 20 of function (*Repo).Commit() is high (> 15) (gocyclo)

golint60%

Golint is a linter for Go source code.

    • go-tuf/sign/keys.go
    • Line 11: warning: exported type PrivateKey should have comment or be unexported (golint)
    • Line 18: warning: exported type PrivateKeyValue should have comment or be unexported (golint)
    • Line 23: warning: exported method PrivateKey.PublicData should have comment or be unexported (golint)
    • Line 32: warning: exported method PrivateKey.Signer should have comment or be unexported (golint)
    • Line 41: warning: exported function GenerateEd25519Key should have comment or be unexported (golint)
    • go-tuf/verify/db.go
    • Line 7: warning: exported type Role should have comment or be unexported (golint)
    • Line 12: warning: exported method Role.ValidKey should have comment or be unexported (golint)
    • Line 17: warning: exported type DB should have comment or be unexported (golint)
    • Line 22: warning: exported function NewDB should have comment or be unexported (golint)
    • Line 29: warning: exported method DB.AddKey should have comment or be unexported (golint)
    • Line 53: warning: exported function ValidRole should have comment or be unexported (golint)
    • Line 58: warning: exported method DB.AddRole should have comment or be unexported (golint)
    • Line 81: warning: exported method DB.GetKey should have comment or be unexported (golint)
    • Line 85: warning: exported method DB.GetRole should have comment or be unexported (golint)
    • go-tuf/util/util.go
    • Line 23: warning: exported type ErrWrongLength should have comment or be unexported (golint)
    • Line 32: warning: exported type ErrWrongVersion should have comment or be unexported (golint)
    • Line 41: warning: exported type ErrWrongHash should have comment or be unexported (golint)
    • Line 51: warning: exported type ErrNoCommonHash should have comment or be unexported (golint)
    • Line 67: warning: exported type ErrUnknownHashAlgorithm should have comment or be unexported (golint)
    • Line 75: warning: exported type PassphraseFunc should have comment or be unexported (golint)
    • Line 77: warning: exported function FileMetaEqual should have comment or be unexported (golint)
    • Line 112: warning: exported function SnapshotFileMetaEqual should have comment or be unexported (golint)
    • Line 135: warning: exported function TargetFileMetaEqual should have comment or be unexported (golint)
    • Line 139: warning: exported function TimestampFileMetaEqual should have comment or be unexported (golint)
    • Line 156: warning: exported function GenerateFileMeta should have comment or be unexported (golint)
    • Line 213: warning: exported function GenerateSnapshotFileMeta should have comment or be unexported (golint)
    • Line 221: warning: exported function GenerateTargetFileMeta should have comment or be unexported (golint)
    • Line 229: warning: exported function GenerateTimestampFileMeta should have comment or be unexported (golint)
    • Line 237: warning: exported function NormalizeTarget should have comment or be unexported (golint)
    • Line 248: warning: exported function VersionedPath should have comment or be unexported (golint)
    • Line 252: warning: exported function HashedPaths should have comment or be unexported (golint)
    • Line 261: warning: exported function StringSliceToSet should have comment or be unexported (golint)
    • Line 269: warning: exported function AtomicallyWriteFile should have comment or be unexported (golint)
    • go-tuf/errors.go
    • Line 10: warning: exported var ErrInitNotAllowed should have comment or be unexported (golint)
    • Line 14: warning: exported type ErrMissingMetadata should have comment or be unexported (golint)
    • Line 22: warning: exported type ErrFileNotFound should have comment or be unexported (golint)
    • Line 30: warning: exported type ErrInsufficientKeys should have comment or be unexported (golint)
    • Line 38: warning: exported type ErrInsufficientSignatures should have comment or be unexported (golint)
    • Line 47: warning: exported type ErrInvalidRole should have comment or be unexported (golint)
    • Line 55: warning: exported type ErrInvalidExpires should have comment or be unexported (golint)
    • Line 63: warning: exported type ErrKeyNotFound should have comment or be unexported (golint)
    • Line 72: warning: exported type ErrNotEnoughKeys should have comment or be unexported (golint)
    • Line 82: warning: exported type ErrPassphraseRequired should have comment or be unexported (golint)
    • go-tuf/verify/verify.go
    • Line 18: warning: exported method DB.Verify should have comment or be unexported (golint)
    • Line 40: warning: exported var IsExpired should have comment or be unexported (golint)
    • Line 44: warning: exported method DB.VerifySignatures should have comment or be unexported (golint)
    • Line 98: warning: exported method DB.Unmarshal should have comment or be unexported (golint)
    • Line 109: warning: exported method DB.UnmarshalTrusted should have comment or be unexported (golint)
    • go-tuf/client/client.go
    • Line 86: warning: exported function NewClient should have comment or be unexported (golint)
    • Line 452: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 469: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 627: warning: exported type Destination should have comment or be unexported (golint)
    • go-tuf/data/hex_bytes.go
    • Line 8: warning: exported type HexBytes should have comment or be unexported (golint)
    • Line 10: warning: exported method HexBytes.UnmarshalJSON should have comment or be unexported (golint)
    • Line 23: warning: exported method HexBytes.MarshalJSON should have comment or be unexported (golint)
    • go-tuf/data/types.go
    • Line 14: warning: exported const KeyIDLength should have comment (or a comment on this block) or be unexported (golint)
    • Line 16: warning: don't use underscores in Go names; const KeyTypeECDSA_SHA2_P256 should be KeyTypeECDSASHA2P256 (golint)
    • Line 18: warning: don't use underscores in Go names; const KeySchemeECDSA_SHA2_P256 should be KeySchemeECDSASHA2P256 (golint)
    • Line 22: warning: exported var KeyAlgorithms should have comment or be unexported (golint)
    • Line 25: warning: exported type Signed should have comment or be unexported (golint)
    • Line 30: warning: exported type Signature should have comment or be unexported (golint)
    • Line 35: warning: exported type Key should have comment or be unexported (golint)
    • Line 45: warning: exported method Key.IDs should have comment or be unexported (golint)
    • Line 54: warning: exported method Key.ContainsID should have comment or be unexported (golint)
    • Line 63: warning: exported type KeyValue should have comment or be unexported (golint)
    • Line 67: warning: exported function DefaultExpires should have comment or be unexported (golint)
    • Line 82: warning: exported type Root should have comment or be unexported (golint)
    • Line 93: warning: exported function NewRoot should have comment or be unexported (golint)
    • Line 104: warning: exported method Root.AddKey should have comment or be unexported (golint)
    • Line 138: warning: exported type Role should have comment or be unexported (golint)
    • Line 143: warning: exported method Role.AddKeyIDs should have comment or be unexported (golint)
    • Line 158: warning: exported type Files should have comment or be unexported (golint)
    • Line 160: warning: exported type FileMeta should have comment or be unexported (golint)
    • Line 166: warning: exported type Hashes should have comment or be unexported (golint)
    • Line 168: warning: exported method FileMeta.HashAlgorithms should have comment or be unexported (golint)
    • Line 176: warning: exported type SnapshotFileMeta should have comment or be unexported (golint)
    • Line 181: warning: exported type SnapshotFiles should have comment or be unexported (golint)
    • Line 183: warning: exported type Snapshot should have comment or be unexported (golint)
    • Line 191: warning: exported function NewSnapshot should have comment or be unexported (golint)
    • Line 200: warning: exported type TargetFiles should have comment or be unexported (golint)
    • Line 202: warning: exported type TargetFileMeta should have comment or be unexported (golint)
    • Line 206: warning: exported method TargetFileMeta.HashAlgorithms should have comment or be unexported (golint)
    • Line 210: warning: exported type Targets should have comment or be unexported (golint)
    • Line 218: warning: exported function NewTargets should have comment or be unexported (golint)
    • Line 227: warning: exported type TimestampFileMeta should have comment or be unexported (golint)
    • Line 232: warning: exported type TimestampFiles should have comment or be unexported (golint)
    • Line 234: warning: exported type Timestamp should have comment or be unexported (golint)
    • Line 242: warning: exported function NewTimestamp should have comment or be unexported (golint)
    • go-tuf/verify/errors.go
    • Line 10: warning: exported var ErrMissingKey should have comment or be unexported (golint)
    • Line 22: warning: exported type ErrWrongID should have comment or be unexported (golint)
    • Line 28: warning: exported type ErrUnknownRole should have comment or be unexported (golint)
    • Line 36: warning: exported type ErrExpired should have comment or be unexported (golint)
    • Line 44: warning: exported type ErrLowVersion should have comment or be unexported (golint)
    • Line 53: warning: exported type ErrRoleThreshold should have comment or be unexported (golint)
    • go-tuf/client/errors.go
    • Line 11: warning: exported var ErrNoRootKeys should have comment or be unexported (golint)
    • Line 15: warning: exported type ErrMissingRemoteMetadata should have comment or be unexported (golint)
    • Line 23: warning: exported type ErrDownloadFailed should have comment or be unexported (golint)
    • Line 32: warning: exported type ErrDecodeFailed should have comment or be unexported (golint)
    • Line 54: warning: exported type ErrNotFound should have comment or be unexported (golint)
    • Line 62: warning: exported function IsNotFound should have comment or be unexported (golint)
    • Line 67: warning: exported type ErrWrongSize should have comment or be unexported (golint)
    • Line 77: warning: exported type ErrLatestSnapshot should have comment or be unexported (golint)
    • Line 85: warning: exported function IsLatestSnapshot should have comment or be unexported (golint)
    • Line 90: warning: exported type ErrUnknownTarget should have comment or be unexported (golint)
    • Line 98: warning: exported type ErrMetaTooLarge should have comment or be unexported (golint)
    • Line 108: warning: exported type ErrInvalidURL should have comment or be unexported (golint)
    • go-tuf/client/remote_store.go
    • Line 14: warning: exported type HTTPRemoteOptions should have comment or be unexported (golint)
    • Line 21: warning: exported type HTTPRemoteRetries should have comment or be unexported (golint)
    • Line 26: warning: exported var DefaultHTTPRetries should have comment or be unexported (golint)
    • Line 31: warning: exported function HTTPRemoteStore should have comment or be unexported (golint)
    • go-tuf/sign/sign.go
    • Line 11: warning: exported type Signer should have comment or be unexported (golint)
    • Line 30: warning: exported function Sign should have comment or be unexported (golint)
    • Line 62: warning: exported function Marshal should have comment or be unexported (golint)
    • go-tuf/local_store.go
    • Line 18: warning: exported function MemoryStore should have comment or be unexported (golint)
    • Line 103: warning: exported function FileSystemStore should have comment or be unexported (golint)
    • Line 438: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • go-tuf/repo.go
    • Line 19: warning: exported type CompressionType should have comment or be unexported (golint)
    • Line 22: warning: exported const CompressionTypeNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 41: warning: exported type LocalStore should have comment or be unexported (golint)
    • Line 56: warning: exported type Repo should have comment or be unexported (golint)
    • Line 69: warning: exported function NewRepo should have comment or be unexported (golint)
    • Line 73: warning: exported function NewRepoIndent should have comment or be unexported (golint)
    • Line 90: warning: exported method Repo.Init should have comment or be unexported (golint)
    • Line 162: warning: exported method Repo.RootVersion should have comment or be unexported (golint)
    • Line 170: warning: exported method Repo.Targets should have comment or be unexported (golint)
    • Line 178: warning: exported method Repo.SetTargetsVersion should have comment or be unexported (golint)
    • Line 187: warning: exported method Repo.TargetsVersion should have comment or be unexported (golint)
    • Line 195: warning: exported method Repo.SetTimestampVersion should have comment or be unexported (golint)
    • Line 205: warning: exported method Repo.TimestampVersion should have comment or be unexported (golint)
    • Line 213: warning: exported method Repo.SetSnapshotVersion should have comment or be unexported (golint)
    • Line 224: warning: exported method Repo.SnapshotVersion should have comment or be unexported (golint)
    • Line 264: warning: exported method Repo.GenKey should have comment or be unexported (golint)
    • Line 268: warning: exported method Repo.GenKeyWithExpires should have comment or be unexported (golint)
    • Line 281: warning: exported method Repo.AddPrivateKey should have comment or be unexported (golint)
    • Line 285: warning: exported method Repo.AddPrivateKeyWithExpires should have comment or be unexported (golint)
    • Line 335: warning: exported method Repo.RootKeys should have comment or be unexported (golint)
    • Line 369: warning: exported method Repo.RevokeKey should have comment or be unexported (golint)
    • Line 373: warning: exported method Repo.RevokeKeyWithExpires should have comment or be unexported (golint)
    • Line 460: warning: exported method Repo.Sign should have comment or be unexported (golint)
    • Line 547: warning: exported method Repo.AddTarget should have comment or be unexported (golint)
    • Line 551: warning: exported method Repo.AddTargets should have comment or be unexported (golint)
    • Line 555: warning: exported method Repo.AddTargetWithExpires should have comment or be unexported (golint)
    • Line 559: warning: exported method Repo.AddTargetsWithExpires should have comment or be unexported (golint)
    • Line 602: warning: exported method Repo.RemoveTarget should have comment or be unexported (golint)
    • Line 606: warning: exported method Repo.RemoveTargets should have comment or be unexported (golint)
    • Line 610: warning: exported method Repo.RemoveTargetWithExpires should have comment or be unexported (golint)
    • Line 614: warning: comment on exported method Repo.RemoveTargetsWithExpires should be of the form "RemoveTargetsWithExpires ..." (golint)
    • Line 650: warning: exported method Repo.Snapshot should have comment or be unexported (golint)
    • Line 654: warning: exported method Repo.SnapshotWithExpires should have comment or be unexported (golint)
    • Line 686: warning: exported method Repo.Timestamp should have comment or be unexported (golint)
    • Line 690: warning: exported method Repo.TimestampWithExpires should have comment or be unexported (golint)
    • Line 767: warning: exported method Repo.Commit should have comment or be unexported (golint)
    • Line 849: warning: exported method Repo.Clean should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign91%

IneffAssign detects ineffectual assignments in Go code.


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!