2 ms·
Static analysis of any sizeable Ruby program is at best an unsolved problem, at worst impossible, as a lot of Ruby libraries depend on eval() and tracing down t
by vidarh 13y ago
Static analysis of any sizeable Ruby program is at best an unsolved problem, at worst impossible, as a lot of Ruby libraries depend on eval() and tracing down the sources of data for the eval string to verify that it isn't potentially user supplied (and often it can be)is hard enough, and the moment the data may be user supplied, you've "lost": Pretty much anything you thought you knew up to the eval() call can be wrong after the eval() call.
If you need/want static analysis, the option for the foreseeable future is to use another language (and I say this as a huge Ruby fan that also would love to see an evolution of Ruby that'd make some/more static analysis feasible, but for that to happen I believe you need an effort to provide a module encapsulating common eval() behaviour and a huge effort to replace eval in common Ruby libraries - it's not likely to happen anytime soon).