There is an implementation of McCabe’s Cyclomatic Complexity and Halstead’s metrics for Scratch. You can find more information in the attached publication. The source code is available here: https://github.com/jemole/hairball/blob/master/hairball/plugins/metrics.py
Regards,
Jesús.
Conference Paper Comparing Computational Thinking Development Assessment Scor...
the paper below deals with metrics for IEC 61499, which is a PLC programming model containing graphical elements. May be, that you find some ideas there.