aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-web
diff options
context:
space:
mode:
authorStas Vilchik <vilchiks@gmail.com>2015-01-06 17:05:37 +0100
committerStas Vilchik <vilchiks@gmail.com>2015-01-06 17:20:28 +0100
commit25d3cdf5bcc9a876b7c9c5a046e30dfd5b46d424 (patch)
treeadaa31d8a37cd88727ef4b90a7ab966678939cf1 /server/sonar-web
parent2cd3ef75dce8b978bc96ad3c15c1320c193fdd9d (diff)
downloadsonarqube-25d3cdf5bcc9a876b7c9c5a046e30dfd5b46d424.tar.gz
sonarqube-25d3cdf5bcc9a876b7c9c5a046e30dfd5b46d424.zip
SONAR-5807 On Rules page, display the number of unresolved issues in the details of a rule
Diffstat (limited to 'server/sonar-web')
-rw-r--r--server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs1
-rw-r--r--server/sonar-web/src/main/hbs/coding-rules/rule/coding-rules-rule-issues.hbs19
-rw-r--r--server/sonar-web/src/main/js/coding-rules/rule-details-view.js13
-rw-r--r--server/sonar-web/src/main/js/coding-rules/rule/rule-issues-view.js52
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-rule-should-have-permalink.js1
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-activate-profile.js1
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-custom-rules.js1
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-manual-rules.js1
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-custom-rules.js1
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-manual-rules.js1
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-custom-rules.js1
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-details.js1
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues.js42
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/app.json168
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/issues-search.json51
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/search.json47
-rw-r--r--server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/show.json76
17 files changed, 474 insertions, 3 deletions
diff --git a/server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs b/server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs
index 930576b5285..bfe4d7721e1 100644
--- a/server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs
+++ b/server/sonar-web/src/main/hbs/coding-rules/coding-rules-rule-details.hbs
@@ -17,3 +17,4 @@
<div class="js-rule-custom-rules"></div>
<div class="js-rule-profiles"></div>
+<div class="js-rule-issues"></div>
diff --git a/server/sonar-web/src/main/hbs/coding-rules/rule/coding-rules-rule-issues.hbs b/server/sonar-web/src/main/hbs/coding-rules/rule/coding-rules-rule-issues.hbs
new file mode 100644
index 00000000000..fd7628139e0
--- /dev/null
+++ b/server/sonar-web/src/main/hbs/coding-rules/rule/coding-rules-rule-issues.hbs
@@ -0,0 +1,19 @@
+<h3 class="coding-rules-detail-title">
+ {{t 'coding_rules.issues'}} (<a class="js-rule-issues" href="{{baseSearchUrl}}" target="_blank">{{total}}</a>)
+</h3>
+
+{{#notEmpty projects}}
+ <table class="coding-rules-detail-list coding-rules-most-violated-projects">
+ <tr>
+ <td class="coding-rules-detail-list-name" colspan="2">{{t 'coding_rules.most_violated_projects'}}</td>
+ </tr>
+ {{#each projects}}
+ <tr>
+ <td class="coding-rules-detail-list-name">{{name}}</td>
+ <td class="coding-rules-detail-list-parameters">
+ <a href="{{../baseSearchUrl}}|projectUuids={{val}}" target="_blank">{{count}}</a>
+ </td>
+ </tr>
+ {{/each}}
+ </table>
+{{/notEmpty}}
diff --git a/server/sonar-web/src/main/js/coding-rules/rule-details-view.js b/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
index d9b76e526d2..5ae027f524b 100644
--- a/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
+++ b/server/sonar-web/src/main/js/coding-rules/rule-details-view.js
@@ -8,7 +8,8 @@ define([
'coding-rules/rule/rule-parameters-view',
'coding-rules/rule/rule-profiles-view',
'coding-rules/rule/custom-rules-view',
- 'coding-rules/rule/manual-rule-creation-view'
+ 'coding-rules/rule/manual-rule-creation-view',
+ 'coding-rules/rule/rule-issues-view'
],
function (Backbone,
Marionette,
@@ -19,7 +20,8 @@ define([
ParamView,
ProfilesView,
CustomRulesView,
- ManualRuleCreationView) {
+ ManualRuleCreationView,
+ IssuesView) {
var $ = jQuery;
@@ -32,7 +34,8 @@ define([
descRegion: '.js-rule-description',
paramRegion: '.js-rule-parameters',
profilesRegion: '.js-rule-profiles',
- customRulesRegion: '.js-rule-custom-rules'
+ customRulesRegion: '.js-rule-custom-rules',
+ issuesRegion: '.js-rule-issues'
},
events: {
@@ -71,6 +74,10 @@ define([
model: this.model,
collection: this.customRules
}));
+ this.issuesRegion.show(new IssuesView({
+ app: this.options.app,
+ model: this.model
+ }));
this.$el.scrollParent().scrollTop(30);
},
diff --git a/server/sonar-web/src/main/js/coding-rules/rule/rule-issues-view.js b/server/sonar-web/src/main/js/coding-rules/rule/rule-issues-view.js
new file mode 100644
index 00000000000..31daddd1892
--- /dev/null
+++ b/server/sonar-web/src/main/js/coding-rules/rule/rule-issues-view.js
@@ -0,0 +1,52 @@
+define([
+ 'backbone.marionette',
+ 'templates/coding-rules'
+], function (Marionette, Templates) {
+
+ var $ = jQuery;
+
+ return Marionette.ItemView.extend({
+ template: Templates['coding-rules-rule-issues'],
+
+ initialize: function () {
+ var that = this;
+ this.total = null;
+ this.projects = [];
+ this.requestIssues().done(function () {
+ that.render();
+ });
+ },
+
+ requestIssues: function () {
+ var that = this,
+ url = baseUrl + '/api/issues/search',
+ options = {
+ rules: this.model.id,
+ resolved: false,
+ ps: 1,
+ facets: 'projectUuids'
+ };
+ return $.get(url, options).done(function (r) {
+ var projectsFacet = _.findWhere(r.facets, { property: 'projectUuids' }),
+ projects = projectsFacet != null ? projectsFacet.values : [];
+ projects = projects.map(function (project) {
+ var projectBase = _.findWhere(r.projects, { uuid: project.val });
+ return _.extend(project, {
+ name: projectBase != null ? projectBase.longName : ''
+ });
+ });
+ that.projects = projects;
+ that.total = r.total;
+ });
+ },
+
+ serializeData: function () {
+ return _.extend(Marionette.ItemView.prototype.serializeData.apply(this, arguments), {
+ total: this.total,
+ projects: this.projects,
+ baseSearchUrl: baseUrl + '/issues/search#resolved=false|rules=' + encodeURIComponent(this.model.id)
+ });
+ }
+ });
+
+});
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-rule-should-have-permalink.js b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-rule-should-have-permalink.js
index 75898fd15fe..6203fd61405 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-rule-should-have-permalink.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-rule-should-have-permalink.js
@@ -15,6 +15,7 @@ casper.test.begin('coding-rules-page-rule-permalink', 1, function (test) {
lib.mockRequestFromFile('/api/rules/app', 'app.json');
lib.mockRequestFromFile('/api/rules/search', 'search.json');
lib.mockRequestFromFile('/api/rules/show', 'show.json');
+ lib.mockRequest('/api/issues/search', '{}');
})
.then(function () {
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-activate-profile.js b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-activate-profile.js
index fe049606765..8c5e05d8cb4 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-activate-profile.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-activate-profile.js
@@ -16,6 +16,7 @@ casper.test.begin('coding-rules-page-should-activate-profile', 5, function (test
lib.mockRequestFromFile('/api/rules/search', 'search.json');
this.showMock = lib.mockRequestFromFile('/api/rules/show', 'show.json');
lib.mockRequest('/api/qualityprofiles/activate_rule', '{}');
+ lib.mockRequest('/api/issues/search', '{}');
})
.then(function () {
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-custom-rules.js b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-custom-rules.js
index 761a0d1819c..b0de4b2965f 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-custom-rules.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-custom-rules.js
@@ -18,6 +18,7 @@ casper.test.begin('coding-rules-page-should-delete-create-rules', 2, function (t
this.searchMock = lib.mockRequestFromFile('/api/rules/search', 'search.json');
lib.mockRequestFromFile('/api/rules/show', 'show.json');
lib.mockRequest('/api/rules/create', '{}');
+ lib.mockRequest('/api/issues/search', '{}');
})
.then(function () {
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-manual-rules.js b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-manual-rules.js
index a128ffa277c..86af5a83c42 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-manual-rules.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-create-manual-rules.js
@@ -16,6 +16,7 @@ casper.test.begin('coding-rules-page-should-delete-manual-rules', 3, function (t
lib.mockRequestFromFile('/api/rules/search', 'search.json');
lib.mockRequestFromFile('/api/rules/create', 'show.json');
lib.mockRequestFromFile('/api/rules/show', 'show.json');
+ lib.mockRequest('/api/issues/search', '{}');
})
.then(function () {
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-custom-rules.js b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-custom-rules.js
index fdce258714d..969919d7f9b 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-custom-rules.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-custom-rules.js
@@ -18,6 +18,7 @@ casper.test.begin('coding-rules-page-should-delete-custom-rules', 2, function (t
lib.mockRequestFromFile('/api/rules/search', 'search.json');
lib.mockRequestFromFile('/api/rules/show', 'show.json');
lib.mockRequest('/api/rules/delete', '{}');
+ lib.mockRequest('/api/issues/search', '{}');
})
.then(function () {
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-manual-rules.js b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-manual-rules.js
index 06fcd20739a..718feaaa276 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-manual-rules.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-delete-manual-rules.js
@@ -16,6 +16,7 @@ casper.test.begin('coding-rules-page-should-delete-manual-rules', 1, function (t
this.searchMock = lib.mockRequestFromFile('/api/rules/search', 'search-before.json');
lib.mockRequestFromFile('/api/rules/show', 'show.json');
lib.mockRequest('/api/rules/delete', '{}');
+ lib.mockRequest('/api/issues/search', '{}');
})
.then(function () {
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-custom-rules.js b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-custom-rules.js
index d96e7d78761..3215bad5d5e 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-custom-rules.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-custom-rules.js
@@ -17,6 +17,7 @@ casper.test.begin('coding-rules-page-should-show-custom-rules', 3, function (tes
{ data: { template_key: 'squid:ArchitecturalConstraint' } });
lib.mockRequestFromFile('/api/rules/search', 'search.json');
lib.mockRequestFromFile('/api/rules/show', 'show.json');
+ lib.mockRequest('/api/issues/search', '{}');
})
.then(function () {
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-details.js b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-details.js
index 1dfd0d48d28..11fe3b595f0 100644
--- a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-details.js
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-details.js
@@ -15,6 +15,7 @@ casper.test.begin('coding-rules-page-should-show-details', 20, function (test) {
lib.mockRequestFromFile('/api/rules/app', 'app.json');
lib.mockRequestFromFile('/api/rules/search', 'search.json');
lib.mockRequestFromFile('/api/rules/show', 'show.json');
+ lib.mockRequest('/api/issues/search', '{}');
})
.then(function () {
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues.js b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues.js
new file mode 100644
index 00000000000..dd52ba03187
--- /dev/null
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues.js
@@ -0,0 +1,42 @@
+/* global casper:false */
+
+var lib = require('../lib');
+
+lib.initMessages();
+lib.changeWorkingDirectory('coding-rules-page-should-show-rule-issues');
+
+
+casper.test.begin('coding-rules-page-should-show-rule-issues', 5, function (test) {
+ casper
+ .start(lib.buildUrl('coding-rules'), function () {
+ lib.setDefaultViewport();
+
+ lib.mockRequest('/api/l10n/index', '{}');
+ lib.mockRequestFromFile('/api/rules/app', 'app.json');
+ lib.mockRequestFromFile('/api/rules/search', 'search.json');
+ lib.mockRequestFromFile('/api/rules/show', 'show.json');
+ lib.mockRequestFromFile('/api/issues/search', 'issues-search.json');
+ })
+
+ .then(function () {
+ casper.waitForSelector('.coding-rule.selected', function () {
+ casper.click('.coding-rule.selected .js-rule');
+ });
+ })
+
+ .then(function () {
+ casper.waitForSelector('.coding-rules-most-violated-projects');
+ })
+
+ .then(function () {
+ test.assertSelectorContains('.js-rule-issues', '7');
+ test.assertSelectorContains('.coding-rules-most-violated-projects', 'SonarQube');
+ test.assertSelectorContains('.coding-rules-most-violated-projects', '2');
+ test.assertSelectorContains('.coding-rules-most-violated-projects', 'SonarQube Runner');
+ test.assertSelectorContains('.coding-rules-most-violated-projects', '1');
+ })
+
+ .run(function () {
+ test.done();
+ });
+});
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/app.json b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/app.json
new file mode 100644
index 00000000000..4f3319c8707
--- /dev/null
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/app.json
@@ -0,0 +1,168 @@
+{
+ "canWrite": false,
+ "qualityprofiles": [
+ {
+ "key": "java-default-with-mojo-conventions-49307",
+ "name": "Default - Maven Conventions",
+ "lang": "java",
+ "parentKey": "java-top-profile-without-formatting-conventions-50037"
+ },
+ {
+ "key": "java-default-with-sonarsource-conventions-27339",
+ "name": "Default - SonarSource conventions",
+ "lang": "java",
+ "parentKey": "java-top-profile-without-formatting-conventions-50037"
+ },
+ {
+ "key": "java-top-profile-without-formatting-conventions-50037",
+ "name": "Default - Top",
+ "lang": "java"
+ },
+ {
+ "key": "java-findbugs-14954",
+ "name": "FindBugs",
+ "lang": "java"
+ },
+ {
+ "key": "java-for-sq-java-plugin-only-92289",
+ "name": "For SQ Java Plugin Only",
+ "lang": "java",
+ "parentKey": "java-default-with-sonarsource-conventions-27339"
+ },
+ {
+ "key": "java-for-sq-only-95381",
+ "name": "For SQ Only",
+ "lang": "java",
+ "parentKey": "java-default-with-sonarsource-conventions-27339"
+ },
+ {
+ "key": "php-psr-2-06315",
+ "name": "PSR-2",
+ "lang": "php"
+ },
+ {
+ "key": "java-sonar-way-80423",
+ "name": "Sonar way",
+ "lang": "java"
+ },
+ {
+ "key": "js-sonar-way",
+ "name": "Sonar way",
+ "lang": "js"
+ },
+ {
+ "key": "php-sonar-way-05548",
+ "name": "Sonar way",
+ "lang": "php"
+ },
+ {
+ "key": "py-sonar-way-80265",
+ "name": "Sonar way",
+ "lang": "py"
+ },
+ {
+ "key": "java-without-findbugs",
+ "name": "Without Findbugs",
+ "lang": "java"
+ }
+ ],
+ "languages": {
+ "py": "Python",
+ "js": "JavaScript",
+ "php": "PHP",
+ "java": "Java"
+ },
+ "repositories": [
+ {
+ "key": "common-java",
+ "name": "Common SonarQube",
+ "language": "java"
+ },
+ {
+ "key": "common-js",
+ "name": "Common SonarQube",
+ "language": "js"
+ },
+ {
+ "key": "common-php",
+ "name": "Common SonarQube",
+ "language": "php"
+ },
+ {
+ "key": "common-py",
+ "name": "Common SonarQube",
+ "language": "py"
+ },
+ {
+ "key": "Pylint",
+ "name": "Pylint",
+ "language": "py"
+ },
+ {
+ "key": "javascript",
+ "name": "SonarQube",
+ "language": "js"
+ },
+ {
+ "key": "php",
+ "name": "SonarQube",
+ "language": "php"
+ },
+ {
+ "key": "python",
+ "name": "SonarQube",
+ "language": "py"
+ },
+ {
+ "key": "squid",
+ "name": "SonarQube",
+ "language": "java"
+ }
+ ],
+ "statuses": {
+ "BETA": "Beta",
+ "DEPRECATED": "Deprecated",
+ "READY": "Ready"
+ },
+ "characteristics": {
+ "UNDERSTANDABILITY": "Maintainability: Understandability",
+ "MAINTAINABILITY": "Maintainability",
+ "TIME_ZONE_RELATED_PORTABILITY": "Portability: Time zone related portability",
+ "READABILITY": "Maintainability: Readability",
+ "SECURITY_FEATURES": "Security: Security features",
+ "ARCHITECTURE_RELIABILITY": "Reliability: Architecture related reliability",
+ "OS_RELATED_PORTABILITY": "Portability: OS related portability",
+ "EXCEPTION_HANDLING": "Reliability: Exception handling",
+ "LOGIC_CHANGEABILITY": "Changeability: Logic related changeability",
+ "SOFTWARE_RELATED_PORTABILITY": "Portability: Software related portability",
+ "INPUT_VALIDATION_AND_REPRESENTATION": "Security: Input validation and representation",
+ "LANGUAGE_RELATED_PORTABILITY": "Portability: Language related portability",
+ "ERRORS": "Security: Errors",
+ "SECURITY": "Security",
+ "RELIABILITY": "Reliability",
+ "PORTABILITY": "Portability",
+ "HARDWARE_RELATED_PORTABILITY": "Portability: Hardware related portability",
+ "SYNCHRONIZATION_RELIABILITY": "Reliability: Synchronization related reliability",
+ "TRANSPORTABILITY": "Reusability: Transportability",
+ "COMPILER_RELATED_PORTABILITY": "Portability: Compiler related portability",
+ "RESOURCE_RELIABILITY": "Reliability: Resource",
+ "CPU_EFFICIENCY": "Efficiency: Processor use",
+ "EFFICIENCY": "Efficiency",
+ "CHANGEABILITY": "Changeability",
+ "DATA_CHANGEABILITY": "Changeability: Data related changeability",
+ "API_ABUSE": "Security: API abuse",
+ "ARCHITECTURE_CHANGEABILITY": "Changeability: Architecture related changeability",
+ "UNIT_TESTS": "Reliability: Unit tests",
+ "INSTRUCTION_RELIABILITY": "Reliability: Instruction related reliability",
+ "REUSABILITY": "Reusability",
+ "MODULARITY": "Reusability: Modularity",
+ "UNIT_TESTABILITY": "Testability: Unit level testability",
+ "TESTABILITY": "Testability",
+ "INTEGRATION_TESTABILITY": "Testability: Integration level testability",
+ "NETWORK_USE": "Efficiency: Network use",
+ "MEMORY_EFFICIENCY": "Efficiency: Memory use",
+ "DATA_RELIABILITY": "Reliability: Data related reliability",
+ "FAULT_TOLERANCE": "Reliability: Fault tolerance",
+ "LOGIC_RELIABILITY": "Reliability: Logic related reliability"
+ }
+}
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/issues-search.json b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/issues-search.json
new file mode 100644
index 00000000000..511b9288285
--- /dev/null
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/issues-search.json
@@ -0,0 +1,51 @@
+{
+ "total": 7,
+ "p": 1,
+ "ps": 1,
+ "projects": [
+ {
+ "uuid": "3b22f38e-ad68-4792-9791-1435584a686c",
+ "key": "org.codehaus.sonar.runner:sonar-runner",
+ "id": 17226,
+ "qualifier": "TRK",
+ "name": "SonarQube Runner",
+ "longName": "SonarQube Runner"
+ },
+ {
+ "uuid": "69e57151-be0d-4157-adff-c06741d88879",
+ "key": "org.codehaus.sonar:sonar",
+ "id": 2865,
+ "qualifier": "TRK",
+ "name": "SonarQube",
+ "longName": "SonarQube"
+ }
+ ],
+ "components": [],
+ "issues": [],
+ "rules": [],
+ "users": [],
+ "languages": [],
+ "maxResultsReached": false,
+ "paging": {
+ "pageIndex": 1,
+ "pageSize": 1,
+ "total": 7,
+ "fTotal": "7",
+ "pages": 7
+ },
+ "facets": [
+ {
+ "property": "projectUuids",
+ "values": [
+ {
+ "val": "69e57151-be0d-4157-adff-c06741d88879",
+ "count": 2
+ },
+ {
+ "val": "3b22f38e-ad68-4792-9791-1435584a686c",
+ "count": 1
+ }
+ ]
+ }
+ ]
+}
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/search.json b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/search.json
new file mode 100644
index 00000000000..558be10513e
--- /dev/null
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/search.json
@@ -0,0 +1,47 @@
+{
+ "total": 1,
+ "p": 1,
+ "ps": 200,
+ "rules": [
+ {
+ "key": "squid:S2096",
+ "name": "\"main\" should not \"throw\" anything",
+ "lang": "java",
+ "langName": "Java",
+ "sysTags": [
+ "bug"
+ ],
+ "tags": [],
+ "status": "READY"
+ }
+ ],
+ "facets": [
+ {
+ "property": "tags",
+ "values": [
+ {
+ "val": "bug",
+ "count": 1
+ }
+ ]
+ },
+ {
+ "property": "languages",
+ "values": [
+ {
+ "val": "java",
+ "count": 1
+ }
+ ]
+ },
+ {
+ "property": "repositories",
+ "values": [
+ {
+ "val": "squid",
+ "count": 1
+ }
+ ]
+ }
+ ]
+}
diff --git a/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/show.json b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/show.json
new file mode 100644
index 00000000000..274b587bfb2
--- /dev/null
+++ b/server/sonar-web/src/main/js/tests/e2e/tests/coding-rules-page-should-show-rule-issues/show.json
@@ -0,0 +1,76 @@
+{
+ "rule": {
+ "key": "squid:S1181",
+ "repo": "squid",
+ "name": "Throwable and Error classes should not be caught",
+ "createdAt": "2013-08-09T14:40:54+0200",
+ "severity": "BLOCKER",
+ "status": "READY",
+ "internalKey": "S1181",
+ "isTemplate": false,
+ "tags": [],
+ "sysTags": [
+ "error-handling"
+ ],
+ "lang": "java",
+ "langName": "Java",
+ "htmlDesc": "<p>\n<code>Throwable</code> is the superclass of all errors and exceptions in Java.\n<code>Error</code> is the superclass of all errors which are not meant to be caught by applications.\n</p>\n\n<p>\nCatching either <code>Throwable</code> or <code>Error</code> will also catch <code>OutOfMemoryError</code> or <code>InternalError</code> from which an application should not attempt to recover.\n</p>\n\n<p>Only <code>Exception</code> and its subclasses should be caught.</p>\n\n<h2>Noncompliant Code Example</h2>\n\n<pre>\ntry { /* ... */ } catch (Throwable t) { /* ... */ }\ntry { /* ... */ } catch (Error e) { /* ... */ } \n</pre>\n\n<h2>Compliant Solution</h2>\n\n<pre>\ntry { /* ... */ } catch (Exception e) { /* ... */ } \ntry { /* ... */ } catch (RuntimeException e) { /* ... */ } \ntry { /* ... */ } catch (MyException e) { /* ... */ } \n</pre>",
+ "defaultDebtChar": "RELIABILITY",
+ "defaultDebtSubChar": "EXCEPTION_HANDLING",
+ "debtChar": "RELIABILITY",
+ "debtSubChar": "EXCEPTION_HANDLING",
+ "debtCharName": "Reliability",
+ "debtSubCharName": "Exception handling",
+ "defaultDebtRemFnType": "CONSTANT_ISSUE",
+ "defaultDebtRemFnOffset": "20min",
+ "debtOverloaded": true,
+ "debtRemFnType": "LINEAR",
+ "debtRemFnCoeff": "20min",
+ "params": [
+ {
+ "key": "max",
+ "htmlDesc": "Maximum authorized number of parameters",
+ "type": "INTEGER",
+ "defaultValue": "7"
+ }
+ ]
+ },
+ "actives": [
+ {
+ "qProfile": "java-top-profile-without-formatting-conventions-50037",
+ "inherit": "NONE",
+ "severity": "BLOCKER",
+ "params": []
+ },
+ {
+ "qProfile": "java-default-with-sonarsource-conventions-27339",
+ "inherit": "INHERITED",
+ "severity": "BLOCKER",
+ "params": []
+ },
+ {
+ "qProfile": "java-for-sq-java-plugin-only-92289",
+ "inherit": "INHERITED",
+ "severity": "BLOCKER",
+ "params": []
+ },
+ {
+ "qProfile": "java-for-sq-only-95381",
+ "inherit": "INHERITED",
+ "severity": "BLOCKER",
+ "params": []
+ },
+ {
+ "qProfile": "java-default-with-mojo-conventions-49307",
+ "inherit": "INHERITED",
+ "severity": "BLOCKER",
+ "params": []
+ },
+ {
+ "qProfile": "java-sonar-way-80423",
+ "inherit": "NONE",
+ "severity": "BLOCKER",
+ "params": []
+ }
+ ]
+}