That is an extremely difficult task.

I've used "number of maintenance screens"+"number of reports"+"number of major-business rules/calc" and lost my shirt.

Even gut-feeling doesn't work out (at least for the past 25 years or so).

See this post:

Agile methodologies

and look at the link for "Incrementalist and Completionists".

I believe there is about to be a fundamental shift in how us poor programmers cost out jobs, so that we don't keep taking the risk when the business managers are looking to take no risk at all.