Example #1
0
 /**
  * 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()));
     }
     $formula = isset($request->variables['formula']) ? $request->variables['formula'] : '$ce / ( $ca + $ce )';
     $this->model->load($this->resultDir . '/pdepend_summary.xml');
     $classes = $this->model->calculateTopClasses($formula, 25);
     $methods = $this->model->calculateTopMethods($formula, 25);
     return new Struct\Response('calculator.twig', array('formula' => $formula, 'classes' => $classes, 'classMetrics' => $this->model->getClassMetricList(), 'methods' => $methods, 'methodMetrics' => $this->model->getMethodMetricList()));
 }
Example #2
0
 /**
  * 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')));
 }