Skip to content

Add additional Callgraph class inclusion filtering#1522

Open
aburghuber wants to merge 14 commits intosoot-oss:developfrom
aburghuber:filter-lib-callgraph
Open

Add additional Callgraph class inclusion filtering#1522
aburghuber wants to merge 14 commits intosoot-oss:developfrom
aburghuber:filter-lib-callgraph

Conversation

@aburghuber
Copy link
Copy Markdown

@aburghuber aburghuber commented Feb 16, 2026

What does this PR do?

Adds a nullable parameter called basePackageName to CallGraphAlgorithm#initialize that filters out all non-source classes from the graph (more accurately). Also adds AbstractCallGraphAlgorithm#includeCallToTarget for even more additional filtering.

The motivation behind this is that in Android projects often Android base API classes were included in the graph.


Checklist

Code style & guidelines

  • I ran the formatter: mvn com.spotify.fmt:fmt-maven-plugin:format
  • I added the necessary comments in the code
  • I provided meaningful tests for my proposed change - Not needed
  • I updated documentation (if needed)

Self-review

  • I performed a self-review of my code
  • I added or updated tests where needed
  • I have successfully run tests with your changes locally
  • My branch is up to date with develop

Review

  • CI checks are green
  • I requested a review from a core contributor

@aburghuber aburghuber changed the title Add nullable parameter basePackageName to Callgraph init for additional class inclusion filtering Add additional Callgraph class inclusion filtering Feb 16, 2026
@JonasKlauke
Copy link
Copy Markdown
Collaborator

mmh I like the includeCallTarget method. But I think a Call object as parameter or the addition of the invoking statement would be better, so the users could also consider the stmt in the check.

i dont like the part about the base package. An application might not have one base package. We have also a similar approach with tagging a inputlocaction as Library. If it is tagged as Library then the call graph ignores it.
with a combination of your includeCallTarget method it should be possible to create your base package solution as an user.

So i would only partly accept this PR. However, thanks for improving SootUp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants