ethergo/backends/simulated/multibackend/simulated_gen_test.go
File simulated_gen_test.go
has 1131 lines of code (exceeds 500 allowed). Consider refactoring. Open
Open
// Code copied from github.com/ethereum/go-ethereum/accounts/abi/bind/backends:/simulated_test.go for testing by synapse modulecopier DO NOT EDIT."
// Copyright 2019 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
Function TestCallContractRevert
has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring. Open
Open
func TestCallContractRevert(t *testing.T) {
t.Parallel()
testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
sim := simTestBackend(testAddr)
defer sim.Close()
- 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
Function TestEstimateGas
has 97 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestEstimateGas(t *testing.T) {
t.Parallel()
/*
pragma solidity ^0.6.4;
contract GasEstimation {
Function TestEstimateGasWithPrice
has 81 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestEstimateGasWithPrice(t *testing.T) {
t.Parallel()
key, _ := crypto.GenerateKey()
addr := crypto.PubkeyToAddress(key.PublicKey)
Function TestCallContractRevert
has 75 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestCallContractRevert(t *testing.T) {
t.Parallel()
testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
sim := simTestBackend(testAddr)
defer sim.Close()
Function TestPendingAndCallContract
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestPendingAndCallContract(t *testing.T) {
t.Parallel()
testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
sim := simTestBackend(testAddr)
defer sim.Close()
Function TestForkLogsReborn
has 52 lines of code (exceeds 50 allowed). Consider refactoring. Open
Open
func TestForkLogsReborn(t *testing.T) {
t.Parallel()
testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
sim := simTestBackend(testAddr)
defer sim.Close()