Expected Behavior
All the lines of code that we have in our production code are "meaningful".
Observed Behavior
The second parameter in this functions is never used in production: valueOrDefault(KEY, "value") and it's really missleading when you are writing/editing a rule.
Context
Working on #2498 I found some rules that doesn't have the default value hardcoded in it. And I created commits to fix that (4073097 and e7c0190)
But as I continue working in #2498 I see that there are even more rules that have this "issue".
I think that those values are there to make the tests easier. But we should not add any code in production to make the tests easier to write.
My proposal: change the use of valueOrDefault(key, value) to valueString(key), valueBoolean(key)...
Good thing: This is not a breaking change.
Expected Behavior
All the lines of code that we have in our production code are "meaningful".
Observed Behavior
The second parameter in this functions is never used in production:
valueOrDefault(KEY, "value")and it's really missleading when you are writing/editing a rule.Context
Working on #2498 I found some rules that doesn't have the default value hardcoded in it. And I created commits to fix that (4073097 and e7c0190)
But as I continue working in #2498 I see that there are even more rules that have this "issue".
I think that those values are there to make the tests easier. But we should not add any code in production to make the tests easier to write.
My proposal: change the use of
valueOrDefault(key, value)tovalueString(key),valueBoolean(key)...Good thing: This is not a breaking change.