MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / initializeAnalysis

Function initializeAnalysis

codeclash/viewer/static/js/analysis.js:11–37  ·  view source on GitHub ↗

* Initialize the analysis functionality

()

Source from the content-addressed store, hash-verified

9 * Initialize the analysis functionality
10 */
11function initializeAnalysis() {
12 const analysisDataElement = document.getElementById("analysis-data");
13 if (!analysisDataElement) {
14 return; // No analysis data available
15 }
16
17 // Check if the element has any content before parsing
18 const textContent = analysisDataElement.textContent.trim();
19 if (!textContent) {
20 return; // No data loaded yet (will be loaded on demand)
21 }
22
23 try {
24 analysisData = JSON.parse(textContent);
25
26 if (
27 analysisData &&
28 analysisData.all_files &&
29 analysisData.all_files.length > 0
30 ) {
31 setupFileDropdown();
32 createLineCountChart(analysisData.all_files[0]); // Start with first file
33 }
34 } catch (error) {
35 console.error("Error parsing analysis data:", error);
36 }
37}
38
39/**
40 * Setup the file dropdown change handler

Callers 1

analysis.jsFile · 0.85

Calls 3

setupFileDropdownFunction · 0.85
createLineCountChartFunction · 0.85
parseMethod · 0.45

Tested by

no test coverage detected