{"action":"created","comment":{"url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/comments/72248085","id":72248085,"diff_hunk":"@@ -0,0 +1,180 @@\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.plugins.javascript.minify;\n+\n+import java.io.File;\n+import java.nio.charset.Charset;\n+import org.fest.assertions.BooleanAssert;\n+import org.junit.Test;\n+import org.junit.rules.ExpectedException;\n+import org.sonar.squidbridge.api.AnalysisException;\n+\n+import static org.fest.assertions.Assertions.assertThat;\n+\n+public class MinificationAssessorTest {\n+\n+  private final static String DIR = \"src/test/resources/minify/\";\n+\n+  @org.junit.Rule\n+  public final ExpectedException thrown = ExpectedException.none();\n+\n+  @Test\n+  public void assessOnFileName() {\n+    // the files below do not exist on the file system, as we just test their name - not their contents\n+    getAssert(\"file.min.js\").isTrue();\n+    getAssert(\"file-min.js\").isTrue();\n+    getAssert(\"file.not-js\").isFalse();\n+  }\n+\n+  @Test\n+  public void assessOnFileContents() {\n+    getAssert(\"file1.js\").isFalse();","path":"sonar-javascript-plugin/src/test/java/org/sonar/plugins/javascript/minify/MinificationAssessorTest.java","position":48,"original_position":48,"commit_id":"dd69012a93b79bc1e071bcfd47fdc505cd2c04c9","original_commit_id":"dd69012a93b79bc1e071bcfd47fdc505cd2c04c9","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":"@ivandalbosco These assertions are not obvious at all. I suggest to change the threshold from 35 to something much lower.","created_at":"2016-07-26T13:28:42Z","updated_at":"2016-07-26T13:28:42Z","html_url":"https://github.com/SonarSource/sonar-javascript/pull/299#discussion_r72248085","pull_request_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/299","_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/comments/72248085"},"html":{"href":"https://github.com/SonarSource/sonar-javascript/pull/299#discussion_r72248085"},"pull_request":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/299"}}},"pull_request":{"url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/299","id":78500343,"html_url":"https://github.com/SonarSource/sonar-javascript/pull/299","diff_url":"https://github.com/SonarSource/sonar-javascript/pull/299.diff","patch_url":"https://github.com/SonarSource/sonar-javascript/pull/299.patch","issue_url":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/299","number":299,"state":"open","locked":false,"title":"SONARJS-741 Improve detection of minified files","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-07-22T15:58:36Z","updated_at":"2016-07-26T13:28:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d697aa832595ef8c2f9206f640bd2ece721e32de","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/299/commits","review_comments_url":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/299/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/299/comments","statuses_url":"https://api.github.com/repos/SonarSource/sonar-javascript/statuses/dd69012a93b79bc1e071bcfd47fdc505cd2c04c9","head":{"label":"SonarSource:SONARJS-741","ref":"SONARJS-741","sha":"dd69012a93b79bc1e071bcfd47fdc505cd2c04c9","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-06-23T14:20:24Z","pushed_at":"2016-07-26T11:39:10Z","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":12797,"stargazers_count":77,"watchers_count":77,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":4,"forks":63,"open_issues":4,"watchers":77,"default_branch":"master"}},"base":{"label":"SonarSource:master","ref":"master","sha":"c6a3de3becd50fd2785e40fbae6bad3e4a443f43","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-06-23T14:20:24Z","pushed_at":"2016-07-26T11:39:10Z","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":12797,"stargazers_count":77,"watchers_count":77,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":63,"mirror_url":null,"open_issues_count":4,"forks":63,"open_issues":4,"watchers":77,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/299"},"html":{"href":"https://github.com/SonarSource/sonar-javascript/pull/299"},"issue":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/299"},"comments":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/issues/299/comments"},"review_comments":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/pulls/299/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/299/commits"},"statuses":{"href":"https://api.github.com/repos/SonarSource/sonar-javascript/statuses/dd69012a93b79bc1e071bcfd47fdc505cd2c04c9"}}}}
{"actor":{"display_login":"pynicolas"}}