osmosis-labs / osmosis

The AMM Laboratory
https://app.osmosis.zone
Apache License 2.0
872 stars 560 forks source link

lint: investigate static-analysis tool to make sure all iterators are closed #2414

Open p0mvn opened 1 year ago

p0mvn commented 1 year ago

Background

We need a static analysis tool to detect iterators that were not closed.

Example problem: https://github.com/osmosis-labs/osmosis/blob/a1dc69413fd908810dbafe150967e814b796897b/x/superfluid/keeper/intermediary_account.go#L134

Suggested Approach

Acceptance Criteria

ValarDragon commented 1 year ago

I feel like this has to be something handled within gosec

faddat commented 1 year ago

So, I can think of 2-3 ways to do it, but in our internal chat, I started here:

https://github.com/crypto-com/cosmos-sdk-codeql

there's also:

https://github.com/informalsystems/gosec

but in general, the crypto.com tooling has replaced the informalsysstems/gosec repo in our code practice.