Showing 291 of 829 total issues
File contract.go
has 4348 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package sfc202
File contract.go
has 4028 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package sfc204
File contract.go
has 3746 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Code generated - DO NOT EDIT.
// This file is a generated binding and any manual changes will be lost.
package sfc110
Function ExportState
has a Cognitive Complexity of 207 (exceeds 20 allowed). Consider refactoring. Open
func ExportState(path string, gdb *gossip.Store, cdb *poset.Store, net *lachesis.Config) (*genesisstore.Store, error) {
_ = os.RemoveAll(path)
err := os.MkdirAll(path, 0700)
if err != nil {
- 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"
Further reading
File api.go
has 1526 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
Method Service.processSfc
has a Cognitive Complexity of 145 (exceeds 20 allowed). Consider refactoring. Open
func (s *Service) processSfc(block *inter.Block, receipts types.Receipts, blockFee *big.Int, sealEpoch bool, cheaters inter.Cheaters, statedb *state.StateDB) {
// s.engineMu is locked here
// process SFC contract logs
epoch := s.engine.GetEpoch()
- 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"
Further reading
Method ProtocolManager.handleMsg
has a Cognitive Complexity of 127 (exceeds 20 allowed). Consider refactoring. Open
func (pm *ProtocolManager) handleMsg(p *peer) error {
// Read the next message from the remote peer, and ensure it's fully consumed
msg, err := p.rw.ReadMsg()
if err != nil {
return err
- 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"
Further reading
File tx_pool.go
has 1137 lines of code (exceeds 500 allowed). Consider refactoring. Open
// Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
Function ExportState
has 395 lines of code (exceeds 50 allowed). Consider refactoring. Open
func ExportState(path string, gdb *gossip.Store, cdb *poset.Store, net *lachesis.Config) (*genesisstore.Store, error) {
_ = os.RemoveAll(path)
err := os.MkdirAll(path, 0700)
if err != nil {
ContractSession
has 83 methods (exceeds 20 allowed). Consider refactoring. Open
type ContractSession struct {
Contract *Contract // Generic contract binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
Function ASCIIschemeForEach
has a Cognitive Complexity of 93 (exceeds 20 allowed). Consider refactoring. Open
func ASCIIschemeForEach(
scheme string,
callback ForEachEvent,
) (
nodes []idx.StakerID,
- 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"
Further reading
ContractFilterer
has 81 methods (exceeds 20 allowed). Consider refactoring. Open
type ContractFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
ContractSession
has 78 methods (exceeds 20 allowed). Consider refactoring. Open
type ContractSession struct {
Contract *Contract // Generic contract binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
ContractFilterer
has 75 methods (exceeds 20 allowed). Consider refactoring. Open
type ContractFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
ContractSession
has 71 methods (exceeds 20 allowed). Consider refactoring. Open
type ContractSession struct {
Contract *Contract // Generic contract binding to set the session for
CallOpts bind.CallOpts // Call options to use throughout this session
TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session
}
ContractFilterer
has 69 methods (exceeds 20 allowed). Consider refactoring. Open
type ContractFilterer struct {
contract *bind.BoundContract // Generic contract wrapper for the low level calls
}
Method Service.processSfc
has 262 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (s *Service) processSfc(block *inter.Block, receipts types.Receipts, blockFee *big.Int, sealEpoch bool, cheaters inter.Cheaters, statedb *state.StateDB) {
// s.engineMu is locked here
// process SFC contract logs
epoch := s.engine.GetEpoch()
Method Fetcher.loop
has a Cognitive Complexity of 74 (exceeds 20 allowed). Consider refactoring. Open
func (f *Fetcher) loop() {
defer f.wg.Done()
// Iterate the event fetching until a quit is requested
fetchTimer := time.NewTimer(0)
defer fetchTimer.Stop()
- 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"
Further reading
EthAPIBackend
has 61 methods (exceeds 20 allowed). Consider refactoring. Open
type EthAPIBackend struct {
extRPCEnabled bool
svc *Service
state *EvmStateReader
gpo *gasprice.Oracle
Method rows.Optimize
has a Cognitive Complexity of 71 (exceeds 20 allowed). Consider refactoring. Open
func (rr *rows) Optimize() {
for curr, row := range rr.rows {
REFS:
for iRef, ref := range row.Refs {
- 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"