Preparing report...

Report for github.com/Kregopaulgue/go

(v0.0.0-20171005095302-801da377c497)

A    Great!    Found 79 issues across 196 files

Tweet

gofmt71%

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!


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.

    • xdr/xdr_generated.go
    • Line 4630: warning: cyclomatic complexity 27 of function NewOperationResultTr() is high (> 15) (gocyclo)
    • Line 7239: warning: cyclomatic complexity 26 of function NewStellarMessage() is high (> 15) (gocyclo)
    • Line 2137: warning: cyclomatic complexity 26 of function NewOperationBody() is high (> 15) (gocyclo)

golint81%

Golint is a linter for Go source code.

    • support/log/loggly_hook.go
    • Line 26: warning: exported method LogglyHook.Fire should have comment or be unexported (golint)
    • Line 46: warning: exported method LogglyHook.Flush should have comment or be unexported (golint)
    • Line 50: warning: exported method LogglyHook.Levels should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/hash.go
    • Line 14: warning: exported type Hash should have comment or be unexported (golint)
    • Line 16: warning: exported function DecodeHash should have comment or be unexported (golint)
    • Line 23: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 27: warning: should replace errors.New(fmt.Sprintf(...)) with fmt.Errorf(...) (golint)
    • Line 36: warning: exported function MustDecodeHash should have comment or be unexported (golint)
    • Line 45: warning: exported function EmptyXdrArrayHash should have comment or be unexported (golint)
    • Line 52: warning: exported method Hash.IsZero should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/fs_archive.go
    • Line 14: warning: exported type FsArchiveBackend should have comment or be unexported (golint)
    • Line 18: warning: exported method FsArchiveBackend.GetFile should have comment or be unexported (golint)
    • Line 22: warning: exported method FsArchiveBackend.Exists should have comment or be unexported (golint)
    • Line 29: warning: exported method FsArchiveBackend.PutFile should have comment or be unexported (golint)
    • Line 48: warning: exported method FsArchiveBackend.ListFiles should have comment or be unexported (golint)
    • Line 69: warning: exported method FsArchiveBackend.CanListFiles should have comment or be unexported (golint)
    • Line 73: warning: exported function MakeFsBackend should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/util.go
    • Line 54: warning: exported function Categories should have comment or be unexported (golint)
    • Line 61: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 70: warning: exported function CategoryCheckpointPath should have comment or be unexported (golint)
    • Line 76: warning: exported function BucketPath should have comment or be unexported (golint)
    • keypair/full.go
    • Line 11: warning: exported type Full should have comment or be unexported (golint)
    • Line 15: warning: exported method Full.Address should have comment or be unexported (golint)
    • Line 19: warning: exported method Full.Hint should have comment or be unexported (golint)
    • Line 24: warning: exported method Full.Seed should have comment or be unexported (golint)
    • Line 28: warning: exported method Full.Verify should have comment or be unexported (golint)
    • Line 42: warning: exported method Full.Sign should have comment or be unexported (golint)
    • Line 47: warning: exported method Full.SignDecorated should have comment or be unexported (golint)
    • support/log/main.go
    • Line 19: warning: exported const PanicLevel should have comment (or a comment on this block) or be unexported (golint)
    • Line 102: warning: exported function SetLevel should have comment or be unexported (golint)
    • Line 106: warning: exported function WithField should have comment or be unexported (golint)
    • Line 111: warning: exported function WithFields should have comment or be unexported (golint)
    • Line 115: warning: exported function WithStack should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/xdrstream.go
    • Line 20: warning: exported type XdrStream should have comment or be unexported (golint)
    • Line 26: warning: exported function NewXdrStream should have comment or be unexported (golint)
    • Line 30: warning: exported function NewXdrGzStream should have comment or be unexported (golint)
    • Line 39: warning: exported method Archive.GetXdrStream should have comment or be unexported (golint)
    • Line 50: warning: exported function HashXdr should have comment or be unexported (golint)
    • Line 60: warning: exported method XdrStream.Close should have comment or be unexported (golint)
    • Line 69: warning: exported method XdrStream.ReadOne should have comment or be unexported (golint)
    • Line 76: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 105: warning: exported function WriteFramedXdr should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/verify.go
    • Line 33: warning: exported type ByHash should have comment or be unexported (golint)
    • Line 47: warning: exported function SortTxsForHash should have comment or be unexported (golint)
    • Line 63: warning: exported function HashTxSet should have comment or be unexported (golint)
    • Line 83: warning: exported function HashEmptyTxSet should have comment or be unexported (golint)
    • Line 87: warning: exported method Archive.VerifyLedgerHeaderHistoryEntry should have comment or be unexported (golint)
    • Line 107: warning: exported method Archive.VerifyTransactionHistoryEntry should have comment or be unexported (golint)
    • Line 118: warning: exported method Archive.VerifyTransactionHistoryResultEntry should have comment or be unexported (golint)
    • Line 129: warning: exported method Archive.VerifyCategoryCheckpoint should have comment or be unexported (golint)
    • Line 205: warning: exported method Archive.VerifyBucketHash should have comment or be unexported (golint)
    • Line 220: warning: exported method Archive.VerifyBucketEntries should have comment or be unexported (golint)
    • Line 271: warning: exported method Archive.ReportInvalid should have comment or be unexported (golint)
    • Line 280: warning: should omit 2nd value from range; this loop is equivalent to `for i := range ...` (golint)
    • tools/stellar-archivist/main.go
    • Line 35: warning: exported type Options should have comment or be unexported (golint)
    • Line 44: warning: exported method Options.SetRange should have comment or be unexported (golint)
    • Line 60: warning: exported method Options.MaybeProfile should have comment or be unexported (golint)
    • keypair/from_address.go
    • Line 19: warning: exported method FromAddress.Address should have comment or be unexported (golint)
    • Line 23: warning: exported method FromAddress.Hint should have comment or be unexported (golint)
    • Line 28: warning: exported method FromAddress.Verify should have comment or be unexported (golint)
    • Line 42: warning: exported method FromAddress.Sign should have comment or be unexported (golint)
    • Line 46: warning: exported method FromAddress.SignDecorated should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/dirprefix.go
    • Line 12: warning: exported type DirPrefix should have comment or be unexported (golint)
    • Line 14: warning: exported method DirPrefix.Path should have comment or be unexported (golint)
    • Line 18: warning: exported method DirPrefix.PathPrefix should have comment or be unexported (golint)
    • Line 29: warning: exported function CheckpointPrefix should have comment or be unexported (golint)
    • Line 37: warning: exported function HashPrefix should have comment or be unexported (golint)
    • Line 41: warning: comment on exported function RangePaths should be of the form "RangePaths ..." (golint)
    • tools/stellar-archivist/internal/scan.go
    • Line 26: warning: exported method Archive.ScanCheckpoints should have comment or be unexported (golint)
    • Line 37: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 42: warning: exported method Archive.ScanCheckpointsSlow should have comment or be unexported (golint)
    • Line 98: warning: exported method Archive.ScanCheckpointsFast should have comment or be unexported (golint)
    • Line 156: warning: exported method Archive.Scan should have comment or be unexported (golint)
    • Line 168: warning: exported method Archive.ScanAllBuckets should have comment or be unexported (golint)
    • Line 189: warning: exported method Archive.ScanBuckets should have comment or be unexported (golint)
    • Line 283: warning: exported method Archive.ClearCachedInfo should have comment or be unexported (golint)
    • Line 293: warning: exported method Archive.ReportCheckpointStats should have comment or be unexported (golint)
    • Line 304: warning: exported method Archive.ReportBucketStats should have comment or be unexported (golint)
    • Line 311: warning: exported method Archive.NoteCheckpointFile should have comment or be unexported (golint)
    • Line 317: warning: exported method Archive.NoteExistingBucket should have comment or be unexported (golint)
    • Line 323: warning: exported method Archive.NoteReferencedBucket should have comment or be unexported (golint)
    • Line 334: warning: exported method Archive.CheckCheckpointFilesMissing should have comment or be unexported (golint)
    • Line 350: warning: exported method Archive.CheckBucketsMissing should have comment or be unexported (golint)
    • Line 354: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 363: warning: exported method Archive.ReportMissing should have comment or be unexported (golint)
    • Line 386: warning: should omit 2nd value from range; this loop is equivalent to `for bucket := range ...` (golint)
    • tools/stellar-archivist/internal/archive.go
    • Line 24: warning: exported type CommandOptions should have comment or be unexported (golint)
    • Line 33: warning: exported type ConnectOptions should have comment or be unexported (golint)
    • Line 37: warning: exported type ArchiveBackend should have comment or be unexported (golint)
    • Line 46: warning: exported type Archive should have comment or be unexported (golint)
    • Line 69: warning: exported method Archive.GetPathHAS should have comment or be unexported (golint)
    • Line 81: warning: exported method Archive.PutPathHAS should have comment or be unexported (golint)
    • Line 94: warning: exported method Archive.BucketExists should have comment or be unexported (golint)
    • Line 98: warning: exported method Archive.CategoryCheckpointExists should have comment or be unexported (golint)
    • Line 102: warning: exported method Archive.GetRootHAS should have comment or be unexported (golint)
    • Line 106: warning: exported method Archive.GetCheckpointHAS should have comment or be unexported (golint)
    • Line 110: warning: exported method Archive.PutCheckpointHAS should have comment or be unexported (golint)
    • Line 114: warning: exported method Archive.PutRootHAS should have comment or be unexported (golint)
    • Line 122: warning: exported method Archive.ListBucket should have comment or be unexported (golint)
    • Line 126: warning: exported method Archive.ListAllBuckets should have comment or be unexported (golint)
    • Line 130: warning: exported method Archive.ListAllBucketHashes should have comment or be unexported (golint)
    • Line 147: warning: exported method Archive.ListCategoryCheckpoints should have comment or be unexported (golint)
    • Line 172: warning: exported function Connect should have comment or be unexported (golint)
    • Line 214: warning: exported function MustConnect should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/mock_archive.go
    • Line 16: warning: exported type MockArchiveBackend should have comment or be unexported (golint)
    • Line 21: warning: exported method MockArchiveBackend.Exists should have comment or be unexported (golint)
    • Line 28: warning: exported method MockArchiveBackend.GetFile should have comment or be unexported (golint)
    • Line 39: warning: exported method MockArchiveBackend.PutFile should have comment or be unexported (golint)
    • Line 50: warning: exported method MockArchiveBackend.ListFiles should have comment or be unexported (golint)
    • Line 56: warning: should omit 2nd value from range; this loop is equivalent to `for k := range ...` (golint)
    • Line 71: warning: exported method MockArchiveBackend.CanListFiles should have comment or be unexported (golint)
    • Line 75: warning: exported function MakeMockBackend should have comment or be unexported (golint)
    • clients/horizon/main.go
    • Line 44: warning: exported const OrderAsc should have comment (or a comment on this block) or be unexported (golint)
    • Line 69: warning: exported type ClientInterface should have comment or be unexported (golint)
    • protocols/federation/main.go
    • Line 28: warning: exported method Memo.MarshalJSON should have comment or be unexported (golint)
    • Line 42: warning: exported method Memo.UnmarshalJSON should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/s3_archive.go
    • Line 16: warning: exported type S3ArchiveBackend should have comment or be unexported (golint)
    • Line 22: warning: exported method S3ArchiveBackend.GetFile should have comment or be unexported (golint)
    • Line 34: warning: exported method S3ArchiveBackend.Exists should have comment or be unexported (golint)
    • Line 43: warning: exported method S3ArchiveBackend.PutFile should have comment or be unexported (golint)
    • Line 61: warning: exported method S3ArchiveBackend.ListFiles should have comment or be unexported (golint)
    • Line 99: warning: exported method S3ArchiveBackend.CanListFiles should have comment or be unexported (golint)
    • Line 103: warning: exported function MakeS3Backend should have comment or be unexported (golint)
    • support/db/sqlite.go
    • Line 6: warning: a blank import should be only in a main or test package, or have a comment justifying it (golint)
    • clients/horizon/responses.go
    • Line 9: warning: exported type Problem should have comment or be unexported (golint)
    • Line 18: warning: exported type Account should have comment or be unexported (golint)
    • Line 40: warning: exported method Account.GetNativeBalance should have comment or be unexported (golint)
    • Line 53: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 63: warning: receiver name should be a reflection of its identity; don't use generic names such as "this" or "self" (golint)
    • Line 67: warning: exported type AccountFlags should have comment or be unexported (golint)
    • Line 72: warning: exported type AccountThresholds should have comment or be unexported (golint)
    • Line 78: warning: exported type Asset should have comment or be unexported (golint)
    • Line 84: warning: exported type Balance should have comment or be unexported (golint)
    • Line 90: warning: exported type HistoryAccount should have comment or be unexported (golint)
    • Line 96: warning: exported type Ledger should have comment or be unexported (golint)
    • Line 120: warning: exported type Link should have comment or be unexported (golint)
    • Line 125: warning: exported type Offer should have comment or be unexported (golint)
    • Line 141: warning: exported type OrderBookSummary should have comment or be unexported (golint)
    • Line 148: warning: exported type TransactionSuccess should have comment or be unexported (golint)
    • Line 166: warning: exported type Signer should have comment or be unexported (golint)
    • Line 173: warning: exported type OffersPage should have comment or be unexported (golint)
    • Line 184: warning: exported type Payment should have comment or be unexported (golint)
    • Line 210: warning: exported type Price should have comment or be unexported (golint)
    • Line 215: warning: exported type PriceLevel should have comment or be unexported (golint)
    • Line 221: warning: exported type Transaction should have comment or be unexported (golint)
    • xdr/main.go
    • Line 60: warning: exported function MarshalBase64 should have comment or be unexported (golint)
    • xdr/xdr_generated.go
    • Line 90: warning: exported const CryptoKeyTypeKeyTypeEd25519 should have comment (or a comment on this block) or be unexported (golint)
    • Line 124: warning: exported const PublicKeyTypePublicKeyTypeEd25519 should have comment (or a comment on this block) or be unexported (golint)
    • Line 156: warning: exported const SignerKeyTypeSignerKeyTypeEd25519 should have comment (or a comment on this block) or be unexported (golint)
    • Line 596: warning: exported const AssetTypeAssetTypeNative should have comment (or a comment on this block) or be unexported (golint)
    • Line 796: warning: exported const ThresholdIndexesThresholdMasterWeight should have comment (or a comment on this block) or be unexported (golint)
    • Line 836: warning: exported const LedgerEntryTypeAccount should have comment (or a comment on this block) or be unexported (golint)
    • Line 896: warning: exported const AccountFlagsAuthRequiredFlag should have comment (or a comment on this block) or be unexported (golint)
    • Line 1011: warning: exported const TrustLineFlagsAuthorizedFlag should have comment (or a comment on this block) or be unexported (golint)
    • Line 1110: warning: exported const OfferEntryFlagsPassiveFlag should have comment (or a comment on this block) or be unexported (golint)
    • Line 1631: warning: exported const EnvelopeTypeEnvelopeTypeScp should have comment (or a comment on this block) or be unexported (golint)
    • Line 1690: warning: exported const OperationTypeCreateAccount should have comment (or a comment on this block) or be unexported (golint)
    • Line 2590: warning: exported const MemoTypeMemoNone should have comment (or a comment on this block) or be unexported (golint)
    • Line 3041: warning: exported const CreateAccountResultCodeCreateAccountSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 3134: warning: exported const PaymentResultCodePaymentSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 3240: warning: exported const PathPaymentResultCodePathPaymentSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 3455: warning: exported const ManageOfferResultCodeManageOfferSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 3511: warning: exported const ManageOfferEffectManageOfferCreated should have comment (or a comment on this block) or be unexported (golint)
    • Line 3737: warning: exported const SetOptionsResultCodeSetOptionsSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 3832: warning: exported const GiveSignersAccessResultCodeGiveSignersAccessSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 3919: warning: exported const SetSignersResultCodeSetSignersSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 4012: warning: exported const ChangeTrustResultCodeChangeTrustSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 4103: warning: exported const AllowTrustResultCodeAllowTrustSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 4192: warning: exported const AccountMergeResultCodeAccountMergeSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 4307: warning: exported const InflationResultCodeInflationSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 4432: warning: exported const ManageDataResultCodeManageDataSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 4516: warning: exported const OperationResultCodeOpInner should have comment (or a comment on this block) or be unexported (golint)
    • Line 5180: warning: exported const TransactionResultCodeTxSuccess should have comment (or a comment on this block) or be unexported (golint)
    • Line 5562: warning: exported const LedgerUpgradeTypeLedgerUpgradeVersion should have comment (or a comment on this block) or be unexported (golint)
    • Line 6043: warning: exported const BucketEntryTypeLiveentry should have comment (or a comment on this block) or be unexported (golint)
    • Line 6497: warning: exported const LedgerEntryChangeTypeLedgerEntryCreated should have comment (or a comment on this block) or be unexported (golint)
    • Line 6803: warning: exported const ErrorCodeErrMisc should have comment (or a comment on this block) or be unexported (golint)
    • Line 6910: warning: exported const IpAddrTypeIPv4 should have comment (or a comment on this block) or be unexported (golint)
    • Line 7089: warning: exported const MessageTypeErrorMsg should have comment (or a comment on this block) or be unexported (golint)
    • Line 7753: warning: exported const ScpStatementTypeScpStPrepare should have comment (or a comment on this block) or be unexported (golint)
    • tools/stellar-archivist/internal/history_archive_state.go
    • Line 7: warning: exported const NumLevels should have comment or be unexported (golint)
    • Line 9: warning: exported type HistoryArchiveState should have comment or be unexported (golint)
    • Line 23: warning: exported method HistoryArchiveState.LevelSummary should have comment or be unexported (golint)
    • Line 44: warning: exported method HistoryArchiveState.Buckets should have comment or be unexported (golint)
    • Line 59: warning: exported method HistoryArchiveState.Range should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/http_archive.go
    • Line 16: warning: exported type HttpArchiveBackend should have comment or be unexported (golint)
    • Line 24: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 30: warning: exported method HttpArchiveBackend.GetFile should have comment or be unexported (golint)
    • Line 50: warning: exported method HttpArchiveBackend.Exists should have comment or be unexported (golint)
    • Line 60: warning: exported method HttpArchiveBackend.PutFile should have comment or be unexported (golint)
    • Line 65: warning: exported method HttpArchiveBackend.ListFiles should have comment or be unexported (golint)
    • Line 74: warning: exported method HttpArchiveBackend.CanListFiles should have comment or be unexported (golint)
    • Line 78: warning: exported function MakeHttpBackend should have comment or be unexported (golint)
    • tools/stellar-archivist/internal/range.go
    • Line 13: warning: exported const CheckpointFreq should have comment or be unexported (golint)
    • Line 15: warning: exported type Range should have comment or be unexported (golint)
    • Line 20: warning: exported function PrevCheckpoint should have comment or be unexported (golint)
    • Line 28: warning: exported function NextCheckpoint should have comment or be unexported (golint)
    • Line 41: warning: exported function MakeRange should have comment or be unexported (golint)
    • Line 51: warning: exported method Range.Clamp should have comment or be unexported (golint)
    • Line 67: warning: exported method Range.Checkpoints should have comment or be unexported (golint)
    • Line 78: warning: exported method Range.Size should have comment or be unexported (golint)
    • Line 82: warning: exported method Range.CollapsedString should have comment or be unexported (golint)
    • Line 85: warning: if block ends with a return statement, so drop this else and outdent its block (golint)
    • Line 90: warning: exported type ByUint32 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!


misspell94%

Misspell Finds commonly misspelled English words

    • xdr/xdr_generated.go
    • Line 3117: warning: "successfuly" is a misspelling of "successfully" (misspell)
    • Line 4225: warning: "transfered" is a misspelling of "transferred" (misspell)
    • Line 5174: warning: "occured" is a misspelling of "occurred" (misspell)
    • xdr/price.go
    • Line 7: warning: "represenation" is a misspelling of "representation" (misspell)
    • exp/doc.go
    • Line 1: warning: "developement" is a misspelling of "development" (misspell)