Because you could only edit function bodies in Servoy 3.5, when you import Servoy 3.5 solutions in Servoy 4.0, function bodies have bad indentation.
This can be fixed using the Eclipse auto-indent function:
In a Javascript editor window, press <ctrl>-a followed by <ctrl>-i
Be warned though, this will basically redo all indentation, possibly ruining some carefully crafted indentation.