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 a=this.editor.graph,b=a.isSelectionEmpty()?mxRectangle.fromRectangle(a.getGraphBounds()):a.getBoundingBox(a.getSelectionCells()),e=a.view.translate,f=a.view.scale;b.x=b.x/f-e.x;b.y=b.y/f-e.y;b.width/=f;b.height/=f;null!=a.backgroundImage&&b.add(new mxRectangle(0,0,a.backgroundImage.width,a.backgroundImage.height));0==b.width||0==b.height?(a.zoomTo(1),this.resetScrollbars()):(e=Editor.fitWindowBorders,null!=e&&(b.x-=e.x,b.y-=e.y,b.width+=e.width+
e.x,b.height+=e.height+e.y),a.fitWindow(b))};EditorUi.prototype.hasScrollbars=function(){return this.editor.graph.scrollbars};