Code Duplication    Length = 11-11 lines in 2 locations

src/Xhgui/Controller/RunController.php 2 locations

@@ 360-370 (lines=11) @@
357
        ]);
358
    }
359
360
    public function callgraphData(Request $request, Response $response)
361
    {
362
        $profile = $this->searcher->get($request->get('id'));
363
        $metric = $request->get('metric') ?: 'wt';
364
        $threshold = (float)$request->get('threshold') ?: 0.01;
365
        $callgraph = $profile->getCallgraph($metric, $threshold);
366
367
        $response['Content-Type'] = 'application/json';
368
369
        return $response->body(json_encode($callgraph));
370
    }
371
372
    public function callgraphDataDot(Request $request, Response $response)
373
    {
@@ 372-382 (lines=11) @@
369
        return $response->body(json_encode($callgraph));
370
    }
371
372
    public function callgraphDataDot(Request $request, Response $response)
373
    {
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->getCallgraphNodes($metric, $threshold);
378
379
        $response['Content-Type'] = 'application/json';
380
381
        return $response->body(json_encode($callgraph));
382
    }
383
}
384