For a large scripts exist a trick to reduce the complexity of the Script Fields if you use classes that can be “common” and reused between other Script Fields.
For example, imagine we want to create a Script field that show a report HTML inside the tickets with the Lean metrics. Something like this:
And we have a very large script to calculate this, but well-formed/encoded using CLASSES. In this case, if we use classes, we can reuse-it in other Script Fields (because when you save the scripts are compiled and available in the same classpath!)
Now you can create another Script Field but with only the MAIN class!
(imports of the classes are not necessary)