A comprehensive optical analysis of nanoscale structures: from thin films to asymmetric nanocavities