Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow partial analysis for CallGraphAlgorithm #711

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

Liyw979
Copy link
Contributor

@Liyw979 Liyw979 commented Oct 17, 2023

#710
This PR cleans up usage of superClassesOf and getClassOrThrow.

Tested with

  public static void main(String[] args) {

    AnalysisInputLocation<JavaSootClass> inputLocation = PathBasedAnalysisInputLocation.create(
            Paths.get("hutool-db-5.7.18.jar"), SourceType.Application);

    JavaLanguage language = new JavaLanguage(8);

    JavaProject project = JavaProject.builder(language).addInputLocation(inputLocation).build();
    JavaView view = project.createView();
    AbstractCallGraphAlgorithm cha = new ClassHierarchyAnalysisAlgorithm(view);
    Stream<MethodSignature> methods = view.getClasses()
            .stream()
            .flatMap(c -> c.getMethods().stream())
            .map(SootClassMember::getSignature);
    CallGraph graph = cha.initialize(methods.collect(Collectors.toList()));
    System.out.println(graph);
  }

@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (5140a36) 64.90% compared to head (74da0de) 64.90%.

Additional details and impacted files
@@            Coverage Diff             @@
##             develop     #711   +/-   ##
==========================================
  Coverage      64.90%   64.90%           
+ Complexity      3368     3367    -1     
==========================================
  Files            313      313           
  Lines          14960    14960           
  Branches        2525     2524    -1     
==========================================
  Hits            9710     9710           
  Misses          4351     4351           
  Partials         899      899           
Files Coverage Δ
...a/sootup/callgraph/AbstractCallGraphAlgorithm.java 89.63% <100.00%> (+0.12%) ⬆️
...src/main/java/sootup/java/core/views/JavaView.java 90.38% <100.00%> (-0.36%) ⬇️
.../java/sootup/core/typehierarchy/TypeHierarchy.java 80.64% <0.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@swissiety swissiety self-requested a review October 18, 2023 08:04
Copy link
Collaborator

@swissiety swissiety left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good 👍

@swissiety swissiety merged commit 68ce0a6 into soot-oss:develop Oct 18, 2023
8 checks passed
@Liyw979 Liyw979 deleted the allow_partial_analysis branch October 27, 2023 11:05
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.

2 participants