{"action":"created","comment":{"url":"https://api.github.com/repos/okutane/cmake-edit/pulls/comments/76544191","id":76544191,"diff_hunk":"@@ -12,19 +12,108 @@\n     private final List<CommandInvocationNode> nodes;\n     private int position;\n     private final Map<String, Set<CommandInvocationNode>> variables;\n-    private final Map<String, LogicalBlock> subroutines = new HashMap<>();\n+    private final Set<CommandInvocationNode> suspiciousPoints;\n+    private final Map<String, AbstractSimulator.CommandSimulator> dynamicSimulators = new HashMap<>();\n \n-    SimulationState(List<CommandInvocationNode> nodes, int position) {\n-        this(nodes, position, new HashMap<>());\n+    SimulationState(List<CommandInvocationNode> nodes, int position, Set<CommandInvocationNode> suspiciousPoints) {\n+        this(nodes, position, suspiciousPoints, new HashMap<>());\n     }\n \n-    SimulationState(List<CommandInvocationNode> nodes, int position, Map<String, Set<CommandInvocationNode>> variables) {\n+    SimulationState(List<CommandInvocationNode> nodes, int position, Set<CommandInvocationNode> suspiciousPoints, Map<String, Set<CommandInvocationNode>> variables) {\n         this.nodes = nodes;\n         this.position = position;\n         this.variables = variables;\n+        this.suspiciousPoints = suspiciousPoints;\n     }\n \n-    void simulate(Set<Node> suspiciousPoints, Node node) {\n+    /** todo think of better name */\n+    String getValue(Node argumentNode) {\n+        StringBuilder sb = new StringBuilder();\n+\n+        argumentNode.visitAll(new NodeVisitorAdapter() {\n+            @Override\n+            public void accept(ExpressionNode node) {\n+                StringBuilder exprBuilder = new StringBuilder();\n+\n+                if (node.getKey() != null) {\n+                    exprBuilder.append(node.getKey());\n+                }\n+\n+                node.getNested().stream().forEach(n -> exprBuilder.append(getValue(n)));\n+\n+                String expr = exprBuilder.toString();\n+                processUsage(expr);\n+\n+                sb.append('*').append(expr);\n+            }\n+\n+            @Override\n+            public void accept(ConstantNode node) {\n+                String value = node.getValue();\n+                if (value.endsWith(\"\\n\")) {\n+                    value = value.replace(\"\\n\", \"\"); // todo this hack should be replaced by fix in parser!","path":"cmake-edit-core/src/main/java/ru/urururu/cmakeedit/core/checker/SimulationState.java","position":48,"original_position":48,"commit_id":"a6dc2ca4e781165797f2df15bf3b566c754f36f9","original_commit_id":"a6dc2ca4e781165797f2df15bf3b566c754f36f9","user":{"login":"okutane","id":2418478,"avatar_url":"https://avatars.githubusercontent.com/u/2418478?v=3","gravatar_id":"","url":"https://api.github.com/users/okutane","html_url":"https://github.com/okutane","followers_url":"https://api.github.com/users/okutane/followers","following_url":"https://api.github.com/users/okutane/following{/other_user}","gists_url":"https://api.github.com/users/okutane/gists{/gist_id}","starred_url":"https://api.github.com/users/okutane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okutane/subscriptions","organizations_url":"https://api.github.com/users/okutane/orgs","repos_url":"https://api.github.com/users/okutane/repos","events_url":"https://api.github.com/users/okutane/events{/privacy}","received_events_url":"https://api.github.com/users/okutane/received_events","type":"User","site_admin":false},"body":"![INFO](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/severity-info.png) Complete the task associated to this TODO comment. [![rule](https://raw.githubusercontent.com/SonarCommunity/sonar-github/master/images/rule.png)](https://sonarqube.com/coding_rules#rule_key=squid%3AS1135)\n","created_at":"2016-08-29T01:26:13Z","updated_at":"2016-08-29T01:26:13Z","html_url":"https://github.com/okutane/cmake-edit/pull/6#discussion_r76544191","pull_request_url":"https://api.github.com/repos/okutane/cmake-edit/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/okutane/cmake-edit/pulls/comments/76544191"},"html":{"href":"https://github.com/okutane/cmake-edit/pull/6#discussion_r76544191"},"pull_request":{"href":"https://api.github.com/repos/okutane/cmake-edit/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/okutane/cmake-edit/pulls/6","id":82496180,"html_url":"https://github.com/okutane/cmake-edit/pull/6","diff_url":"https://github.com/okutane/cmake-edit/pull/6.diff","patch_url":"https://github.com/okutane/cmake-edit/pull/6.patch","issue_url":"https://api.github.com/repos/okutane/cmake-edit/issues/6","number":6,"state":"open","locked":false,"title":"Checker 3","user":{"login":"okutane","id":2418478,"avatar_url":"https://avatars.githubusercontent.com/u/2418478?v=3","gravatar_id":"","url":"https://api.github.com/users/okutane","html_url":"https://github.com/okutane","followers_url":"https://api.github.com/users/okutane/followers","following_url":"https://api.github.com/users/okutane/following{/other_user}","gists_url":"https://api.github.com/users/okutane/gists{/gist_id}","starred_url":"https://api.github.com/users/okutane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okutane/subscriptions","organizations_url":"https://api.github.com/users/okutane/orgs","repos_url":"https://api.github.com/users/okutane/repos","events_url":"https://api.github.com/users/okutane/events{/privacy}","received_events_url":"https://api.github.com/users/okutane/received_events","type":"User","site_admin":false},"body":"Hey! It gives more respect to expressions!","created_at":"2016-08-24T07:48:06Z","updated_at":"2016-08-29T01:26:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ddc72fb6dc342af35de12bf486d569819f7a197e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/okutane/cmake-edit/pulls/6/commits","review_comments_url":"https://api.github.com/repos/okutane/cmake-edit/pulls/6/comments","review_comment_url":"https://api.github.com/repos/okutane/cmake-edit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/okutane/cmake-edit/issues/6/comments","statuses_url":"https://api.github.com/repos/okutane/cmake-edit/statuses/a6dc2ca4e781165797f2df15bf3b566c754f36f9","head":{"label":"okutane:checker-3","ref":"checker-3","sha":"a6dc2ca4e781165797f2df15bf3b566c754f36f9","user":{"login":"okutane","id":2418478,"avatar_url":"https://avatars.githubusercontent.com/u/2418478?v=3","gravatar_id":"","url":"https://api.github.com/users/okutane","html_url":"https://github.com/okutane","followers_url":"https://api.github.com/users/okutane/followers","following_url":"https://api.github.com/users/okutane/following{/other_user}","gists_url":"https://api.github.com/users/okutane/gists{/gist_id}","starred_url":"https://api.github.com/users/okutane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okutane/subscriptions","organizations_url":"https://api.github.com/users/okutane/orgs","repos_url":"https://api.github.com/users/okutane/repos","events_url":"https://api.github.com/users/okutane/events{/privacy}","received_events_url":"https://api.github.com/users/okutane/received_events","type":"User","site_admin":false},"repo":{"id":62172155,"name":"cmake-edit","full_name":"okutane/cmake-edit","owner":{"login":"okutane","id":2418478,"avatar_url":"https://avatars.githubusercontent.com/u/2418478?v=3","gravatar_id":"","url":"https://api.github.com/users/okutane","html_url":"https://github.com/okutane","followers_url":"https://api.github.com/users/okutane/followers","following_url":"https://api.github.com/users/okutane/following{/other_user}","gists_url":"https://api.github.com/users/okutane/gists{/gist_id}","starred_url":"https://api.github.com/users/okutane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okutane/subscriptions","organizations_url":"https://api.github.com/users/okutane/orgs","repos_url":"https://api.github.com/users/okutane/repos","events_url":"https://api.github.com/users/okutane/events{/privacy}","received_events_url":"https://api.github.com/users/okutane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/okutane/cmake-edit","description":null,"fork":false,"url":"https://api.github.com/repos/okutane/cmake-edit","forks_url":"https://api.github.com/repos/okutane/cmake-edit/forks","keys_url":"https://api.github.com/repos/okutane/cmake-edit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/okutane/cmake-edit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/okutane/cmake-edit/teams","hooks_url":"https://api.github.com/repos/okutane/cmake-edit/hooks","issue_events_url":"https://api.github.com/repos/okutane/cmake-edit/issues/events{/number}","events_url":"https://api.github.com/repos/okutane/cmake-edit/events","assignees_url":"https://api.github.com/repos/okutane/cmake-edit/assignees{/user}","branches_url":"https://api.github.com/repos/okutane/cmake-edit/branches{/branch}","tags_url":"https://api.github.com/repos/okutane/cmake-edit/tags","blobs_url":"https://api.github.com/repos/okutane/cmake-edit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/okutane/cmake-edit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/okutane/cmake-edit/git/refs{/sha}","trees_url":"https://api.github.com/repos/okutane/cmake-edit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/okutane/cmake-edit/statuses/{sha}","languages_url":"https://api.github.com/repos/okutane/cmake-edit/languages","stargazers_url":"https://api.github.com/repos/okutane/cmake-edit/stargazers","contributors_url":"https://api.github.com/repos/okutane/cmake-edit/contributors","subscribers_url":"https://api.github.com/repos/okutane/cmake-edit/subscribers","subscription_url":"https://api.github.com/repos/okutane/cmake-edit/subscription","commits_url":"https://api.github.com/repos/okutane/cmake-edit/commits{/sha}","git_commits_url":"https://api.github.com/repos/okutane/cmake-edit/git/commits{/sha}","comments_url":"https://api.github.com/repos/okutane/cmake-edit/comments{/number}","issue_comment_url":"https://api.github.com/repos/okutane/cmake-edit/issues/comments{/number}","contents_url":"https://api.github.com/repos/okutane/cmake-edit/contents/{+path}","compare_url":"https://api.github.com/repos/okutane/cmake-edit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/okutane/cmake-edit/merges","archive_url":"https://api.github.com/repos/okutane/cmake-edit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/okutane/cmake-edit/downloads","issues_url":"https://api.github.com/repos/okutane/cmake-edit/issues{/number}","pulls_url":"https://api.github.com/repos/okutane/cmake-edit/pulls{/number}","milestones_url":"https://api.github.com/repos/okutane/cmake-edit/milestones{/number}","notifications_url":"https://api.github.com/repos/okutane/cmake-edit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/okutane/cmake-edit/labels{/name}","releases_url":"https://api.github.com/repos/okutane/cmake-edit/releases{/id}","deployments_url":"https://api.github.com/repos/okutane/cmake-edit/deployments","created_at":"2016-06-28T20:29:26Z","updated_at":"2016-07-07T06:17:09Z","pushed_at":"2016-08-29T01:21:28Z","git_url":"git://github.com/okutane/cmake-edit.git","ssh_url":"git@github.com:okutane/cmake-edit.git","clone_url":"https://github.com/okutane/cmake-edit.git","svn_url":"https://github.com/okutane/cmake-edit","homepage":null,"size":9568,"stargazers_count":0,"watchers_count":0,"language":"CMake","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"okutane:master","ref":"master","sha":"1d560a30a37697a78ba452d90b1fd7701db32514","user":{"login":"okutane","id":2418478,"avatar_url":"https://avatars.githubusercontent.com/u/2418478?v=3","gravatar_id":"","url":"https://api.github.com/users/okutane","html_url":"https://github.com/okutane","followers_url":"https://api.github.com/users/okutane/followers","following_url":"https://api.github.com/users/okutane/following{/other_user}","gists_url":"https://api.github.com/users/okutane/gists{/gist_id}","starred_url":"https://api.github.com/users/okutane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okutane/subscriptions","organizations_url":"https://api.github.com/users/okutane/orgs","repos_url":"https://api.github.com/users/okutane/repos","events_url":"https://api.github.com/users/okutane/events{/privacy}","received_events_url":"https://api.github.com/users/okutane/received_events","type":"User","site_admin":false},"repo":{"id":62172155,"name":"cmake-edit","full_name":"okutane/cmake-edit","owner":{"login":"okutane","id":2418478,"avatar_url":"https://avatars.githubusercontent.com/u/2418478?v=3","gravatar_id":"","url":"https://api.github.com/users/okutane","html_url":"https://github.com/okutane","followers_url":"https://api.github.com/users/okutane/followers","following_url":"https://api.github.com/users/okutane/following{/other_user}","gists_url":"https://api.github.com/users/okutane/gists{/gist_id}","starred_url":"https://api.github.com/users/okutane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/okutane/subscriptions","organizations_url":"https://api.github.com/users/okutane/orgs","repos_url":"https://api.github.com/users/okutane/repos","events_url":"https://api.github.com/users/okutane/events{/privacy}","received_events_url":"https://api.github.com/users/okutane/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/okutane/cmake-edit","description":null,"fork":false,"url":"https://api.github.com/repos/okutane/cmake-edit","forks_url":"https://api.github.com/repos/okutane/cmake-edit/forks","keys_url":"https://api.github.com/repos/okutane/cmake-edit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/okutane/cmake-edit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/okutane/cmake-edit/teams","hooks_url":"https://api.github.com/repos/okutane/cmake-edit/hooks","issue_events_url":"https://api.github.com/repos/okutane/cmake-edit/issues/events{/number}","events_url":"https://api.github.com/repos/okutane/cmake-edit/events","assignees_url":"https://api.github.com/repos/okutane/cmake-edit/assignees{/user}","branches_url":"https://api.github.com/repos/okutane/cmake-edit/branches{/branch}","tags_url":"https://api.github.com/repos/okutane/cmake-edit/tags","blobs_url":"https://api.github.com/repos/okutane/cmake-edit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/okutane/cmake-edit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/okutane/cmake-edit/git/refs{/sha}","trees_url":"https://api.github.com/repos/okutane/cmake-edit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/okutane/cmake-edit/statuses/{sha}","languages_url":"https://api.github.com/repos/okutane/cmake-edit/languages","stargazers_url":"https://api.github.com/repos/okutane/cmake-edit/stargazers","contributors_url":"https://api.github.com/repos/okutane/cmake-edit/contributors","subscribers_url":"https://api.github.com/repos/okutane/cmake-edit/subscribers","subscription_url":"https://api.github.com/repos/okutane/cmake-edit/subscription","commits_url":"https://api.github.com/repos/okutane/cmake-edit/commits{/sha}","git_commits_url":"https://api.github.com/repos/okutane/cmake-edit/git/commits{/sha}","comments_url":"https://api.github.com/repos/okutane/cmake-edit/comments{/number}","issue_comment_url":"https://api.github.com/repos/okutane/cmake-edit/issues/comments{/number}","contents_url":"https://api.github.com/repos/okutane/cmake-edit/contents/{+path}","compare_url":"https://api.github.com/repos/okutane/cmake-edit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/okutane/cmake-edit/merges","archive_url":"https://api.github.com/repos/okutane/cmake-edit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/okutane/cmake-edit/downloads","issues_url":"https://api.github.com/repos/okutane/cmake-edit/issues{/number}","pulls_url":"https://api.github.com/repos/okutane/cmake-edit/pulls{/number}","milestones_url":"https://api.github.com/repos/okutane/cmake-edit/milestones{/number}","notifications_url":"https://api.github.com/repos/okutane/cmake-edit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/okutane/cmake-edit/labels{/name}","releases_url":"https://api.github.com/repos/okutane/cmake-edit/releases{/id}","deployments_url":"https://api.github.com/repos/okutane/cmake-edit/deployments","created_at":"2016-06-28T20:29:26Z","updated_at":"2016-07-07T06:17:09Z","pushed_at":"2016-08-29T01:21:28Z","git_url":"git://github.com/okutane/cmake-edit.git","ssh_url":"git@github.com:okutane/cmake-edit.git","clone_url":"https://github.com/okutane/cmake-edit.git","svn_url":"https://github.com/okutane/cmake-edit","homepage":null,"size":9568,"stargazers_count":0,"watchers_count":0,"language":"CMake","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/okutane/cmake-edit/pulls/6"},"html":{"href":"https://github.com/okutane/cmake-edit/pull/6"},"issue":{"href":"https://api.github.com/repos/okutane/cmake-edit/issues/6"},"comments":{"href":"https://api.github.com/repos/okutane/cmake-edit/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/okutane/cmake-edit/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/okutane/cmake-edit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/okutane/cmake-edit/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/okutane/cmake-edit/statuses/a6dc2ca4e781165797f2df15bf3b566c754f36f9"}}}}
{"actor":{"display_login":"okutane"}}