Exemplo n.º 1
0
 /**
  * Performs the crap index analysis.
  *
  * @param  \PDepend\Source\AST\ASTNamespace[] $namespaces
  * @return void
  */
 private function doAnalyze($namespaces)
 {
     $this->metrics = array();
     $this->ccnAnalyzer->analyze($namespaces);
     $this->fireStartAnalyzer();
     foreach ($namespaces as $namespace) {
         $namespace->accept($this);
     }
     $this->fireEndAnalyzer();
 }
Exemplo n.º 2
0
 /**
  * Processes all {@link \PDepend\Source\AST\ASTNamespace} code nodes.
  *
  * @param  \PDepend\Source\AST\ASTNamespace[] $namespaces
  * @return void
  */
 public function analyze($namespaces)
 {
     if ($this->nodeMetrics === null) {
         // First check for the require cc analyzer
         if ($this->cyclomaticAnalyzer === null) {
             throw new \RuntimeException('Missing required CC analyzer.');
         }
         $this->fireStartAnalyzer();
         $this->cyclomaticAnalyzer->analyze($namespaces);
         // Init node metrics
         $this->nodeMetrics = array();
         // Visit all nodes
         foreach ($namespaces as $namespace) {
             $namespace->accept($this);
         }
         $this->fireEndAnalyzer();
     }
 }