Code Duplication    Length = 13-13 lines in 2 locations

src/Xhgui/Controller/RunController.php 2 locations

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