{"action":"created","issue":{"url":"https://api.github.com/repos/code-cracker/code-cracker/issues/1","labels_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/1/labels{/name}","comments_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/1/comments","events_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/1/events","html_url":"https://github.com/code-cracker/code-cracker/issues/1","id":48034038,"number":1,"title":"Validate color from System.Drawing.ColorTranslator.FromHtml","user":{"login":"giggio","id":334958,"avatar_url":"https://avatars.githubusercontent.com/u/334958?v=3","gravatar_id":"","url":"https://api.github.com/users/giggio","html_url":"https://github.com/giggio","followers_url":"https://api.github.com/users/giggio/followers","following_url":"https://api.github.com/users/giggio/following{/other_user}","gists_url":"https://api.github.com/users/giggio/gists{/gist_id}","starred_url":"https://api.github.com/users/giggio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giggio/subscriptions","organizations_url":"https://api.github.com/users/giggio/orgs","repos_url":"https://api.github.com/users/giggio/repos","events_url":"https://api.github.com/users/giggio/events{/privacy}","received_events_url":"https://api.github.com/users/giggio/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/2%20-%20Working","name":"2 - Working","color":"CCCCCC"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/analyzer","name":"analyzer","color":"0052cc"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/C%23","name":"C#","color":"5319e7"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/code-cracker/code-cracker/milestones/9","html_url":"https://github.com/code-cracker/code-cracker/milestones/vnext","labels_url":"https://api.github.com/repos/code-cracker/code-cracker/milestones/9/labels","id":1221401,"number":9,"title":"vnext","description":"This will come after v1.0.0. New analyzers come here until we work on stabilizing 1.0.0.","creator":{"login":"giggio","id":334958,"avatar_url":"https://avatars.githubusercontent.com/u/334958?v=3","gravatar_id":"","url":"https://api.github.com/users/giggio","html_url":"https://github.com/giggio","followers_url":"https://api.github.com/users/giggio/followers","following_url":"https://api.github.com/users/giggio/following{/other_user}","gists_url":"https://api.github.com/users/giggio/gists{/gist_id}","starred_url":"https://api.github.com/users/giggio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giggio/subscriptions","organizations_url":"https://api.github.com/users/giggio/orgs","repos_url":"https://api.github.com/users/giggio/repos","events_url":"https://api.github.com/users/giggio/events{/privacy}","received_events_url":"https://api.github.com/users/giggio/received_events","type":"User","site_admin":false},"open_issues":3,"closed_issues":0,"state":"open","created_at":"2015-07-23T02:43:08Z","updated_at":"2015-07-23T21:18:05Z","due_on":null,"closed_at":null},"comments":47,"created_at":"2014-11-07T00:35:52Z","updated_at":"2015-07-24T03:22:13Z","closed_at":null,"body":"This:\r\n\r\n````csharp\r\nSystem.Drawing.ColorTranslator.FromHtml(\"wrong color\");\r\n````\r\n\r\nWill be marked as an `Error`. Category is `Usage`.\r\nDiagnostic id is `CC0053`\r\n\r\nHow to implement it is being discussed below, we still have to find an optimal way to do it, as we cannot call `ColorTranslator` from the Code Cracker project and see if it throws, as CC is a PCL, and `System.Drawing` is not available.\r\n\r\n@dgmachado is working on it."},"comment":{"url":"https://api.github.com/repos/code-cracker/code-cracker/issues/comments/124307501","html_url":"https://github.com/code-cracker/code-cracker/issues/1#issuecomment-124307501","issue_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/1","id":124307501,"user":{"login":"dgmachado","id":5738416,"avatar_url":"https://avatars.githubusercontent.com/u/5738416?v=3","gravatar_id":"","url":"https://api.github.com/users/dgmachado","html_url":"https://github.com/dgmachado","followers_url":"https://api.github.com/users/dgmachado/followers","following_url":"https://api.github.com/users/dgmachado/following{/other_user}","gists_url":"https://api.github.com/users/dgmachado/gists{/gist_id}","starred_url":"https://api.github.com/users/dgmachado/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dgmachado/subscriptions","organizations_url":"https://api.github.com/users/dgmachado/orgs","repos_url":"https://api.github.com/users/dgmachado/repos","events_url":"https://api.github.com/users/dgmachado/events{/privacy}","received_events_url":"https://api.github.com/users/dgmachado/received_events","type":"User","site_admin":false},"created_at":"2015-07-24T03:22:12Z","updated_at":"2015-07-24T03:22:12Z","body":"My idea would be don't show any code fixes for the analyzer. We simply validate the color and offer no code fix just a message error if there is a error on parsing. \r\n\r\n**Scenario 1 -  Valid data types input:**\r\nObs: Analyzer does not create diagnostic\r\n``` \r\nnamespace ConsoleApplication\r\n            {\r\n                class TypeName\r\n                {\r\n                    public int Foo()\r\n                    {\r\n                        ColorTranslator.FromHtml(\"\");\r\n                        ColorTranslator.FromHtml(\"#FFFFFF\");\r\n                        ColorTranslator.FromHtml(\"Red\");\r\n                        ColorTranslator.FromHtml(\"200\");\r\n                        ColorTranslator.FromHtml(\"200;100;50\");\r\n                        ColorTranslator.FromHtml(\"200;100;50;60\");\r\n                    }\r\n                }\r\n            };\r\n```\r\n\r\n**Scenario 2 -  Invalid data types input:**\r\nObs: Analyzer creates diagnostic\r\n``` \r\nnamespace ConsoleApplication\r\n            {\r\n                class TypeName\r\n                {\r\n                    public int Foo()\r\n                    {\r\n                        ColorTranslator.FromHtml(\"#FFFZZZ\");\r\n                        ColorTranslator.FromHtml(\"bluee\");\r\n                        ColorTranslator.FromHtml(\"200;100\");\r\n                        ColorTranslator.FromHtml(\"200;JJ;50;60\");\r\n                        ColorTranslator.FromHtml(\"200;100;50;100;60\");\r\n                    }\r\n                }\r\n            };\r\n```\r\n\r\n\r\n\r\n**Scenario 3 - Ignore validation for not literal expression syntax:**\r\nObs: Analyzer does not create diagnostic\r\n``` \r\nnamespace ConsoleApplication\r\n            {\r\n                class TypeName\r\n                {\r\n                    public int Foo()\r\n                    {\r\n                        var htmlColor = \"#FFFFFF\";  \r\n                        ColorTranslator.FromHtml(htmlColor);\r\n                    }\r\n                }\r\n            };\r\n```\r\n\r\n\r\n\r\n\r\n---- \r\nWhat do you think about all this?"}}