Code Duplication    Length = 12-12 lines in 2 locations

src/Xhgui/Controller/Run.php 2 locations

@@ 329-340 (lines=12) @@
326
        ));
327
    }
328
329
    public function callgraphData()
330
    {
331
        $request = $this->app->request();
332
        $response = $this->app->response();
333
        $profile = $this->profiles->get($request->get('id'));
334
        $metric = $request->get('metric') ?: 'wt';
335
        $threshold = (float)$request->get('threshold') ?: 0.01;
336
        $callgraph = $profile->getCallgraph($metric, $threshold);
337
338
        $response['Content-Type'] = 'application/json';
339
        return $response->body(json_encode($callgraph));
340
    }
341
342
    public function callgraphDataDot()
343
    {
@@ 342-353 (lines=12) @@
339
        return $response->body(json_encode($callgraph));
340
    }
341
342
    public function callgraphDataDot()
343
    {
344
        $request = $this->app->request();
345
        $response = $this->app->response();
346
        $profile = $this->profiles->get($request->get('id'));
347
        $metric = $request->get('metric') ?: 'wt';
348
        $threshold = (float)$request->get('threshold') ?: 0.01;
349
        $callgraph = $profile->getCallgraphNodes($metric, $threshold);
350
351
        $response['Content-Type'] = 'application/json';
352
        return $response->body(json_encode($callgraph));
353
    }
354
}
355