I've always felt bad about the way hudson-behaviour.js became a single 3000 line spaghetti JavaScript file.
Good chunk of it is behaviour rules, which are normally associated with specific tag files. So I split those into separate JavaScript files and co-located them close to their tag files in [1]. I think it makes it bit more maintainable.
I've only done this for a few tag files so far, and it already cut about 600 lines out of hudson-behaviour.js, but I wanted to get feedback before I make further progress.
I suspect the rest of the hudson-behaviour.js code can be modularized via YUI3 modules, but I haven't tried that.
[1] https://github.com/jenkinsci/jenkins/commit/96442cd9cd7b432a19d05dd945502a854541cae7
-- Kohsuke Kawaguchi | CloudBees, Inc. | http://cloudbees.com/ Try Nectar, our professional version of Jenkins
