Cypher Examples

These queries can be executed via the MCP query 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 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 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.
  1. Always use LIMIT — without it, large result sets can be slow or overwhelming.
  2. Use WITH to chain aggregations — intermediate WITH clauses enable multi-step filtering.
  3. Prefer specific start nodes — starting with a labeled node (MATCH (r:Repository)) is faster than starting with an unlabeled node.
  4. Use WHERE after MATCH — filtering early reduces the traversal space.
  5. Check IS NOT NULL — some properties may be absent; filter them out if needed.
  6. toLower() for case-insensitive search — property values are stored as-is; use toLower() for robust text matching.