codegraphcontext 0.2.11__py3-none-any.whl → 0.2.12__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -276,59 +276,50 @@ def get_repository_stats(code_finder: CodeFinder, **args) -> Dict[str, Any]:
276
276
  "error": f"Repository not found: {repo_path_obj}"
277
277
  }
278
278
 
279
- # Get stats for specific repo
280
- stats_query = """
281
- MATCH (r:Repository {path: $path})-[:CONTAINS]->(f:File)
282
- WITH r, count(f) as file_count, f
283
- OPTIONAL MATCH (f)-[:CONTAINS]->(func:Function)
284
- OPTIONAL MATCH (f)-[:CONTAINS]->(cls:Class)
285
- OPTIONAL MATCH (f)-[:IMPORTS]->(m:Module)
286
- RETURN
287
- file_count,
288
- count(DISTINCT func) as function_count,
289
- count(DISTINCT cls) as class_count,
290
- count(DISTINCT m) as module_count
291
- """
292
- result = session.run(stats_query, path=repo_path_obj)
293
- record = result.single()
279
+ # 1. Files
280
+ file_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(f:File) RETURN count(f) as c"
281
+ file_count = session.run(file_query, path=repo_path_obj).single()["c"]
282
+
283
+ # 2. Functions
284
+ func_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(func:Function) RETURN count(func) as c"
285
+ func_count = session.run(func_query, path=repo_path_obj).single()["c"]
286
+
287
+ # 3. Classes
288
+ class_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(cls:Class) RETURN count(cls) as c"
289
+ class_count = session.run(class_query, path=repo_path_obj).single()["c"]
290
+
291
+ # 4. Modules (imported)
292
+ module_query = "MATCH (r:Repository {path: $path})-[:CONTAINS*]->(f:File)-[:IMPORTS]->(m:Module) RETURN count(DISTINCT m) as c"
293
+ module_count = session.run(module_query, path=repo_path_obj).single()["c"]
294
294
 
295
295
  return {
296
296
  "success": True,
297
297
  "repository": repo_path_obj,
298
298
  "stats": {
299
- "files": record["file_count"] if record else 0,
300
- "functions": record["function_count"] if record else 0,
301
- "classes": record["class_count"] if record else 0,
302
- "modules": record["module_count"] if record else 0
299
+ "files": file_count,
300
+ "functions": func_count,
301
+ "classes": class_count,
302
+ "modules": module_count
303
303
  }
304
304
  }
305
305
  else:
306
306
  # Overall database stats
307
- stats_query = """
308
- MATCH (r:Repository)
309
- OPTIONAL MATCH (f:File)
310
- OPTIONAL MATCH (func:Function)
311
- OPTIONAL MATCH (cls:Class)
312
- OPTIONAL MATCH (m:Module)
313
- RETURN
314
- count(DISTINCT r) as repo_count,
315
- count(DISTINCT f) as file_count,
316
- count(DISTINCT func) as function_count,
317
- count(DISTINCT cls) as class_count,
318
- count(DISTINCT m) as module_count
319
- """
320
- result = session.run(stats_query)
321
- record = result.single()
307
+ repo_count = session.run("MATCH (r:Repository) RETURN count(r) as c").single()["c"]
322
308
 
323
- if record and record["repo_count"] > 0:
309
+ if repo_count > 0:
310
+ file_count = session.run("MATCH (f:File) RETURN count(f) as c").single()["c"]
311
+ func_count = session.run("MATCH (func:Function) RETURN count(func) as c").single()["c"]
312
+ class_count = session.run("MATCH (cls:Class) RETURN count(cls) as c").single()["c"]
313
+ module_count = session.run("MATCH (m:Module) RETURN count(m) as c").single()["c"]
314
+
324
315
  return {
325
316
  "success": True,
326
317
  "stats": {
327
- "repositories": record["repo_count"],
328
- "files": record["file_count"],
329
- "functions": record["function_count"],
330
- "classes": record["class_count"],
331
- "modules": record["module_count"]
318
+ "repositories": repo_count,
319
+ "files": file_count,
320
+ "functions": func_count,
321
+ "classes": class_count,
322
+ "modules": module_count
332
323
  }
333
324
  }
334
325
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: codegraphcontext
3
- Version: 0.2.11
3
+ Version: 0.2.12
4
4
  Summary: An MCP server that indexes local code into a graph database to provide context to AI assistants.
5
5
  Author-email: Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
6
6
  License: MIT License
@@ -147,7 +147,7 @@ A powerful **MCP server** and **CLI toolkit** that indexes local code into a gra
147
147
  ---
