Skip to content

Add supported endpoint types to predicates#3331

Merged
koesie10 merged 1 commit intomainfrom
koesie10/endpoint-type-supported
Feb 13, 2024
Merged

Add supported endpoint types to predicates#3331
koesie10 merged 1 commit intomainfrom
koesie10/endpoint-type-supported

Conversation

@koesie10
Copy link
Copy Markdown
Member

@koesie10 koesie10 commented Feb 8, 2024

This adds the possibility for languages to define which predicates are supported for each endpoint type. It also defines a method for languages to define the endpoint type of an endpoint, overriding the default heuristics.

For Ruby, we are making the following changes to support of models:

  • Source models are not supported for constructors and class definitions
  • Sink models are not supported for class instances and class definitions
  • Summary models are not supported for class instances and class definitions

This is based on the examples shown here.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@koesie10 koesie10 force-pushed the koesie10/endpoint-type-supported branch 3 times, most recently from 73221e8 to bcd251d Compare February 8, 2024 14:51
@koesie10 koesie10 force-pushed the koesie10/endpoint-type-supported branch from bcd251d to 0b4c611 Compare February 8, 2024 15:28
@koesie10 koesie10 changed the title Add supported endpoint types Add supported endpoint types to predicates Feb 8, 2024
Base automatically changed from koesie10/add-endpoint-type to main February 12, 2024 11:34
@koesie10 koesie10 marked this pull request as ready for review February 12, 2024 11:34
@koesie10 koesie10 requested a review from a team as a code owner February 12, 2024 11:34
Copy link
Copy Markdown
Contributor

@shati-patel shati-patel left a comment

Choose a reason for hiding this comment

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

As mentioned inline, I can't really comment on the ruby specifics, but the code/comments seem fine generally! Up to you if you'd like a more comprehensive review, otherwise LGTM 🙇🏽‍♀️

Comment on lines +75 to +89
export function rubyEndpointType(typeName: string, methodName: string) {
if (typeName.endsWith("!") && methodName === "new") {
// This is a constructor
return EndpointType.Constructor;
}

if (typeName.endsWith("!") && methodName === "") {
return EndpointType.Module;
}

if (methodName === "") {
return EndpointType.Class;
}

return EndpointType.Method;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know enough about ruby to comment on the conditions here, but it seems sensible!

@koesie10 koesie10 merged commit d7e9606 into main Feb 13, 2024
@koesie10 koesie10 deleted the koesie10/endpoint-type-supported branch February 13, 2024 11:04
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