Cypher Examples
These queries can be executed via the MCPquery tool, the CLI query command, or directly against FalkorDB. All queries are read-only.
Repository Queries
Find all Django models in a specific repo
Top 10 repos by composite score
Repos with the most API endpoints
Repos with no tests (orphan test coverage)
Find orphan repos with no imports from other repos
Function Queries
Find functions with complexity greater than 10
Find all authentication-related functions
Find the most-called functions (hotspots)
Cross-repo function call analysis
Contributor Queries
Find contributors who worked on 5 or more repos
Top contributors by total commit count
Contributors who haven’t committed recently (inactive)
Find sole contributors (single-developer repos)
Security Queries
Find security patterns by severity
Repos with the most security issues
Hardcoded secrets across all repos
Model and Schema Queries
Find all ForeignKey fields across all models
Find models with the most fields (complex models)
Find all models related to a domain (e.g. billing)
Find all tests for a specific class
Structural Queries
Repos with similar structure (both Python, same tier, similar commit count)
Find repos that share the most contributors
Find the deepest inheritance chains
Repos that have both Docker and CI/CD configured
Advanced Aggregations
Language distribution by tier
Average complexity by repository
Test coverage proxy (test count vs function count)
Tips for Writing Cypher Queries
All queries run against FalkorDB (a Cypher-compatible graph database). FalkorDB supports the OpenCypher subset. Avoid Neo4j-specific functions that are not part of OpenCypher.
- Always use
LIMIT— without it, large result sets can be slow or overwhelming. - Use
WITHto chain aggregations — intermediateWITHclauses enable multi-step filtering. - Prefer specific start nodes — starting with a labeled node (
MATCH (r:Repository)) is faster than starting with an unlabeled node. - Use
WHEREafterMATCH— filtering early reduces the traversal space. - Check
IS NOT NULL— some properties may be absent; filter them out if needed. toLower()for case-insensitive search — property values are stored as-is; usetoLower()for robust text matching.