/**
  * This method will return an <b>array</b> with all generated metric values
  * for the node with the given <b>$id</b> identifier. If there are no
  * metrics for the requested node, this method will return an empty <b>array</b>.
  *
  * <code>
  * array(
  *     'loc'    =>  42,
  *     'ncloc'  =>  17,
  *     'cc'     =>  12
  * )
  * </code>
  *
  * @param \PDepend\Source\AST\ASTArtifact $artifact
  * @return array(string=>mixed)
  */
 public function getNodeMetrics(ASTArtifact $artifact)
 {
     if (isset($this->nodeMetrics[$artifact->getId()])) {
         return $this->nodeMetrics[$artifact->getId()];
     }
     return array();
 }
예제 #2
0
 /**
  * This method will return an <b>array</b> with all generated metric values
  * for the given <b>$node</b> instance. If there are no metrics for the
  * requested node, this method will return an empty <b>array</b>.
  *
  * <code>
  * array(
  *     'loc'    =>  23,
  *     'cloc'   =>  17,
  *     'eloc'   =>  17,
  *     'ncloc'  =>  42
  * )
  * </code>
  *
  * @param  \PDepend\Source\AST\ASTArtifact $artifact
  * @return array
  */
 public function getNodeMetrics(ASTArtifact $artifact)
 {
     $metrics = array();
     if (isset($this->metrics[$artifact->getId()])) {
         $metrics = $this->metrics[$artifact->getId()];
     }
     return $metrics;
 }
예제 #3
0
 /**
  * This method will return an <b>array</b> with all generated metric values
  * for the node with the given <b>$id</b> identifier. If there are no
  * metrics for the requested node, this method will return an empty <b>array</b>.
  *
  * <code>
  * array(
  *     'npath'  =>  '17'
  * )
  * </code>
  *
  * @param  \PDepend\Source\AST\ASTArtifact $artifact
  * @return array
  */
 public function getNodeMetrics(ASTArtifact $artifact)
 {
     $metric = array();
     if (isset($this->metrics[$artifact->getId()])) {
         $metric = array(self::M_NPATH_COMPLEXITY => $this->metrics[$artifact->getId()]);
     }
     return $metric;
 }