148
148
 
149
149
  ## Project Details
150
- - **Version:** 0.2.11
150
+ - **Version:** 0.2.12
151
151
  - **Authors:** Shashank Shekhar Singh <shashankshekharsingh1205@gmail.com>
152
152
  - **License:** MIT License (See [LICENSE](LICENSE) for details)
153
153
  - **Website:** [CodeGraphContext](http://codegraphcontext.vercel.app/)
@@ -31,7 +31,7 @@ codegraphcontext/tools/scip_pb2.py,sha256=dwOMNKlu6VyLq5h8kTPZRDqxrwfVL8yw7I7zio
31
31
  codegraphcontext/tools/system.py,sha256=DGeavZoPxzV78wwApV4f7fdBFQRa8oeOSv5wprHSjRE,5733
32
32
  codegraphcontext/tools/handlers/analysis_handlers.py,sha256=lYECkMC2NKvnBWI4nQsAeCL5-e_JfJSVvQAwV7IbNJk,4749
33
33
  codegraphcontext/tools/handlers/indexing_handlers.py,sha256=B1Op0wZ8MZ2pt170irc558T7rBYyuBTxWJsgRaiQRtw,5217
34
- codegraphcontext/tools/handlers/management_handlers.py,sha256=EL6lTFcIGmHmlzVpIsKpvzRaJMmB5KiH2UWlpRqIi5Y,13565
34
+ codegraphcontext/tools/handlers/management_handlers.py,sha256=jCosISjq4QD7oBa8ZaaX9xVzHO6W-6IC4nitlG9pZdk,13537
35
35
  codegraphcontext/tools/handlers/query_handlers.py,sha256=KdZ1yH4yFj3RrXT4BTnyO7OZe6OKuNLW7tCAEPmjOy4,7629
36
36
  codegraphcontext/tools/handlers/watcher_handlers.py,sha256=9hBkMdI8mwQyXj77WvgyUWCtNeItV3DiCLnmNI7Xjp8,3623
37
37
  codegraphcontext/tools/languages/c.py,sha256=mrXQWEvMtzLVElATYNZ7VThNk1ZNZdw2UV8i6r2y2y4,22291
@@ -71,9 +71,9 @@ codegraphcontext/tools/query_tool_languages/typescript_toolkit.py,sha256=3S4hpmO
71
71
  codegraphcontext/utils/debug_log.py,sha256=Qg7jwyeg7x2h3Ur_2S34bdMCkHdlk_ngHfPwa97A9vE,2836
72
72
  codegraphcontext/utils/tree_sitter_manager.py,sha256=bIuKYN1aj1Zi6BnksGjZSLZzgBwuFRselZzyUpbToAU,9180
73
73
  codegraphcontext/utils/visualize_graph.py,sha256=Ntq8l8SvAOvsOp19QKByjEwU7-5rPa_XfcGLOrUehq4,5003
74
- codegraphcontext-0.2.11.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
75
- codegraphcontext-0.2.11.dist-info/METADATA,sha256=DSR3Rl__danmwQ3QC1rfTf09radrvOaons1hhTCv3QY,21095
76
- codegraphcontext-0.2.11.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
77
- codegraphcontext-0.2.11.dist-info/entry_points.txt,sha256=LCxWCWMshdvYGoHBPuQZ8C-e4CiNSHCLXofrNSGHkoE,103
78
- codegraphcontext-0.2.11.dist-info/top_level.txt,sha256=CBgc6LAPZIO5FS0nSYYkylDifHsZTIqw3Gf5UwDxeGI,17
79
- codegraphcontext-0.2.11.dist-info/RECORD,,
74
+ codegraphcontext-0.2.12.dist-info/licenses/LICENSE,sha256=Btzdu2kIoMbdSp6OyCLupB1aRgpTCJ_szMimgEnpkkE,1056
75
+ codegraphcontext-0.2.12.dist-info/METADATA,sha256=EgsTEDqJ5yLjKXbLI4GQ2gTgI3xOEP2s3Qi5TGbeIVg,21095
76
+ codegraphcontext-0.2.12.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
77
+ codegraphcontext-0.2.12.dist-info/entry_points.txt,sha256=LCxWCWMshdvYGoHBPuQZ8C-e4CiNSHCLXofrNSGHkoE,103
78
+ codegraphcontext-0.2.12.dist-info/top_level.txt,sha256=CBgc6LAPZIO5FS0nSYYkylDifHsZTIqw3Gf5UwDxeGI,17
79
+ codegraphcontext-0.2.12.dist-info/RECORD,,