\input zb-basic \input zb-ioport \iteman{io-port 06073711} \itemau{Kir\'aly, Roland; Kitlei, R\'obert; T\"om\"osk\"ozi, P\'eter} \itemti{Implementing structural complexity metrics in Erlang.} \itemso{Egri-Nagy, Attila (ed.) et al., Proceedings of the 8th international conference on applied informatics (ICAI 2010), Eger, Hungary, January 27--30, 2010. 2 Volumes. Eger: BVB Nyomda \'es Kiad\'o Kft. (ISBN 978-963-9894-72-3/pbk). 173-180 (2012).} \itemab Summary: In this paper, we present a way to measure the structural complexity of distributed functional programs. Apart from introducing newly devised complexity metrics, it is desirable to make use of long standing structural complexity metrics known for their usefulness in practice. However, most of these metrics are applied to procedural and OO programs, which have different semantics and language constructs. We describe our approach to make some of these metrics applicable to functional programs. Also, we investigate how closely the above metrics follow changes in the source code made either by hand or by refactoring. Finally, we show that with a sufficiently rich set of metrics, it is possible to enhance the refactoring process further either by giving more elaborate feedback to the user on the effectiveness of a series of refactoring steps, or by automatically taking refactoring steps along the best choice offered by the measured metrics. We illustrate our achievements in Erlang, using the back-end of the RefactorErl refactoring tool. \itemrv{~} \itemcc{} \itemut{} \itemli{} \end