/** * Render yourself * * @param RMF\Request $request * @return Struct\Response */ public function render(RMF\Request $request) { if (!is_file($this->resultDir . '/pdepend_summary.xml')) { return new Struct\Response('not_available.twig', array('summary' => $this->getSummary())); } if (isset($request->variables['chart'])) { return $this->renderChart($request); } $classMetric = isset($request->variables['class']) ? $request->variables['class'] : 'cr'; $methodMetric = isset($request->variables['method']) ? $request->variables['method'] : 'ccn'; $this->model->load($this->resultDir . '/pdepend_summary.xml'); $classCloud = $this->model->getClassesMetric($classMetric); $classTop = $this->model->limitItemList($classCloud['items'], 15); $methodCloud = $this->model->getMethodsMetric($methodMetric); $methodTop = $this->model->limitItemList($methodCloud['items'], 15); return new Struct\Response('pdepend.twig', array('class' => $classCloud, 'classTop' => $classTop, 'classMetrics' => $this->model->getClassMetricList(), 'method' => $methodCloud, 'methodTop' => $methodTop, 'methodMetrics' => $this->model->getMethodMetricList(), 'pyramid' => file_get_contents($this->resultDir . '/pdepend_pyramid.svg'), 'jdepend' => file_get_contents($this->resultDir . '/pdepend_jdepend.svg'))); }