1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
|
define ['jquery.mockjax'], ->
jQuery.mockjaxSettings.contentType = 'text/json';
jQuery.mockjaxSettings.responseTime = 250;
# GET /api/codingrules/app
jQuery.mockjax
url: "#{baseUrl}/api/codingrules/app"
responseText: JSON.stringify
qualityprofiles: [
{ key: 'sonarway', name: 'Sonar Way', lang: 'Java', parent: null },
{ key: 'qualityprofile1', name: 'Quality Profile 1', lang: 'Java', parent: 'sonarway' },
{ key: 'qualityprofile2', name: 'Quality Profile 2', lang: 'JavaScript', parent: 'sonarway' },
{ key: 'qualityprofile3', name: 'Quality Profile 3', lang: 'Java', parent: null },
]
languages:
java: 'Java'
javascript: 'JavaScript'
repositories:
'checkstyle': 'Checkstyle'
'common-java': 'Common SonarQube'
'findbugs': 'FindBugs'
'pmd': 'PMD'
'pmd-unit-tests': 'PMD Unit Tests'
'squid': 'SonarQube'
statuses:
'BETA': 'Beta'
'DEPRECATED': 'Deprecated'
'READY': 'Ready'
tags:
'brain-overload': 'brain-overload'
'bug': 'bug'
'comment': 'comment'
'convention': 'convention'
'error-handling': 'error-handling'
'formatting': 'formatting'
'java8': 'java8'
'multithreading': 'multithreading'
'naming': 'naming'
'pitfall': 'pitfall'
'security': 'security'
'size': 'size'
'unused': 'unused'
'unused-code': 'unused-code'
characteristics:
'1469': 'Changeability'
'1441': 'Changeability: Architecture related changeability'
'1470': 'Changeability: Data related changeability'
'1475': 'Changeability: Logic related changeability'
'1392': 'Efficiency'
'1377': 'Efficiency: Memory use'
'2965': 'Efficiency: Network use'
'1393': 'Efficiency: Processor use'
'1154': 'Maintainability'
'1022': 'Maintainability: Readability'
'1155': 'Maintainability: Understandability'
'988': 'Portability'
'977': 'Portability: Compiler related portability'
'989': 'Portability: Hardware related portability'
'994': 'Portability: Language related portability'
'1000': 'Portability: OS related portability'
'1006': 'Portability: Software related portability'
'1021': 'Portability: Time zone related portability'
'1551': 'Reliability'
'1496': 'Reliability: Architecture related reliability'
'1552': 'Reliability: Data related reliability'
'1596': 'Reliability: Exception handling'
'1622': 'Reliability: Fault tolerance'
'1629': 'Reliability: Instruction related reliability'
'1759': 'Reliability: Logic related reliability'
'2948': 'Reliability: Resource'
'1874': 'Reliability: Synchronization related reliability'
'1925': 'Reliability: Unit tests'
'975': 'Reusability'
'974': 'Reusability: Modularity'
'976': 'Reusability: Transportability'
'1345': 'Security'
'1335': 'Security: API abuse'
'1346': 'Security: Errors'
'1349': 'Security: Input validation and representation'
'1364': 'Security: Security features'
'1933': 'Testability'
'1932': 'Testability: Integration level testability'
'1934': 'Testability: Unit level testability'
messages:
'all': 'All'
'any': 'Any'
'apply': 'Apply'
'bold': 'Bold'
'bulk_change': 'Bulk Change'
'bulleted_point': 'Bulleted point'
'cancel': 'Cancel'
'change': 'Change'
'code': 'Code'
'delete': 'Delete'
'done': 'Done'
'edit': 'Edit'
'markdown.helplink': 'Markdown Help'
'moreCriteria': '+ More Criteria'
'save': 'Save'
'search_verb': 'Search'
'severity': 'Severity'
'update': 'Update'
'severity.BLOCKER': 'Blocker'
'severity.CRITICAL': 'Critical'
'severity.MAJOR': 'Major'
'severity.MINOR': 'Minor'
'severity.INFO': 'Info'
'coding_rules.activate': 'Activate'
'coding_rules.activate_in': 'Activate In'
'coding_rules.activate_in_quality_profile': 'Activate In Quality Profile'
'coding_rules.add_note': 'Add Note'
'coding_rules.available_since': 'Available Since'
'coding_rules.bulk_change': 'Bulk Change'
'coding_rules.change_severity': 'Change Severity'
'coding_rules.change_severity_in': 'Change Severity In'
'coding_rules.change_details': 'Change Details of Quality Profile'
'coding_rules.extend_description': 'Extend Description'
'coding_rules.deactivate_in': 'Deactivate In'
'coding_rules.deactivate': 'Deactivate'
'coding_rules.deactivate_in_quality_profile': 'Deactivate In Quality Profile'
'coding_rules.found': 'Found'
'coding_rules._inherits': 'inherits'
'coding_rules.key': 'Key:'
'coding_rules.new_search': 'New Search'
'coding_rules.no_results': 'No Coding Rules'
'coding_rules.order': 'Order'
'coding_rules.ordered_by': 'Ordered By'
'coding_rules.original': 'Original:'
'coding_rules.page': 'Coding Rules'
'coding_rules.parameters': 'Parameters'
'coding_rules.parameters.default_value': 'Default Value:'
'coding_rules.quality_profiles': 'Quality Profiles'
'coding_rules.quality_profile': 'Quality Profile'
'coding_rules.repository': 'Repository:'
'coding_rules.revert_to_parent_definition': 'Revert to Parent Definition'
'coding_rules._rules': 'rules'
'coding_rules.select_tag': 'Select Tag'
'coding_rules.filters.activation': 'Activation'
'coding_rules.filters.activation.active': 'Active'
'coding_rules.filters.activation.inactive': 'Inactive'
'coding_rules.filters.activation.help': 'Activation criterion is available when a quality profile is selected'
'coding_rules.filters.availableSince': 'Available Since'
'coding_rules.filters.characteristic': 'Characteristic'
'coding_rules.filters.description': 'Description'
'coding_rules.filters.quality_profile': 'Quality Profile'
'coding_rules.filters.inheritance': 'Inheritance'
'coding_rules.filters.inheritance.inactive': 'Inheritance criterion is available when an inherited quality profile is selected'
'coding_rules.filters.inheritance.not_inherited': 'Not Inherited'
'coding_rules.filters.inheritance.inherited': 'Inherited'
'coding_rules.filters.inheritance.overriden': 'Overriden'
'coding_rules.filters.key': 'Key'
'coding_rules.filters.language': 'Language'
'coding_rules.filters.name': 'Name'
'coding_rules.filters.repository': 'Repository'
'coding_rules.filters.severity': 'Severity'
'coding_rules.filters.status': 'Status'
'coding_rules.filters.tag': 'Tag'
'coding_rules.sort.creation_date': 'Creation Date'
'coding_rules.sort.name': 'Name'
# GET /api/codingrules/search
jQuery.mockjax
url: "#{baseUrl}/api/codingrules/search"
responseText: JSON.stringify
codingrules: [
{
name: 'Array designators "[]" should be located after the type in method signatures'
language: 'Java'
severity: 'MAJOR'
status: 'DEPRECATED'
},
{
name: 'Avoid Array Loops'
language: 'Java'
severity: 'CRITICAL'
status: 'READY'
},
{
name: 'Bad practice - Abstract class defines covariant compareTo() method'
language: 'Java'
severity: 'MAJOR'
status: 'READY'
},
{
name: 'Correctness - Use of class without a hashCode() method in a hashed data structure'
language: 'Java'
severity: 'MINOR'
status: 'BETA'
},
{
name: 'Useless Operation On Immutable'
language: 'Java'
severity: 'MAJOR'
status: 'READY'
}
]
paging:
total: 5
fTotal: '5'
# GET /api/codingrules/show
jQuery.mockjax
url: "#{baseUrl}/api/codingrules/show"
responseText: JSON.stringify
codingrule:
name: 'Array designators "[]" should be located after the type in method signatures'
language: 'Java'
tags: ['bug', 'comment', 'java8']
creationDate: '2013-10-15'
fCreationDate: 'Oct 15, 2013'
status: 'DEPRECATED'
repositoryName: 'SonarQube'
repositoryKey: 'squid'
characteristic: 'Reliability'
subcharacteristic: 'Data related reliability'
key: 'S1190'
parameters: [
{ key: 'someParameter', type: 'INT', default: 4, description: 'Some parameter description' }
]
description: '''
<p>
According to the Java Language Specification:
</p>
<pre>For compatibility with older versions of the Java SE platform,
the declaration of a method that returns an array is allowed to place (some or all of)
the empty bracket pairs that form the declaration of the array type after
the formal parameter list. This obsolescent syntax should not be used in new code.
</pre>
<p>The following code snippet illustrates this rule:</p>
<pre>public int getVector()[] { /* ... */ } // Non-Compliant
public int[] getVector() { /* ... */ } // Compliant
public int[] getMatrix()[] { /* ... */ } // Non-Compliant
public int[][] getMatrix() { /* ... */ } // Compliant
</pre>'''
extra: '''This note is here <b>only for test purposes</b>.'''
extraRaw: '''This note is here *only for test purposes*.'''
qualityProfiles: [
{
name: 'SonarWay'
key: 'sonarway'
severity: 'MINOR'
parameters: [
{ key: 'someParameter', value: 8 }
]
note:
username: 'Admin Admin'
html: '''<p>This note is here <b>only for test purposes</b>.</p>'''
raw: '''This note is here *only for test purposes*.'''
fCreationDate: 'less than a minute'
},
{
name: 'Quality Profile 1'
key: 'qualityprofile1'
severity: 'MAJOR'
parameters: [
{ key: 'someParameter', value: 6 }
]
inherits: 'sonarway'
}
]
# POST /api/codingrules/extend_description
jQuery.mockjax
url: "#{baseUrl}/api/codingrules/extend_description"
responseText: JSON.stringify
extra: '''This note is here <i>only for test purposes</i>.'''
extraRaw: '''This note is here *only for test purposes*.'''
# POST /api/codingrules/bulk_change
jQuery.mockjax
url: "#{baseUrl}/api/codingrules/bulk_change"
# POST /api/codingrules/set_tags
jQuery.mockjax
url: "#{baseUrl}/api/codingrules/set_tags"
# POST /api/codingrules/activate
jQuery.mockjax
url: "#{baseUrl}/api/codingrules/activate"
# POST /api/codingrules/note
jQuery.mockjax
url: "#{baseUrl}/api/codingrules/note"
responseText: JSON.stringify
note:
username: 'Admin Admin'
html: '''<p>This note is here <b>only for test purposes</b>.</p>'''
raw: '''This note is here *only for test purposes*.'''
fCreationDate: 'less than a minute'
# GET /api/qualityprofiles/list
jQuery.mockjax
url: "#{baseUrl}/api/qualityprofiles/list"
responseText: JSON.stringify
more: false
results: [
{ id: 'sonarway', text: 'Sonar Way', category: 'Java', parent: null },
{ id: 'qp1', text: 'Quality Profile 1', category: 'Java', parent: 'sonarway' },
{ id: 'qp2', text: 'Quality Profile 2', category: 'JavaScript', parent: 'sonarway' },
{ id: 'qp3', text: 'Quality Profile 3', category: 'Java', parent: null },
]
# GET /api/qualityprofiles/show
jQuery.mockjax
url: "#{baseUrl}/api/qualityprofiles/show"
responseText: JSON.stringify
qualityprofile:
id: 'sonarway', text: 'Sonar Way', category: 'Java', parent: null
|