Preparing report...

Report for github.com/ChainSafe/gossamer

A+    Excellent!    Found 40 issues across 367 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!


gocyclo94%

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.

    • gossamer/lib/scale/decode.go
    • Line 480: warning: cyclomatic complexity 47 of function (*Decoder).DecodeTuple() is high (> 15) (gocyclo)
    • Line 58: warning: cyclomatic complexity 22 of function (*Decoder).Decode() is high (> 15) (gocyclo)
    • Line 141: warning: cyclomatic complexity 19 of function (*Decoder).DecodeFixedWidthInt() is high (> 15) (gocyclo)
    • Line 406: warning: cyclomatic complexity 18 of function (*Decoder).DecodeSlice() is high (> 15) (gocyclo)
    • gossamer/dot/sync/message.go
    • Line 32: warning: cyclomatic complexity 23 of function (*Service).CreateBlockResponse() is high (> 15) (gocyclo)
    • Line 130: warning: cyclomatic complexity 18 of function (*Service).getBlockData() is high (> 15) (gocyclo)

golint93%

Golint is a linter for Go source code.

    • gossamer/lib/babe/build.go
    • Line 56: warning: comment on exported type BlockBuilder should be of the form "BlockBuilder ..." (with optional leading article) (golint)
    • Line 66: warning: comment on exported function NewBlockBuilder should be of the form "NewBlockBuilder ..." (golint)
    • gossamer/lib/runtime/wasmtime/imports.go
    • Line 36: warning: don't use underscores in Go names; func ext_logging_log_version_1 should be extLoggingLogVersion1 (golint)
    • Line 40: warning: don't use underscores in Go names; func ext_sandbox_instance_teardown_version_1 should be extSandboxInstanceTeardownVersion1 (golint)
    • Line 44: warning: don't use underscores in Go names; func ext_sandbox_instantiate_version_1 should be extSandboxInstantiateVersion1 (golint)
    • Line 49: warning: don't use underscores in Go names; func ext_sandbox_invoke_version_1 should be extSandboxInvokeVersion1 (golint)
    • Line 54: warning: don't use underscores in Go names; func ext_sandbox_memory_get_version_1 should be extSandboxMemoryGetVersion1 (golint)
    • Line 59: warning: don't use underscores in Go names; func ext_sandbox_memory_new_version_1 should be extSandboxMemoryNewVersion1 (golint)
    • Line 64: warning: don't use underscores in Go names; func ext_sandbox_memory_set_version_1 should be extSandboxMemorySetVersion1 (golint)
    • Line 69: warning: don't use underscores in Go names; func ext_sandbox_memory_teardown_version_1 should be extSandboxMemoryTeardownVersion1 (golint)
    • Line 73: warning: don't use underscores in Go names; func ext_crypto_ed25519_generate_version_1 should be extCryptoEd25519GenerateVersion1 (golint)
    • Line 78: warning: don't use underscores in Go names; func ext_crypto_ed25519_verify_version_1 should be extCryptoEd25519VerifyVersion1 (golint)
    • Line 83: warning: don't use underscores in Go names; func ext_crypto_finish_batch_verify_version_1 should be extCryptoFinishBatchVerifyVersion1 (golint)
    • Line 88: warning: don't use underscores in Go names; func ext_crypto_secp256k1_ecdsa_recover_compressed_version_1 should be extCryptoSecp256k1EcdsaRecoverCompressedVersion1 (golint)
    • Line 93: warning: don't use underscores in Go names; func ext_crypto_sr25519_generate_version_1 should be extCryptoSr25519GenerateVersion1 (golint)
    • Line 98: warning: don't use underscores in Go names; func ext_crypto_sr25519_public_keys_version_1 should be extCryptoSr25519PublicKeysVersion1 (golint)
    • Line 103: warning: don't use underscores in Go names; func ext_crypto_sr25519_sign_version_1 should be extCryptoSr25519SignVersion1 (golint)
    • Line 108: warning: don't use underscores in Go names; func ext_crypto_sr25519_verify_version_2 should be extCryptoSr25519VerifyVersion2 (golint)
    • Line 113: warning: don't use underscores in Go names; func ext_crypto_start_batch_verify_version_1 should be extCryptoStartBatchVerifyVersion1 (golint)
    • Line 117: warning: don't use underscores in Go names; func ext_trie_blake2_256_ordered_root_version_1 should be extTrieBlake2_256OrderedRootVersion1 (golint)
    • Line 122: warning: don't use underscores in Go names; func ext_misc_print_hex_version_1 should be extMiscPrintHexVersion1 (golint)
    • Line 126: warning: don't use underscores in Go names; func ext_misc_print_num_version_1 should be extMiscPrintNumVersion1 (golint)
    • Line 131: warning: don't use underscores in Go names; func ext_misc_print_utf8_version_1 should be extMiscPrintUtf8Version1 (golint)
    • Line 138: warning: don't use underscores in Go names; func ext_misc_runtime_version_version_1 should be extMiscRuntimeVersionVersion1 (golint)
    • Line 143: warning: don't use underscores in Go names; func ext_default_child_storage_clear_version_1 should be extDefaultChildStorageClearVersion1 (golint)
    • Line 147: warning: don't use underscores in Go names; func ext_default_child_storage_get_version_1 should be extDefaultChildStorageGetVersion1 (golint)
    • Line 152: warning: don't use underscores in Go names; func ext_default_child_storage_root_version_1 should be extDefaultChildStorageRootVersion1 (golint)
    • Line 157: warning: don't use underscores in Go names; func ext_default_child_storage_set_version_1 should be extDefaultChildStorageSetVersion1 (golint)
    • Line 161: warning: don't use underscores in Go names; func ext_default_child_storage_storage_kill_version_1 should be extDefaultChildStorageStorageKillVersion1 (golint)
    • Line 165: warning: don't use underscores in Go names; func ext_allocator_free_version_1 should be extAllocatorFreeVersion1 (golint)
    • Line 173: warning: don't use underscores in Go names; func ext_allocator_malloc_version_1 should be extAllocatorMallocVersion1 (golint)
    • Line 182: warning: don't use underscores in Go names; func ext_hashing_blake2_128_version_1 should be extHashingBlake2_128Version1 (golint)
    • Line 187: warning: don't use underscores in Go names; func ext_hashing_blake2_256_version_1 should be extHashingBlake2_256Version1 (golint)
    • Line 192: warning: don't use underscores in Go names; func ext_hashing_keccak_256_version_1 should be extHashingKeccak256Version1 (golint)
    • Line 197: warning: don't use underscores in Go names; func ext_hashing_sha2_256_version_1 should be extHashingSha2_256Version1 (golint)
    • Line 202: warning: don't use underscores in Go names; func ext_hashing_twox_128_version_1 should be extHashingTwox128Version1 (golint)
    • Line 207: warning: don't use underscores in Go names; func ext_hashing_twox_64_version_1 should be extHashingTwox64Version1 (golint)
    • Line 212: warning: don't use underscores in Go names; func ext_offchain_is_validator_version_1 should be extOffchainIsValidatorVersion1 (golint)
    • Line 217: warning: don't use underscores in Go names; func ext_offchain_local_storage_compare_and_set_version_1 should be extOffchainLocalStorageCompareAndSetVersion1 (golint)
    • Line 222: warning: don't use underscores in Go names; func ext_offchain_local_storage_get_version_1 should be extOffchainLocalStorageGetVersion1 (golint)
    • Line 227: warning: don't use underscores in Go names; func ext_offchain_local_storage_set_version_1 should be extOffchainLocalStorageSetVersion1 (golint)
    • Line 231: warning: don't use underscores in Go names; func ext_offchain_network_state_version_1 should be extOffchainNetworkStateVersion1 (golint)
    • Line 236: warning: don't use underscores in Go names; func ext_offchain_random_seed_version_1 should be extOffchainRandomSeedVersion1 (golint)
    • Line 241: warning: don't use underscores in Go names; func ext_offchain_submit_transaction_version_1 should be extOffchainSubmitTransactionVersion1 (golint)
    • Line 246: warning: don't use underscores in Go names; func ext_storage_append_version_1 should be extStorageAppendVersion1 (golint)
    • Line 250: warning: don't use underscores in Go names; func ext_storage_changes_root_version_1 should be extStorageChangesRootVersion1 (golint)
    • Line 255: warning: don't use underscores in Go names; func ext_storage_clear_version_1 should be extStorageClearVersion1 (golint)
    • Line 259: warning: don't use underscores in Go names; func ext_storage_clear_prefix_version_1 should be extStorageClearPrefixVersion1 (golint)
    • Line 263: warning: don't use underscores in Go names; func ext_storage_commit_transaction_version_1 should be extStorageCommitTransactionVersion1 (golint)
    • Line 267: warning: don't use underscores in Go names; func ext_storage_get_version_1 should be extStorageGetVersion1 (golint)
    • Line 272: warning: don't use underscores in Go names; func ext_storage_next_key_version_1 should be extStorageNextKeyVersion1 (golint)
    • Line 277: warning: don't use underscores in Go names; func ext_storage_read_version_1 should be extStorageReadVersion1 (golint)
    • Line 282: warning: don't use underscores in Go names; func ext_storage_rollback_transaction_version_1 should be extStorageRollbackTransactionVersion1 (golint)
    • Line 286: warning: don't use underscores in Go names; func ext_storage_root_version_1 should be extStorageRootVersion1 (golint)
    • Line 291: warning: don't use underscores in Go names; func ext_storage_set_version_1 should be extStorageSetVersion1 (golint)
    • Line 295: warning: don't use underscores in Go names; func ext_storage_start_transaction_version_1 should be extStorageStartTransactionVersion1 (golint)
    • Line 299: warning: don't use underscores in Go names; func ext_offchain_index_set_version_1 should be extOffchainIndexSetVersion1 (golint)
    • gossamer/lib/grandpa/types.go
    • Line 31: warning: comment on exported type Voter should be of the form "Voter ..." (with optional leading article) (golint)
    • Line 31: warning: comment on exported type Voters should be of the form "Voters ..." (with optional leading article) (golint)
    • gossamer/lib/babe/crypto.go
    • Line 1: warning: package comment should be of the form "Package babe ..." (golint)
    • Line 31: warning: don't use underscores in Go names; var babe_vrf_prefix should be babeVrfPrefix (golint)
    • Line 112: warning: don't use underscores in Go names; var pp_exp should be ppExp (golint)
    • Line 116: warning: don't use underscores in Go names; var p_rat should be pRat (golint)
    • Line 124: warning: don't use underscores in Go names; var threshold_big should be thresholdBig (golint)
    • gossamer/lib/runtime/wasmtime/exports.go
    • Line 101: warning: comment on exported method Instance.InitializeBlock should be of the form "InitializeBlock ..." (golint)
    • Line 123: warning: comment on exported method Instance.FinalizeBlock should be of the form "FinalizeBlock ..." (golint)
    • Line 153: warning: exported method Instance.CheckInherents should have comment or be unexported (golint)
    • Line 154: warning: exported method Instance.RandomSeed should have comment or be unexported (golint)
    • Line 155: warning: exported method Instance.OffchainWorker should have comment or be unexported (golint)
    • Line 156: warning: exported method Instance.GenerateSessionKeys should have comment or be unexported (golint)
    • gossamer/lib/runtime/extrinsic/unchecked_extrinsic.go
    • Line 1: warning: package comment should be of the form "Package extrinsic ..." (golint)
    • Line 46: warning: don't use underscores in Go names; const PB_Transfer should be PBTransfer (golint)
    • Line 47: warning: don't use underscores in Go names; const PB_Set_balance should be PBSetBalance (golint)
    • Line 48: warning: don't use underscores in Go names; const PB_Force_transfer should be PBForceTransfer (golint)
    • Line 49: warning: don't use underscores in Go names; const PB_Transfer_keep_alive should be PBTransferKeepAlive (golint)
    • Line 54: warning: don't use underscores in Go names; const SYS_fill_block should be SYSFillBlock (golint)
    • Line 55: warning: don't use underscores in Go names; const SYS_remark should be SYSRemark (golint)
    • Line 56: warning: don't use underscores in Go names; const SYS_set_heap_pages should be SYSSetHeapPages (golint)
    • Line 57: warning: don't use underscores in Go names; const SYS_set_code should be SYSSetCode (golint)
    • Line 58: warning: don't use underscores in Go names; const SYS_set_storage should be SYSSetStorage (golint)
    • Line 59: warning: don't use underscores in Go names; const SYS_kill_storage should be SYSKillStorage (golint)
    • Line 60: warning: don't use underscores in Go names; const SYS_kill_prefix should be SYSKillPrefix (golint)
    • Line 65: warning: don't use underscores in Go names; const SESS_set_keys should be SESSSetKeys (golint)
    • gossamer/lib/runtime/life/resolver.go
    • Line 79: warning: don't use underscores in Go names; func ext_logging_log_version_1 should be extLoggingLogVersion1 (golint)
    • Line 106: warning: don't use underscores in Go names; func ext_misc_print_utf8_version_1 should be extMiscPrintUtf8Version1 (golint)
    • Line 114: warning: don't use underscores in Go names; func ext_misc_print_hex_version_1 should be extMiscPrintHexVersion1 (golint)
    • Line 122: warning: don't use underscores in Go names; func ext_allocator_malloc_version_1 should be extAllocatorMallocVersion1 (golint)
    • Line 136: warning: don't use underscores in Go names; func ext_allocator_free_version_1 should be extAllocatorFreeVersion1 (golint)
    • Line 150: warning: don't use underscores in Go names; func ext_hashing_blake2_256_version_1 should be extHashingBlake2_256Version1 (golint)
    • Line 173: warning: don't use underscores in Go names; func ext_hashing_twox_128_version_1 should be extHashingTwox128Version1 (golint)
    • Line 195: warning: don't use underscores in Go names; func ext_hashing_twox_64_version_1 should be extHashingTwox64Version1 (golint)
    • Line 217: warning: don't use underscores in Go names; func ext_storage_get_version_1 should be extStorageGetVersion1 (golint)
    • Line 238: warning: don't use underscores in Go names; func ext_storage_set_version_1 should be extStorageSetVersion1 (golint)
    • Line 255: warning: don't use underscores in Go names; func ext_storage_next_key_version_1 should be extStorageNextKeyVersion1 (golint)
    • Line 274: warning: don't use underscores in Go names; func ext_storage_clear_version_1 should be extStorageClearVersion1 (golint)
    • Line 286: warning: don't use underscores in Go names; func ext_storage_clear_prefix_version_1 should be extStorageClearPrefixVersion1 (golint)
    • Line 308: warning: don't use underscores in Go names; func ext_storage_read_version_1 should be extStorageReadVersion1 (golint)
    • Line 386: warning: don't use underscores in Go names; func ext_storage_append_version_1 should be extStorageAppendVersion1 (golint)
    • Line 404: warning: don't use underscores in Go names; func ext_trie_blake2_256_ordered_root_version_1 should be extTrieBlake2_256OrderedRootVersion1 (golint)
    • Line 448: warning: don't use underscores in Go names; func ext_storage_root_version_1 should be extStorageRootVersion1 (golint)
    • Line 469: warning: don't use underscores in Go names; func ext_storage_changes_root_version_1 should be extStorageChangesRootVersion1 (golint)
    • Line 482: warning: don't use underscores in Go names; func ext_crypto_start_batch_verify_version_1 should be extCryptoStartBatchVerifyVersion1 (golint)
    • Line 487: warning: don't use underscores in Go names; func ext_crypto_finish_batch_verify_version_1 should be extCryptoFinishBatchVerifyVersion1 (golint)
    • gossamer/lib/runtime/wasmer/exports.go
    • Line 130: warning: comment on exported method Instance.FinalizeBlock should be of the form "FinalizeBlock ..." (golint)
    • Line 178: warning: exported method Instance.CheckInherents should have comment or be unexported (golint)
    • Line 179: warning: exported method Instance.RandomSeed should have comment or be unexported (golint)
    • Line 180: warning: exported method Instance.OffchainWorker should have comment or be unexported (golint)
    • Line 181: warning: exported method Instance.GenerateSessionKeys should have comment or be unexported (golint)
    • gossamer/lib/runtime/life/exports.go
    • Line 109: warning: comment on exported method Instance.FinalizeBlock should be of the form "FinalizeBlock ..." (golint)
    • Line 153: warning: exported method Instance.CheckInherents should have comment or be unexported (golint)
    • Line 154: warning: exported method Instance.RandomSeed should have comment or be unexported (golint)
    • Line 155: warning: exported method Instance.OffchainWorker should have comment or be unexported (golint)
    • Line 156: warning: exported method Instance.GenerateSessionKeys should have comment or be unexported (golint)

license100%

Checks whether your project has a LICENSE file.

No problems detected. Good job!


ineffassign100%

IneffAssign detects ineffectual assignments in Go code.

No problems detected. Good job!


misspell100%

Misspell Finds commonly misspelled English words

No problems detected. Good job!