console/profilerEngine.js: Put the code to get the displayName in a function + JSHint compliance