codekingpro commited on
Commit
651c7e5
·
verified ·
1 Parent(s): 228e11b

Add files using upload-large-folder tool

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. micromamba_root/Library/bin/api-ms-win-core-console-l1-1-0.dll +0 -0
  2. micromamba_root/Library/bin/api-ms-win-core-console-l1-2-0.dll +0 -0
  3. micromamba_root/Library/bin/api-ms-win-core-datetime-l1-1-0.dll +0 -0
  4. micromamba_root/Library/bin/api-ms-win-core-debug-l1-1-0.dll +0 -0
  5. micromamba_root/Library/bin/api-ms-win-core-errorhandling-l1-1-0.dll +0 -0
  6. micromamba_root/Library/bin/api-ms-win-core-fibers-l1-1-0.dll +0 -0
  7. micromamba_root/Library/bin/api-ms-win-core-fibers-l1-1-1.dll +0 -0
  8. micromamba_root/Library/bin/api-ms-win-core-file-l1-1-0.dll +0 -0
  9. micromamba_root/Library/bin/api-ms-win-core-file-l1-2-0.dll +0 -0
  10. micromamba_root/Library/bin/api-ms-win-core-file-l2-1-0.dll +0 -0
  11. micromamba_root/Library/bin/api-ms-win-core-handle-l1-1-0.dll +0 -0
  12. micromamba_root/Library/bin/api-ms-win-core-heap-l1-1-0.dll +0 -0
  13. micromamba_root/Library/bin/api-ms-win-core-interlocked-l1-1-0.dll +0 -0
  14. micromamba_root/Library/bin/api-ms-win-core-kernel32-legacy-l1-1-1.dll +0 -0
  15. micromamba_root/Library/bin/api-ms-win-core-libraryloader-l1-1-0.dll +0 -0
  16. micromamba_root/Library/bin/api-ms-win-core-localization-l1-2-0.dll +0 -0
  17. micromamba_root/Library/bin/api-ms-win-core-memory-l1-1-0.dll +0 -0
  18. micromamba_root/Library/bin/api-ms-win-core-namedpipe-l1-1-0.dll +0 -0
  19. micromamba_root/Library/bin/api-ms-win-core-processenvironment-l1-1-0.dll +0 -0
  20. micromamba_root/Library/bin/api-ms-win-core-processthreads-l1-1-0.dll +0 -0
  21. micromamba_root/Library/bin/api-ms-win-core-processthreads-l1-1-1.dll +0 -0
  22. micromamba_root/Library/bin/api-ms-win-core-profile-l1-1-0.dll +0 -0
  23. micromamba_root/Library/bin/api-ms-win-core-rtlsupport-l1-1-0.dll +0 -0
  24. micromamba_root/Library/bin/api-ms-win-core-string-l1-1-0.dll +0 -0
  25. micromamba_root/Library/bin/api-ms-win-core-synch-l1-1-0.dll +0 -0
  26. micromamba_root/Library/bin/api-ms-win-core-synch-l1-2-0.dll +0 -0
  27. micromamba_root/Library/bin/api-ms-win-core-sysinfo-l1-1-0.dll +0 -0
  28. micromamba_root/Library/bin/api-ms-win-core-sysinfo-l1-2-0.dll +0 -0
  29. micromamba_root/Library/bin/api-ms-win-core-timezone-l1-1-0.dll +0 -0
  30. micromamba_root/Library/bin/api-ms-win-core-util-l1-1-0.dll +0 -0
  31. micromamba_root/Library/bin/api-ms-win-crt-conio-l1-1-0.dll +0 -0
  32. micromamba_root/Library/bin/api-ms-win-crt-convert-l1-1-0.dll +0 -0
  33. micromamba_root/Library/bin/api-ms-win-crt-environment-l1-1-0.dll +0 -0
  34. micromamba_root/Library/bin/api-ms-win-crt-filesystem-l1-1-0.dll +0 -0
  35. micromamba_root/Library/bin/api-ms-win-crt-heap-l1-1-0.dll +0 -0
  36. micromamba_root/Library/bin/api-ms-win-crt-locale-l1-1-0.dll +0 -0
  37. micromamba_root/Library/bin/api-ms-win-crt-math-l1-1-0.dll +0 -0
  38. micromamba_root/Library/bin/api-ms-win-crt-multibyte-l1-1-0.dll +0 -0
  39. micromamba_root/Library/bin/api-ms-win-crt-private-l1-1-0.dll +0 -0
  40. micromamba_root/Library/bin/api-ms-win-crt-process-l1-1-0.dll +0 -0
  41. micromamba_root/Library/bin/api-ms-win-crt-runtime-l1-1-0.dll +0 -0
  42. micromamba_root/Library/bin/api-ms-win-crt-stdio-l1-1-0.dll +0 -0
  43. micromamba_root/Library/bin/api-ms-win-crt-string-l1-1-0.dll +0 -0
  44. micromamba_root/Library/bin/api-ms-win-crt-time-l1-1-0.dll +0 -0
  45. micromamba_root/Library/bin/api-ms-win-crt-utility-l1-1-0.dll +0 -0
  46. micromamba_root/Library/bin/c_rehash.pl +253 -0
  47. micromamba_root/Library/bin/charset.dll +0 -0
  48. micromamba_root/Library/bin/cppcheck-htmlreport +1157 -0
  49. micromamba_root/Library/bin/ffi-8.dll +0 -0
  50. micromamba_root/Library/bin/libbz2.dll +0 -0
