def reachedLimit(parameter, analyzer):
    """Checks if the set limit has been reached

  :rtype: bool
  """
    if analyzer.query_size() == analyzer.size():
        return True
    if not parameter.retmax:
        return False
    if analyzer.size() == parameter.retmax:
        return True
    return False
