Code Duplication    Length = 12-12 lines in 2 locations

src/Xhgui/Controller/Run.php 2 locations

@@ 366-377 (lines=12) @@
363
        ));
364
    }
365
366
    public function callgraphData()
367
    {
368
        $request = $this->app->request();
369
        $response = $this->app->response();
370
        $profile = $this->searcher->get($request->get('id'));
371
        $metric = $request->get('metric') ?: 'wt';
372
        $threshold = (float)$request->get('threshold') ?: 0.01;
373
        $callgraph = $profile->getCallgraph($metric, $threshold);
374
375
        $response['Content-Type'] = 'application/json';
376
        return $response->body(json_encode($callgraph));
377
    }
378
379
    public function callgraphDataDot()
380
    {
@@ 379-390 (lines=12) @@
376
        return $response->body(json_encode($callgraph));
377
    }
378
379
    public function callgraphDataDot()
380
    {
381
        $request = $this->app->request();
382
        $response = $this->app->response();
383
        $profile = $this->searcher->get($request->get('id'));
384
        $metric = $request->get('metric') ?: 'wt';
385
        $threshold = (float)$request->get('threshold') ?: 0.01;
386
        $callgraph = $profile->getCallgraphNodes($metric, $threshold);
387
388
        $response['Content-Type'] = 'application/json';
389
        return $response->body(json_encode($callgraph));
390
    }
391
}
392