{"action":"created","issue":{"url":"https://api.github.com/repos/code-cracker/code-cracker/issues/307","labels_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/307/comments","events_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/307/events","html_url":"https://github.com/code-cracker/code-cracker/issues/307","id":66988710,"number":307,"title":"Add property to constructor","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/0%20-%20Backlog","name":"0 - Backlog","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/code-fix","name":"code-fix","color":"207de5"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/needs%20discussion","name":"needs discussion","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-04-07T20:56:15Z","updated_at":"2015-04-08T20:14:34Z","closed_at":null,"body":"This:\r\n\r\n````csharp\r\nclass Foo\r\n{\r\n    public int Bar { get; set; }\r\n}\r\n````\r\n\r\nBecomes:\r\n\r\n````csharp\r\nclass Foo\r\n{\r\n    public Foo(int bar)\r\n    {\r\n        this.Bar = bar;\r\n    }\r\n    public int Bar { get; set; }\r\n}\r\n````\r\n\r\nIf the constructor already exists, add to it:\r\n\r\nThis:\r\n\r\n````csharp\r\nclass Foo\r\n{\r\n    public Foo()\r\n    {\r\n    }\r\n    public int Bar { get; set; }\r\n}\r\n````\r\n\r\nBecomes:\r\n\r\n````csharp\r\nclass Foo\r\n{\r\n    public Foo(int bar)\r\n    {\r\n        this.Bar = bar;\r\n    }\r\n    public int Bar { get; set; }\r\n}\r\n````\r\n\r\nIf more than one constructor exists, offer one fix for each constructor, and another for all constructors.\r\nIf property is already being assigned on constructor, don't raise a diagnostic.\r\nNot defined yet how to deal with existing constructor calls:\r\n\r\n* Let them break\r\n* Let them break, but add a placeholder variable\r\n\r\nDiagnostic Id: `CC0083`\r\nSeverity: Hidden\r\nCategory: Refactoring"},"comment":{"url":"https://api.github.com/repos/code-cracker/code-cracker/issues/comments/91022934","html_url":"https://github.com/code-cracker/code-cracker/issues/307#issuecomment-91022934","issue_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/307","id":91022934,"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},"created_at":"2015-04-08T20:14:34Z","updated_at":"2015-04-08T20:14:34Z","body":"@carloscds Yes, that is it.\r\nRight now this issue is considering only properties. We could expand it to use fields or we could create another issue to consider fields."}}