Identification of critical segments for water quality and fluvial functionality