Returns current fail attempt count

@return integer
435013
public function getCurrentFailAttemptCount()
    {
        if (!$this->sessionBag->has(self::PARAM_ATTEMPT_NS)) {
            $this->reset();
        }

        return $this->sessionBag->get(self::PARAM_ATTEMPT_NS);
    }
1255409
public function getFailures()
    {
        $results = [];
        foreach ($this->hash as $key) {
            if ($this->hash[$key] instanceof \Exception) {
                $results[] = $this->hash[$key];
            }
        }

        return $results;
    }
66554
public function getTrackingFailures()
    {
        if (Piwik::hasUserSuperUserAccess()) {
            $failures = $this->trackingFailures->getAllFailures();
        } else {
            Piwik::checkUserHasSomeAdminAccess();
            $idSites = Access::getInstance()->getSitesIdWithAdminAccess();
            Piwik::checkUserHasAdminAccess($idSites);

            $failures = $this->trackingFailures->getFailuresForSites($idSites);
        }

        return $failures;
    }
438636
def num_failures(self):
        
        min_time = time.time() - self.window

        while self.failures and self.failures[0] < min_time:
            self.failures.popleft()

        return len(self.failures)
1032236
public function fails() {
      $ban = false;
      if (count(@$this->fails["failed"]) > 0 || count(@$this->fails["messages"]) > 0) {
         $ban = true;
      }
      return $ban;
   }
1330597
public function getCount () {
        if ($this->_count === null) {
            $this->_count = $this->getConnection ()->getSlave ()->scard ($this->name);
        }
        return $this->_count;
    }
416300
public function count()
    {
        if(is_null($this->int_count)){
            $this->int_count = mb_strlen($this->value, C::ENCODING);
        }

        return $this->int_count;
    }
219659
public function getCode(): int {
        if ($status = $this->getMainCode()) {
            return $status;
        }

        if ($this->isValid()) {
            return 200;
        }

        // There was no status so loop through the errors and look for the highest one.
        $max = 0;
        foreach ($this->getRawErrors() as $error) {
            if (isset($error['code']) && $error['code'] > $max) {
                $max = $error['code'];
            }
        }

        return $max ?: 400;
    }
539045
public function getError()
    {
        for ($i = 0, $c = count($this->read); $i < $c; $i++) {
            if (!$this->read[$i]) continue;
            $this->error[] = socket_last_error($this->read[$i]['sock']);
        }
    }
759241
public int getFailureCount() {
    int count = 0;
    for (AggregatedTestResultEvent t : getTests()) {
      if (t.getStatus() == TestStatus.FAILURE)
        count++;
    }
    for (FailureMirror m : getFailures()) {
      if (m.isAssertionViolation())
        count++;
    }
    return count;
  }
592263
public function getAttempts() {
        $rs = $this->runQuery(
            "SELECT attempts FROM " . self::$jobsTable . " WHERE id = ?",
            array($this->job_id)
        );
        foreach ($rs as $r) return $r["attempts"];
        return false;
    }
946594
private function sessionBruteForceLock()
    {
        $attempt = Yii::$app->session->get('__attempt_count', 0);
        
        $counter = $attempt + 1;
        
        Yii::$app->session->set('__attempt_count', $counter);
        
        $lockout = Yii::$app->session->get('__attempt_lockout');
        
        if ($lockout && $lockout > time()) {
            Yii::$app->session->set('__attempt_count', 0);
            return $lockout;
        }
        
        if ($counter >= $this->module->loginSessionAttemptCount) {
            Yii::$app->session->set('__attempt_lockout', time() + $this->module->loginSessionAttemptLockoutTime);
        }
        
        return false;
    }
1192350
protected function record_attempt(){
    $this->cfg['num_attempts'] = isset($this->cfg['num_attempts']) ?
      $this->cfg['num_attempts']+1 : 1;
    $this->_set_session('num_attempts', $this->cfg['num_attempts']);
    $this->save_session();
    return $this;
  }
929866
public function rowCount()
    {
        if (!$this->_stmt) {
            return false;
        }

        if (!$this->_executed) {
            return 0;
        }

        $num_rows = sqlsrv_rows_affected($this->_stmt);

        // Strict check is necessary; 0 is a valid return value
        if ($num_rows === false) {
            // require_once 'Zend/Db/Statement/Sqlsrv/Exception.php';
            throw new Zend_Db_Statement_Sqlsrv_Exception(sqlsrv_errors());
        }

        return $num_rows;
    }
1020095
public function aliveCount()
    {
        $count = 0;
        foreach ($this->processes as $process) {
            if ($process->isRunning()) {
                $count++;
            }
        }

        return $count;
    }
66732
protected function failed()
    {
        $retryCount = $this->model->getTriedCount() + 1;

        if ($retryCount >= $this->getMaxRetryCount()) {
            $this->model->setStatus(JobsConst::JOB_STATUS_FAILED);
        } else {
            $this->model->setStatus(JobsConst::JOB_STATUS_WAITING_RETRY);
            $this->model->setTryAt($this->getNextTryTime());
        }
        $this->model->setTriedCount($retryCount);

        return $this->model->persist();
    }
249174
public function error() {
		$errors = array();

		foreach (func_get_args() as $msg) {
			if (is_array($msg)) {
				$errors = array_merge($errors, $msg);
			} else {
				$errors[] = $msg;
			}
		}
		
		return count($errors) ? $errors : array(self::ERROR_UNKNOWN);
	}