If you are willing to accept quite a few false positives and false negatives, I think current techniques in machine learning can deliver on this promise. (If you put in all the work to train a good mode etc.)
Btw, have a look at hlint. It sometimes gives rather involved hints about how you can restructure your code.
Btw, have a look at hlint. It sometimes gives rather involved hints about how you can restructure your code.