synapsecns/sanguine

View on GitHub

Showing 1,971 of 13,422 total issues

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

func DetectChangedModules(repoPath string, ct tree.Tree, includeDeps bool) (modules map[string]bool, err error) {
    modules = make(map[string]bool)

    goWorkPath := path.Join(repoPath, "go.work")

Severity: Major
Found in contrib/git-changes-action/detector/package/detector.go - About 35 mins to fix

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

    func ParseCall(step model.TraceStep) (map[string]string, error) {
        result := make(map[string]string)
        stack := GenerateStack(step.Stack)
        memory := GenerateMemory(step.Memory)
        gas := AccessStack(stack, 0)
    Severity: Major
    Found in ethergo/parser/tracely/op.go - About 35 mins to fix

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

      func DetectChangedModules(repoPath string, ct tree.Tree, includeDeps bool) (modules map[string]bool, err error) {
          modules = make(map[string]bool)
      
          goWorkPath := path.Join(repoPath, "go.work")
      
      
      Severity: Major
      Found in contrib/git-changes-action/detector/module/detector.go - About 35 mins to fix

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

        func loadConfig() *signoz.Client {
            cfg := config{}
        
            var configFormFields []huh.Field
        
        
        Severity: Major
        Found in contrib/opbot/signoz/example/main.go - About 35 mins to fix

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

          func resolveAddr(ctx context.Context, client KeyClient, keyName string) (address common.Address, pubKeyBytes []byte, _ error) {
              resp, err := client.GetPublicKey(ctx, &kmspb.GetPublicKeyRequest{Name: keyName})
              if err != nil {
                  return common.Address{}, []byte{}, fmt.Errorf("google KMS public key %q lookup: %w", keyName, err)
              }
          Severity: Major
          Found in ethergo/signer/signer/gcpsigner/google.go - About 35 mins to fix

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

            func newOtelRecorder(meterHandler metrics.Handler, chainID int, name string) (_ iOtelRecorder, err error) {
                or := otelRecorder{
                    metrics:            meterHandler,
                    meter:              meterHandler.Meter(meterName),
                    lastBlock:          nil,
            Severity: Major
            Found in ethergo/listener/otel.go - About 35 mins to fix

              Function validatePath has a Cognitive Complexity of 22 (exceeds 20 allowed). Consider refactoring.
              Open

              func validatePath(path string, allowedDirs ...string) error {
                  // Get repository root using go-findroot
                  root, err := find.Repo()
                  if err == nil {
                      // Add repository root to allowed directories
              Severity: Minor
              Found in contrib/golang-ci-lint/main.go - About 35 mins 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 AddDirectoryPaths has 5 return statements (exceeds 4 allowed).
              Open

              func AddDirectoryPaths(tree Tree, dirPath, trimPrefix string) error {
                  err := filepath.Walk(dirPath, func(path string, _ os.FileInfo, err error) error {
                      if err != nil {
                          return fmt.Errorf("error walking path %s: %w", path, err)
                      }
              Severity: Major
              Found in contrib/git-changes-action/detector/tree/add.go - About 35 mins to fix

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

                func setupLinter(ctx context.Context, version, osName, arch string) (string, error) {
                    root, err := find.Repo()
                    if err != nil {
                        return "", fmt.Errorf("failed to get repository root: %w", err)
                    }
                Severity: Major
                Found in contrib/golang-ci-lint/main.go - About 35 mins to fix

                  Method fileRateLimiter.obtainLock has 5 return statements (exceeds 4 allowed).
                  Open

                  func (f *fileRateLimiter) obtainLock(ctx context.Context) (ok bool, err error) {
                      f.mux.Lock()
                      err = f.openFile()
                      if err != nil {
                          return false, fmt.Errorf("could not open file: %w", err)
                  Severity: Major
                  Found in tools/abigen/internal/etherscan/ratelimiter.go - About 35 mins to fix

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

                    func UnpackInputDataToInterface(v interface{}, input []byte, metadata *bind.MetaData) error {
                        abiData, err := metadata.GetAbi()
                        if err != nil {
                            return fmt.Errorf("failed to get abiData: %w", err)
                        }
                    Severity: Major
                    Found in ethergo/parser/abiutil/input.go - About 35 mins to fix

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

                      func setupOtterscan(ctx context.Context, tb testing.TB, pool *dockertest.Pool, anvilResource *dockertest.Resource, args *OptionBuilder) (string, error) {
                          tb.Helper()
                      
                          runOptions := &dockertest.RunOptions{
                              Repository: "otterscan/otterscan",
                      Severity: Major
                      Found in ethergo/backends/anvil/anvil.go - About 35 mins to fix

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

                        func validatePath(path string, allowedDirs ...string) error {
                            // Get repository root using go-findroot
                            root, err := find.Repo()
                            if err == nil {
                                // Add repository root to allowed directories
                        Severity: Major
                        Found in contrib/golang-ci-lint/main.go - About 35 mins to fix

                          Method nonceManagerImp.SignTx has 5 return statements (exceeds 4 allowed).
                          Open

                          func (n *nonceManagerImp) SignTx(ogTx *types.Transaction, signer types.Signer, prv *ecdsa.PrivateKey, options ...Option) (*types.Transaction, error) {
                              cfg := &signTXConfig{}
                          
                              for _, opt := range options {
                                  opt(cfg)
                          Severity: Major
                          Found in ethergo/signer/nonce/nonce.go - About 35 mins to fix

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

                            func FromRandom() (Wallet, error) {
                                newSeed, err := hdwallet.NewSeed()
                                if err != nil {
                                    return nil, fmt.Errorf("could not generate seed: %w", err)
                                }
                            Severity: Major
                            Found in ethergo/signer/wallet/import.go - About 35 mins to fix

                              Method exporter.getAllTokens has 5 return statements (exceeds 4 allowed).
                              Open

                              func (e *exporter) getAllTokens(parentCtx context.Context) (allTokens Tokens, err error) {
                                  allTokens = []TokenConfig{}
                              
                                  ctx, span := e.metrics.Tracer().Start(parentCtx, "get_all_tokens")
                              
                              
                              Severity: Major
                              Found in contrib/promexporter/exporters/util.go - About 35 mins to fix

                                Method exporter.fetchAllQuotes has 5 return statements (exceeds 4 allowed).
                                Open

                                func (e *exporter) fetchAllQuotes(ctx context.Context, url string) ([]rfqAPIModel.GetQuoteResponse, error) {
                                    req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
                                    if err != nil {
                                        return nil, fmt.Errorf("could not get quotes: %w", err)
                                    }
                                Severity: Major
                                Found in contrib/promexporter/exporters/relayer.go - About 35 mins to fix

                                  Method Guard.isStateSlashable has 5 return statements (exceeds 4 allowed).
                                  Open

                                  func (g Guard) isStateSlashable(ctx context.Context, state types.State) (bool, error) {
                                      statePayload, err := state.Encode()
                                      if err != nil {
                                          return false, fmt.Errorf("could not encode state: %w", err)
                                      }
                                  Severity: Major
                                  Found in agents/agents/guard/fraud.go - About 35 mins to fix

                                    Method AgentConfig.IsValid has 5 return statements (exceeds 4 allowed).
                                    Open

                                    func (a *AgentConfig) IsValid(ctx context.Context) (ok bool, err error) {
                                        if int64(a.RefreshIntervalSeconds) == int64(0) {
                                            return false, fmt.Errorf("refresh_interval_seconds cannot be 0")
                                        }
                                    
                                    
                                    Severity: Major
                                    Found in agents/config/agent_config.go - About 35 mins to fix

                                      Method receiptsProxyImpl.ProxyRequest has 5 return statements (exceeds 4 allowed).
                                      Open

                                      func (r *receiptsProxyImpl) ProxyRequest(c *gin.Context) (err error) {
                                          ctx, span := r.handler.Tracer().Start(c, "ProxyRequest",
                                              trace.WithAttributes(attribute.String("endpoint", r.proxyURL)),
                                          )
                                      
                                      
                                      Severity: Major
                                      Found in services/omnirpc/modules/receiptsbackup/receiptsbackup.go - About 35 mins to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language