feat: add Dart Frog detector and analyzer (dart web framework)#1337
feat: add Dart Frog detector and analyzer (dart web framework)#1337
Conversation
There was a problem hiding this comment.
Code Review
This pull request adds support for the Dart Frog framework by implementing a new detector and analyzer along with functional and unit tests. The analyzer handles filesystem-based routing, translates dynamic segments like [id] to {id}, and detects HTTP methods from source code. A review comment suggests using rindex instead of index to find the /routes/ directory to prevent potential path resolution issues in nested directory structures.
| parallel_analyze(channel) do |path| | ||
| next unless path.ends_with?(".dart") | ||
|
|
||
| idx = path.index("/routes/") |
There was a problem hiding this comment.
Using index to find the /routes/ directory can be problematic if a parent directory in the path also contains the string /routes/ (e.g., in certain monorepo structures or specific deployment paths). Using rindex ensures that we identify the routes directory closest to the file, which is the correct behavior for filesystem-based routing in Dart Frog.
idx = path.rindex("/routes/")
Closes #1214