cppcheck-py 2.18.0__py3-none-win_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (86) hide show
  1. cppcheck/__init__.py +55 -0
  2. cppcheck/cppcheck-2.18.0.tar.gz +0 -0
  3. cppcheck/data/addons/__init__.py +0 -0
  4. cppcheck/data/addons/cppcheck.py +41 -0
  5. cppcheck/data/addons/cppcheckdata.py +1727 -0
  6. cppcheck/data/addons/findcasts.py +32 -0
  7. cppcheck/data/addons/misc.py +163 -0
  8. cppcheck/data/addons/misra.py +5168 -0
  9. cppcheck/data/addons/misra_9.py +559 -0
  10. cppcheck/data/addons/naming.py +92 -0
  11. cppcheck/data/addons/namingng.py +420 -0
  12. cppcheck/data/addons/runaddon.py +16 -0
  13. cppcheck/data/addons/threadsafety.py +350 -0
  14. cppcheck/data/addons/y2038.py +241 -0
  15. cppcheck/data/cfg/avr.cfg +402 -0
  16. cppcheck/data/cfg/bento4.cfg +142 -0
  17. cppcheck/data/cfg/boost.cfg +1284 -0
  18. cppcheck/data/cfg/bsd.cfg +567 -0
  19. cppcheck/data/cfg/cairo.cfg +89 -0
  20. cppcheck/data/cfg/cppcheck-lib.cfg +72 -0
  21. cppcheck/data/cfg/cppunit.cfg +48 -0
  22. cppcheck/data/cfg/dpdk.cfg +11 -0
  23. cppcheck/data/cfg/embedded_sql.cfg +4 -0
  24. cppcheck/data/cfg/emscripten.cfg +108 -0
  25. cppcheck/data/cfg/ginac.cfg +12848 -0
  26. cppcheck/data/cfg/gnu.cfg +1738 -0
  27. cppcheck/data/cfg/googletest.cfg +62 -0
  28. cppcheck/data/cfg/gtk.cfg +23082 -0
  29. cppcheck/data/cfg/icu.cfg +221 -0
  30. cppcheck/data/cfg/kde.cfg +92 -0
  31. cppcheck/data/cfg/libcerror.cfg +203 -0
  32. cppcheck/data/cfg/libcurl.cfg +487 -0
  33. cppcheck/data/cfg/libsigc++.cfg +36 -0
  34. cppcheck/data/cfg/lua.cfg +316 -0
  35. cppcheck/data/cfg/mfc.cfg +271 -0
  36. cppcheck/data/cfg/microsoft_atl.cfg +40 -0
  37. cppcheck/data/cfg/microsoft_sal.cfg +490 -0
  38. cppcheck/data/cfg/microsoft_unittest.cfg +20 -0
  39. cppcheck/data/cfg/motif.cfg +318 -0
  40. cppcheck/data/cfg/nspr.cfg +38 -0
  41. cppcheck/data/cfg/ntl.cfg +6907 -0
  42. cppcheck/data/cfg/opencv2.cfg +132 -0
  43. cppcheck/data/cfg/opengl.cfg +581 -0
  44. cppcheck/data/cfg/openmp.cfg +157 -0
  45. cppcheck/data/cfg/openssl.cfg +174 -0
  46. cppcheck/data/cfg/pcre.cfg +165 -0
  47. cppcheck/data/cfg/posix.cfg +6445 -0
  48. cppcheck/data/cfg/protobuf.cfg +10 -0
  49. cppcheck/data/cfg/python.cfg +674 -0
  50. cppcheck/data/cfg/qt.cfg +5500 -0
  51. cppcheck/data/cfg/ruby.cfg +142 -0
  52. cppcheck/data/cfg/sdl.cfg +354 -0
  53. cppcheck/data/cfg/selinux.cfg +3621 -0
  54. cppcheck/data/cfg/sfml.cfg +301 -0
  55. cppcheck/data/cfg/sqlite3.cfg +1571 -0
  56. cppcheck/data/cfg/std.cfg +9205 -0
  57. cppcheck/data/cfg/tinyxml2.cfg +37 -0
  58. cppcheck/data/cfg/vcl.cfg +4 -0
  59. cppcheck/data/cfg/windows.cfg +17237 -0
  60. cppcheck/data/cfg/wxsqlite3.cfg +1955 -0
  61. cppcheck/data/cfg/wxsvg.cfg +16905 -0
  62. cppcheck/data/cfg/wxwidgets.cfg +17243 -0
  63. cppcheck/data/cfg/zephyr.cfg +113 -0
  64. cppcheck/data/cfg/zlib.cfg +1450 -0
  65. cppcheck/data/cppcheck-htmlreport +1079 -0
  66. cppcheck/data/cppcheck.exe +0 -0
  67. cppcheck/data/platforms/aix_ppc64.xml +18 -0
  68. cppcheck/data/platforms/arm32-wchar_t2.xml +18 -0
  69. cppcheck/data/platforms/arm32-wchar_t4.xml +18 -0
  70. cppcheck/data/platforms/arm64-wchar_t2.xml +18 -0
  71. cppcheck/data/platforms/arm64-wchar_t4.xml +18 -0
  72. cppcheck/data/platforms/avr8.xml +18 -0
  73. cppcheck/data/platforms/cray_sv1.xml +18 -0
  74. cppcheck/data/platforms/elbrus-e1cp.xml +18 -0
  75. cppcheck/data/platforms/mips32.xml +18 -0
  76. cppcheck/data/platforms/msp430_eabi_large_datamodel.xml +18 -0
  77. cppcheck/data/platforms/pic16.xml +18 -0
  78. cppcheck/data/platforms/pic8-enhanced.xml +18 -0
  79. cppcheck/data/platforms/pic8.xml +18 -0
  80. cppcheck/data/platforms/unix32-unsigned.xml +18 -0
  81. cppcheck/data/platforms/unix64-unsigned.xml +18 -0
  82. cppcheck_py-2.18.0.dist-info/METADATA +76 -0
  83. cppcheck_py-2.18.0.dist-info/RECORD +86 -0
  84. cppcheck_py-2.18.0.dist-info/WHEEL +5 -0
  85. cppcheck_py-2.18.0.dist-info/entry_points.txt +4 -0
  86. cppcheck_py-2.18.0.dist-info/licenses/LICENSE.md +191 -0
@@ -0,0 +1,1079 @@
1
+ #!/usr/bin/env python3
2
+
3
+ from __future__ import unicode_literals
4
+
5
+ from datetime import date
6
+ import argparse
7
+ import io
8
+ import locale
9
+ import operator
10
+ import os
11
+ import re
12
+ import sys
13
+ import subprocess
14
+ import time
15
+
16
+ from collections import Counter
17
+ from pygments import highlight
18
+ from pygments.lexers import guess_lexer, guess_lexer_for_filename
19
+ from pygments.formatters import HtmlFormatter # pylint: disable=no-name-in-module
20
+ from pygments.util import ClassNotFound
21
+ from xml.sax import parse as xml_parse
22
+ from xml.sax import SAXParseException as XmlParseException
23
+ from xml.sax.handler import ContentHandler as XmlContentHandler
24
+ from xml.sax.saxutils import escape
25
+ """
26
+ Turns a cppcheck xml file into a browsable html report along
27
+ with syntax highlighted source code.
28
+ """
29
+
30
+ STYLE_FILE = """
31
+ body {
32
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
33
+ font-size: 13px;
34
+ line-height: 1.5;
35
+ height: 100%;
36
+ margin: 0;
37
+ }
38
+
39
+ #wrapper {
40
+ position: fixed;
41
+ height: 100vh;
42
+ width: 100vw;
43
+ display: grid;
44
+ grid-template-rows: fit-content(8rem) auto fit-content(8rem);
45
+ grid-template-columns: fit-content(25%) 1fr;
46
+ grid-template-areas:
47
+ "header header"
48
+ "menu content"
49
+ "footer footer";
50
+ }
51
+
52
+ h1 {
53
+ margin: 0 0 8px -2px;
54
+ font-size: 175%;
55
+ }
56
+
57
+ .header {
58
+ padding: 0 0 5px 15px;
59
+ grid-area: header;
60
+ border-bottom: thin solid #aaa;
61
+ }
62
+
63
+ .footer {
64
+ grid-area: footer;
65
+ border-top: thin solid #aaa;
66
+ font-size: 85%;
67
+
68
+ }
69
+
70
+ .footer > p {
71
+ margin: 4px;
72
+ }
73
+
74
+ #menu,
75
+ #menu_index {
76
+ grid-area: menu;
77
+ text-align: left;
78
+ overflow: auto;
79
+ padding: 0 23px 15px 15px;
80
+ border-right: thin solid #aaa;
81
+ min-width: 200px;
82
+ }
83
+
84
+ #menu > a {
85
+ display: block;
86
+ margin-left: 10px;
87
+ font-size: 12px;
88
+ }
89
+
90
+ #content,
91
+ #content_index {
92
+ grid-area: content;
93
+ padding: 0px 5px 15px 15px;
94
+ overflow: auto;
95
+ }
96
+
97
+ label {
98
+ white-space: nowrap;
99
+ }
100
+
101
+ label.checkBtn.disabled {
102
+ color: #606060;
103
+ background: #e0e0e0;
104
+ font-style: italic;
105
+ }
106
+
107
+ label.checkBtn, input[type="text"] {
108
+ border: 1px solid grey;
109
+ border-radius: 4px;
110
+ box-shadow: 1px 1px inset;
111
+ padding: 1px 5px;
112
+ }
113
+
114
+ label.checkBtn {
115
+ white-space: nowrap;
116
+ background: #ccddff;
117
+ }
118
+
119
+ label.unchecked {
120
+ background: #eff8ff;
121
+ box-shadow: 1px 1px 1px;
122
+ }
123
+
124
+ label.checkBtn:hover, label.unchecked:hover{
125
+ box-shadow: 0 0 2px;
126
+ }
127
+
128
+ label.disabled:hover {
129
+ box-shadow: 1px 1px inset;
130
+ }
131
+
132
+ label.checkBtn > input {
133
+ display:none;
134
+ }
135
+
136
+ .summaryTable {
137
+ width: 100%;
138
+ }
139
+
140
+ table.summaryTable td { padding: 0 5px 0 5px; }
141
+
142
+ .statHeader, .severityHeader, .classificationHeader {
143
+ font-weight: bold;
144
+ }
145
+
146
+ .warning {
147
+ background-color: #ffffa7;
148
+ }
149
+
150
+ .error {
151
+ background-color: #ffb7b7;
152
+ }
153
+
154
+ .error2 {
155
+ background-color: #faa;
156
+ display: inline-block;
157
+ margin-left: 4px;
158
+ }
159
+
160
+ .inconclusive {
161
+ background-color: #b6b6b4;
162
+ }
163
+
164
+ .inconclusive2 {
165
+ background-color: #b6b6b4;
166
+ display: inline-block;
167
+ margin-left: 4px;
168
+ }
169
+
170
+ .verbose {
171
+ display: inline-block;
172
+ vertical-align: top;
173
+ cursor: help;
174
+ }
175
+
176
+ .verbose .content {
177
+ display: none;
178
+ position: absolute;
179
+ padding: 10px;
180
+ margin: 4px;
181
+ max-width: 40%;
182
+ white-space: pre-wrap;
183
+ border: 1px solid #000;
184
+ background-color: #ffffcc;
185
+ cursor: auto;
186
+ }
187
+
188
+ .highlight .hll {
189
+ padding: 1px;
190
+ }
191
+
192
+ .highlighttable {
193
+ background-color: #fff;
194
+ position: relative;
195
+ margin: -10px;
196
+ }
197
+
198
+ .linenos {
199
+ border-right: thin solid #aaa;
200
+ color: #d3d3d3;
201
+ padding-right: 6px;
202
+ }
203
+
204
+ .id-filtered, .severity-filtered, .classification-filtered, .file-filtered, .tool-filtered, .text-filtered {
205
+ visibility: collapse;
206
+ }
207
+ """
208
+
209
+ HTML_HEAD = """
210
+ <!doctype html>
211
+ <html lang="en">
212
+ <head>
213
+ <meta charset="utf-8">
214
+ <title>Cppcheck - HTML report - %s</title>
215
+ <link rel="stylesheet" href="style.css">
216
+ <style>
217
+ %s
218
+ </style>
219
+ <script>
220
+ function getStyle(el, styleProp) {
221
+ var y;
222
+
223
+ if (el.currentStyle) {
224
+ y = el.currentStyle[styleProp];
225
+ } else if (window.getComputedStyle) {
226
+ y = document.defaultView.getComputedStyle(el, null).getPropertyValue(styleProp);
227
+ }
228
+
229
+ return y;
230
+ }
231
+
232
+ function toggle() {
233
+ var el = this.expandable_content;
234
+ var mark = this.expandable_marker;
235
+
236
+ if (el.style.display === "block") {
237
+ el.style.display = "none";
238
+ mark.textContent = "[+]";
239
+ } else {
240
+ el.style.display = "block";
241
+ mark.textContent = "[-]";
242
+ }
243
+ }
244
+
245
+ function initExpandables() {
246
+ var elements = document.querySelectorAll(".expandable");
247
+
248
+ for (var i = 0, len = elements.length; i < len; i++) {
249
+ var el = elements[i];
250
+ var clickable = el.querySelector("span");
251
+ var marker = clickable.querySelector(".marker");
252
+ var content = el.querySelector(".content");
253
+ var width = clickable.clientWidth - parseInt(getStyle(content, "padding-left")) - parseInt(getStyle(content, "padding-right"));
254
+ content.style.width = width + "px";
255
+ clickable.expandable_content = content;
256
+ clickable.expandable_marker = marker;
257
+ clickable.addEventListener("click", toggle);
258
+ }
259
+ }
260
+
261
+ function toggleDisplay(cb) {
262
+ var elements = document.querySelectorAll("." + cb.id);
263
+
264
+ for (var i = 0, len = elements.length; i < len; i++) {
265
+ elements[i].classList.toggle("id-filtered", !cb.checked);
266
+ }
267
+
268
+ updateFileRows();
269
+ }
270
+
271
+ function toggleSeverity(cb) {
272
+ cb.parentElement.classList.toggle("unchecked", !cb.checked);
273
+ var elements = document.querySelectorAll(".sev_" + cb.id);
274
+
275
+ for (var i = 0, len = elements.length; i < len; i++) {
276
+ elements[i].classList.toggle("severity-filtered", !cb.checked);
277
+ }
278
+
279
+ updateFileRows();
280
+ }
281
+
282
+ function toggleClassification(cb) {
283
+ cb.parentElement.classList.toggle("unchecked", !cb.checked);
284
+ var elements = document.querySelectorAll(".class_" + cb.id);
285
+
286
+ for (var i = 0, len = elements.length; i < len; i++) {
287
+ elements[i].classList.toggle("classification-filtered", !cb.checked);
288
+ }
289
+
290
+ updateFileRows();
291
+ }
292
+
293
+ function toggleTool(cb) {
294
+ cb.parentElement.classList.toggle("unchecked", !cb.checked);
295
+
296
+ var elements;
297
+ if (cb.id == "clang-tidy")
298
+ elements = document.querySelectorAll("[class^=clang-tidy-]");
299
+ else
300
+ elements = document.querySelectorAll(".issue:not([class^=clang-tidy-])");
301
+
302
+ for (var i = 0, len = elements.length; i < len; i++) {
303
+ elements[i].classList.toggle("tool-filtered", !cb.checked);
304
+ }
305
+
306
+ updateFileRows();
307
+ }
308
+
309
+ function toggleAll() {
310
+ var elements = document.querySelectorAll(".idToggle");
311
+
312
+ // starting from 1 since 0 is the "toggle all" input
313
+ for (var i = 1, len = elements.length; i < len; i++) {
314
+ var changed = elements[i].checked != elements[0].checked;
315
+ if (changed) {
316
+ elements[i].checked = elements[0].checked;
317
+ toggleDisplay(elements[i]);
318
+ }
319
+ }
320
+ }
321
+
322
+ function filterFile(filter) {
323
+ var elements = document.querySelectorAll(".fileEntry");
324
+
325
+ for (var i = 0, len = elements.length; i < len; i++) {
326
+ var visible = elements[i].querySelector("tr").querySelector("td").textContent.toLowerCase().includes(filter.toLowerCase());
327
+ elements[i].classList.toggle("text-filtered", !visible);
328
+ }
329
+ }
330
+
331
+ function filterText(text) {
332
+ filter = text.toLowerCase();
333
+ var elements = document.querySelectorAll(".issue");
334
+
335
+ for (var i = 0, len = elements.length; i < len; i++) {
336
+ var visible = false;
337
+ var fields = elements[i].querySelectorAll("td");
338
+ for (var n = 0, num = fields.length; n < num; n++) {
339
+ if (fields[n].textContent.toLowerCase().includes(filter)) {
340
+ visible = true;
341
+ break;
342
+ }
343
+ }
344
+ elements[i].classList.toggle("text-filtered", !visible);
345
+ }
346
+
347
+ updateFileRows();
348
+ }
349
+
350
+ function updateFileRows(element) {
351
+ var elements = document.querySelectorAll(".fileEntry");
352
+
353
+ for (var i = 0, len = elements.length; i < len; i++) {
354
+ var visible = elements[i].querySelector(".issue:not(.id-filtered):not(.severity-filtered):not(.classification-filtered):not(.tool-filtered):not(.text-filtered)");
355
+ elements[i].classList.toggle("file-filtered", !visible);
356
+ }
357
+ }
358
+
359
+ window.addEventListener("load", initExpandables);
360
+ </script>
361
+ </head>
362
+ <body>
363
+ <div id="wrapper">
364
+ <div id="header" class="header">
365
+ <h1>Cppcheck report - %s%s</h1>
366
+ """
367
+
368
+ HTML_HEAD_END = """
369
+ </div>
370
+ """
371
+
372
+ HTML_MENU = """
373
+ <div id="menu">
374
+ <p><a href="index.html">Defects:</a> %s</p>
375
+ """
376
+
377
+ HTML_MENU_END = """
378
+ </div>
379
+ <div id="content">
380
+ """
381
+
382
+ HTML_FOOTER = """
383
+ </div>
384
+ <div id="footer" class="footer">
385
+ <p>
386
+ Created by Cppcheck %s (<a href="https://cppcheck.sourceforge.io">Sourceforge</a>, <a href="irc://irc.libera.chat/#cppcheck">IRC</a>)
387
+ </p>
388
+ </div>
389
+ </div>
390
+ </body>
391
+ </html>
392
+ """
393
+
394
+ HTML_ERROR = "<span class=\"error2\">&lt;--- %s</span>\n"
395
+ HTML_INCONCLUSIVE = "<span class=\"inconclusive2\">&lt;--- %s</span>\n"
396
+
397
+ HTML_EXPANDABLE_ERROR = "<div class=\"verbose expandable\"><span class=\"error2\">&lt;--- %s <span class=\"marker\">[+]</span></span><div class=\"content\">%s</div></div>\n"
398
+ HTML_EXPANDABLE_INCONCLUSIVE = "<div class=\"verbose expandable\"><span class=\"inconclusive2\">&lt;--- %s <span class=\"marker\">[+]</span></span><div class=\"content\">%s</div></div>\n"
399
+
400
+ # escape() and unescape() takes care of &, < and >.
401
+ html_escape_table = {
402
+ '"': "&quot;",
403
+ "'": "&apos;"
404
+ }
405
+ html_unescape_table = {v: k for k, v in html_escape_table.items()}
406
+
407
+
408
+ def html_escape(text):
409
+ return escape(text, html_escape_table)
410
+
411
+ def filter_button(enabled_filters, id, function):
412
+ enabled = enabled_filters.get(id, False)
413
+ if not id:
414
+ id = 'None'
415
+ return '\n <label class="checkBtn%s"><input type="checkbox" onclick="%s(this)" id="%s"%s/>%s</label>'\
416
+ % (' disabled' if not enabled else '', function, id, 'checked' if enabled else 'disabled', id)
417
+
418
+ def filter_bar(enabled):
419
+ severity_bar = ''.join([filter_button(enabled, severity, 'toggleSeverity') for severity in ['error', 'warning', 'portability', 'performance', 'style', 'information']]) + '\n | '
420
+ classification_bar = ''.join([filter_button(enabled, _class, 'toggleClassification') for _class in ['Mandatory', 'Required', 'Advisory', 'Document', 'Disapplied', 'L1','L2','L3','']]) + '\n | '
421
+ if "checked/>" not in severity_bar:
422
+ severity_bar = ''
423
+ if "checked/>" not in classification_bar:
424
+ classification_bar = ''
425
+ return ''.join([
426
+ ' <div id="filters">\n'
427
+ ,severity_bar
428
+ , classification_bar
429
+ ,''.join([filter_button(enabled, tool, 'toggleTool') for tool in ['cppcheck', 'clang-tidy']])
430
+ ,'\n | '
431
+ ,'\n <label class="severityHeader">File: <input type="search" oninput="filterFile(this.value)"/></label>'
432
+ ,'\n <label class="severityHeader">Filter: <input type="search" oninput="filterText(this.value)"/></label>'
433
+ ,'\n </div>\n'])
434
+ def git_blame(errors, path, file, blame_options):
435
+ last_line= errors[-1]['line']
436
+ if last_line == 0:
437
+ return {}
438
+
439
+ first_line = next((error for error in errors if error['line'] > 0))['line']
440
+
441
+ full_path = os.path.join(path, file)
442
+ path, filename = os.path.split(full_path)
443
+
444
+ if not path:
445
+ path = None # make sure this is None
446
+
447
+ cmd_args = ['git', 'blame', '-L %d,%d' % (first_line, last_line)]
448
+ if '-w' in blame_options:
449
+ cmd_args.append('-w')
450
+ if '-M' in blame_options:
451
+ cmd_args.append('-M')
452
+ cmd_args = cmd_args + ['--porcelain', '--incremental', '--', filename]
453
+
454
+ try:
455
+ result = subprocess.check_output(cmd_args, cwd=path)
456
+ result = result.decode(locale.getpreferredencoding())
457
+ except:
458
+ return []
459
+
460
+ if result.startswith('fatal'):
461
+ return []
462
+
463
+ blame_data = []
464
+ line_from = 0
465
+ line_to = 0
466
+ blame_info = {}
467
+
468
+ for line_str in result.splitlines():
469
+ field, _, value = line_str.partition(' ')
470
+ if len(field) == 40:
471
+ line_nr, count = value.split(' ')[1:]
472
+ line_from = int(line_nr)
473
+ line_to = line_from + int(count)
474
+ elif field.startswith('author'):
475
+ blame_info[field] = value
476
+ if field == 'author-time':
477
+ author_date = date.fromtimestamp(int(blame_info['author-time']))
478
+ blame_info['author-time'] = author_date.strftime("%d/%m/%Y")
479
+ elif field == 'filename':
480
+ blame_data.append([line_from, line_to, blame_info.copy()])
481
+
482
+ return blame_data
483
+
484
+
485
+ def blame_lookup(blame_data, line):
486
+ return next((data for start, end, data in blame_data if line >= start and line < end), {})
487
+
488
+
489
+ def tr_str(td_th, line, id, cwe, severity, classification, guideline, message, timestamp, author, author_mail, date, add_author, tr_class=None, htmlfile=None, message_class=None):
490
+ ret = ''
491
+ items = [id, cwe]
492
+ if severity:
493
+ items.append(severity)
494
+ if classification:
495
+ items.extend([classification, guideline])
496
+ if htmlfile:
497
+ ret += '<%s><a href="%s#line-%d">%d</a></%s>' % (td_th, htmlfile, line, line, td_th)
498
+ for item in items:
499
+ ret += '<%s>%s</%s>' % (td_th, item, td_th)
500
+ else:
501
+ items.insert(0,line)
502
+ for item in items:
503
+ ret += '<%s>%s</%s>' % (td_th, item, td_th)
504
+ if message_class:
505
+ message_attribute = ' class="%s"' % message_class
506
+ else:
507
+ message_attribute = ''
508
+ ret += '<%s%s>%s</%s>' % (td_th, message_attribute, html_escape(message), td_th)
509
+
510
+ if timestamp:
511
+ ret += '<%s>%s</%s>' % (td_th, timestamp, td_th)
512
+
513
+ for field in add_author:
514
+ if field == 'name':
515
+ ret += '<%s>%s</%s>' % (td_th, html_escape(author), td_th)
516
+ elif field == 'email':
517
+ ret += '<%s>%s</%s>' % (td_th, html_escape(author_mail), td_th)
518
+ elif field == 'date':
519
+ ret += '<%s>%s</%s>' % (td_th, date, td_th)
520
+
521
+ if tr_class:
522
+ tr_attributes = ' class="%s"' % tr_class
523
+ else:
524
+ tr_attributes = ''
525
+ return '<tr%s>%s</tr>' % (tr_attributes, ret)
526
+
527
+
528
+ def to_css_selector(tag):
529
+ # https://www.w3.org/TR/CSS2/syndata.html#characters
530
+ # Note: for our usage, we don't consider escaped characters
531
+ invalid_css_chars = re.compile(r"[^-_a-zA-Z0-9\u00A0-\uFFFF]")
532
+ invalid_start = re.compile(r"^([0-9]|-[0-9]|--)")
533
+ # Replace forbidden characters by an hyphen
534
+ valid_chars = invalid_css_chars.sub("-", tag)
535
+ # Check that the start of the tag doesn't break the rules
536
+ start_invalid = invalid_start.match(valid_chars)
537
+ if start_invalid:
538
+ # otherwise, append a token to make it valid
539
+ valid_chars_valid_start = "cpp" + valid_chars
540
+ else:
541
+ valid_chars_valid_start = valid_chars
542
+ return valid_chars_valid_start
543
+
544
+ class AnnotateCodeFormatter(HtmlFormatter):
545
+ errors = []
546
+
547
+ def wrap(self, *args, **kwargs):
548
+ line_no = 1
549
+ for i, t in HtmlFormatter.wrap(self, *args, **kwargs):
550
+ # If this is a source code line we want to add a span tag at the
551
+ # end.
552
+ if i == 1:
553
+ for error in self.errors:
554
+ if error['line'] == line_no:
555
+ try:
556
+ if error['inconclusive'] == 'true':
557
+ # only print verbose msg if it really differs
558
+ # from actual message
559
+ if error.get('verbose') and (error['verbose'] != error['msg']):
560
+ index = t.rfind('\n')
561
+ t = t[:index] + HTML_EXPANDABLE_INCONCLUSIVE % (error['msg'], html_escape(error['verbose'].replace("\\012", '\n'))) + t[index + 1:]
562
+ else:
563
+ t = t.replace('\n', HTML_INCONCLUSIVE % error['msg'])
564
+ except KeyError:
565
+ if error.get('verbose') and (error['verbose'] != error['msg']):
566
+ index = t.rfind('\n')
567
+ t = t[:index] + HTML_EXPANDABLE_ERROR % (error['msg'], html_escape(error['verbose'].replace("\\012", '\n'))) + t[index + 1:]
568
+ else:
569
+ t = t.replace('\n', HTML_ERROR % error['msg'])
570
+
571
+ line_no = line_no + 1
572
+ yield i, t
573
+
574
+
575
+ class CppCheckHandler(XmlContentHandler):
576
+
577
+ """Parses the cppcheck xml file and produces a list of all its errors."""
578
+
579
+ def __init__(self):
580
+ XmlContentHandler.__init__(self)
581
+ self.errors = []
582
+ self.version = '1'
583
+ self.versionCppcheck = ''
584
+ self.timestamp = ''
585
+ self.report_type = False
586
+
587
+ def startElement(self, name, attributes):
588
+ if name == 'results':
589
+ self.version = attributes.get('version', self.version)
590
+
591
+ if self.version == '1':
592
+ self.handleVersion1(name, attributes)
593
+ else:
594
+ self.handleVersion2(name, attributes)
595
+
596
+ def handleVersion1(self, name, attributes):
597
+ if name != 'error':
598
+ return
599
+ att_class = attributes.get('classification', '')
600
+ att_guide = attributes.get('guideline', '')
601
+ if att_class and not self.report_type:
602
+ self.report_type = True
603
+ self.errors.append({
604
+ 'file': attributes.get('file', ''),
605
+ 'line': int(attributes.get('line', 0)),
606
+ 'locations': [{
607
+ 'file': attributes.get('file', ''),
608
+ 'line': int(attributes.get('line', 0)),
609
+ }],
610
+ 'id': attributes['id'],
611
+ 'severity': attributes['severity'],
612
+ 'classification': att_class,
613
+ 'guideline': att_guide,
614
+ 'timestamp': self.timestamp,
615
+ 'msg': attributes['msg']
616
+ })
617
+
618
+ def handleVersion2(self, name, attributes):
619
+ if name == 'cppcheck':
620
+ self.versionCppcheck = attributes['version']
621
+ if name == 'error':
622
+ att_class = attributes.get('classification', '')
623
+ att_guide = attributes.get('guideline', '')
624
+ if att_class and not self.report_type:
625
+ self.report_type = True
626
+ error = {
627
+ 'locations': [],
628
+ 'file': '',
629
+ 'line': 0,
630
+ 'id': attributes['id'],
631
+ 'classification': att_class,
632
+ 'severity': attributes['severity'],
633
+ 'guideline': att_guide,
634
+ 'timestamp': self.timestamp,
635
+ 'msg': attributes['msg'],
636
+ 'verbose': attributes.get('verbose')
637
+ }
638
+
639
+ if 'inconclusive' in attributes:
640
+ error['inconclusive'] = attributes['inconclusive']
641
+ if 'cwe' in attributes:
642
+ error['cwe'] = attributes['cwe']
643
+
644
+ self.errors.append(error)
645
+ elif name == 'location':
646
+ assert self.errors
647
+ error = self.errors[-1]
648
+ locations = error['locations']
649
+ file = attributes['file']
650
+ line = int(attributes['line'])
651
+ if not locations:
652
+ error['file'] = file
653
+ error['line'] = line
654
+ locations.append({
655
+ 'file': file,
656
+ 'line': line,
657
+ 'info': attributes.get('info')
658
+ })
659
+ def main() -> None:
660
+ # Configure all the options this little utility is using.
661
+ parser = argparse.ArgumentParser()
662
+ parser.add_argument('--title', dest='title',
663
+ help='The title of the project.',
664
+ default='[project name]')
665
+ parser.add_argument('--file', dest='file', action="append",
666
+ help='The cppcheck xml output file to read defects '
667
+ 'from. You can combine results from several '
668
+ 'xml reports i.e. "--file file1.xml --file file2.xml ..". '
669
+ 'Default is reading from stdin.')
670
+ parser.add_argument('--checkers-report-file', dest='checkers_report',
671
+ help='The cppcheck checkers report file as produced '
672
+ 'with the "--checkers-report" option of cppcheck.')
673
+ parser.add_argument('--report-dir', dest='report_dir',
674
+ help='The directory where the HTML report content is '
675
+ 'written.')
676
+ parser.add_argument('--source-dir', dest='source_dir',
677
+ help='Base directory where source code files can be '
678
+ 'found.')
679
+ parser.add_argument('--add-author-information', dest='add_author_information',
680
+ help='Blame information to include. '
681
+ 'Adds specified author information. '
682
+ 'Specify as comma-separated list of either "name", "email", "date" or "n","e","d". '
683
+ 'Default: "n,e,d"')
684
+ parser.add_argument('--source-encoding', dest='source_encoding',
685
+ help='Encoding of source code.', default='utf-8')
686
+ parser.add_argument('--blame-options', dest='blame_options',
687
+ help='[-w, -M] blame options which you can use to get author and author mail '
688
+ '-w --> not including white spaces and returns original author of the line '
689
+ '-M --> not including moving of lines and returns original author of the line')
690
+
691
+ # Parse options and make sure that we have an output directory set.
692
+ options = parser.parse_args()
693
+
694
+ try:
695
+ sys.argv[1]
696
+ except IndexError: # no arguments give, print --help
697
+ parser.print_help()
698
+ sys.exit(0)
699
+
700
+ if not options.report_dir:
701
+ parser.error('No report directory set.')
702
+
703
+ # Get the directory where source code files are located.
704
+ source_dir = os.getcwd()
705
+ if options.source_dir:
706
+ source_dir = options.source_dir
707
+
708
+ add_author_information = []
709
+ if options.add_author_information:
710
+ fields = [x.strip() for x in options.add_author_information.split(',')]
711
+ for x in fields:
712
+ if x.lower() in ['n', 'name']:
713
+ add_author_information.append('name')
714
+ elif x.lower() in ['e', 'email']:
715
+ add_author_information.append('email')
716
+ elif x.lower() in ['d', 'date']:
717
+ add_author_information.append('date')
718
+ else:
719
+ print('Unrecognized value "%s" for author information, using default (name, email, date)' % x)
720
+ add_author_information = ['name', 'email', 'date']
721
+ break
722
+
723
+ blame_options = ''
724
+ if options.blame_options:
725
+ blame_options = options.blame_options
726
+ add_author_information = add_author_information or ['name', 'email', 'date']
727
+
728
+ # Parse the xml from all files defined in file argument
729
+ # or from stdin. If no input is provided, stdin is used
730
+ # Produce a simple list of errors.
731
+ print('Parsing xml report.')
732
+ try:
733
+ contentHandler = CppCheckHandler()
734
+ for fname in options.file or [sys.stdin]:
735
+ if options.file is not None:
736
+ t = os.path.getmtime(fname)
737
+ else:
738
+ t = time.time()
739
+ t_s = time.ctime(t)
740
+ if t_s is not None:
741
+ contentHandler.timestamp = t_s
742
+ xml_parse(fname, contentHandler)
743
+ except (XmlParseException, ValueError) as msg:
744
+ print('Failed to parse cppcheck xml file: %s' % msg)
745
+ sys.exit(1)
746
+
747
+ # We have a list of errors. But now we want to group them on
748
+ # each source code file. Lets create a files dictionary that
749
+ # will contain a list of all the errors in that file. For each
750
+ # file we will also generate a HTML filename to use.
751
+ files = {}
752
+ file_no = 0
753
+ for error in contentHandler.errors:
754
+ filename = error['file']
755
+ if filename not in files:
756
+ files[filename] = {
757
+ 'errors': [], 'htmlfile': str(file_no) + '.html'}
758
+ file_no = file_no + 1
759
+ files[filename]['errors'].append(error)
760
+
761
+ # Make sure that the report directory is created if it doesn't exist.
762
+ print('Creating %s directory' % options.report_dir)
763
+ if not os.path.exists(options.report_dir):
764
+ os.makedirs(options.report_dir)
765
+
766
+ # Generate a HTML file with syntax highlighted source code for each
767
+ # file that contains one or more errors.
768
+ print('Processing errors')
769
+
770
+ decode_errors = []
771
+ for filename, data in sorted(files.items()):
772
+ htmlfile = data['htmlfile']
773
+ errors = []
774
+
775
+ for error in data['errors']:
776
+ for location in error['locations']:
777
+ if filename == location['file']:
778
+ newError = dict(error)
779
+
780
+ del newError['locations']
781
+ newError['line'] = location['line']
782
+ if location.get('info'):
783
+ newError['msg'] = location['info']
784
+ newError['severity'] = 'information'
785
+ newError['classification'] = ''
786
+ newError['guideline'] = ''
787
+ del newError['verbose']
788
+
789
+ errors.append(newError)
790
+
791
+ lines = []
792
+ for error in errors:
793
+ lines.append(error['line'])
794
+
795
+ if filename == '':
796
+ continue
797
+
798
+ source_filename = os.path.join(source_dir, filename)
799
+ try:
800
+ with io.open(source_filename, 'r', encoding=options.source_encoding) as input_file:
801
+ content = input_file.read()
802
+ except IOError:
803
+ if error['id'] != 'unmatchedSuppression':
804
+ sys.stderr.write("ERROR: Source file '%s' not found.\n" %
805
+ source_filename)
806
+ continue
807
+ except UnicodeDecodeError:
808
+ sys.stderr.write("WARNING: Unicode decode error in '%s'.\n" %
809
+ source_filename)
810
+ decode_errors.append(source_filename[2:]) # "[2:]" gets rid of "./" at beginning
811
+ continue
812
+
813
+ htmlFormatter = AnnotateCodeFormatter(linenos=True,
814
+ style='colorful',
815
+ hl_lines=lines,
816
+ lineanchors='line',
817
+ encoding=options.source_encoding)
818
+ htmlFormatter.errors = errors
819
+
820
+ with io.open(os.path.join(options.report_dir, htmlfile), 'w', encoding='utf-8') as output_file:
821
+ output_file.write(HTML_HEAD %
822
+ (options.title,
823
+ htmlFormatter.get_style_defs('.highlight'),
824
+ options.title,
825
+ ': ' + filename))
826
+ output_file.write(HTML_HEAD_END)
827
+
828
+ output_file.write(HTML_MENU % (filename.split('/')[-1]))
829
+ for error in sorted(errors, key=lambda k: k['line']):
830
+ output_file.write("<a href=\"%s#line-%d\"> %s %s</a>" % (data['htmlfile'], error['line'], error['id'], error['line']))
831
+ output_file.write(HTML_MENU_END)
832
+
833
+ try:
834
+ lexer = guess_lexer_for_filename(source_filename, '', stripnl=False)
835
+ except ClassNotFound:
836
+ try:
837
+ lexer = guess_lexer(content, stripnl=False)
838
+ except ClassNotFound:
839
+ sys.stderr.write("ERROR: Couldn't determine lexer for the file' " + source_filename + " '. Won't be able to syntax highlight this file.")
840
+ output_file.write("\n <tr><td colspan=\"5\"> Could not generate content because pygments failed to determine the code type.</td></tr>")
841
+ output_file.write("\n <tr><td colspan=\"5\"> Sorry about this.</td></tr>")
842
+ continue
843
+
844
+ if options.source_encoding:
845
+ lexer.encoding = options.source_encoding
846
+
847
+ output_file.write(
848
+ highlight(content, lexer, htmlFormatter).decode(
849
+ options.source_encoding))
850
+
851
+ output_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
852
+
853
+ print(' ' + filename)
854
+
855
+ # Generate a master index.html file that will contain a list of
856
+ # all the errors created.
857
+ print('Creating index.html')
858
+
859
+ with io.open(os.path.join(options.report_dir, 'index.html'),
860
+ 'w') as output_file:
861
+
862
+ stats_count = 0
863
+ stats = []
864
+ filter_enabled = {}
865
+ for filename, data in sorted(files.items()):
866
+ for error in data['errors']:
867
+ stats.append(error['id']) # get the stats
868
+ if contentHandler.report_type:
869
+ filter_enabled[error['severity']] = False
870
+ filter_enabled[error['classification']] = True
871
+ else:
872
+ filter_enabled[error['severity']] = True
873
+ filter_enabled[error['classification']] = False
874
+ filter_enabled['clang-tidy' if error['id'].startswith('clang-tidy-') else 'cppcheck'] = True
875
+ stats_count += 1
876
+
877
+ counter = Counter(stats)
878
+
879
+ stat_html = []
880
+ # the following lines sort the stat primary by value (occurrences),
881
+ # but if two IDs occur equally often, then we sort them alphabetically by warning ID
882
+ try:
883
+ cnt_max = counter.most_common()[0][1]
884
+ except IndexError:
885
+ cnt_max = 0
886
+
887
+ try:
888
+ cnt_min = counter.most_common()[-1][1]
889
+ except IndexError:
890
+ cnt_min = 0
891
+
892
+ stat_fmt = "\n <tr><td><input type=\"checkbox\" class=\"idToggle\" onclick=\"toggleDisplay(this)\" id=\"{}\" name=\"{}\" checked></td><td>{}</td><td>{}</td></tr>"
893
+ for occurrences in reversed(range(cnt_min, cnt_max + 1)):
894
+ for _id in [k for k, v in sorted(counter.items()) if v == occurrences]:
895
+ stat_html.append(stat_fmt.format(
896
+ to_css_selector(_id),
897
+ to_css_selector(_id),
898
+ dict(counter.most_common())[_id],
899
+ _id
900
+ ))
901
+
902
+ output_file.write(HTML_HEAD % (options.title, '', options.title, ''))
903
+ output_file.write(filter_bar(filter_enabled))
904
+ output_file.write(HTML_HEAD_END)
905
+ output_file.write(HTML_MENU.replace('id="menu"', 'id="menu_index"', 1).replace("Defects:", "Defect summary", 1) % (''))
906
+ output_file.write('\n <label><input type="checkbox" class=\"idToggle\" onclick="toggleAll()" checked> Toggle all</label>')
907
+ output_file.write('\n <table>')
908
+ output_file.write('\n <tr><th>Show</th><th>#</th><th>Defect ID</th></tr>')
909
+ output_file.write(''.join(stat_html))
910
+ output_file.write('\n <tr><td></td><td>' + str(stats_count) + '</td><td>total</td></tr>')
911
+ output_file.write('\n </table>')
912
+ output_file.write('\n <p><a href="stats.html">Statistics</a></p>')
913
+ if options.checkers_report:
914
+ output_file.write('\n <p><a href="checkers.html">Checkers</a></p>')
915
+ output_file.write(HTML_MENU_END.replace("content", "content_index", 1))
916
+
917
+ output_file.write('\n <table class=\"summaryTable\">')
918
+ if contentHandler.report_type:
919
+ output_file.write(
920
+ '\n %s' %
921
+ tr_str('th', 'Line', 'Id', 'CWE', '', 'Classification', 'Guideline', 'Message', 'Timestamp',
922
+ 'Author', 'Author mail', 'Date (DD/MM/YYYY)', add_author=add_author_information))
923
+ else:
924
+ output_file.write(
925
+ '\n %s' %
926
+ tr_str('th', 'Line', 'Id', 'CWE', 'Severity', '', '', 'Message', 'Timestamp', 'Author', 'Author mail', 'Date (DD/MM/YYYY)', add_author=add_author_information))
927
+
928
+ for filename, data in sorted(files.items()):
929
+ file_error = filename in decode_errors or filename.endswith('*')
930
+ is_file = filename != '' and not file_error
931
+ row_content = filename if file_error else "<a href=\"%s\">%s</a>" % (data['htmlfile'], filename)
932
+ htmlfile = data.get('htmlfile') if is_file else None
933
+
934
+ output_file.write("\n <tbody class=\"fileEntry\">")
935
+ output_file.write("\n <tr><td colspan=\"5\">%s</td></tr>" % row_content)
936
+
937
+ if filename in decode_errors:
938
+ output_file.write("\n <tr><td colspan=\"5\">Could not generated due to UnicodeDecodeError</td></tr>")
939
+
940
+ sorted_errors = sorted(data['errors'], key=lambda k: k['line'])
941
+ blame_data = git_blame(sorted_errors, source_dir, filename, blame_options) if add_author_information else []
942
+ for error in sorted_errors:
943
+ git_blame_dict = blame_lookup(blame_data, error['line'])
944
+ message_class = None
945
+ try:
946
+ if error['inconclusive'] == 'true':
947
+ message_class = 'inconclusive'
948
+ error['severity'] += ", inconcl."
949
+ except KeyError:
950
+ pass
951
+
952
+ cwe_url = ""
953
+ try:
954
+ if error['cwe']:
955
+ cwe_url = "<a href=\"https://cwe.mitre.org/data/definitions/" + error['cwe'] + ".html\">" + error['cwe'] + "</a>"
956
+ except KeyError:
957
+ pass
958
+
959
+ if error['severity'] in ['error', 'warning']:
960
+ message_class = error['severity']
961
+
962
+ line = error["line"] if is_file else ""
963
+ _severity = error.get('severity', '')
964
+ _classification = error.get('classification', '')
965
+ _guideline = error.get('guideline', '')
966
+ if contentHandler.report_type:
967
+ _severity = ''
968
+ if not _classification:
969
+ _classification = 'None'
970
+ _guideline = 'None'
971
+ output_file.write(
972
+ '\n %s' %
973
+ tr_str('td', line, error["id"], cwe_url, _severity, _classification, _guideline, error["msg"], error["timestamp"],
974
+ git_blame_dict.get('author', 'Unknown'), git_blame_dict.get('author-mail', '---'),
975
+ git_blame_dict.get('author-time', '---'),
976
+ tr_class=to_css_selector(error["id"]) + ' sev_' + _severity +' class_' + _classification + ' issue',
977
+ message_class=message_class,
978
+ add_author=add_author_information,
979
+ htmlfile=htmlfile))
980
+ output_file.write("\n </tbody>")
981
+ output_file.write('\n </table>')
982
+ output_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
983
+
984
+ if decode_errors:
985
+ sys.stderr.write("\nGenerating html failed for the following files: " + ' '.join(decode_errors))
986
+ sys.stderr.write("\nConsider changing source-encoding (for example: \"htmlreport ... --source-encoding=\"iso8859-1\"\"\n")
987
+
988
+ print('Creating style.css file')
989
+ with io.open(os.path.join(options.report_dir, 'style.css'), 'w') as css_file:
990
+ css_file.write(STYLE_FILE)
991
+
992
+ print("Creating stats.html (statistics)\n")
993
+ stats_countlist = {}
994
+
995
+ for filename, data in sorted(files.items()):
996
+ if filename == '':
997
+ continue
998
+ stats_tmplist = []
999
+ for error in sorted(data['errors'], key=lambda k: k['line']):
1000
+ stats_tmplist.append(error['severity'])
1001
+
1002
+ stats_countlist[filename] = dict(Counter(stats_tmplist))
1003
+
1004
+ # get top ten for each severity
1005
+ SEVERITIES = "error", "warning", "portability", "performance", "style", "unusedFunction", "information", "missingInclude", "internal"
1006
+
1007
+ with io.open(os.path.join(options.report_dir, 'stats.html'), 'w') as stats_file:
1008
+
1009
+ stats_file.write(HTML_HEAD % (options.title, '', options.title, ': Statistics'))
1010
+ stats_file.write(HTML_HEAD_END)
1011
+
1012
+ stats_file.write(HTML_MENU.replace('id="menu"', 'id="menu_index"', 1).replace("Defects:", "Back to summary", 1) % (''))
1013
+ stats_file.write(HTML_MENU_END.replace("content", "content_index", 1))
1014
+
1015
+
1016
+ for sev in SEVERITIES:
1017
+ _sum = 0
1018
+ stats_templist = {}
1019
+
1020
+ # if the we have an style warning but we are checking for
1021
+ # portability, we have to skip it to prevent KeyError
1022
+ try:
1023
+ for filename in stats_countlist:
1024
+ try: # also bail out if we have a file with no sev-results
1025
+ _sum += stats_countlist[filename][sev]
1026
+ stats_templist[filename] = int(stats_countlist[filename][sev]) # file : amount,
1027
+ except KeyError:
1028
+ continue
1029
+ # don't print "0 style" etc, if no style warnings were found
1030
+ if _sum == 0:
1031
+ continue
1032
+ except KeyError:
1033
+ continue
1034
+ stats_file.write("<p><span class=\"statHeader\">Top 10 files for " + sev + " severity, total findings: " + str(_sum) + "</span><br>\n")
1035
+
1036
+ # sort, so that the file with the most severities per type is first
1037
+ stats_list_sorted = sorted(stats_templist.items(), key=operator.itemgetter(1, 0), reverse=True)
1038
+ it = 0
1039
+ LENGTH = 0
1040
+
1041
+ for i in stats_list_sorted: # printing loop
1042
+ # for aesthetics: if it's the first iteration of the loop, get
1043
+ # the max length of the number string
1044
+ if it == 0:
1045
+ LENGTH = len(str(i[1])) # <- length of longest number, now get the difference and try to make other numbers align to it
1046
+
1047
+ stats_file.write("&#160;" * 3 + str(i[1]) + "&#160;" * (1 + LENGTH - len(str(i[1]))) + "<a href=\"" + files[i[0]]['htmlfile'] + "\"> " + i[0] + "</a><br>\n")
1048
+ it += 1
1049
+ if it == 10: # print only the top 10
1050
+ break
1051
+ stats_file.write("</p>\n")
1052
+
1053
+ stats_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
1054
+
1055
+ if options.checkers_report:
1056
+ print("Creating checkers.html (checkers report)\n")
1057
+
1058
+ with io.open(os.path.join(options.report_dir, 'checkers.html'), 'w') as checkers_file:
1059
+
1060
+ checkers_file.write(HTML_HEAD % (options.title, '', options.title, ': Checkers'))
1061
+ checkers_file.write(HTML_HEAD_END)
1062
+
1063
+ checkers_file.write(HTML_MENU.replace('id="menu"', 'id="menu_index"', 1).replace("Defects:", "Back to summary", 1) % (''))
1064
+ checkers_file.write(HTML_MENU_END.replace("content", "content_index", 1))
1065
+
1066
+ with io.open(options.checkers_report, 'r', encoding=options.source_encoding) as checkers_report:
1067
+ content = checkers_report.read()
1068
+
1069
+ checkers_file.write("<pre>\n")
1070
+ checkers_file.write(html_escape(content))
1071
+ checkers_file.write("</pre>\n")
1072
+
1073
+ checkers_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
1074
+
1075
+ print("\nOpen '" + options.report_dir + "/index.html' to see the results.")
1076
+
1077
+
1078
+ if __name__ == "__main__":
1079
+ main()