Skip to content

Allow partial analysis for CallGraphAlgorithm#711

Merged
swissiety merged 1 commit intosoot-oss:developfrom
Liyw979:allow_partial_analysis
Oct 18, 2023
Merged

Allow partial analysis for CallGraphAlgorithm#711
swissiety merged 1 commit intosoot-oss:developfrom
Liyw979:allow_partial_analysis

Conversation

@Liyw979
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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
@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