{"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/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/code-fix","name":"code-fix","color":"207de5"},{"url":"https://api.github.com/repos/code-cracker/code-cracker/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":{"login":"julianosaless","id":1616798,"avatar_url":"https://avatars.githubusercontent.com/u/1616798?v=3","gravatar_id":"","url":"https://api.github.com/users/julianosaless","html_url":"https://github.com/julianosaless","followers_url":"https://api.github.com/users/julianosaless/followers","following_url":"https://api.github.com/users/julianosaless/following{/other_user}","gists_url":"https://api.github.com/users/julianosaless/gists{/gist_id}","starred_url":"https://api.github.com/users/julianosaless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julianosaless/subscriptions","organizations_url":"https://api.github.com/users/julianosaless/orgs","repos_url":"https://api.github.com/users/julianosaless/repos","events_url":"https://api.github.com/users/julianosaless/events{/privacy}","received_events_url":"https://api.github.com/users/julianosaless/received_events","type":"User","site_admin":false},"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":4,"closed_issues":1,"state":"open","created_at":"2015-07-23T02:43:08Z","updated_at":"2015-08-24T01:15:44Z","due_on":null,"closed_at":null},"comments":23,"created_at":"2015-04-07T20:56:15Z","updated_at":"2015-08-24T01:47:57Z","closed_at":null,"body":"If property is already being assigned on constructor, don't raise a diagnostic.\r\n\r\nOffer the diagnostic if the class has:\r\n\r\n* No constructors. Offer two code fixes: \r\n  * Create the constructor initializing the property.\r\n  * Create the constructor initializing the property and create a default constructor. This will keep existing code from breaking.\r\n* One constructor. If the existing constructor is not the default constructor update this constructor. If it is, offer 2 code fixes:\r\n  * Update the existing constructor.\r\n  * Create a new parametrized constructor that calls the default constructor. This will keep existing code from breaking.\r\n* Two constructors, and one of them is the default constructor. Update the constructor that is not the default one. If the property is initialized on the default constructor or the non default constructor, don't raise the diagnostic. If neither of the constructors is the default one don't raise any diagnostic.\r\n\r\nExisting constructions of this object are expected to break in some of these scenario.\r\n\r\nExamples (not all of the above rules are exemplified):\r\n\r\nThis:\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\nDiagnostic Id: `CC0083`\r\nSeverity: Hidden\r\nCategory: Refactoring"},"comment":{"url":"https://api.github.com/repos/code-cracker/code-cracker/issues/comments/133985636","html_url":"https://github.com/code-cracker/code-cracker/issues/307#issuecomment-133985636","issue_url":"https://api.github.com/repos/code-cracker/code-cracker/issues/307","id":133985636,"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-08-24T01:47:56Z","updated_at":"2015-08-24T01:47:56Z","body":"@julianosaless How is this coming?"}}