private function _checkUnusedCode($endToken) {
		if ($this->_isActive('checkUnusedCode')) {

			// The check is done only when we are at the root level of a function
			if ($this->statementStack->getCurrentStackItem()->type === StatementItem::TYPE_FUNCTION) {

				// Find the end of the return statement
				$pos = $this->tokenizer->findNextStringPosition(';');

				// Find the next valid token after the return statement
				$nextValidToken = $this->tokenizer->peekNextValidToken($pos + 1);

				// Find the end of the function or bloc of code
				$posClose = $this->tokenizer->findNextStringPosition('}');

				// If the end of bloc if not right after the return statement, we have dead code
				if ($nextValidToken !== null && $posClose > $nextValidToken->position) {
					$msg = $this->_getMessage('UNUSED_CODE', $this->statementStack->getCurrentStackItem()->name, $endToken);
					$this->_writeError('checkUnusedCode', $msg);
				}
			}
		}
	}