User blog comment:Catinthedark/Infobox level: killing the massive switches/@comment-3225604-20150705085205/@comment-26235098-20150706020537

Since the template can be used with params, no impact on functionality... I don't even have to do a work around.

Nothing is actually broken on the wiki as things stand, but something is kind of wrong...

From a programming perspective, we always want one layer to "talk" to it's neighboring layer. We don't like a layer "finding out" about things it isn't explicitly told about. If a layer (can be a module, a document, a function, an app, doesn't matter) is send/receive information, it should do so through a clear interface wherever possible. Functions "listen" through their parameters, and "talk" through return values. Currently, the getLevel function is "eavesdropping" :D -- listening to it's parent's parameters. Likewise, it isn't a good thing that it ignores its own.. i.e. what is sent in through an invoke. It's like it is wearing headphones, plugged into the parent, so it can't hear its own environment. Very counter-intuitive. That's the long and rather more colorful explanation you didn't ask for, I know... But these are the CS concepts involved.

Now, that said. Nothing is currently broken. But if I fix JUST the module, call paths that expect to be "overheard" -- such as your difficulty color template -- will break. Template:Difficulty level needs to be fixed as well: it needs to send its parameters on to the function, through the invoke statement. Ideally it should go first, because adding the params on the invoke won't hurt anything. (believe me I invoked with params till I was blue in the face last night :D) Then when the module is fixed, it will automatically work through the new path. No breaking of anything at any time.

I do have one concern: is Template:difficulty Level the ONLY place the getLevel function is directly invoked (called via #invoke)? If it is, we can proceed / lower the protections on both so I can edit. Otherwise... ha... project for a rainy day. ;)