Is possible to call CustomJS code as one-liners, but they can be long lines if you don’t choose your names wisely. See DataviewJS Snippet Showcase - #308 by holroy
Within Templater javascript code, they share the same scope, which would allow for declaration at one place, and references other places. Alas, I don’t think you can do the same with Dataview.
I don’t think you can do multiline inline queries, but you can call dv.view()
functions inline, where those functions can be multiline. (Kind of similar to CustomJS stuff)