{"action":"created","comment":{"url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/comments/93761624","pull_request_review_id":14296308,"id":93761624,"diff_hunk":"@@ -0,0 +1,124 @@\n+/*\n+ * SonarQube JavaScript Plugin\n+ * Copyright (C) 2011-2016 SonarSource SA\n+ * mailto:contact AT sonarsource DOT com\n+ *\n+ * This program is free software; you can redistribute it and/or\n+ * modify it under the terms of the GNU Lesser General Public\n+ * License as published by the Free Software Foundation; either\n+ * version 3 of the License, or (at your option) any later version.\n+ *\n+ * This program is distributed in the hope that it will be useful,\n+ * but WITHOUT ANY WARRANTY; without even the implied warranty of\n+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\n+ * Lesser General Public License for more details.\n+ *\n+ * You should have received a copy of the GNU Lesser General Public License\n+ * along with this program; if not, write to the Free Software Foundation,\n+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.\n+ */\n+package org.sonar.javascript.checks;\n+\n+import java.util.HashSet;\n+import java.util.Optional;\n+import java.util.Set;\n+import org.sonar.javascript.se.SeCheck;\n+import org.sonar.javascript.tree.symbols.Scope;\n+import org.sonar.plugins.javascript.api.tree.Tree;\n+import org.sonar.plugins.javascript.api.visitors.Issue;\n+import org.sonar.plugins.javascript.api.visitors.IssueLocation;\n+import org.sonar.plugins.javascript.api.visitors.PreciseIssue;\n+\n+/**\n+ * Base class for check classes which must ensure that the same issue is never raised\n+ * more than once for the same tree.\n+ */\n+public abstract class AbstractAnyPathSeCheck extends SeCheck {\n+\n+  /**\n+   * Trees for which an issue has already been raised.\n+   * Used to avoid multiple identical issues raised by different execution paths.\n+   */\n+  private Set<Tree> treesWithIssue = new HashSet<>();\n+\n+  @Override\n+  public final void startOfExecution(Scope functionScope) {\n+    treesWithIssue.clear();\n+    doStartOfExecution(functionScope);\n+  }\n+\n+  /**\n+   * Override this method to perform actions before the start of execution.\n+   * This method is called for each execution, i.e. for each function in the file.\n+   * Note this method is called even if the execution limit was reached later.\n+   * @param functionScope scope corresponding to the function which will be executed\n+   */\n+  public void doStartOfExecution(Scope functionScope) {\n+    // do nothing\n+  }\n+\n+  /**\n+   * Implementers of subclasses should not use this function, as this function","path":"javascript-checks/src/main/java/org/sonar/javascript/checks/AbstractAnyPathSeCheck.java","position":61,"original_position":61,"commit_id":"19a1263094c56a9d08fa49751bef32f96e96ec28","original_commit_id":"19a1263094c56a9d08fa49751bef32f96e96ec28","user":{"login":"ivandalbosco","id":19170614,"avatar_url":"https://avatars.githubusercontent.com/u/19170614?v=3","gravatar_id":"","url":"https://api.github.com/users/ivandalbosco","html_url":"https://github.com/ivandalbosco","followers_url":"https://api.github.com/users/ivandalbosco/followers","following_url":"https://api.github.com/users/ivandalbosco/following{/other_user}","gists_url":"https://api.github.com/users/ivandalbosco/gists{/gist_id}","starred_url":"https://api.github.com/users/ivandalbosco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivandalbosco/subscriptions","organizations_url":"https://api.github.com/users/ivandalbosco/orgs","repos_url":"https://api.github.com/users/ivandalbosco/repos","events_url":"https://api.github.com/users/ivandalbosco/events{/privacy}","received_events_url":"https://api.github.com/users/ivandalbosco/received_events","type":"User","site_admin":false},"body":"@vilchik-elena OK doc fixed.","created_at":"2016-12-23T12:42:26Z","updated_at":"2016-12-23T12:42:26Z","html_url":"https://github.com/SonarSource/sonar-javascript/pull/424#discussion_r93761624","pull_request_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/424","_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/comments/93761624"},"html":{"href":"https://github.com/SonarSource/sonar-javascript/pull/424#discussion_r93761624"},"pull_request":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/424"}}},"pull_request":{"url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/424","id":98955631,"html_url":"https://github.com/SonarSource/sonar-javascript/pull/424","diff_url":"https://github.com/SonarSource/sonar-javascript/pull/424.diff","patch_url":"https://github.com/SonarSource/sonar-javascript/pull/424.patch","issue_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/424","number":424,"state":"open","locked":false,"title":"Refactor SeCheck","user":{"login":"ivandalbosco","id":19170614,"avatar_url":"https://avatars.githubusercontent.com/u/19170614?v=3","gravatar_id":"","url":"https://api.github.com/users/ivandalbosco","html_url":"https://github.com/ivandalbosco","followers_url":"https://api.github.com/users/ivandalbosco/followers","following_url":"https://api.github.com/users/ivandalbosco/following{/other_user}","gists_url":"https://api.github.com/users/ivandalbosco/gists{/gist_id}","starred_url":"https://api.github.com/users/ivandalbosco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ivandalbosco/subscriptions","organizations_url":"https://api.github.com/users/ivandalbosco/orgs","repos_url":"https://api.github.com/users/ivandalbosco/repos","events_url":"https://api.github.com/users/ivandalbosco/events{/privacy}","received_events_url":"https://api.github.com/users/ivandalbosco/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-21T15:47:09Z","updated_at":"2016-12-23T12:42:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1e824639e611a8c009e6fac1e9cecce95537e4fe","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/424/commits","review_comments_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/424/comments","review_comment_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/424/comments","statuses_url":"https://api.github.com/repos/SonarSource/sonar-javascript/statuses/19a1263094c56a9d08fa49751bef32f96e96ec28","head":{"label":"SonarSource:refactor-SeCheck","ref":"refactor-SeCheck","sha":"19a1263094c56a9d08fa49751bef32f96e96ec28","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars.githubusercontent.com/u/545988?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"repo":{"id":4335519,"name":"sonar-javascript","full_name":"SonarSource/sonar-javascript","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars.githubusercontent.com/u/545988?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SonarSource/sonar-javascript","description":"SonarJS: JavaScript Analyzer for SonarQube","fork":false,"url":"https://api.github.com/repos/SonarSource/sonar-javascript","forks_url":"https://api.github.com/repos/SonarSource/sonar-javascript/forks","keys_url":"https://api.github.com/repos/SonarSource/sonar-javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonar-javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonar-javascript/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonar-javascript/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonar-javascript/events","assignees_url":"https://api.github.com/repos/SonarSource/sonar-javascript/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonar-javascript/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonar-javascript/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonar-javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonar-javascript/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonar-javascript/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonar-javascript/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonar-javascript/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonar-javascript/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonar-javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonar-javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonar-javascript/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonar-javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonar-javascript/merges","archive_url":"https://api.github.com/repos/SonarSource/sonar-javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonar-javascript/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonar-javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonar-javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonar-javascript/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonar-javascript/releases{/id}","deployments_url":"https://api.github.com/repos/SonarSource/sonar-javascript/deployments","created_at":"2012-05-15T12:35:38Z","updated_at":"2016-12-20T20:13:14Z","pushed_at":"2016-12-23T10:57:41Z","git_url":"git://github.com/SonarSource/sonar-javascript.git","ssh_url":"git@github.com:SonarSource/sonar-javascript.git","clone_url":"https://github.com/SonarSource/sonar-javascript.git","svn_url":"https://github.com/SonarSource/sonar-javascript","homepage":"http://docs.sonarqube.org/display/PLUG/SonarJS","size":12543,"stargazers_count":87,"watchers_count":87,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":9,"forks":70,"open_issues":9,"watchers":87,"default_branch":"master"}},"base":{"label":"SonarSource:master","ref":"master","sha":"293fc2974d4449f72f67ab09f86a22337d955cb0","user":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars.githubusercontent.com/u/545988?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"repo":{"id":4335519,"name":"sonar-javascript","full_name":"SonarSource/sonar-javascript","owner":{"login":"SonarSource","id":545988,"avatar_url":"https://avatars.githubusercontent.com/u/545988?v=3","gravatar_id":"","url":"https://api.github.com/users/SonarSource","html_url":"https://github.com/SonarSource","followers_url":"https://api.github.com/users/SonarSource/followers","following_url":"https://api.github.com/users/SonarSource/following{/other_user}","gists_url":"https://api.github.com/users/SonarSource/gists{/gist_id}","starred_url":"https://api.github.com/users/SonarSource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SonarSource/subscriptions","organizations_url":"https://api.github.com/users/SonarSource/orgs","repos_url":"https://api.github.com/users/SonarSource/repos","events_url":"https://api.github.com/users/SonarSource/events{/privacy}","received_events_url":"https://api.github.com/users/SonarSource/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SonarSource/sonar-javascript","description":"SonarJS: JavaScript Analyzer for SonarQube","fork":false,"url":"https://api.github.com/repos/SonarSource/sonar-javascript","forks_url":"https://api.github.com/repos/SonarSource/sonar-javascript/forks","keys_url":"https://api.github.com/repos/SonarSource/sonar-javascript/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SonarSource/sonar-javascript/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SonarSource/sonar-javascript/teams","hooks_url":"https://api.github.com/repos/SonarSource/sonar-javascript/hooks","issue_events_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/events{/number}","events_url":"https://api.github.com/repos/SonarSource/sonar-javascript/events","assignees_url":"https://api.github.com/repos/SonarSource/sonar-javascript/assignees{/user}","branches_url":"https://api.github.com/repos/SonarSource/sonar-javascript/branches{/branch}","tags_url":"https://api.github.com/repos/SonarSource/sonar-javascript/tags","blobs_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/refs{/sha}","trees_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SonarSource/sonar-javascript/statuses/{sha}","languages_url":"https://api.github.com/repos/SonarSource/sonar-javascript/languages","stargazers_url":"https://api.github.com/repos/SonarSource/sonar-javascript/stargazers","contributors_url":"https://api.github.com/repos/SonarSource/sonar-javascript/contributors","subscribers_url":"https://api.github.com/repos/SonarSource/sonar-javascript/subscribers","subscription_url":"https://api.github.com/repos/SonarSource/sonar-javascript/subscription","commits_url":"https://api.github.com/repos/SonarSource/sonar-javascript/commits{/sha}","git_commits_url":"https://api.github.com/repos/SonarSource/sonar-javascript/git/commits{/sha}","comments_url":"https://api.github.com/repos/SonarSource/sonar-javascript/comments{/number}","issue_comment_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/comments{/number}","contents_url":"https://api.github.com/repos/SonarSource/sonar-javascript/contents/{+path}","compare_url":"https://api.github.com/repos/SonarSource/sonar-javascript/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SonarSource/sonar-javascript/merges","archive_url":"https://api.github.com/repos/SonarSource/sonar-javascript/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SonarSource/sonar-javascript/downloads","issues_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues{/number}","pulls_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls{/number}","milestones_url":"https://api.github.com/repos/SonarSource/sonar-javascript/milestones{/number}","notifications_url":"https://api.github.com/repos/SonarSource/sonar-javascript/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SonarSource/sonar-javascript/labels{/name}","releases_url":"https://api.github.com/repos/SonarSource/sonar-javascript/releases{/id}","deployments_url":"https://api.github.com/repos/SonarSource/sonar-javascript/deployments","created_at":"2012-05-15T12:35:38Z","updated_at":"2016-12-20T20:13:14Z","pushed_at":"2016-12-23T10:57:41Z","git_url":"git://github.com/SonarSource/sonar-javascript.git","ssh_url":"git@github.com:SonarSource/sonar-javascript.git","clone_url":"https://github.com/SonarSource/sonar-javascript.git","svn_url":"https://github.com/SonarSource/sonar-javascript","homepage":"http://docs.sonarqube.org/display/PLUG/SonarJS","size":12543,"stargazers_count":87,"watchers_count":87,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":9,"forks":70,"open_issues":9,"watchers":87,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/424"},"html":{"href":"https://github.com/SonarSource/sonar-javascript/pull/424"},"issue":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/424"},"comments":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/424/comments"},"review_comments":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/424/comments"},"review_comment":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/424/commits"},"statuses":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/statuses/19a1263094c56a9d08fa49751bef32f96e96ec28"}}}}
{"actor":{"display_login":"ivandalbosco"}}