{"action":"created","comment":{"url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/comments/58841679","id":58841679,"diff_hunk":"@@ -0,0 +1,310 @@\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 com.google.common.collect.HashMultimap;\n+import com.google.common.collect.ImmutableList;\n+import com.google.common.collect.SetMultimap;\n+import java.util.ArrayDeque;\n+import java.util.Collection;\n+import java.util.Deque;\n+import java.util.HashSet;\n+import java.util.List;\n+import java.util.Map.Entry;\n+import java.util.Set;\n+import javax.annotation.CheckForNull;\n+import org.sonar.api.server.rule.RulesDefinition.SubCharacteristics;\n+import org.sonar.check.Priority;\n+import org.sonar.check.Rule;\n+import org.sonar.javascript.cfg.CfgBlock;\n+import org.sonar.javascript.cfg.CfgBranchingBlock;\n+import org.sonar.javascript.cfg.ControlFlowGraph;\n+import org.sonar.javascript.se.BlockExecution;\n+import org.sonar.javascript.se.LocalVariables;\n+import org.sonar.javascript.se.ProgramState;\n+import org.sonar.javascript.se.SymbolicValue;\n+import org.sonar.javascript.se.Truthiness;\n+import org.sonar.javascript.tree.symbols.Scope;\n+import org.sonar.plugins.javascript.api.symbols.Symbol;\n+import org.sonar.plugins.javascript.api.tree.Tree;\n+import org.sonar.plugins.javascript.api.tree.Tree.Kind;\n+import org.sonar.plugins.javascript.api.tree.declaration.FunctionTree;\n+import org.sonar.plugins.javascript.api.tree.declaration.InitializedBindingElementTree;\n+import org.sonar.plugins.javascript.api.tree.expression.AssignmentExpressionTree;\n+import org.sonar.plugins.javascript.api.tree.expression.ExpressionTree;\n+import org.sonar.plugins.javascript.api.tree.expression.IdentifierTree;\n+import org.sonar.plugins.javascript.api.tree.expression.UnaryExpressionTree;\n+import org.sonar.plugins.javascript.api.tree.statement.BlockTree;\n+import org.sonar.plugins.javascript.api.tree.statement.ForObjectStatementTree;\n+import org.sonar.plugins.javascript.api.tree.statement.VariableDeclarationTree;\n+import org.sonar.plugins.javascript.api.visitors.SubscriptionVisitorCheck;\n+import org.sonar.squidbridge.annotations.ActivatedByDefault;\n+import org.sonar.squidbridge.annotations.SqaleConstantRemediation;\n+import org.sonar.squidbridge.annotations.SqaleSubCharacteristic;\n+\n+@Rule(\n+  key = \"S2583\",\n+  name = \"Conditions should not unconditionally evaluate to \\\"true\\\" or to \\\"false\\\"\",","path":"javascript-checks/src/main/java/org/sonar/javascript/checks/AlwaysTrueOrFalseConditionCheck.java","position":65,"original_position":64,"commit_id":"444640fefcb0b930c096bdb5eea87650ab4cb579","original_commit_id":"7edc918a4dd7d30fdff595bff44624fba066e9d7","user":{"login":"vilchik-elena","id":10108186,"avatar_url":"https://avatars.githubusercontent.com/u/10108186?v=3","gravatar_id":"","url":"https://api.github.com/users/vilchik-elena","html_url":"https://github.com/vilchik-elena","followers_url":"https://api.github.com/users/vilchik-elena/followers","following_url":"https://api.github.com/users/vilchik-elena/following{/other_user}","gists_url":"https://api.github.com/users/vilchik-elena/gists{/gist_id}","starred_url":"https://api.github.com/users/vilchik-elena/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vilchik-elena/subscriptions","organizations_url":"https://api.github.com/users/vilchik-elena/orgs","repos_url":"https://api.github.com/users/vilchik-elena/repos","events_url":"https://api.github.com/users/vilchik-elena/events{/privacy}","received_events_url":"https://api.github.com/users/vilchik-elena/received_events","type":"User","site_admin":false},"body":"@pynicolas Hm, may be, but I looked at Java https://nemo.sonarqube.org/coding_rules#q=S2583\r\nThen we should create subtask in RSPEC with different title","created_at":"2016-04-07T09:14:43Z","updated_at":"2016-04-07T09:14:43Z","html_url":"https://github.com/SonarSource/sonar-javascript/pull/215#discussion_r58841679","pull_request_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/215","_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/comments/58841679"},"html":{"href":"https://github.com/SonarSource/sonar-javascript/pull/215#discussion_r58841679"},"pull_request":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/215"}}},"pull_request":{"url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/215","id":64064761,"html_url":"https://github.com/SonarSource/sonar-javascript/pull/215","diff_url":"https://github.com/SonarSource/sonar-javascript/pull/215.diff","patch_url":"https://github.com/SonarSource/sonar-javascript/pull/215.patch","issue_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/215","number":215,"state":"open","locked":false,"title":"SONARJS-663 Rule: Conditions should not unconditionally evaluate to \"TRUE\" or to \"FALSE\"","user":{"login":"pynicolas","id":6371790,"avatar_url":"https://avatars.githubusercontent.com/u/6371790?v=3","gravatar_id":"","url":"https://api.github.com/users/pynicolas","html_url":"https://github.com/pynicolas","followers_url":"https://api.github.com/users/pynicolas/followers","following_url":"https://api.github.com/users/pynicolas/following{/other_user}","gists_url":"https://api.github.com/users/pynicolas/gists{/gist_id}","starred_url":"https://api.github.com/users/pynicolas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pynicolas/subscriptions","organizations_url":"https://api.github.com/users/pynicolas/orgs","repos_url":"https://api.github.com/users/pynicolas/repos","events_url":"https://api.github.com/users/pynicolas/events{/privacy}","received_events_url":"https://api.github.com/users/pynicolas/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-03-24T16:56:04Z","updated_at":"2016-04-07T09:14:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"edf84685dd404592ff9840964abefc61c0c80cbb","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/215/commits","review_comments_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/215/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/215/comments","statuses_url":"https://api.github.com/repos/SonarSource/sonar-javascript/statuses/444640fefcb0b930c096bdb5eea87650ab4cb579","head":{"label":"SonarSource:SONARJS-663","ref":"SONARJS-663","sha":"444640fefcb0b930c096bdb5eea87650ab4cb579","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":"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-03-17T12:39:56Z","pushed_at":"2016-04-07T09:12:54Z","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/JavaScript+Plugin","size":11672,"stargazers_count":69,"watchers_count":69,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":5,"forks":61,"open_issues":5,"watchers":69,"default_branch":"master"}},"base":{"label":"SonarSource:SONARJS-661","ref":"SONARJS-661","sha":"56adc66062781b64c19acad8f4cb4c44db4e1883","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":"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-03-17T12:39:56Z","pushed_at":"2016-04-07T09:12:54Z","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/JavaScript+Plugin","size":11672,"stargazers_count":69,"watchers_count":69,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":61,"mirror_url":null,"open_issues_count":5,"forks":61,"open_issues":5,"watchers":69,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/215"},"html":{"href":"https://github.com/SonarSource/sonar-javascript/pull/215"},"issue":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/215"},"comments":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/215/comments"},"review_comments":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/215/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/215/commits"},"statuses":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/statuses/444640fefcb0b930c096bdb5eea87650ab4cb579"}}}}