@@ -326,60 +326,6 @@ def __enter__(self) -> "Codeanalyzer":
326326 if not self .no_venv and venv_path .exists ():
327327 self .virtualenv = venv_path
328328
329- if self .using_codeql :
330- logger .info (f"(Re-)initializing CodeQL analysis for { self .project_dir } " )
331-
332- # Resolve the CLI binary before anything else uses it: DB build
333- # below needs it, and so does every subsequent query run.
334- self .codeql_bin = self ._ensure_codeql_bin ()
335- # Download the standard query library pack (idempotent). The
336- # CLI install ships only the language extractors; the
337- # ``codeql/python-all`` library pack must be fetched separately.
338- self .codeql_packs_dir = self ._ensure_codeql_packs (self .codeql_bin )
339-
340- cache_root = self .cache_dir / "codeql"
341- cache_root .mkdir (parents = True , exist_ok = True )
342- self .db_path = cache_root / f"{ self .project_dir .name } -db"
343- self .db_path .mkdir (exist_ok = True )
344-
345- checksum_file = self .db_path / ".checksum"
346- current_checksum = self ._compute_checksum (self .project_dir )
347-
348- def is_cache_valid () -> bool :
349- if not (self .db_path / "db-python" ).exists ():
350- return False
351- if not checksum_file .exists ():
352- return False
353- return checksum_file .read_text ().strip () == current_checksum
354-
355- if self .rebuild_analysis or not is_cache_valid ():
356- logger .info ("Creating new CodeQL database..." )
357-
358- cmd = [
359- str (self .codeql_bin ),
360- "database" ,
361- "create" ,
362- str (self .db_path ),
363- f"--source-root={ self .project_dir } " ,
364- "--language=python" ,
365- "--overwrite" ,
366- ]
367-
368- proc = subprocess .Popen (
369- cmd , stdout = subprocess .DEVNULL , stderr = subprocess .PIPE
370- )
371- _ , err = proc .communicate ()
372-
373- if proc .returncode != 0 :
374- raise CodeQLExceptions .CodeQLDatabaseBuildException (
375- f"Error building CodeQL database:\n { err .decode ()} "
376- )
377-
378- checksum_file .write_text (current_checksum )
379-
380- else :
381- logger .info (f"Reusing cached CodeQL DB at { self .db_path } " )
382-
383329 return self
384330
385331 def __exit__ (self , * args , ** kwargs ) -> None :
@@ -444,15 +390,11 @@ def analyze(self) -> PyApplication:
444390 # Build symbol table from cached application if available (if no available, the build a new one)
445391 symbol_table = self ._build_symbol_table (cached_pyapplication .symbol_table if cached_pyapplication else {})
446392
447- # Optional CodeQL pass: augments PyCallsites in-place before Jedi runs,
448- # so Jedi edges benefit from CodeQL's resolved callee_signatures.
449- codeql_edges = self ._get_call_graph (symbol_table , augment_sites = True )
450-
451393 resolve_unresolved_constructors (symbol_table )
452394
453- # Level 1: Jedi + CodeQL call graph.
395+ # Level 1: Jedi call graph.
454396 jedi_edges = jedi_call_graph_edges (symbol_table )
455- call_graph = merge_edges (jedi_edges , codeql_edges )
397+ call_graph = list (jedi_edges )
456398
457399 if self .analysis_level >= 2 :
458400 # Level 2: also add PyCG edges.
0 commit comments