Skip to main content
Code impact analysis tells you what a change reaches before you make it. With Graphify you list the callers of a function, trace how two modules connect, and find the tests that touch it, all from one graph. This recipe plans a change to _rebuild_code() in the open-source Graphify-Labs/graphify repository.

What you’ll build

  • A list of every direct caller of the function you plan to change.
  • The call path between two parts of the code.
  • A short list of tests to run, taken from the graph.
  • A rebuilt graph after the change, to confirm the impact.

Setup

If you followed Onboard to a codebase, you already have the graph.

Step 1: Check how central the target is

A degree of 273 means a lot of code touches this function. Plan for a careful change.

Step 2: List what the change affects

affected walks edges backwards: calls, imports, inheritance and similar relations. --depth 1 gives direct callers. Raise it to see callers of callers. The test functions in the list are the tests to run first.

Step 3: Trace how two modules connect

Use path when you want to know whether a change in one area can reach another. If no directed path exists, add --undirected to find any connection.

Step 4: See the community around it

Each node in the answer carries its community. Code in the same community moves together. Code in a different community that still calls your function is where surprises live, so check those callers by hand.

Step 5: Make the change, then rebuild

update re-extracts changed code without an API cost. Compare the new list with the one from Step 2. A caller that vanished or appeared is worth a second look in review.

When it goes wrong

path exits with code 3 and prints candidates. The name matched more than one node. Copy one of the path::symbol candidates it prints. affected prints “No unique node match” and exits 0. The label didn’t match. Check the exact label with graphify explain or graphify query. Because the exit code is 0, a script won’t fail on it, so check the output. A caller you know about is missing. Impact results list direct connections the parser can see. Code called dynamically, through reflection, or by string name may not appear. Always run your test suite.

Production patterns

  • Paste the affected output into the pull request description so reviewers see the planned blast radius.
  • Run the impact check in CI with Graph impact comment on every PR.
  • In Graphify, the hosted product, ask your agent “what breaks if I change _rebuild_code?”. The hosted MCP answers with the graphify_impact and graphify_tests_for tools.

Complete example

What you built

You have a refactor plan backed by the graph: the callers, the paths between modules, the tests to run, and a before-and-after check.

Next steps

Check impact

How Graphify works out what a change reaches.

Review PRs as a team

Check the finished refactor against the same graph.

Try it in Graphify

We build and host the graph for you. Start with a 14-day Pro trial, then keep up to 3 repositories on Free. No card required.