Skip to content

Feature: Class with member predicate support #190

New issue

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

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

Already on GitHub? # to your account

Closed
shivasurya opened this issue Jan 4, 2025 · 1 comment
Closed

Feature: Class with member predicate support #190

shivasurya opened this issue Jan 4, 2025 · 1 comment
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@shivasurya
Copy link
Owner

Is your feature request related to a problem? Please describe.
Similar to CodeQL syntax, Class with member predicate should be available and able to query the graph

import java

class MyPublicStringMethod extends Method {
  MyPublicStringMethod() {
    this.isPublic() and
    isStringReturnType()
  }

  predicate isStringReturnType() {
    exists(RefType returnType |
      returnType = this.getReturnType() and
      returnType.getUnqualifiedName() = "String"
    )
  }
}

Describe the solution you'd like
Currently code-pathfinder supports non-member predicates outside class to filter out the tuples/records. Implement the same for class based member predicates

Describe alternatives you've considered
N/A

Use case
This will boost the inheritance for class nodes and effective filtering + reduce cardinality problem

Additional context
N/A

@shivasurya shivasurya added the enhancement New feature or request label Jan 4, 2025
@shivasurya shivasurya self-assigned this Jan 4, 2025
@shivasurya shivasurya added the help wanted Extra attention is needed label Jan 4, 2025
@shivasurya
Copy link
Owner Author

#187

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant