MCPcopy Create free account
hub / github.com/OWASP/Python-Honeypot / fix_limit

Function fix_limit

api/utility.py:157–174  ·  view source on GitHub ↗

fix limit integer from user Args: limit: limit integer - default 10 Returns: limit integer or 10

(limit)

Source from the content-addressed store, hash-verified

155
156
157def fix_limit(limit):
158 """
159 fix limit integer from user
160
161 Args:
162 limit: limit integer - default 10
163
164 Returns:
165 limit integer or 10
166 """
167 if limit:
168 try:
169 if int(limit) > 10000:
170 return 10000
171 return int(limit)
172 except Exception:
173 pass
174 return 10
175
176
177def fix_skip(skip):

Callers 4

test_fix_limit_passMethod · 0.90
test_fix_limit_failMethod · 0.90
filter_by_limitFunction · 0.90
get_events_dataFunction · 0.90

Calls

no outgoing calls

Tested by 2

test_fix_limit_passMethod · 0.72
test_fix_limit_failMethod · 0.72