Reduce code duplication for code climate

[#52541875]
Merge 52541875-code-climate to master

[#52541875]