Too many parameters, as above. I don't understand what this function does looking at the parameter list either - if I'm disabling the diagnostics, what does it mean if I pass true or false? How does that affect the output?

I wonder if we need more specific methods with fewer parameters.