@@ -179,71 +179,6 @@ public function apiViewDynamicAnalysis(): JsonResponse
179179 return response ()->json (cast_data_for_JSON ($ response ));
180180 }
181181
182- public function apiViewDynamicAnalysisFile (): JsonResponse
183- {
184- $ pageTimer = new PageTimer ();
185-
186- // Make sure a valid id was specified.
187- if (!isset ($ _GET ['id ' ]) || !is_numeric ($ _GET ['id ' ])) {
188- abort (400 , 'Not a valid id! ' );
189- }
190- $ id = $ _GET ['id ' ];
191- $ DA = new DynamicAnalysis ();
192- $ DA ->Id = $ id ;
193- if (!$ DA ->Fill ()) {
194- abort (400 , 'Not a valid id! ' );
195- }
196-
197- // Get the build associated with this analysis.
198- $ this ->setBuildById ($ DA ->BuildId );
199-
200- $ date = TestingDay::get ($ this ->project , $ this ->build ->StartTime );
201- $ response = begin_JSON_response ();
202- get_dashboard_JSON ($ this ->project ->Name , $ date , $ response );
203- $ response ['title ' ] = "{$ this ->project ->Name } - Dynamic Analysis " ;
204-
205- // Build
206- $ build_response = [];
207- $ build_response ['site ' ] = $ this ->build ->GetSite ()->name ;
208- $ build_response ['buildname ' ] = $ this ->build ->Name ;
209- $ build_response ['buildid ' ] = $ this ->build ->Id ;
210- $ build_response ['buildtime ' ] = $ this ->build ->StartTime ;
211- $ response ['build ' ] = $ build_response ;
212-
213- // Menu
214- $ menu_response = [];
215- $ menu_response ['back ' ] = "/builds/ {$ this ->build ->Id }/dynamic_analysis " ;
216- $ previous_id = $ DA ->GetPreviousId ($ this ->build );
217- if ($ previous_id > 0 ) {
218- $ menu_response ['previous ' ] = "viewDynamicAnalysisFile.php?id= $ previous_id " ;
219- } else {
220- $ menu_response ['previous ' ] = false ;
221- }
222- $ current_id = $ DA ->GetLastId ($ this ->build );
223- $ menu_response ['current ' ] = "viewDynamicAnalysisFile.php?id= $ current_id " ;
224- $ next_id = $ DA ->GetNextId ($ this ->build );
225- if ($ next_id > 0 ) {
226- $ menu_response ['next ' ] = "viewDynamicAnalysisFile.php?id= $ next_id " ;
227- } else {
228- $ menu_response ['next ' ] = false ;
229- }
230- $ response ['menu ' ] = $ menu_response ;
231-
232- // dynamic analysis
233- $ DA_response = [];
234- $ DA_response ['status ' ] = ucfirst ($ DA ->Status );
235- $ DA_response ['filename ' ] = $ DA ->Name ;
236- // Only display the first 1MB of the log (in case it's huge)
237- $ DA_response ['log ' ] = substr ($ DA ->Log , 0 , 1024 * 1024 );
238- $ DA_response ['href ' ] = "queryTests.php?project= {$ this ->project ->Name }&filtercount=1&showfilters=1&field1=testname&compare1=61&value1= {$ DA ->Name }&date= {$ this ->date }" ;
239- $ response ['dynamicanalysis ' ] = $ DA_response ;
240-
241- $ response ['deprecated ' ] = 'This endpoint will be removed in the next major version of CDash. ' ;
242-
243- $ pageTimer ->end ($ response );
244- return response ()->json (cast_data_for_JSON ($ response ));
245- }
246-
247182 /**
248183 * Get the previous build id dynamicanalysis
249184 */
0 commit comments