ENH: Remove compiler warning.
STYLE: Prefer small scope for variables.
BUG: Code was throwing exception

When attempting to compute the final metric value, the
code was throwing an exception when the transform type
was a composite transform.