Code Duplication    Length = 12-12 lines in 2 locations

src/Xhgui/Controller/Run.php 2 locations

@@ 310-321 (lines=12) @@
307
        ));
308
    }
309
310
    public function callgraphData()
311
    {
312
        $request = $this->app->request();
313
        $response = $this->app->response();
314
        $profile = $this->profiles->get($request->get('id'));
315
        $metric = $request->get('metric') ?: 'wt';
316
        $threshold = (float)$request->get('threshold') ?: 0.01;
317
        $callgraph = $profile->getCallgraph($metric, $threshold);
318
319
        $response['Content-Type'] = 'application/json';
320
        return $response->body(json_encode($callgraph));
321
    }
322
323
    public function callgraphDataDot()
324
    {
@@ 323-334 (lines=12) @@
320
        return $response->body(json_encode($callgraph));
321
    }
322
323
    public function callgraphDataDot()
324
    {
325
        $request = $this->app->request();
326
        $response = $this->app->response();
327
        $profile = $this->profiles->get($request->get('id'));
328
        $metric = $request->get('metric') ?: 'wt';
329
        $threshold = (float)$request->get('threshold') ?: 0.01;
330
        $callgraph = $profile->getCallgraphNodes($metric, $threshold);
331
332
        $response['Content-Type'] = 'application/json';
333
        return $response->body(json_encode($callgraph));
334
    }
335
}
336