{"action":"created","comment":{"url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/comments/215381289","pull_request_review_id":152631076,"id":215381289,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxNTM4MTI4OQ==","diff_hunk":"@@ -0,0 +1,59 @@\n+﻿using Microsoft.CodeAnalysis;\n+using Agoda.Analyzers.Helpers;\n+using System.Collections.Immutable;\n+using Microsoft.CodeAnalysis.CSharp;\n+using Microsoft.CodeAnalysis.Diagnostics;\n+using Microsoft.CodeAnalysis.CSharp.Syntax;\n+using System.Text.RegularExpressions;\n+\n+namespace Agoda.Analyzers.AgodaCustom\n+{\n+    [DiagnosticAnalyzer(LanguageNames.CSharp)]\n+    public class AG0026EnsureOnlyCssSelectorIsUsedToFindElements : InvocationExpressionAnalyzer\n+    {\n+        public const string DIAGNOSTIC_ID = \"AG0026\";\n+\n+        private static readonly LocalizableResourceString _msg = new LocalizableResourceString(\n+                nameof(CustomRulesResources.AG0026Title), CustomRulesResources.ResourceManager, typeof(CustomRulesResources));\n+              \n+        protected override DiagnosticDescriptor Descriptor => new DiagnosticDescriptor(\n+                DIAGNOSTIC_ID,\n+                _msg,\n+                _msg,\n+                AnalyzerCategory.CustomQualityRules,\n+                DiagnosticSeverity.Warning,\n+                AnalyzerConstants.EnabledByDefault,\n+                DescriptionContentLoader.GetAnalyzerDescription(nameof(AG0026EnsureOnlyCssSelectorIsUsedToFindElements)),\n+                \"https://github.agodadev.io/pages/standards-c-sharp/code-standards/gui-testing/css-selectors.html\",\n+                WellKnownDiagnosticTags.EditAndContinue\n+            );\n+\n+        protected override string NamespaceAndType => \"OpenQA.Selenium.By\";\n+        protected override Regex Regex => new Regex(\"^((?!CssSelector).)*$\");","path":"src/Agoda.Analyzers/AgodaCustom/AG0026EnsureOnlyCssSelectorIsUsedToFindElements.cs","position":32,"original_position":32,"commit_id":"a785de500c9a69bc1fc7294bfc49bd46f8e03bc8","original_commit_id":"a785de500c9a69bc1fc7294bfc49bd46f8e03bc8","user":{"login":"mikechamberlain","id":1414303,"node_id":"MDQ6VXNlcjE0MTQzMDM=","avatar_url":"https://avatars1.githubusercontent.com/u/1414303?v=4","gravatar_id":"","url":"https://api.github.com/users/mikechamberlain","html_url":"https://github.com/mikechamberlain","followers_url":"https://api.github.com/users/mikechamberlain/followers","following_url":"https://api.github.com/users/mikechamberlain/following{/other_user}","gists_url":"https://api.github.com/users/mikechamberlain/gists{/gist_id}","starred_url":"https://api.github.com/users/mikechamberlain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikechamberlain/subscriptions","organizations_url":"https://api.github.com/users/mikechamberlain/orgs","repos_url":"https://api.github.com/users/mikechamberlain/repos","events_url":"https://api.github.com/users/mikechamberlain/events{/privacy}","received_events_url":"https://api.github.com/users/mikechamberlain/received_events","type":"User","site_admin":false},"body":"Could this be named more clearly? Maybe `MatchForbiddenMethodName`?\r\n\r\nAnd I can't work out what the `.` in the regex is doing - is this a literal dot (so should be `\\.`), or is it meant to match any character? Either way, I'm confused... though it obviously seems to work.","created_at":"2018-09-05T18:35:06Z","updated_at":"2018-09-05T18:51:47Z","html_url":"https://github.com/agoda-com/AgodaAnalyzers/pull/82#discussion_r215381289","pull_request_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/82","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/comments/215381289"},"html":{"href":"https://github.com/agoda-com/AgodaAnalyzers/pull/82#discussion_r215381289"},"pull_request":{"href":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/82"}}},"pull_request":{"url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/82","id":213351921,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzMzUxOTIx","html_url":"https://github.com/agoda-com/AgodaAnalyzers/pull/82","diff_url":"https://github.com/agoda-com/AgodaAnalyzers/pull/82.diff","patch_url":"https://github.com/agoda-com/AgodaAnalyzers/pull/82.patch","issue_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues/82","number":82,"state":"open","locked":false,"title":"AG0026: Ensure elements are only selected by CssSelector in Selenium tests","user":{"login":"vladbatushkov","id":6023235,"node_id":"MDQ6VXNlcjYwMjMyMzU=","avatar_url":"https://avatars2.githubusercontent.com/u/6023235?v=4","gravatar_id":"","url":"https://api.github.com/users/vladbatushkov","html_url":"https://github.com/vladbatushkov","followers_url":"https://api.github.com/users/vladbatushkov/followers","following_url":"https://api.github.com/users/vladbatushkov/following{/other_user}","gists_url":"https://api.github.com/users/vladbatushkov/gists{/gist_id}","starred_url":"https://api.github.com/users/vladbatushkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vladbatushkov/subscriptions","organizations_url":"https://api.github.com/users/vladbatushkov/orgs","repos_url":"https://api.github.com/users/vladbatushkov/repos","events_url":"https://api.github.com/users/vladbatushkov/events{/privacy}","received_events_url":"https://api.github.com/users/vladbatushkov/received_events","type":"User","site_admin":false},"body":"Prevent use of OpenQA.Selenium.By....() except for By.CssSelector()\r\n\r\nhttps://github.agodadev.io/pages/standards-c-sharp/code-standards/gui-testing/css-selectors.html","created_at":"2018-09-05T16:15:29Z","updated_at":"2018-09-05T18:51:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a39ea47695ab9c050c67d10a45da9df7e9f30b27","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/82/commits","review_comments_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/82/comments","review_comment_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/comments{/number}","comments_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues/82/comments","statuses_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/statuses/a785de500c9a69bc1fc7294bfc49bd46f8e03bc8","head":{"label":"agoda-com:AG0026","ref":"AG0026","sha":"a785de500c9a69bc1fc7294bfc49bd46f8e03bc8","user":{"login":"agoda-com","id":19235448,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5MjM1NDQ4","avatar_url":"https://avatars2.githubusercontent.com/u/19235448?v=4","gravatar_id":"","url":"https://api.github.com/users/agoda-com","html_url":"https://github.com/agoda-com","followers_url":"https://api.github.com/users/agoda-com/followers","following_url":"https://api.github.com/users/agoda-com/following{/other_user}","gists_url":"https://api.github.com/users/agoda-com/gists{/gist_id}","starred_url":"https://api.github.com/users/agoda-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agoda-com/subscriptions","organizations_url":"https://api.github.com/users/agoda-com/orgs","repos_url":"https://api.github.com/users/agoda-com/repos","events_url":"https://api.github.com/users/agoda-com/events{/privacy}","received_events_url":"https://api.github.com/users/agoda-com/received_events","type":"Organization","site_admin":false},"repo":{"id":79012494,"node_id":"MDEwOlJlcG9zaXRvcnk3OTAxMjQ5NA==","name":"AgodaAnalyzers","full_name":"agoda-com/AgodaAnalyzers","owner":{"login":"agoda-com","id":19235448,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5MjM1NDQ4","avatar_url":"https://avatars2.githubusercontent.com/u/19235448?v=4","gravatar_id":"","url":"https://api.github.com/users/agoda-com","html_url":"https://github.com/agoda-com","followers_url":"https://api.github.com/users/agoda-com/followers","following_url":"https://api.github.com/users/agoda-com/following{/other_user}","gists_url":"https://api.github.com/users/agoda-com/gists{/gist_id}","starred_url":"https://api.github.com/users/agoda-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agoda-com/subscriptions","organizations_url":"https://api.github.com/users/agoda-com/orgs","repos_url":"https://api.github.com/users/agoda-com/repos","events_url":"https://api.github.com/users/agoda-com/events{/privacy}","received_events_url":"https://api.github.com/users/agoda-com/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agoda-com/AgodaAnalyzers","description":"Roslyn rule set, an opinionated set for rules for Fullstack C# Developers","fork":false,"url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers","forks_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/forks","keys_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/teams","hooks_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/hooks","issue_events_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues/events{/number}","events_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/events","assignees_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/assignees{/user}","branches_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/branches{/branch}","tags_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/tags","blobs_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/refs{/sha}","trees_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/statuses/{sha}","languages_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/languages","stargazers_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/stargazers","contributors_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/contributors","subscribers_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/subscribers","subscription_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/subscription","commits_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/commits{/sha}","git_commits_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/commits{/sha}","comments_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/comments{/number}","issue_comment_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues/comments{/number}","contents_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/contents/{+path}","compare_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/merges","archive_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/downloads","issues_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues{/number}","pulls_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls{/number}","milestones_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/milestones{/number}","notifications_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/labels{/name}","releases_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/releases{/id}","deployments_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/deployments","created_at":"2017-01-15T07:57:57Z","updated_at":"2018-09-04T11:42:20Z","pushed_at":"2018-09-05T16:15:29Z","git_url":"git://github.com/agoda-com/AgodaAnalyzers.git","ssh_url":"git@github.com:agoda-com/AgodaAnalyzers.git","clone_url":"https://github.com/agoda-com/AgodaAnalyzers.git","svn_url":"https://github.com/agoda-com/AgodaAnalyzers","homepage":"","size":374,"stargazers_count":9,"watchers_count":9,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":26,"license":null,"forks":8,"open_issues":26,"watchers":9,"default_branch":"master"}},"base":{"label":"agoda-com:master","ref":"master","sha":"203151609aa6b36fd572319285f25eb7c4ff7068","user":{"login":"agoda-com","id":19235448,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5MjM1NDQ4","avatar_url":"https://avatars2.githubusercontent.com/u/19235448?v=4","gravatar_id":"","url":"https://api.github.com/users/agoda-com","html_url":"https://github.com/agoda-com","followers_url":"https://api.github.com/users/agoda-com/followers","following_url":"https://api.github.com/users/agoda-com/following{/other_user}","gists_url":"https://api.github.com/users/agoda-com/gists{/gist_id}","starred_url":"https://api.github.com/users/agoda-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agoda-com/subscriptions","organizations_url":"https://api.github.com/users/agoda-com/orgs","repos_url":"https://api.github.com/users/agoda-com/repos","events_url":"https://api.github.com/users/agoda-com/events{/privacy}","received_events_url":"https://api.github.com/users/agoda-com/received_events","type":"Organization","site_admin":false},"repo":{"id":79012494,"node_id":"MDEwOlJlcG9zaXRvcnk3OTAxMjQ5NA==","name":"AgodaAnalyzers","full_name":"agoda-com/AgodaAnalyzers","owner":{"login":"agoda-com","id":19235448,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE5MjM1NDQ4","avatar_url":"https://avatars2.githubusercontent.com/u/19235448?v=4","gravatar_id":"","url":"https://api.github.com/users/agoda-com","html_url":"https://github.com/agoda-com","followers_url":"https://api.github.com/users/agoda-com/followers","following_url":"https://api.github.com/users/agoda-com/following{/other_user}","gists_url":"https://api.github.com/users/agoda-com/gists{/gist_id}","starred_url":"https://api.github.com/users/agoda-com/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agoda-com/subscriptions","organizations_url":"https://api.github.com/users/agoda-com/orgs","repos_url":"https://api.github.com/users/agoda-com/repos","events_url":"https://api.github.com/users/agoda-com/events{/privacy}","received_events_url":"https://api.github.com/users/agoda-com/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/agoda-com/AgodaAnalyzers","description":"Roslyn rule set, an opinionated set for rules for Fullstack C# Developers","fork":false,"url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers","forks_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/forks","keys_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/teams","hooks_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/hooks","issue_events_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues/events{/number}","events_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/events","assignees_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/assignees{/user}","branches_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/branches{/branch}","tags_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/tags","blobs_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/refs{/sha}","trees_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/statuses/{sha}","languages_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/languages","stargazers_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/stargazers","contributors_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/contributors","subscribers_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/subscribers","subscription_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/subscription","commits_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/commits{/sha}","git_commits_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/git/commits{/sha}","comments_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/comments{/number}","issue_comment_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues/comments{/number}","contents_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/contents/{+path}","compare_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/merges","archive_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/downloads","issues_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues{/number}","pulls_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls{/number}","milestones_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/milestones{/number}","notifications_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/labels{/name}","releases_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/releases{/id}","deployments_url":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/deployments","created_at":"2017-01-15T07:57:57Z","updated_at":"2018-09-04T11:42:20Z","pushed_at":"2018-09-05T16:15:29Z","git_url":"git://github.com/agoda-com/AgodaAnalyzers.git","ssh_url":"git@github.com:agoda-com/AgodaAnalyzers.git","clone_url":"https://github.com/agoda-com/AgodaAnalyzers.git","svn_url":"https://github.com/agoda-com/AgodaAnalyzers","homepage":"","size":374,"stargazers_count":9,"watchers_count":9,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":8,"mirror_url":null,"archived":false,"open_issues_count":26,"license":null,"forks":8,"open_issues":26,"watchers":9,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/82"},"html":{"href":"https://github.com/agoda-com/AgodaAnalyzers/pull/82"},"issue":{"href":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues/82"},"comments":{"href":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/issues/82/comments"},"review_comments":{"href":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/82/comments"},"review_comment":{"href":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/pulls/82/commits"},"statuses":{"href":"https://api.github.com/repos/agoda-com/AgodaAnalyzers/statuses/a785de500c9a69bc1fc7294bfc49bd46f8e03bc8"}},"author_association":"NONE"}}
{"actor":{"display_login":"mikechamberlain"}}