Code Duplication    Length = 12-12 lines in 2 locations

src/Xhgui/Controller/RunController.php 2 locations

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