Title: CodeFactor: Duplicated code for argument completions attribute class · Issue #7724 · PowerShell/PowerShell · GitHub
Open Graph Title: CodeFactor: Duplicated code for argument completions attribute class · Issue #7724 · PowerShell/PowerShell
X Title: CodeFactor: Duplicated code for argument completions attribute class · Issue #7724 · PowerShell/PowerShell
Description: The following attribute class can be found in several code files. CodeFactor found this as duplicated code and grades this as a severe issue. [ArgumentCompletions( EncodingConversion.Ascii, EncodingConversion.BigEndianUnicode, EncodingCo...
Open Graph Description: The following attribute class can be found in several code files. CodeFactor found this as duplicated code and grades this as a severe issue. [ArgumentCompletions( EncodingConversion.Ascii, Encodin...
X Description: The following attribute class can be found in several code files. CodeFactor found this as duplicated code and grades this as a severe issue. [ArgumentCompletions( EncodingConversion.Ascii, Encodin...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/7724
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CodeFactor: Duplicated code for argument completions attribute class","articleBody":"The following attribute class can be found in several code files. CodeFactor found this as duplicated code and grades this as a severe issue. \r\n```powershell\r\n[ArgumentCompletions(\r\n EncodingConversion.Ascii,\r\n EncodingConversion.BigEndianUnicode,\r\n EncodingConversion.OEM,\r\n EncodingConversion.Unicode,\r\n EncodingConversion.Utf7,\r\n EncodingConversion.Utf8,\r\n EncodingConversion.Utf8Bom,\r\n EncodingConversion.Utf8NoBom,\r\n EncodingConversion.Utf32\r\n )]\r\n```\r\nfound in\r\n```\r\nsrc\\Microsoft.PowerShell.Commands.Utility\\commands\\utility\\Send-MailMessage.cs:63-73 \r\nsrc\\Microsoft.PowerShell.Commands.Utility\\commands\\utility\\CSVCommands.cs:210-220 \r\nsrc\\Microsoft.PowerShell.Commands.Utility\\commands\\utility\\CSVCommands.cs:594-604 \r\nsrc\\Microsoft.PowerShell.Commands.Utility\\commands\\utility\\ImplicitRemotingCommands.cs:80-90 \r\nsrc\\Microsoft.PowerShell.Commands.Utility\\commands\\utility\\MatchString.cs:1198-1208 \r\nsrc\\Microsoft.PowerShell.Commands.Utility\\commands\\utility\\XmlCommands.cs:110-120 \r\nsrc\\System.Management.Automation\\namespaces\\FileSystemProvider.cs:7215-7225 \r\nsrc\\Microsoft.PowerShell.Commands.Utility\\commands\\utility\\FormatAndOutput\\format-hex\\Format-Hex.cs:53-63 \r\nsrc\\Microsoft.PowerShell.Commands.Utility\\commands\\utility\\FormatAndOutput\\out-file\\Out-File.cs:75-85\r\n```\r\n\r\nThe CodeFactor grading could improve for each of the mentioned code files if the attribute class would be replaced by a single attribute class dedicated for the Encoding Conversion argument completion.\r\ne.g.\r\n```powershell\r\n[ArgumentEncodingConversionCompletions]\r\n```\r\nin lieu of the above. This would be similar to the `[ArgumentToEncodingTransformationAttribute]` which consolidates the function to transform the properties from a string to the correct encoding enum.\r\n\r\nFurthermore a centrally defined attribute for the Encoding completion would prevent mistakes if another encoding is added in the future.","author":{"url":"https://github.com/ThreeFive-O","@type":"Person","name":"ThreeFive-O"},"datePublished":"2018-09-06T17:00:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/7724/PowerShell/issues/7724"}
| 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:ddedcf36-fbe8-85b5-92d7-165cfbaeb5ee |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C552:333E4B:51E8F20:72B954A:6A551422 |
| html-safe-nonce | defe258e2b5599464ad8a855c13ddb2352c06d65896e12a56aa228b6e6d964d3 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDNTUyOjMzM0U0Qjo1MUU4RjIwOjcyQjk1NEE6NkE1NTE0MjIiLCJ2aXNpdG9yX2lkIjoiNjE4NDUzNzgyNDY1MTcxMTUyMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | cb49a3dd4cfed39ee6a6490652d70ed59508a17a5532cb59711431d538303415 |
| hovercard-subject-tag | issue:357744206 |
| 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/PowerShell/PowerShell/7724/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f8b9a3ecae0533dccc8d138d219aa81465ce821da914e50f93edb6994376f06e/PowerShell/PowerShell/issues/7724 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f8b9a3ecae0533dccc8d138d219aa81465ce821da914e50f93edb6994376f06e/PowerShell/PowerShell/issues/7724 |
| og:image:alt | The following attribute class can be found in several code files. CodeFactor found this as duplicated code and grades this as a severe issue. [ArgumentCompletions( EncodingConversion.Ascii, Encodin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ThreeFive-O |
| hostname | github.com |
| expected-hostname | github.com |
| None | 682d273eacb2ac51680c6eb9c0b270f029f7ce74c32090f319083c34497e28a5 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| 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 | 3b6d37c6470adadff4194742daaab9a817cc4980 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width