@@ -38,7 +38,6 @@ def analyze_code_files(self, code_files: List[Dict], base_dir: str) -> Dict:
3838 self .functions = {}
3939 self .call_relationships = []
4040
41- logger .debug ("Analyzing all code files" )
4241 files_analyzed = 0
4342 for file_info in code_files :
4443 logger .debug (f"Analyzing: { file_info ['path' ]} " )
@@ -111,19 +110,13 @@ def _analyze_code_file(self, repo_dir: str, file_info: Dict):
111110 repo_dir: Repository directory path
112111 file_info: File information dictionary
113112 """
114- # file_path = Path(repo_dir) / file_info["path"]
115113
116- # logger.debug(f"Reading content of {file_path}")
117- # try:
118- # with open(file_path, "r", encoding="utf-8", errors="ignore") as f:
119- # content = f.read()
120114 base = Path (repo_dir )
121115 file_path = base / file_info ["path" ]
122- logger . debug ( f"Reading content of { file_path } " )
116+
123117 try :
124118 content = safe_open_text (base , file_path )
125119 language = file_info ["language" ]
126- logger .debug (f"Analyzing { language } file: { file_path } " )
127120 if language == "python" :
128121 self ._analyze_python_file (file_path , content , repo_dir )
129122 elif language == "javascript" :
@@ -138,10 +131,10 @@ def _analyze_code_file(self, repo_dir: str, file_info: Dict):
138131 self ._analyze_c_file (file_path , content , repo_dir )
139132 elif language == "cpp" :
140133 self ._analyze_cpp_file (file_path , content , repo_dir )
141- else :
142- logger .warning (
143- f"Unsupported language for call graph analysis: { language } for file { file_path } "
144- )
134+ # else:
135+ # logger.warning(
136+ # f"Unsupported language for call graph analysis: {language} for file {file_path}"
137+ # )
145138
146139 except Exception as e :
147140 logger .error (f"⚠️ Error analyzing { file_path } : { str (e )} " )
@@ -180,18 +173,13 @@ def _analyze_javascript_file(self, file_path: str, content: str, repo_dir: str):
180173 repo_dir: Repository base directory
181174 """
182175 try :
183- logger .debug (f"Starting tree-sitter JavaScript analysis for { file_path } " )
184176
185177 from codewiki .src .be .dependency_analyzer .analyzers .javascript import analyze_javascript_file_treesitter
186178
187179 functions , relationships = analyze_javascript_file_treesitter (
188180 file_path , content , repo_path = repo_dir
189181 )
190182
191- logger .debug (
192- f"Tree-sitter JavaScript analysis completed for { file_path } : { len (functions )} functions, { len (relationships )} relationships"
193- )
194-
195183 for func in functions :
196184 func_id = func .id if func .id else f"{ file_path } :{ func .name } "
197185 self .functions [func_id ] = func
@@ -210,18 +198,13 @@ def _analyze_typescript_file(self, file_path: str, content: str, repo_dir: str):
210198 content: File content string
211199 """
212200 try :
213- logger .debug (f"Starting tree-sitter TypeScript analysis for { file_path } " )
214201
215202 from codewiki .src .be .dependency_analyzer .analyzers .typescript import analyze_typescript_file_treesitter
216203
217204 functions , relationships = analyze_typescript_file_treesitter (
218205 file_path , content , repo_path = repo_dir
219206 )
220207
221- logger .debug (
222- f"Tree-sitter TypeScript analysis completed for { file_path } : { len (functions )} functions, { len (relationships )} relationships"
223- )
224-
225208 for func in functions :
226209 func_id = func .id if func .id else f"{ file_path } :{ func .name } "
227210 self .functions [func_id ] = func
@@ -285,9 +268,6 @@ def _analyze_java_file(self, file_path: str, content: str, repo_dir: str):
285268
286269 try :
287270 functions , relationships = analyze_java_file (file_path , content , repo_path = repo_dir )
288- logger .debug (
289- f"Found { len (functions )} functions and { len (relationships )} relationships in { file_path } "
290- )
291271 for func in functions :
292272 func_id = func .id if func .id else f"{ file_path } :{ func .name } "
293273 self .functions [func_id ] = func
@@ -309,9 +289,6 @@ def _analyze_csharp_file(self, file_path: str, content: str, repo_dir: str):
309289
310290 try :
311291 functions , relationships = analyze_csharp_file (file_path , content , repo_path = repo_dir )
312- logger .debug (
313- f"Found { len (functions )} functions and { len (relationships )} relationships in { file_path } "
314- )
315292
316293 for func in functions :
317294 func_id = func .id if func .id else f"{ file_path } :{ func .name } "
@@ -328,7 +305,6 @@ def _resolve_call_relationships(self):
328305 Attempts to match function calls to actual function definitions,
329306 handling cross-language calls where possible.
330307 """
331- logger .debug ("Building function lookup table for resolving relationships." )
332308 func_lookup = {}
333309 for func_id , func_info in self .functions .items ():
334310 func_lookup [func_id ] = func_id
@@ -375,9 +351,6 @@ def _deduplicate_relationships(self):
375351 seen .add (key )
376352 unique_relationships .append (rel )
377353
378- logger .debug (
379- f"Removed { len (self .call_relationships ) - len (unique_relationships )} duplicate relationships."
380- )
381354 self .call_relationships = unique_relationships
382355
383356 def _generate_visualization_data (self ) -> Dict :
@@ -391,7 +364,6 @@ def _generate_visualization_data(self) -> Dict:
391364 """
392365 cytoscape_elements = []
393366
394- logger .debug (f"Adding { len (self .functions )} function nodes." )
395367 for func_id , func_info in self .functions .items ():
396368 node_classes = []
397369 if func_info .node_type == "method" :
@@ -425,7 +397,6 @@ def _generate_visualization_data(self) -> Dict:
425397 )
426398
427399 resolved_rels = [r for r in self .call_relationships if r .is_resolved ]
428- logger .debug (f"Adding { len (resolved_rels )} relationship edges." )
429400 for rel in resolved_rels :
430401 cytoscape_elements .append (
431402 {
@@ -493,9 +464,6 @@ def _select_most_connected_nodes(self, target_count: int):
493464 target_count: The number of nodes to select
494465 """
495466 if len (self .functions ) <= target_count :
496- logger .debug (
497- f"Have { len (self .functions )} functions, target is { target_count } - keeping all"
498- )
499467 return
500468
501469 if not self .call_relationships :
@@ -537,8 +505,3 @@ def _select_most_connected_nodes(self, target_count: int):
537505 if rel .caller in selected_func_ids and rel .callee in selected_func_ids
538506 ]
539507
540- logger .debug (
541- f"Node selection: { original_func_count } -> { len (self .functions )} functions, "
542- f"{ original_rel_count } -> { len (self .call_relationships )} relationships"
543- )
544- logger .debug (f"Kept { len (selected_func_ids )} most connected nodes (target: { target_count } )" )
0 commit comments