MCPcopy
hub / github.com/google/clusterfuzz / get_result

Function get_result

src/appengine/handlers/commit_range.py:140–172  ·  view source on GitHub ↗

Get the result for the crash stats page.

()

Source from the content-addressed store, hash-verified

138
139
140def get_result():
141 """Get the result for the crash stats page."""
142 params = dict(request.iterparams())
143 params['type'] = params.get('type', 'regression')
144 page = helpers.cast(request.get('page') or 1, int, "'page' is not an int.")
145
146 is_revision_empty = 'revision' not in params
147
148 query = big_query_query.Query()
149 crash_access.add_scope(query, params, 'security_flag', 'job_type',
150 'fuzzer_name')
151
152 if is_revision_empty:
153 total_count = 0
154 rows = []
155 else:
156 filters.add(query, params, FILTERS)
157 rows, total_count = get(
158 params=params,
159 query=query,
160 offset=(page - 1) * PAGE_SIZE,
161 limit=PAGE_SIZE)
162 helpers.log('Regression', helpers.VIEW_OPERATION)
163
164 result = {
165 'totalPages': (total_count // PAGE_SIZE) + 1,
166 'page': page,
167 'pageSize': PAGE_SIZE,
168 'items': rows,
169 'totalCount': total_count,
170 'isRevisionEmpty': is_revision_empty
171 }
172 return result, params
173
174
175class Handler(base_handler.Handler):

Callers 2

getMethod · 0.70
postMethod · 0.70

Calls 3

getFunction · 0.70
getMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected