synapsecns/sanguine

View on GitHub
ethergo/backends/simulated/multibackend/simulated_gen_test.go

Summary

Maintainability
F
3 days
Test Coverage

File simulated_gen_test.go has 1131 lines of code (exceeds 500 allowed). Consider refactoring.
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.
//
Severity: Major
Found in ethergo/backends/simulated/multibackend/simulated_gen_test.go - About 2 days to fix

    Function TestCallContractRevert has a Cognitive Complexity of 36 (exceeds 20 allowed). Consider refactoring.
    Open

    func TestCallContractRevert(t *testing.T) {
        t.Parallel()
        testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
        sim := simTestBackend(testAddr)
        defer sim.Close()
    Severity: Minor
    Found in ethergo/backends/simulated/multibackend/simulated_gen_test.go - About 2 hrs to fix

    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

    func TestEstimateGas(t *testing.T) {
        t.Parallel()
        /*
            pragma solidity ^0.6.4;
            contract GasEstimation {
    Severity: Major
    Found in ethergo/backends/simulated/multibackend/simulated_gen_test.go - About 2 hrs to fix

      Function TestEstimateGasWithPrice has 81 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

      func TestEstimateGasWithPrice(t *testing.T) {
          t.Parallel()
          key, _ := crypto.GenerateKey()
          addr := crypto.PubkeyToAddress(key.PublicKey)
      
      
      Severity: Major
      Found in ethergo/backends/simulated/multibackend/simulated_gen_test.go - About 2 hrs to fix

        Function TestCallContractRevert has 75 lines of code (exceeds 50 allowed). Consider refactoring.
        Open

        func TestCallContractRevert(t *testing.T) {
            t.Parallel()
            testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
            sim := simTestBackend(testAddr)
            defer sim.Close()
        Severity: Minor
        Found in ethergo/backends/simulated/multibackend/simulated_gen_test.go - About 2 hrs to fix

          Function TestPendingAndCallContract has 61 lines of code (exceeds 50 allowed). Consider refactoring.
          Open

          func TestPendingAndCallContract(t *testing.T) {
              t.Parallel()
              testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
              sim := simTestBackend(testAddr)
              defer sim.Close()
          Severity: Minor
          Found in ethergo/backends/simulated/multibackend/simulated_gen_test.go - About 1 hr to fix

            Function TestForkLogsReborn has 52 lines of code (exceeds 50 allowed). Consider refactoring.
            Open

            func TestForkLogsReborn(t *testing.T) {
                t.Parallel()
                testAddr := crypto.PubkeyToAddress(testKey.PublicKey)
                sim := simTestBackend(testAddr)
                defer sim.Close()
            Severity: Minor
            Found in ethergo/backends/simulated/multibackend/simulated_gen_test.go - About 1 hr to fix

              There are no issues that match your filters.

              Category
              Status