Skip to main content

Find call graph

org.openrewrite.FindCallGraph

Produces a data table where each row represents a method call.

Recipe source

GitHub, Issue Tracker, Maven Central

This recipe is available under the Apache License Version 2.0.

Options

TypeNameDescriptionExample
booleanincludeStdLibOptional. When enabled calls to methods in packages beginning with "java", "groovy", and "kotlin" will be included in the report. By default these are omitted.

Example

Parameters
ParameterValue
includeStdLibtrue
Before
class A {
String s = foo();
}
After
class A {
String s = /*~~(Method type not found)~~>*/foo();
}

Usage

This recipe has no required configuration options. It can be activated by adding a dependency on org.openrewrite.recipe:rewrite-all in your build file or by running a shell command (in which case no build changes are needed):

  1. Add the following to your build.gradle file:
build.gradle
plugins {
id("org.openrewrite.rewrite") version("7.5.0")
}

rewrite {
activeRecipe("org.openrewrite.FindCallGraph")
setExportDatatables(true)
}

repositories {
mavenCentral()
}

dependencies {
rewrite("org.openrewrite.recipe:rewrite-all:1.15.0")
}
  1. Run gradle rewriteRun to run the recipe.

See how this recipe works across multiple open-source repositories

Run this recipe on OSS repos at scale with the Moderne SaaS.

The community edition of the Moderne platform enables you to easily run recipes across thousands of open-source repositories.

Please contact Moderne for more information about safely running the recipes on your own codebase in a private SaaS.

Data Tables

Method call graph

org.openrewrite.table.CallGraph

Records method callers and the methods they invoke.

Column NameDescription
From source setThe source set from which the action is issued.
From classThe fully qualified name of the class from which the action is issued.
From nameThe name of the method or scope from which the action is issued.
From argumentsThe argument types, if any, to the method or scope from which the action is issued. Expressed as a comma-separated list
From typeThe type of resource the action is being issued from.
ActionThe type of access being made to the resource.
To classThe fully-qualified name of the class containing the resource being accessed.
To nameThe name of the resource being accessed.
To argumentsThe argument types, if any, to the resource being accessed. Expressed as a comma-separated list
To typeThe type of resource being accessed.
Return typeThe return type of the method.

Contributors

Sam Snyder, traceyyoshima, Tim te Beek, Jonathan Schnéider