Showing 4 of 13 total issues
Function file_pbmessage_proto_init
has 71 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func file_pbmessage_proto_init() {
if File_pbmessage_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
Function main
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func main() {
// GENISIS BLOCKCHAIN
// LOAD BLOCK 0 WITH 0000 TRANSACTION
s := "GENISIS BLOCKCHAIN / LOAD BLOCK 0 WITH 0000 TRANSACTION"
Method txRequestMessageSignedStruct.addTransactionToPendingBlock
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func (trms txRequestMessageSignedStruct) addTransactionToPendingBlock(unspentOutputSlice []unspentOutputStruct, change int64) {
// Check if first transaction in pendingBlock
first := false
if pendingBlock.Transactions[0].Inputs == nil {
Function getBalance
has a Cognitive Complexity of 24 (exceeds 20 allowed). Consider refactoring. Open
Open
func getBalance(address string) (int64, []unspentOutputStruct) {
unspentOutputMap := make(map[int64]int64)
var unspentOutput unspentOutputStruct
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"