As a software architect, I get approached by dozens of companies offering me software to help do codebase analysis, vulnerability scans, etc.
And working with many billion lines of code, there is plenty to review. The vendor also supports user exits and modifications, so worldwide, probably 100s of billions of lines of code. The issue isn't identifying the bad code. The issue is what to do with it. Even with this much data to sift through, AI will never be able to completely comprehend the purpose of all code, simply because there are so many bad programmers out there, and documentation is usually no help.
But an 80% solution would be most welcome too.
The same thing goes for warnings. Yes, we can run automated scans to react to warnings. But we already do this. Automation rocks. When I started, I spent at least half of my nights fixing filled harddrives, extending databases, restarting backups, etc. Today I sleep 360 nights of the year, or more. I applaud monitoring, alerting, automated responses, scripting, and of course vendors improving their toolsets, and 3rd parties adding what the vendor sees as "irrelevant", but which makes my life easier.
However, from a warning to an error, there is a long way. Warnings are there to inform us of an impending (and identified - thus known) problem. Errors happen when unforeseen problems occur. Keyword being "unforeseen". If the programmer knew what the problem was, he could fix it with checks, choices or calls to scripts fixing the issue. But when a programmer chooses to throw an error, it is because he CANT fix the issue. Again, we might be able to understand or add in fixes to some of the problems, simply because AI would allow us to effectively trawl through millions of identical errors, and determine a common cause, or a common solution that is not easily identified by the human mind.... But again, at best an 80% solution, I would guess.
Am I happy with 80% ? Absolutely. Can we go higher ? Hopefully ? We need to. Software evolves faster than our solution to the bad code, if it didn't I would be out of a job by now :)
Now once we get the AI to actually WRITE the code (effectively - not the simple procedures it can do today), we can add in purpose, direction, rules, principles. And unlike humans, the AI will be more inclined to follow those guidelines, resulting in fewer errors. And if the AI wrote the code effectively, it will be more likely to understand the purpose, and thus fix unforeseen problems. And more importantly, people with little or no programming skill can effectively join the ranks of the developers, which will make development cheaper and faster. Startups and new projects wont be dependent on good programmers, just good AI.