I used Function Point Analysis weighted for web based applications. But this presupposes there will be no major increase in scope, or increase or decrease in staffing. It also worked well when I had close contact with customers and could understand their needs directly.
In fact as soon as I saw velocity in the Agile, or related, Scientific Software Management practice I immediately "got it". One number to calibrate on to embody a host of factors internal and external and measure complexity.
The problem comes in when you are not allowed to calibrate due to things such as scope creep. People also do not like to hear your answer either. For example I one predicted that it would take four months to complete some features, the naysayers said 3 to 4 weeks. I was looked upon as a "gloomy Gus". The actual time was 3.5 months.
People want it now and try to push for more. The only way to do so is to cut scope and the quickest way to do that is to cut corners on quality.