Title: False positive with Roslyn Analyzer DSP0007 · Issue #2388 · DSharpPlus/DSharpPlus · GitHub
Open Graph Title: False positive with Roslyn Analyzer DSP0007 · Issue #2388 · DSharpPlus/DSharpPlus
X Title: False positive with Roslyn Analyzer DSP0007 · Issue #2388 · DSharpPlus/DSharpPlus
Description: Summary I upgraded to the latest nightly build and I am getting several false positive alerts from the Roslyn Analyzer for "DSP0007: Use one 'channel.ModifyAsync(..)' instead of multiple 'channel.AddOverwriteAsync(..)'". It does not seem...
Open Graph Description: Summary I upgraded to the latest nightly build and I am getting several false positive alerts from the Roslyn Analyzer for "DSP0007: Use one 'channel.ModifyAsync(..)' instead of multiple 'channel.A...
X Description: Summary I upgraded to the latest nightly build and I am getting several false positive alerts from the Roslyn Analyzer for "DSP0007: Use one 'channel.ModifyAsync(..)' instead of multip...
Opengraph URL: https://github.com/DSharpPlus/DSharpPlus/issues/2388
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"False positive with Roslyn Analyzer DSP0007","articleBody":"### Summary\n\nI upgraded to the latest nightly build and I am getting several false positive alerts from the Roslyn Analyzer for \"DSP0007: Use one 'channel.ModifyAsync(..)' instead of multiple 'channel.AddOverwriteAsync(..)'\". It does not seem to be able to understand the difference when 'channel.AddOverwriteAsync(..)' is called on the same channel multiple times vs multiple channels once as well as when there are branching logic paths and 'channel.AddOverwriteAsync(..)' is called once in each path.\n\n### What version of the library are you using?\n\nv5.0.0-nightly (make sure you are using the latest nightly!)\n\n### What .NET version are you using? Make sure to use the latest patch release for your major version.\n\n.NET 9.0\n\n### Operating System\n\nWindows\n\n### Reproduction Steps\n\nIn this block of code the `channel.AddOverwriteAsync(..)` in the else statement gets flagged.\n```\nif (permissions is not null) \n{\n await channel.AddOverwriteAsync(role,\n permissions.AllowedPermissions,\n permissions.DeniedPermissions);\n}\nelse\n{\n await channel.AddOverwriteAsync(role,\n deny: new DiscordPermissions(DiscordPermission.Connect, DiscordPermission.Speak));\n}\n```\n\nThis block of code `channel.AddOverwriteAsync(..)` gets flagged despite being called once per channel.\n```\nforeach (var channel in channels){\n await channel.AddOverwriteAsync(role,\n deny: PermissionValues.LockPermissions);\n}\n```\n\n### Trace Logs\n\n```log\n\n```\n\n### Exceptions or other error messages\n\n```txt\n\n```\n\n### Anything else you'd like to share\n\n_No response_","author":{"url":"https://github.com/Netharria","@type":"Person","name":"Netharria"},"datePublished":"2025-10-25T15:46:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2388/DSharpPlus/issues/2388"}
| 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:6e5dba0f-9f21-f6b9-d948-79f8c188eff0 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9F5E:34031F:17B8C32:203D76D:698CE2F2 |
| html-safe-nonce | 4ec5c76ac050484a22a7e204062d95269644f065da8ac9c9998e47b9e8fb54f3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RjVFOjM0MDMxRjoxN0I4QzMyOjIwM0Q3NkQ6Njk4Q0UyRjIiLCJ2aXNpdG9yX2lkIjoiNzAyNjAzMzUwODUyMjk3NDU4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 1db9e2e12567dab31a5ac0f76706c450a047308c7b04eeccc95f9db9bf03c15d |
| hovercard-subject-tag | issue:3552648690 |
| 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/DSharpPlus/DSharpPlus/2388/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a7ee6485da0cf9e321ea10304251950ce74477af86f5bd6020d29a9cc12fb28f/DSharpPlus/DSharpPlus/issues/2388 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a7ee6485da0cf9e321ea10304251950ce74477af86f5bd6020d29a9cc12fb28f/DSharpPlus/DSharpPlus/issues/2388 |
| og:image:alt | Summary I upgraded to the latest nightly build and I am getting several false positive alerts from the Roslyn Analyzer for "DSP0007: Use one 'channel.ModifyAsync(..)' instead of multiple 'channel.A... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Netharria |
| hostname | github.com |
| expected-hostname | github.com |
| None | 640eeb7b6ff4d8d106235d228c0c286e82592d4d2403227b5b2b4fc5832297a4 |
| turbo-cache-control | no-preview |
| go-import | github.com/DSharpPlus/DSharpPlus git https://github.com/DSharpPlus/DSharpPlus.git |
| octolytics-dimension-user_id | 36208721 |
| octolytics-dimension-user_login | DSharpPlus |
| octolytics-dimension-repository_id | 67243489 |
| octolytics-dimension-repository_nwo | DSharpPlus/DSharpPlus |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 67243489 |
| octolytics-dimension-repository_network_root_nwo | DSharpPlus/DSharpPlus |
| 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 | 3d444f0a47beeeac94cddbb51c91ab408befe8d4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width