synapsecns/sanguine

View on GitHub
tools/abigen/internal/generate.go

Summary

Maintainability
B
5 hrs
Test Coverage

Function compileSolidity has 57 lines of code (exceeds 50 allowed). Consider refactoring.
Open

func compileSolidity(version string, filePath string, optimizeRuns int, evmVersion *string) (map[string]*compiler.Contract, error) {
    runFile, err := createRunFile(version)
    if err != nil {
        return nil, err
    }
Severity: Minor
Found in tools/abigen/internal/generate.go - About 1 hr to fix

    Function BuildTemplates has 53 lines of code (exceeds 50 allowed). Consider refactoring.
    Open

    func BuildTemplates(version, file, pkg, filename string, optimizerRuns int, evmVersion *string) error {
        // TODO ast
        contracts, err := compileSolidity(version, file, optimizerRuns, evmVersion)
        if err != nil {
            return err
    Severity: Minor
    Found in tools/abigen/internal/generate.go - About 1 hr to fix

      Function compileSolidity has 10 return statements (exceeds 4 allowed).
      Open

      func compileSolidity(version string, filePath string, optimizeRuns int, evmVersion *string) (map[string]*compiler.Contract, error) {
          runFile, err := createRunFile(version)
          if err != nil {
              return nil, err
          }
      Severity: Major
      Found in tools/abigen/internal/generate.go - About 1 hr to fix

        Function BuildTemplates has 7 return statements (exceeds 4 allowed).
        Open

        func BuildTemplates(version, file, pkg, filename string, optimizerRuns int, evmVersion *string) error {
            // TODO ast
            contracts, err := compileSolidity(version, file, optimizerRuns, evmVersion)
            if err != nil {
                return err
        Severity: Major
        Found in tools/abigen/internal/generate.go - About 45 mins to fix

          Function GenerateABIFromEtherscan has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          func GenerateABIFromEtherscan(ctx context.Context, chainID uint32, url string, contractAddress common.Address, fileName, solVersion, pkgName string) error {
          Severity: Minor
          Found in tools/abigen/internal/generate.go - About 35 mins to fix

            Function GenerateABIFromEtherscan has 5 return statements (exceeds 4 allowed).
            Open

            func GenerateABIFromEtherscan(ctx context.Context, chainID uint32, url string, contractAddress common.Address, fileName, solVersion, pkgName string) error {
                client, err := etherscan.NewEtherscanAbiGenClientFromChain(ctx, chainID, url)
                if err != nil {
                    return fmt.Errorf("could not etherscan client for chain %d", chainID)
                }
            Severity: Major
            Found in tools/abigen/internal/generate.go - About 35 mins to fix

              There are no issues that match your filters.

              Category
              Status