コード例 #1
0
 /**
  * Checks if a part of code is complex
  *
  * @param Node $node
  * @return bool
  */
 protected function isComplex(Node $node)
 {
     $complexity = $this->complexityComputer->compute($node);
     return $complexity > $this->getThreshold();
 }
コード例 #2
0
 /**
  * Calculates Cylomatic Complexity Number.
  *
  * @param Node $node
  * @return int
  */
 protected static function calculateCCN(Node $node)
 {
     return static::$complexityComputer->compute($node);
 }