{"action":"created","comment":{"url":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/comments/58280040","id":58280040,"diff_hunk":"@@ -29,10 +34,113 @@ public abstract class ParameterNamesShouldMatchBaseDeclarationAnalyzer : Diagnos\n                                                                              helpLinkUri: null,     // TODO: add MSDN url\n                                                                              customTags: WellKnownDiagnosticTags.Telemetry);\n \n+        private static readonly Action<SymbolAnalysisContext> AnalyzeMethodSymbolAction = AnalyzeMethodSymbol;\n+\n+        /// <inheritdoc/>\n         public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray.Create(Rule);\n \n+        /// <inheritdoc/>\n         public override void Initialize(AnalysisContext analysisContext)\n         {\n+            analysisContext.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);\n+            analysisContext.EnableConcurrentExecution();\n+\n+            analysisContext.RegisterSymbolAction(AnalyzeMethodSymbolAction, SymbolKind.Method);\n+        }\n+\n+        private static void AnalyzeMethodSymbol(SymbolAnalysisContext analysisContext)\n+        {\n+            var methodSymbol = analysisContext.Symbol as IMethodSymbol;\n+\n+            if (!(methodSymbol.CanBeReferencedByName || methodSymbol.IsImplementationOfAnyExplicitInterfaceMember())\n+                || !methodSymbol.Locations.Any(x => x.IsInSource)\n+                || string.IsNullOrWhiteSpace(methodSymbol.Name))\n+            {\n+                return;\n+            }\n+\n+            if (!methodSymbol.IsOverride && !methodSymbol.IsImplementationOfAnyImplicitInterfaceMember())\n+            {\n+                return;\n+            }\n+\n+            ImmutableArray<IMethodSymbol> originalDefinitions = GetOriginalDefinitions(methodSymbol);\n+            if (originalDefinitions.Length == 0)\n+            {\n+                // We did not find any original definitions so we don't have to do anything.\n+                // This can happen when the method has an override modifier,\n+                // but does not have any valid method it is overriding.\n+                return;\n+            }\n+\n+            IMethodSymbol bestMatch = null;\n+            int bestMatchScore = -1;\n+\n+            foreach (var originalDefinition in originalDefinitions)\n+            {\n+                // always prefer the method override, if it is available\n+                // (the overridden method will always be the first item in the list.)\n+                if (originalDefinition.ContainingType.TypeKind != TypeKind.Interface)\n+                {\n+                    bestMatch = originalDefinition;\n+                    break;\n+                }\n+\n+                int currentMatchScore = 0;\n+                for (int i = 0; i < methodSymbol.Parameters.Length; i++)\n+                {\n+                    IParameterSymbol currentParameter = methodSymbol.Parameters[i];\n+                    IParameterSymbol originalParameter = originalDefinition.Parameters[i];\n+\n+                    if (currentParameter.Name == originalParameter.Name)\n+                    {\n+                        currentMatchScore++;\n+                    }\n+                }\n+\n+                if (currentMatchScore > bestMatchScore)\n+                {\n+                    bestMatch = originalDefinition;","path":"src/Microsoft.ApiDesignGuidelines.Analyzers/Core/ParameterNamesShouldMatchBaseDeclaration.cs","position":92,"original_position":92,"commit_id":"9e65bdba715cf2b8560129209760a322056d74ff","original_commit_id":"9e65bdba715cf2b8560129209760a322056d74ff","user":{"login":"mavasani","id":10605811,"avatar_url":"https://avatars.githubusercontent.com/u/10605811?v=3","gravatar_id":"","url":"https://api.github.com/users/mavasani","html_url":"https://github.com/mavasani","followers_url":"https://api.github.com/users/mavasani/followers","following_url":"https://api.github.com/users/mavasani/following{/other_user}","gists_url":"https://api.github.com/users/mavasani/gists{/gist_id}","starred_url":"https://api.github.com/users/mavasani/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mavasani/subscriptions","organizations_url":"https://api.github.com/users/mavasani/orgs","repos_url":"https://api.github.com/users/mavasani/repos","events_url":"https://api.github.com/users/mavasani/events{/privacy}","received_events_url":"https://api.github.com/users/mavasani/received_events","type":"User","site_admin":false},"body":"I like your approach of suggesting the best match by count of matching parameter names. FXCop actually searches through the list of original definitions and reports an issue for each definition against which the match fails - that seems like lot of clutter.","created_at":"2016-04-01T23:14:43Z","updated_at":"2016-04-01T23:14:43Z","html_url":"https://github.com/dotnet/roslyn-analyzers/pull/911#discussion_r58280040","pull_request_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/911","_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/comments/58280040"},"html":{"href":"https://github.com/dotnet/roslyn-analyzers/pull/911#discussion_r58280040"},"pull_request":{"href":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/911"}}},"pull_request":{"url":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/911","id":65012625,"html_url":"https://github.com/dotnet/roslyn-analyzers/pull/911","diff_url":"https://github.com/dotnet/roslyn-analyzers/pull/911.diff","patch_url":"https://github.com/dotnet/roslyn-analyzers/pull/911.patch","issue_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/911","number":911,"state":"open","locked":false,"title":"Implemented CA1725 + Fixer","user":{"login":"vweijsters","id":10659991,"avatar_url":"https://avatars.githubusercontent.com/u/10659991?v=3","gravatar_id":"","url":"https://api.github.com/users/vweijsters","html_url":"https://github.com/vweijsters","followers_url":"https://api.github.com/users/vweijsters/followers","following_url":"https://api.github.com/users/vweijsters/following{/other_user}","gists_url":"https://api.github.com/users/vweijsters/gists{/gist_id}","starred_url":"https://api.github.com/users/vweijsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vweijsters/subscriptions","organizations_url":"https://api.github.com/users/vweijsters/orgs","repos_url":"https://api.github.com/users/vweijsters/repos","events_url":"https://api.github.com/users/vweijsters/events{/privacy}","received_events_url":"https://api.github.com/users/vweijsters/received_events","type":"User","site_admin":false},"body":"Fixes #457 \r\n\r\nThe implementation is based on DotNetAnalyzers/StyleCopAnalyzers#2015\r\n\r\n","created_at":"2016-04-01T22:16:27Z","updated_at":"2016-04-01T23:14:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"918352db106cfafeee41cf09b8970f6266814245","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/911/commits","review_comments_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/911/comments","review_comment_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/911/comments","statuses_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/statuses/9e65bdba715cf2b8560129209760a322056d74ff","head":{"label":"vweijsters:CA1725","ref":"CA1725","sha":"9e65bdba715cf2b8560129209760a322056d74ff","user":{"login":"vweijsters","id":10659991,"avatar_url":"https://avatars.githubusercontent.com/u/10659991?v=3","gravatar_id":"","url":"https://api.github.com/users/vweijsters","html_url":"https://github.com/vweijsters","followers_url":"https://api.github.com/users/vweijsters/followers","following_url":"https://api.github.com/users/vweijsters/following{/other_user}","gists_url":"https://api.github.com/users/vweijsters/gists{/gist_id}","starred_url":"https://api.github.com/users/vweijsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vweijsters/subscriptions","organizations_url":"https://api.github.com/users/vweijsters/orgs","repos_url":"https://api.github.com/users/vweijsters/repos","events_url":"https://api.github.com/users/vweijsters/events{/privacy}","received_events_url":"https://api.github.com/users/vweijsters/received_events","type":"User","site_admin":false},"repo":{"id":51874727,"name":"roslyn-analyzers","full_name":"vweijsters/roslyn-analyzers","owner":{"login":"vweijsters","id":10659991,"avatar_url":"https://avatars.githubusercontent.com/u/10659991?v=3","gravatar_id":"","url":"https://api.github.com/users/vweijsters","html_url":"https://github.com/vweijsters","followers_url":"https://api.github.com/users/vweijsters/followers","following_url":"https://api.github.com/users/vweijsters/following{/other_user}","gists_url":"https://api.github.com/users/vweijsters/gists{/gist_id}","starred_url":"https://api.github.com/users/vweijsters/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vweijsters/subscriptions","organizations_url":"https://api.github.com/users/vweijsters/orgs","repos_url":"https://api.github.com/users/vweijsters/repos","events_url":"https://api.github.com/users/vweijsters/events{/privacy}","received_events_url":"https://api.github.com/users/vweijsters/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/vweijsters/roslyn-analyzers","description":"","fork":true,"url":"https://api.github.com/repos/vweijsters/roslyn-analyzers","forks_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/forks","keys_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/teams","hooks_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/hooks","issue_events_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/issues/events{/number}","events_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/events","assignees_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/assignees{/user}","branches_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/branches{/branch}","tags_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/tags","blobs_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/git/refs{/sha}","trees_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/statuses/{sha}","languages_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/languages","stargazers_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/stargazers","contributors_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/contributors","subscribers_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/subscribers","subscription_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/subscription","commits_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/commits{/sha}","git_commits_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/git/commits{/sha}","comments_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/comments{/number}","issue_comment_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/issues/comments{/number}","contents_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/contents/{+path}","compare_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/merges","archive_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/downloads","issues_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/issues{/number}","pulls_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/pulls{/number}","milestones_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/milestones{/number}","notifications_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/labels{/name}","releases_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/releases{/id}","deployments_url":"https://api.github.com/repos/vweijsters/roslyn-analyzers/deployments","created_at":"2016-02-16T22:21:44Z","updated_at":"2016-02-27T21:09:30Z","pushed_at":"2016-04-01T22:12:16Z","git_url":"git://github.com/vweijsters/roslyn-analyzers.git","ssh_url":"git@github.com:vweijsters/roslyn-analyzers.git","clone_url":"https://github.com/vweijsters/roslyn-analyzers.git","svn_url":"https://github.com/vweijsters/roslyn-analyzers","homepage":null,"size":6879,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"dotnet:master","ref":"master","sha":"9219260c049ad0deda74d2fc479fafcd089ef72b","user":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"repo":{"id":36946704,"name":"roslyn-analyzers","full_name":"dotnet/roslyn-analyzers","owner":{"login":"dotnet","id":9141961,"avatar_url":"https://avatars.githubusercontent.com/u/9141961?v=3","gravatar_id":"","url":"https://api.github.com/users/dotnet","html_url":"https://github.com/dotnet","followers_url":"https://api.github.com/users/dotnet/followers","following_url":"https://api.github.com/users/dotnet/following{/other_user}","gists_url":"https://api.github.com/users/dotnet/gists{/gist_id}","starred_url":"https://api.github.com/users/dotnet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dotnet/subscriptions","organizations_url":"https://api.github.com/users/dotnet/orgs","repos_url":"https://api.github.com/users/dotnet/repos","events_url":"https://api.github.com/users/dotnet/events{/privacy}","received_events_url":"https://api.github.com/users/dotnet/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/dotnet/roslyn-analyzers","description":"","fork":false,"url":"https://api.github.com/repos/dotnet/roslyn-analyzers","forks_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/forks","keys_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/teams","hooks_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/hooks","issue_events_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/events{/number}","events_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/events","assignees_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/assignees{/user}","branches_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/branches{/branch}","tags_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/tags","blobs_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/git/refs{/sha}","trees_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/statuses/{sha}","languages_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/languages","stargazers_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/stargazers","contributors_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/contributors","subscribers_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/subscribers","subscription_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/subscription","commits_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/commits{/sha}","git_commits_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/git/commits{/sha}","comments_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/comments{/number}","issue_comment_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/comments{/number}","contents_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/contents/{+path}","compare_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/merges","archive_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/downloads","issues_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues{/number}","pulls_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls{/number}","milestones_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/milestones{/number}","notifications_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/labels{/name}","releases_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/releases{/id}","deployments_url":"https://api.github.com/repos/dotnet/roslyn-analyzers/deployments","created_at":"2015-06-05T17:48:07Z","updated_at":"2016-04-01T19:44:03Z","pushed_at":"2016-04-01T22:54:05Z","git_url":"git://github.com/dotnet/roslyn-analyzers.git","ssh_url":"git@github.com:dotnet/roslyn-analyzers.git","clone_url":"https://github.com/dotnet/roslyn-analyzers.git","svn_url":"https://github.com/dotnet/roslyn-analyzers","homepage":null,"size":8685,"stargazers_count":88,"watchers_count":88,"language":"C#","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":72,"mirror_url":null,"open_issues_count":175,"forks":72,"open_issues":175,"watchers":88,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/911"},"html":{"href":"https://github.com/dotnet/roslyn-analyzers/pull/911"},"issue":{"href":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/911"},"comments":{"href":"https://api.github.com/repos/dotnet/roslyn-analyzers/issues/911/comments"},"review_comments":{"href":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/911/comments"},"review_comment":{"href":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/dotnet/roslyn-analyzers/pulls/911/commits"},"statuses":{"href":"https://api.github.com/repos/dotnet/roslyn-analyzers/statuses/9e65bdba715cf2b8560129209760a322056d74ff"}}}}