micromamba_root/Library/bin/api-ms-win-core-console-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-console-l1-2-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-datetime-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-debug-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-errorhandling-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-fibers-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-fibers-l1-1-1.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-file-l1-1-0.dll ADDED
Binary file (27 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-file-l1-2-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-file-l2-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-handle-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-heap-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-interlocked-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-kernel32-legacy-l1-1-1.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-libraryloader-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-localization-l1-2-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-memory-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-namedpipe-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-processenvironment-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-processthreads-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-processthreads-l1-1-1.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-profile-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-rtlsupport-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-string-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-synch-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-synch-l1-2-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-sysinfo-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-sysinfo-l1-2-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-timezone-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-core-util-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-conio-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-convert-l1-1-0.dll ADDED
Binary file (27 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-environment-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-filesystem-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-heap-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-locale-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-math-l1-1-0.dll ADDED
Binary file (31.1 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-multibyte-l1-1-0.dll ADDED
Binary file (31.1 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-private-l1-1-0.dll ADDED
Binary file (76.1 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-process-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-runtime-l1-1-0.dll ADDED
Binary file (27 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-stdio-l1-1-0.dll ADDED
Binary file (27 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-string-l1-1-0.dll ADDED
Binary file (27 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-time-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/api-ms-win-crt-utility-l1-1-0.dll ADDED
Binary file (22.9 kB). View file
 
micromamba_root/Library/bin/c_rehash.pl ADDED
@@ -0,0 +1,253 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env perl
2
+
3
+ # WARNING: do not edit!
4
+ # Generated by makefile from tools\c_rehash.in
5
+ # Copyright 1999-2025 The OpenSSL Project Authors. All Rights Reserved.
6
+ #
7
+ # Licensed under the Apache License 2.0 (the "License"). You may not use
8
+ # this file except in compliance with the License. You can obtain a copy
9
+ # in the file LICENSE in the source distribution or at
10
+ # https://www.openssl.org/source/license.html
11
+
12
+ # Perl c_rehash script, scan all files in a directory
13
+ # and add symbolic links to their hash values.
14
+
15
+ my $dir = "C:\\Program Files\\Common Files\\ssl";
16
+ my $prefix = "D:/code/apps/devtools/micromamba_root\\Library";
17
+
18
+ my $errorcount = 0;
19
+ my $openssl = $ENV{OPENSSL} || "openssl";
20
+ my $pwd;
21
+ my $x509hash = "-subject_hash";
22
+ my $crlhash = "-hash";
23
+ my $verbose = 0;
24
+ my $symlink_exists=eval {symlink("",""); 1};
25
+ my $removelinks = 1;
26
+
27
+ ## Parse flags.
28
+ while ( $ARGV[0] =~ /^-/ ) {
29
+ my $flag = shift @ARGV;
30
+ last if ( $flag eq '--');
31
+ if ( $flag eq '-old') {
32
+ $x509hash = "-subject_hash_old";
33
+ $crlhash = "-hash_old";
34
+ } elsif ( $flag eq '-h' || $flag eq '-help' ) {
35
+ help();
36
+ } elsif ( $flag eq '-n' ) {
37
+ $removelinks = 0;
38
+ } elsif ( $flag eq '-v' ) {
39
+ $verbose++;
40
+ }
41
+ else {
42
+ print STDERR "Usage error; try -h.\n";
43
+ exit 1;
44
+ }
45
+ }
46
+
47
+ sub help {
48
+ print "Usage: c_rehash [-old] [-h] [-help] [-v] [dirs...]\n";
49
+ print " -old use old-style digest\n";
50
+ print " -h or -help print this help text\n";
51
+ print " -v print files removed and linked\n";
52
+ exit 0;
53
+ }
54
+
55
+ eval "require Cwd";
56
+ if (defined(&Cwd::getcwd)) {
57
+ $pwd=Cwd::getcwd();
58
+ } else {
59
+ $pwd=`pwd`;
60
+ chomp($pwd);
61
+ }
62
+
63
+ # DOS/Win32 or Unix delimiter? Prefix our installdir, then search.
64
+ my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':';
65
+ $ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : "");
66
+
67
+ if (!(-f $openssl && -x $openssl)) {
68
+ my $found = 0;
69
+ foreach (split /$path_delim/, $ENV{PATH}) {
70
+ if (-f "$_/$openssl" && -x "$_/$openssl") {
71
+ $found = 1;
72
+ $openssl = "$_/$openssl";
73
+ last;
74
+ }
75
+ }
76
+ if ($found == 0) {
77
+ print STDERR "c_rehash: rehashing skipped ('openssl' program not available)\n";
78
+ exit 0;
79
+ }
80
+ }
81
+
82
+ if (@ARGV) {
83
+ @dirlist = @ARGV;
84
+ } elsif ($ENV{SSL_CERT_DIR}) {
85
+ @dirlist = split /$path_delim/, $ENV{SSL_CERT_DIR};
86
+ } else {
87
+ $dirlist[0] = "$dir/certs";
88
+ }
89
+
90
+ if (-d $dirlist[0]) {
91
+ chdir $dirlist[0];
92
+ $openssl="$pwd/$openssl" if (!(-f $openssl && -x $openssl));
93
+ chdir $pwd;
94
+ }
95
+
96
+ foreach (@dirlist) {
97
+ if (-d $_ ) {
98
+ if ( -w $_) {
99
+ hash_dir($_);
100
+ } else {
101
+ print "Skipping $_, can't write\n";
102
+ $errorcount++;
103
+ }
104
+ }
105
+ }
106
+ exit($errorcount);
107
+
108
+ sub copy_file {
109
+ my ($src_fname, $dst_fname) = @_;
110
+
111
+ if (open(my $in, "<", $src_fname)) {
112
+ if (open(my $out, ">", $dst_fname)) {
113
+ print $out $_ while (<$in>);
114
+ close $out;
115
+ } else {
116
+ warn "Cannot open $dst_fname for write, $!";
117
+ }
118
+ close $in;
119
+ } else {
120
+ warn "Cannot open $src_fname for read, $!";
121
+ }
122
+ }
123
+
124
+ sub hash_dir {
125
+ my $dir = shift;
126
+ my %hashlist;
127
+
128
+ print "Doing $dir\n";
129
+
130
+ if (!chdir $dir) {
131
+ print STDERR "WARNING: Cannot chdir to '$dir', $!\n";
132
+ return;
133
+ }
134
+
135
+ opendir(DIR, ".") || print STDERR "WARNING: Cannot opendir '.', $!\n";
136
+ my @flist = sort readdir(DIR);
137
+ closedir DIR;
138
+ if ( $removelinks ) {
139
+ # Delete any existing symbolic links
140
+ foreach (grep {/^[\da-f]+\.r{0,1}\d+$/} @flist) {
141
+ if (-l $_) {
142
+ print "unlink $_\n" if $verbose;
143
+ unlink $_ || warn "Can't unlink $_, $!\n";
144
+ }
145
+ }
146
+ }
147
+ FILE: foreach $fname (grep {/\.(pem|crt|cer|crl)$/} @flist) {
148
+ # Check to see if certificates and/or CRLs present.
149
+ my ($cert, $crl) = check_file($fname);
150
+ if (!$cert && !$crl) {
151
+ print STDERR "WARNING: $fname does not contain a certificate or CRL: skipping\n";
152
+ next;
153
+ }
154
+ link_hash_cert($fname) if ($cert);
155
+ link_hash_crl($fname) if ($crl);
156
+ }
157
+
158
+ chdir $pwd;
159
+ }
160
+
161
+ sub check_file {
162
+ my ($is_cert, $is_crl) = (0,0);
163
+ my $fname = $_[0];
164
+
165
+ open(my $in, "<", $fname);
166
+ while(<$in>) {
167
+ if (/^-----BEGIN (.*)-----/) {
168
+ my $hdr = $1;
169
+ if ($hdr =~ /^(X509 |TRUSTED |)CERTIFICATE$/) {
170
+ $is_cert = 1;
171
+ last if ($is_crl);
172
+ } elsif ($hdr eq "X509 CRL") {
173
+ $is_crl = 1;
174
+ last if ($is_cert);
175
+ }
176
+ }
177
+ }
178
+ close $in;
179
+ return ($is_cert, $is_crl);
180
+ }
181
+
182
+ sub compute_hash {
183
+ my $fh;
184
+ if ( $^O eq "VMS" ) {
185
+ # VMS uses the open through shell
186
+ # The file names are safe there and list form is unsupported
187
+ if (!open($fh, "-|", join(' ', @_))) {
188
+ print STDERR "Cannot compute hash on '$fname'\n";
189
+ return;
190
+ }
191
+ } else {
192
+ if (!open($fh, "-|", @_)) {
193
+ print STDERR "Cannot compute hash on '$fname'\n";
194
+ return;
195
+ }
196
+ binmode($fh, ":crlf");
197
+ }
198
+ return (<$fh>, <$fh>);
199
+ }
200
+
201
+ # Link a certificate to its subject name hash value, each hash is of
202
+ # the form <hash>.<n> where n is an integer. If the hash value already exists
203
+ # then we need to up the value of n, unless its a duplicate in which
204
+ # case we skip the link. We check for duplicates by comparing the
205
+ # certificate fingerprints
206
+
207
+ sub link_hash_cert {
208
+ link_hash($_[0], 'cert');
209
+ }
210
+
211
+ # Same as above except for a CRL. CRL links are of the form <hash>.r<n>
212
+
213
+ sub link_hash_crl {
214
+ link_hash($_[0], 'crl');
215
+ }
216
+
217
+ sub link_hash {
218
+ my ($fname, $type) = @_;
219
+ my $is_cert = $type eq 'cert';
220
+
221
+ my ($hash, $fprint) = compute_hash($openssl,
222
+ $is_cert ? "x509" : "crl",
223
+ $is_cert ? $x509hash : $crlhash,
224
+ "-fingerprint", "-noout",
225
+ "-in", $fname);
226
+ chomp $hash;
227
+ $hash =~ s/^.*=// if !$is_cert;
228
+ chomp $fprint;
229
+ return if !$hash;
230
+ $fprint =~ s/^.*=//;
231
+ $fprint =~ tr/://d;
232
+ my $suffix = 0;
233
+ # Search for an unused hash filename
234
+ my $crlmark = $is_cert ? "" : "r";
235
+ while(exists $hashlist{"$hash.$crlmark$suffix"}) {
236
+ # Hash matches: if fingerprint matches its a duplicate cert
237
+ if ($hashlist{"$hash.$crlmark$suffix"} eq $fprint) {
238
+ my $what = $is_cert ? 'certificate' : 'CRL';
239
+ print STDERR "WARNING: Skipping duplicate $what $fname\n";
240
+ return;
241
+ }
242
+ $suffix++;
243
+ }
244
+ $hash .= ".$crlmark$suffix";
245
+ if ($symlink_exists) {
246
+ print "link $fname -> $hash\n" if $verbose;
247
+ symlink $fname, $hash || warn "Can't symlink, $!";
248
+ } else {
249
+ print "copy $fname -> $hash\n" if $verbose;
250
+ copy_file($fname, $hash);
251
+ }
252
+ $hashlist{$hash} = $fprint;
253
+ }
micromamba_root/Library/bin/charset.dll ADDED
Binary file (12.8 kB). View file
 
micromamba_root/Library/bin/cppcheck-htmlreport ADDED
@@ -0,0 +1,1157 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
+ function reapplyFilters() {
360
+ // Reapply ID filters
361
+ var idToggles = document.querySelectorAll(".idToggle");
362
+ for (var i = 1; i < idToggles.length; i++) {
363
+ var cb = idToggles[i];
364
+ var elements = document.querySelectorAll("." + cb.id);
365
+ for (var j = 0; j < elements.length; j++) {
366
+ elements[j].classList.toggle("id-filtered", !cb.checked);
367
+ }
368
+ }
369
+
370
+ // Reapply severity filters
371
+ var sevToggles = document.querySelectorAll(".sev_toggle");
372
+ for (var i = 0; i < sevToggles.length; i++) {
373
+ var cb = sevToggles[i];
374
+ var elements = document.querySelectorAll(".sev_" + cb.id);
375
+ for (var j = 0; j < elements.length; j++) {
376
+ elements[j].classList.toggle("severity-filtered", !cb.checked);
377
+ }
378
+ }
379
+
380
+ // Reapply classification filters
381
+ var classToggles = document.querySelectorAll(".class_toggle");
382
+ for (var i = 0; i < classToggles.length; i++) {
383
+ var cb = classToggles[i];
384
+ var elements = document.querySelectorAll(".class_" + cb.id);
385
+ for (var j = 0; j < elements.length; j++) {
386
+ elements[j].classList.toggle("classification-filtered", !cb.checked);
387
+ }
388
+ }
389
+
390
+ // Reapply tool filters
391
+ var toolToggles = document.querySelectorAll(".tool_toggle");
392
+ for (var i = 0; i < toolToggles.length; i++) {
393
+ var cb = toolToggles[i];
394
+ var elements;
395
+ if (cb.id == "clang-tidy")
396
+ elements = document.querySelectorAll("[class^=clang-tidy-]");
397
+ else
398
+ elements = document.querySelectorAll(".issue:not([class^=clang-tidy-])");
399
+
400
+ for (var j = 0; j < elements.length; j++) {
401
+ elements[j].classList.toggle("tool-filtered", !cb.checked);
402
+ }
403
+ }
404
+
405
+ // Update file rows
406
+ updateFileRows();
407
+ }
408
+
409
+ window.addEventListener("pageshow", reapplyFilters);
410
+ window.addEventListener("load", initExpandables);
411
+ </script>
412
+ </head>
413
+ <body>
414
+ <div id="wrapper">
415
+ <div id="header" class="header">
416
+ <h1>Cppcheck report - %s%s</h1>
417
+ """
418
+
419
+ HTML_HEAD_END = """
420
+ </div>
421
+ """
422
+
423
+ HTML_MENU = """
424
+ <div id="menu">
425
+ <p><a href="index.html">Defects:</a> %s</p>
426
+ """
427
+
428
+ HTML_MENU_END = """
429
+ </div>
430
+ <div id="content">
431
+ """
432
+
433
+ HTML_FOOTER = """
434
+ </div>
435
+ <div id="footer" class="footer">
436
+ <p>
437
+ Created by Cppcheck %s (<a href="https://cppcheck.sourceforge.io">Sourceforge</a>, <a href="irc://irc.libera.chat/#cppcheck">IRC</a>)
438
+ </p>
439
+ </div>
440
+ </div>
441
+ </body>
442
+ </html>
443
+ """
444
+
445
+ HTML_ERROR = "<span class=\"error2\">&lt;--- %s</span>\n"
446
+ HTML_INCONCLUSIVE = "<span class=\"inconclusive2\">&lt;--- %s</span>\n"
447
+
448
+ HTML_EXPANDABLE_ERROR = "<div class=\"verbose expandable\"><span class=\"error2\">&lt;--- %s <span class=\"marker\">[+]</span></span><div class=\"content\">%s</div></div>\n"
449
+ HTML_EXPANDABLE_INCONCLUSIVE = "<div class=\"verbose expandable\"><span class=\"inconclusive2\">&lt;--- %s <span class=\"marker\">[+]</span></span><div class=\"content\">%s</div></div>\n"
450
+
451
+ # escape() and unescape() takes care of &, < and >.
452
+ html_escape_table = {
453
+ '"': "&quot;",
454
+ "'": "&apos;"
455
+ }
456
+ html_unescape_table = {v: k for k, v in html_escape_table.items()}
457
+
458
+
459
+ def html_escape(text):
460
+ return escape(text, html_escape_table)
461
+
462
+ def filter_button(enabled_filters, id, function):
463
+ enabled = enabled_filters.get(id, False)
464
+ if not id:
465
+ id = 'None'
466
+ return '\n <label class="checkBtn%s"><input type="checkbox" onclick="%s(this)" id="%s" %s>%s</label>'\
467
+ % (' disabled' if not enabled else '', function, id, 'checked' if enabled else 'disabled', id)
468
+
469
+ def filter_bar(enabled):
470
+ severity_bar = ''.join([filter_button(enabled, severity, 'toggleSeverity') for severity in ['error', 'warning', 'portability', 'performance', 'style', 'information']]) + '\n | '
471
+ classification_bar = ''.join([filter_button(enabled, _class, 'toggleClassification') for _class in ['Mandatory', 'Required', 'Advisory', 'Document', 'Disapplied', 'L1','L2','L3','']]) + '\n | '
472
+ if "checked/>" not in severity_bar:
473
+ severity_bar = ''
474
+ if "checked/>" not in classification_bar:
475
+ classification_bar = ''
476
+ return ''.join([
477
+ ' <div id="filters">\n'
478
+ ,severity_bar
479
+ , classification_bar
480
+ ,''.join([filter_button(enabled, tool, 'toggleTool') for tool in ['cppcheck', 'clang-tidy']])
481
+ ,'\n | '
482
+ ,'\n <label class="severityHeader">File: <input type="search" oninput="filterFile(this.value)"></label>'
483
+ ,'\n <label class="severityHeader">Filter: <input type="search" oninput="filterText(this.value)"></label>'
484
+ ,'\n </div>\n'])
485
+ def git_blame(errors, path, file, blame_options):
486
+ last_line= errors[-1]['line']
487
+ if last_line == 0:
488
+ return {}
489
+
490
+ first_line = next((error for error in errors if error['line'] > 0))['line']
491
+
492
+ full_path = os.path.join(path, file)
493
+ path, filename = os.path.split(full_path)
494
+
495
+ if not path:
496
+ path = None # make sure this is None
497
+
498
+ cmd_args = ['git', 'blame', '-L %d,%d' % (first_line, last_line)]
499
+ if '-w' in blame_options:
500
+ cmd_args.append('-w')
501
+ if '-M' in blame_options:
502
+ cmd_args.append('-M')
503
+ cmd_args = cmd_args + ['--porcelain', '--incremental', '--', filename]
504
+
505
+ try:
506
+ result = subprocess.check_output(cmd_args, cwd=path)
507
+ result = result.decode(locale.getpreferredencoding())
508
+ except:
509
+ return []
510
+
511
+ if result.startswith('fatal'):
512
+ return []
513
+
514
+ blame_data = []
515
+ line_from = 0
516
+ line_to = 0
517
+ blame_info = {}
518
+
519
+ for line_str in result.splitlines():
520
+ field, _, value = line_str.partition(' ')
521
+ if len(field) == 40:
522
+ line_nr, count = value.split(' ')[1:]
523
+ line_from = int(line_nr)
524
+ line_to = line_from + int(count)
525
+ elif field.startswith('author'):
526
+ blame_info[field] = value
527
+ if field == 'author-time':
528
+ author_date = date.fromtimestamp(int(blame_info['author-time']))
529
+ blame_info['author-time'] = author_date.strftime("%d/%m/%Y")
530
+ elif field == 'filename':
531
+ blame_data.append([line_from, line_to, blame_info.copy()])
532
+
533
+ return blame_data
534
+
535
+
536
+ def blame_lookup(blame_data, line):
537
+ return next((data for start, end, data in blame_data if line >= start and line < end), {})
538
+
539
+
540
+ 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):
541
+ ret = ''
542
+ items = [id, cwe]
543
+ if severity:
544
+ items.append(severity)
545
+ if classification:
546
+ items.extend([classification, guideline])
547
+ if htmlfile:
548
+ if htmlfile.startswith("http://") or htmlfile.startswith("https://"):
549
+ # GitHub/GitLab style line anchor
550
+ href = f"{htmlfile.rstrip('#L1')}#L{line}"
551
+ # Emit **line number with link**
552
+ ret += f'<{td_th}><a href="{href}" target="_blank" rel="noopener noreferrer">{line}</a></{td_th}>'
553
+ else:
554
+ # local HTML annotated
555
+ href = f"{htmlfile}#line-{line}"
556
+ # Emit **line number with link**
557
+ ret += f'<{td_th}><a href="{href}">{line}</a></{td_th}>'
558
+
559
+ # Emit id, cwe, severity, classification, ...
560
+ for item in items:
561
+ ret += f'<{td_th}>{item}</{td_th}>'
562
+ else:
563
+ items.insert(0,line)
564
+ for item in items:
565
+ ret += '<%s>%s</%s>' % (td_th, item, td_th)
566
+ if message_class:
567
+ message_attribute = ' class="%s"' % message_class
568
+ else:
569
+ message_attribute = ''
570
+ ret += '<%s%s>%s</%s>' % (td_th, message_attribute, html_escape(message), td_th)
571
+
572
+ if timestamp:
573
+ ret += '<%s>%s</%s>' % (td_th, timestamp, td_th)
574
+
575
+ for field in add_author:
576
+ if field == 'name':
577
+ ret += '<%s>%s</%s>' % (td_th, html_escape(author), td_th)
578
+ elif field == 'email':
579
+ ret += '<%s>%s</%s>' % (td_th, html_escape(author_mail), td_th)
580
+ elif field == 'date':
581
+ ret += '<%s>%s</%s>' % (td_th, date, td_th)
582
+
583
+ if tr_class:
584
+ tr_attributes = ' class="%s"' % tr_class
585
+ else:
586
+ tr_attributes = ''
587
+ return '<tr%s>%s</tr>' % (tr_attributes, ret)
588
+
589
+
590
+ def to_css_selector(tag):
591
+ # https://www.w3.org/TR/CSS2/syndata.html#characters
592
+ # Note: for our usage, we don't consider escaped characters
593
+ invalid_css_chars = re.compile(r"[^-_a-zA-Z0-9\u00A0-\uFFFF]")
594
+ invalid_start = re.compile(r"^([0-9]|-[0-9]|--)")
595
+ # Replace forbidden characters by an hyphen
596
+ valid_chars = invalid_css_chars.sub("-", tag)
597
+ # Check that the start of the tag doesn't break the rules
598
+ start_invalid = invalid_start.match(valid_chars)
599
+ if start_invalid:
600
+ # otherwise, append a token to make it valid
601
+ valid_chars_valid_start = "cpp" + valid_chars
602
+ else:
603
+ valid_chars_valid_start = valid_chars
604
+ return valid_chars_valid_start
605
+
606
+ class AnnotateCodeFormatter(HtmlFormatter):
607
+ errors = []
608
+
609
+ def wrap(self, *args, **kwargs):
610
+ line_no = 1
611
+ for i, t in HtmlFormatter.wrap(self, *args, **kwargs):
612
+ # If this is a source code line we want to add a span tag at the
613
+ # end.
614
+ if i == 1:
615
+ for error in self.errors:
616
+ if error['line'] == line_no:
617
+ try:
618
+ if error['inconclusive'] == 'true':
619
+ # only print verbose msg if it really differs
620
+ # from actual message
621
+ if error.get('verbose') and (error['verbose'] != error['msg']):
622
+ index = t.rfind('\n')
623
+ t = t[:index] + HTML_EXPANDABLE_INCONCLUSIVE % (error['msg'], html_escape(error['verbose'].replace("\\012", '\n'))) + t[index + 1:]
624
+ else:
625
+ t = t.replace('\n', HTML_INCONCLUSIVE % error['msg'])
626
+ except KeyError:
627
+ if error.get('verbose') and (error['verbose'] != error['msg']):
628
+ index = t.rfind('\n')
629
+ t = t[:index] + HTML_EXPANDABLE_ERROR % (error['msg'], html_escape(error['verbose'].replace("\\012", '\n'))) + t[index + 1:]
630
+ else:
631
+ t = t.replace('\n', HTML_ERROR % error['msg'])
632
+
633
+ line_no = line_no + 1
634
+ yield i, t
635
+
636
+
637
+ class CppCheckHandler(XmlContentHandler):
638
+
639
+ """Parses the cppcheck xml file and produces a list of all its errors."""
640
+
641
+ def __init__(self):
642
+ XmlContentHandler.__init__(self)
643
+ self.errors = []
644
+ self.version = '1'
645
+ self.versionCppcheck = ''
646
+ self.timestamp = ''
647
+ self.report_type = False
648
+
649
+ def startElement(self, name, attributes):
650
+ if name == 'results':
651
+ self.version = attributes.get('version', self.version)
652
+
653
+ if self.version == '1':
654
+ self.handleVersion1(name, attributes)
655
+ else:
656
+ self.handleVersion2(name, attributes)
657
+
658
+ def handleVersion1(self, name, attributes):
659
+ if name != 'error':
660
+ return
661
+ att_class = attributes.get('classification', '')
662
+ att_guide = attributes.get('guideline', '')
663
+ if att_class and not self.report_type:
664
+ self.report_type = True
665
+ self.errors.append({
666
+ 'file': attributes.get('file', ''),
667
+ 'line': int(attributes.get('line', 0)),
668
+ 'locations': [{
669
+ 'file': attributes.get('file', ''),
670
+ 'line': int(attributes.get('line', 0)),
671
+ }],
672
+ 'id': attributes['id'],
673
+ 'severity': attributes['severity'],
674
+ 'classification': att_class,
675
+ 'guideline': att_guide,
676
+ 'timestamp': self.timestamp,
677
+ 'msg': attributes['msg']
678
+ })
679
+
680
+ def handleVersion2(self, name, attributes):
681
+ if name == 'cppcheck':
682
+ self.versionCppcheck = attributes['version']
683
+ if name == 'error':
684
+ att_class = attributes.get('classification', '')
685
+ att_guide = attributes.get('guideline', '')
686
+ if att_class and not self.report_type:
687
+ self.report_type = True
688
+ error = {
689
+ 'locations': [],
690
+ 'file': '',
691
+ 'line': 0,
692
+ 'id': attributes['id'],
693
+ 'classification': att_class,
694
+ 'severity': attributes['severity'],
695
+ 'guideline': att_guide,
696
+ 'timestamp': self.timestamp,
697
+ 'msg': attributes['msg'],
698
+ 'verbose': attributes.get('verbose')
699
+ }
700
+
701
+ if 'inconclusive' in attributes:
702
+ error['inconclusive'] = attributes['inconclusive']
703
+ if 'cwe' in attributes:
704
+ error['cwe'] = attributes['cwe']
705
+
706
+ self.errors.append(error)
707
+ elif name == 'location':
708
+ assert self.errors
709
+ error = self.errors[-1]
710
+ locations = error['locations']
711
+ file = attributes['file']
712
+ line = int(attributes['line'])
713
+ if not locations:
714
+ error['file'] = file
715
+ error['line'] = line
716
+ locations.append({
717
+ 'file': file,
718
+ 'line': line,
719
+ 'info': attributes.get('info')
720
+ })
721
+ def main() -> None:
722
+ # Configure all the options this little utility is using.
723
+ parser = argparse.ArgumentParser()
724
+ parser.add_argument('--title', dest='title',
725
+ help='The title of the project.',
726
+ default='[project name]')
727
+ parser.add_argument('--file', dest='file', action="append",
728
+ help='The cppcheck xml output file to read defects '
729
+ 'from. You can combine results from several '
730
+ 'xml reports i.e. "--file file1.xml --file file2.xml ..". '
731
+ 'Default is reading from stdin.')
732
+ parser.add_argument('--checkers-report-file', dest='checkers_report',
733
+ help='The cppcheck checkers report file as produced '
734
+ 'with the "--checkers-report" option of cppcheck.')
735
+ parser.add_argument('--report-dir', dest='report_dir',
736
+ help='The directory where the HTML report content is '
737
+ 'written.')
738
+ parser.add_argument('--source-dir', dest='source_dir',
739
+ help='Base directory where source code files can be '
740
+ 'found, or a URL to a remote GitHub/GitLab '
741
+ 'repository including a branch, e.g. '
742
+ '--source-dir=https://github.com/<username>/<repo>/blob/<branch>/')
743
+ parser.add_argument('--add-author-information', dest='add_author_information',
744
+ help='Blame information to include. '
745
+ 'Adds specified author information. '
746
+ 'Specify as comma-separated list of either "name", "email", "date" or "n","e","d". '
747
+ 'Default: "n,e,d"')
748
+ parser.add_argument('--source-encoding', dest='source_encoding',
749
+ help='Encoding of source code.', default='utf-8')
750
+ parser.add_argument('--blame-options', dest='blame_options',
751
+ help='[-w, -M] blame options which you can use to get author and author mail '
752
+ '-w --> not including white spaces and returns original author of the line '
753
+ '-M --> not including moving of lines and returns original author of the line')
754
+
755
+ # Parse options and make sure that we have an output directory set.
756
+ options = parser.parse_args()
757
+
758
+ try:
759
+ sys.argv[1]
760
+ except IndexError: # no arguments give, print --help
761
+ parser.print_help()
762
+ sys.exit(0)
763
+
764
+ if not options.report_dir:
765
+ parser.error('No report directory set.')
766
+
767
+ # Get the directory where source code files are located.
768
+ source_dir = os.getcwd()
769
+ if options.source_dir:
770
+ source_dir = options.source_dir
771
+
772
+ is_remote = False
773
+ if source_dir.startswith("http://") or source_dir.startswith("https://"):
774
+ is_remote = True
775
+
776
+ add_author_information = []
777
+ if options.add_author_information:
778
+ fields = [x.strip() for x in options.add_author_information.split(',')]
779
+ for x in fields:
780
+ if x.lower() in ['n', 'name']:
781
+ add_author_information.append('name')
782
+ elif x.lower() in ['e', 'email']:
783
+ add_author_information.append('email')
784
+ elif x.lower() in ['d', 'date']:
785
+ add_author_information.append('date')
786
+ else:
787
+ print('Unrecognized value "%s" for author information, using default (name, email, date)' % x)
788
+ add_author_information = ['name', 'email', 'date']
789
+ break
790
+
791
+ blame_options = ''
792
+ if options.blame_options:
793
+ blame_options = options.blame_options
794
+ add_author_information = add_author_information or ['name', 'email', 'date']
795
+
796
+ # Parse the xml from all files defined in file argument
797
+ # or from stdin. If no input is provided, stdin is used
798
+ # Produce a simple list of errors.
799
+ print('Parsing xml report.')
800
+ try:
801
+ contentHandler = CppCheckHandler()
802
+ for fname in options.file or [sys.stdin]:
803
+ if options.file is not None:
804
+ t = os.path.getmtime(fname)
805
+ else:
806
+ t = time.time()
807
+ t_s = time.ctime(t)
808
+ if t_s is not None:
809
+ contentHandler.timestamp = t_s
810
+ xml_parse(fname, contentHandler)
811
+ except (XmlParseException, ValueError) as msg:
812
+ print('Failed to parse cppcheck xml file: %s' % msg)
813
+ sys.exit(1)
814
+
815
+ # We have a list of errors. But now we want to group them on
816
+ # each source code file. Lets create a files dictionary that
817
+ # will contain a list of all the errors in that file. For each
818
+ # file we will also generate a HTML filename to use.
819
+ files = {}
820
+ file_no = 0
821
+ for error in contentHandler.errors:
822
+ filename = error['file']
823
+ if filename not in files:
824
+ if is_remote:
825
+ # Construct remote URL for GitHub/GitLab
826
+ # tr_str() will use the actual line number, so we can just start with line 1
827
+ remote_url = source_dir.rstrip('/') + '/' + filename + '#L1'
828
+ files[filename] = {'errors': [], 'htmlfile': remote_url}
829
+ else:
830
+ files[filename] = {'errors': [], 'htmlfile': str(file_no) + '.html'}
831
+ file_no += 1
832
+ files[filename]['errors'].append(error)
833
+
834
+ # Make sure that the report directory is created if it doesn't exist.
835
+ print('Creating %s directory' % options.report_dir)
836
+ if not os.path.exists(options.report_dir):
837
+ os.makedirs(options.report_dir)
838
+
839
+ # Generate a HTML file with syntax highlighted source code for each
840
+ # file that contains one or more errors.
841
+ print('Processing errors')
842
+
843
+ decode_errors = []
844
+ for filename, data in sorted(files.items()):
845
+ htmlfile = data['htmlfile']
846
+ errors = []
847
+
848
+ for error in data['errors']:
849
+ for location in error['locations']:
850
+ if filename == location['file']:
851
+ newError = dict(error)
852
+
853
+ del newError['locations']
854
+ newError['line'] = location['line']
855
+ if location.get('info'):
856
+ newError['msg'] = location['info']
857
+ newError['severity'] = 'information'
858
+ newError['classification'] = ''
859
+ newError['guideline'] = ''
860
+ del newError['verbose']
861
+
862
+ errors.append(newError)
863
+
864
+ lines = []
865
+ for error in errors:
866
+ lines.append(error['line'])
867
+
868
+ if filename == '':
869
+ continue
870
+
871
+ if is_remote:
872
+ # Remote source: do NOT generate local annotated HTML files.
873
+ # The index will still point directly to GitHub/GitLab URLs.
874
+ continue
875
+
876
+ source_filename = os.path.join(source_dir, filename)
877
+ try:
878
+ with io.open(source_filename, 'r', encoding=options.source_encoding) as input_file:
879
+ content = input_file.read()
880
+ except IOError:
881
+ if error['id'] != 'unmatchedSuppression':
882
+ sys.stderr.write("ERROR: Source file '%s' not found.\n" %
883
+ source_filename)
884
+ continue
885
+ except UnicodeDecodeError:
886
+ sys.stderr.write("WARNING: Unicode decode error in '%s'.\n" %
887
+ source_filename)
888
+ decode_errors.append(source_filename[2:]) # "[2:]" gets rid of "./" at beginning
889
+ continue
890
+
891
+ htmlFormatter = AnnotateCodeFormatter(linenos=True,
892
+ style='colorful',
893
+ hl_lines=lines,
894
+ lineanchors='line',
895
+ encoding=options.source_encoding)
896
+ htmlFormatter.errors = errors
897
+
898
+ with io.open(os.path.join(options.report_dir, htmlfile), 'w', encoding='utf-8') as output_file:
899
+ output_file.write(HTML_HEAD %
900
+ (options.title,
901
+ htmlFormatter.get_style_defs('.highlight'),
902
+ options.title,
903
+ ': ' + filename))
904
+ output_file.write(HTML_HEAD_END)
905
+
906
+ output_file.write(HTML_MENU % (filename.split('/')[-1]))
907
+ for error in sorted(errors, key=lambda k: k['line']):
908
+ output_file.write("<a href=\"%s#line-%d\"> %s %s</a>" % (data['htmlfile'], error['line'], error['id'], error['line']))
909
+ output_file.write(HTML_MENU_END)
910
+
911
+ try:
912
+ lexer = guess_lexer_for_filename(source_filename, '', stripnl=False)
913
+ except ClassNotFound:
914
+ try:
915
+ lexer = guess_lexer(content, stripnl=False)
916
+ except ClassNotFound:
917
+ sys.stderr.write("ERROR: Couldn't determine lexer for the file' " + source_filename + " '. Won't be able to syntax highlight this file.")
918
+ output_file.write("\n <tr><td colspan=\"6\"> Could not generate content because pygments failed to determine the code type.</td></tr>")
919
+ output_file.write("\n <tr><td colspan=\"6\"> Sorry about this.</td></tr>")
920
+ continue
921
+
922
+ if options.source_encoding:
923
+ lexer.encoding = options.source_encoding
924
+
925
+ output_file.write(
926
+ highlight(content, lexer, htmlFormatter).decode(
927
+ options.source_encoding))
928
+
929
+ output_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
930
+
931
+ print(' ' + filename)
932
+
933
+ # Generate a master index.html file that will contain a list of
934
+ # all the errors created.
935
+ print('Creating index.html')
936
+
937
+ with io.open(os.path.join(options.report_dir, 'index.html'),
938
+ 'w') as output_file:
939
+
940
+ stats_count = 0
941
+ stats = []
942
+ filter_enabled = {}
943
+ for filename, data in sorted(files.items()):
944
+ for error in data['errors']:
945
+ stats.append(error['id']) # get the stats
946
+ if contentHandler.report_type:
947
+ filter_enabled[error['severity']] = False
948
+ filter_enabled[error['classification']] = True
949
+ else:
950
+ filter_enabled[error['severity']] = True
951
+ filter_enabled[error['classification']] = False
952
+ filter_enabled['clang-tidy' if error['id'].startswith('clang-tidy-') else 'cppcheck'] = True
953
+ stats_count += 1
954
+
955
+ counter = Counter(stats)
956
+
957
+ stat_html = []
958
+ # the following lines sort the stat primary by value (occurrences),
959
+ # but if two IDs occur equally often, then we sort them alphabetically by warning ID
960
+ try:
961
+ cnt_max = counter.most_common()[0][1]
962
+ except IndexError:
963
+ cnt_max = 0
964
+
965
+ try:
966
+ cnt_min = counter.most_common()[-1][1]
967
+ except IndexError:
968
+ cnt_min = 0
969
+
970
+ stat_fmt = "\n <tr><td><input type=\"checkbox\" class=\"idToggle\" onclick=\"toggleDisplay(this)\" id=\"{}\" name=\"{}\" checked></td><td>{}</td><td>{}</td></tr>"
971
+ for occurrences in reversed(range(cnt_min, cnt_max + 1)):
972
+ for _id in [k for k, v in sorted(counter.items()) if v == occurrences]:
973
+ stat_html.append(stat_fmt.format(
974
+ to_css_selector(_id),
975
+ to_css_selector(_id),
976
+ dict(counter.most_common())[_id],
977
+ _id
978
+ ))
979
+
980
+ output_file.write(HTML_HEAD % (options.title, '', options.title, ''))
981
+ output_file.write(filter_bar(filter_enabled))
982
+ output_file.write(HTML_HEAD_END)
983
+ output_file.write(HTML_MENU.replace('id="menu"', 'id="menu_index"', 1).replace("Defects:", "Defect summary", 1) % (''))
984
+ output_file.write('\n <label><input type="checkbox" class=\"idToggle\" onclick="toggleAll()" checked> Toggle all</label>')
985
+ output_file.write('\n <table>')
986
+ output_file.write('\n <tr><th>Show</th><th>#</th><th>Defect ID</th></tr>')
987
+ output_file.write(''.join(stat_html))
988
+ output_file.write('\n <tr><td></td><td>' + str(stats_count) + '</td><td>total</td></tr>')
989
+ output_file.write('\n </table>')
990
+ output_file.write('\n <p><a href="stats.html">Statistics</a></p>')
991
+ if options.checkers_report:
992
+ output_file.write('\n <p><a href="checkers.html">Checkers</a></p>')
993
+ output_file.write(HTML_MENU_END.replace("content", "content_index", 1))
994
+
995
+ output_file.write('\n <table class=\"summaryTable\">')
996
+ if contentHandler.report_type:
997
+ output_file.write(
998
+ '\n %s' %
999
+ tr_str('th', 'Line', 'Id', 'CWE', '', 'Classification', 'Guideline', 'Message', 'Timestamp',
1000
+ 'Author', 'Author mail', 'Date (DD/MM/YYYY)', add_author=add_author_information))
1001
+ else:
1002
+ output_file.write(
1003
+ '\n %s' %
1004
+ tr_str('th', 'Line', 'Id', 'CWE', 'Severity', '', '', 'Message', 'Timestamp', 'Author', 'Author mail', 'Date (DD/MM/YYYY)', add_author=add_author_information))
1005
+
1006
+ for filename, data in sorted(files.items()):
1007
+ file_error = filename in decode_errors or filename.endswith('*')
1008
+ is_file = filename != '' and not file_error
1009
+ row_content = filename if file_error else "<a href=\"%s\">%s</a>" % (data['htmlfile'], filename)
1010
+ htmlfile = data.get('htmlfile') if is_file else None
1011
+
1012
+ output_file.write("\n <tbody class=\"fileEntry\">")
1013
+ output_file.write("\n <tr><td colspan=\"6\">%s</td></tr>" % row_content)
1014
+
1015
+ if filename in decode_errors:
1016
+ output_file.write("\n <tr><td colspan=\"6\">Could not generated due to UnicodeDecodeError</td></tr>")
1017
+
1018
+ sorted_errors = sorted(data['errors'], key=lambda k: k['line'])
1019
+ blame_data = git_blame(sorted_errors, source_dir, filename, blame_options) if add_author_information else []
1020
+ for error in sorted_errors:
1021
+ git_blame_dict = blame_lookup(blame_data, error['line'])
1022
+ message_class = None
1023
+ try:
1024
+ if error['inconclusive'] == 'true':
1025
+ message_class = 'inconclusive'
1026
+ error['severity'] += ", inconcl."
1027
+ except KeyError:
1028
+ pass
1029
+
1030
+ cwe_url = ""
1031
+ try:
1032
+ if error['cwe']:
1033
+ cwe_url = "<a href=\"https://cwe.mitre.org/data/definitions/" + error['cwe'] + ".html\">" + error['cwe'] + "</a>"
1034
+ except KeyError:
1035
+ pass
1036
+
1037
+ if error['severity'] in ['error', 'warning']:
1038
+ message_class = error['severity']
1039
+
1040
+ line = error["line"] if is_file else ""
1041
+ _severity = error.get('severity', '')
1042
+ _classification = error.get('classification', '')
1043
+ _guideline = error.get('guideline', '')
1044
+ if contentHandler.report_type:
1045
+ _severity = ''
1046
+ if not _classification:
1047
+ _classification = 'None'
1048
+ _guideline = 'None'
1049
+ output_file.write(
1050
+ '\n %s' %
1051
+ tr_str('td', line, error["id"], cwe_url, _severity, _classification, _guideline, error["msg"], error["timestamp"],
1052
+ git_blame_dict.get('author', 'Unknown'), git_blame_dict.get('author-mail', '---'),
1053
+ git_blame_dict.get('author-time', '---'),
1054
+ tr_class=to_css_selector(error["id"]) + ' sev_' + _severity +' class_' + _classification + ' issue',
1055
+ message_class=message_class,
1056
+ add_author=add_author_information,
1057
+ htmlfile=htmlfile))
1058
+ output_file.write("\n </tbody>")
1059
+ output_file.write('\n </table>')
1060
+ output_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
1061
+
1062
+ if decode_errors:
1063
+ sys.stderr.write("\nGenerating html failed for the following files: " + ' '.join(decode_errors))
1064
+ sys.stderr.write("\nConsider changing source-encoding (for example: \"htmlreport ... --source-encoding=\"iso8859-1\"\"\n")
1065
+
1066
+ print('Creating style.css file')
1067
+ with io.open(os.path.join(options.report_dir, 'style.css'), 'w') as css_file:
1068
+ css_file.write(STYLE_FILE)
1069
+
1070
+ print("Creating stats.html (statistics)\n")
1071
+ stats_countlist = {}
1072
+
1073
+ for filename, data in sorted(files.items()):
1074
+ if filename == '':
1075
+ continue
1076
+ stats_tmplist = []
1077
+ for error in sorted(data['errors'], key=lambda k: k['line']):
1078
+ stats_tmplist.append(error['severity'])
1079
+
1080
+ stats_countlist[filename] = dict(Counter(stats_tmplist))
1081
+
1082
+ # get top ten for each severity
1083
+ SEVERITIES = "error", "warning", "portability", "performance", "style", "unusedFunction", "information", "missingInclude", "internal"
1084
+
1085
+ with io.open(os.path.join(options.report_dir, 'stats.html'), 'w') as stats_file:
1086
+
1087
+ stats_file.write(HTML_HEAD % (options.title, '', options.title, ': Statistics'))
1088
+ stats_file.write(HTML_HEAD_END)
1089
+
1090
+ stats_file.write(HTML_MENU.replace('id="menu"', 'id="menu_index"', 1).replace("Defects:", "Back to summary", 1) % (''))
1091
+ stats_file.write(HTML_MENU_END.replace("content", "content_index", 1))
1092
+
1093
+
1094
+ for sev in SEVERITIES:
1095
+ _sum = 0
1096
+ stats_templist = {}
1097
+
1098
+ # if the we have an style warning but we are checking for
1099
+ # portability, we have to skip it to prevent KeyError
1100
+ try:
1101
+ for filename in stats_countlist:
1102
+ try: # also bail out if we have a file with no sev-results
1103
+ _sum += stats_countlist[filename][sev]
1104
+ stats_templist[filename] = int(stats_countlist[filename][sev]) # file : amount,
1105
+ except KeyError:
1106
+ continue
1107
+ # don't print "0 style" etc, if no style warnings were found
1108
+ if _sum == 0:
1109
+ continue
1110
+ except KeyError:
1111
+ continue
1112
+ stats_file.write("<p><span class=\"statHeader\">Top 10 files for " + sev + " severity, total findings: " + str(_sum) + "</span><br>\n")
1113
+
1114
+ # sort, so that the file with the most severities per type is first
1115
+ stats_list_sorted = sorted(stats_templist.items(), key=operator.itemgetter(1, 0), reverse=True)
1116
+ it = 0
1117
+ LENGTH = 0
1118
+
1119
+ for i in stats_list_sorted: # printing loop
1120
+ # for aesthetics: if it's the first iteration of the loop, get
1121
+ # the max length of the number string
1122
+ if it == 0:
1123
+ LENGTH = len(str(i[1])) # <- length of longest number, now get the difference and try to make other numbers align to it
1124
+
1125
+ 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")
1126
+ it += 1
1127
+ if it == 10: # print only the top 10
1128
+ break
1129
+ stats_file.write("</p>\n")
1130
+
1131
+ stats_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
1132
+
1133
+ if options.checkers_report:
1134
+ print("Creating checkers.html (checkers report)\n")
1135
+
1136
+ with io.open(os.path.join(options.report_dir, 'checkers.html'), 'w') as checkers_file:
1137
+
1138
+ checkers_file.write(HTML_HEAD % (options.title, '', options.title, ': Checkers'))
1139
+ checkers_file.write(HTML_HEAD_END)
1140
+
1141
+ checkers_file.write(HTML_MENU.replace('id="menu"', 'id="menu_index"', 1).replace("Defects:", "Back to summary", 1) % (''))
1142
+ checkers_file.write(HTML_MENU_END.replace("content", "content_index", 1))
1143
+
1144
+ with io.open(options.checkers_report, 'r', encoding=options.source_encoding) as checkers_report:
1145
+ content = checkers_report.read()
1146
+
1147
+ checkers_file.write("<pre>\n")
1148
+ checkers_file.write(html_escape(content))
1149
+ checkers_file.write("</pre>\n")
1150
+
1151
+ checkers_file.write(HTML_FOOTER % contentHandler.versionCppcheck)
1152
+
1153
+ print("\nOpen '" + options.report_dir + "/index.html' to see the results.")
1154
+
1155
+
1156
+ if __name__ == "__main__":
1157
+ main()
micromamba_root/Library/bin/ffi-8.dll ADDED
Binary file (27.1 kB). View file
 
micromamba_root/Library/bin/libbz2.dll ADDED
Binary file (77.8 kB). View file