Language: JavaScript
Label: safe
CWE: CWE-78 \u2014 Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
The product constructs all or part of an OS command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended OS command when it is sent to a downstream component.

Code:
EditorUi.prototype.fitDiagramToWindow=function(){var b=this.editor.graph,e=b.isSelectionEmpty()?mxRectangle.fromRectangle(b.getGraphBounds()):b.getBoundingBox(b.getSelectionCells()),g=b.view.translate,n=b.view.scale;e.x=e.x/n-g.x;e.y=e.y/n-g.y;e.width/=n;e.height/=n;null!=b.backgroundImage&&e.add(new mxRectangle(0,0,b.backgroundImage.width,b.backgroundImage.height));0==e.width||0==e.height?(b.zoomTo(1),this.resetScrollbars()):(g=Editor.fitWindowBorders,null!=g&&(e.x-=g.x,e.y-=g.y,e.width+=g.width+
g.x,e.height+=g.height+g.y),b.fitWindow(e))};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};