Title: Codegen struggling to recognize module atrtribute access as a usage · Issue #242 · codegen-sh/codegen · GitHub
Open Graph Title: Codegen struggling to recognize module atrtribute access as a usage · Issue #242 · codegen-sh/codegen
X Title: Codegen struggling to recognize module atrtribute access as a usage · Issue #242 · codegen-sh/codegen
Description: When using codegen to remove dead code, it incorrectly identifies functions accessed via module attribute notation as unused. Example: file: example.py from a.b import module module.some_func() # this usage is not detected In the dead co...
Open Graph Description: When using codegen to remove dead code, it incorrectly identifies functions accessed via module attribute notation as unused. Example: file: example.py from a.b import module module.some_func() # t...
X Description: When using codegen to remove dead code, it incorrectly identifies functions accessed via module attribute notation as unused. Example: file: example.py from a.b import module module.some_func() # t...
Opengraph URL: https://github.com/codegen-sh/codegen/issues/242
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Codegen struggling to recognize module atrtribute access as a usage","articleBody":"When using codegen to remove dead code, it incorrectly identifies functions accessed via module attribute notation as unused.\n\n### Example:\n\nfile: example.py\n```\nfrom a.b import module\n\nmodule.some_func() # this usage is not detected\n\n```\n\nIn the dead code script:\n```\nsome_func.usages # Returns []\nsome_func.call_sites # Returns []\nsome_func.symbol_usages # Returns []\n```\n\n\nAs a result, `some_func` is incorrectly identified as dead code and removed, despite being actively used through module attribute access.\n\n### Expected Behavior:\n- `some_func` should show usage when accessed via `module.some_func()`\n","author":{"url":"https://github.com/gautum","@type":"Person","name":"gautum"},"datePublished":"2025-02-01T20:03:25.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/242/codegen/issues/242"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0e9e475c-0e0d-0dfa-1d08-47fb48a38ccf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D844:DF9A3:2480476:2F658DB:6990B702 |
| html-safe-nonce | 8a01fc2dc02727df90418c9867b38f7a8691318498735826e3c0390a532016af |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODQ0OkRGOUEzOjI0ODA0NzY6MkY2NThEQjo2OTkwQjcwMiIsInZpc2l0b3JfaWQiOiIyMTcyNDEwNDg0NjEwODczMDkxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d6b5448150e37de9699fe04a0006f89facd9f821065376519f5dcb061f67aeee |
| hovercard-subject-tag | issue:2825401255 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/codegen-sh/codegen/242/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fa23ae8f8415a56604d6a0fc9a2dc718c30d3bac8ae903097138d89b63befde0/codegen-sh/codegen/issues/242 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fa23ae8f8415a56604d6a0fc9a2dc718c30d3bac8ae903097138d89b63befde0/codegen-sh/codegen/issues/242 |
| og:image:alt | When using codegen to remove dead code, it incorrectly identifies functions accessed via module attribute notation as unused. Example: file: example.py from a.b import module module.some_func() # t... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gautum |
| hostname | github.com |
| expected-hostname | github.com |
| None | 42c603b9d642c4a9065a51770f75e5e27132fef0e858607f5c9cb7e422831a7b |
| turbo-cache-control | no-preview |
| go-import | github.com/codegen-sh/codegen git https://github.com/codegen-sh/codegen.git |
| octolytics-dimension-user_id | 130597291 |
| octolytics-dimension-user_login | codegen-sh |
| octolytics-dimension-repository_id | 920229736 |
| octolytics-dimension-repository_nwo | codegen-sh/codegen |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 920229736 |
| octolytics-dimension-repository_network_root_nwo | codegen-sh/codegen |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 848bc6032dcc93a9a7301dcc3f379a72ba13b96e |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width