Closed rdb closed 1 year ago
clang-tidy can be extremely verbose, adding lots of context that can be useful but is often redundant and can cause extremely long comments.
It would be great if the additional context, if present, could be hidden underneath a collapsible section, like so:
warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
return result; ^
That is a great idea, thanks @rdb! I might have time to implement that this week, but if you're able to add it yourself, PRs are always greatly appreciated!
clang-tidy can be extremely verbose, adding lots of context that can be useful but is often redundant and can cause extremely long comments.
It would be great if the additional context, if present, could be hidden underneath a collapsible section, like so:
warning: Undefined or garbage value returned to caller [clang-analyzer-core.uninitialized.UndefReturn]
Additional context
**panda/src/downloadertools/multify.cxx:784:** Assuming 'argc' is >= 2 ```cpp if (argc < 2) { ^ ``` **panda/src/downloadertools/multify.cxx:784:** Taking false branch ```cpp if (argc < 2) { ^ ``` **panda/src/downloadertools/multify.cxx:791:** 'argc' is >= 2 ```cpp if (argc >= 2) { ^ ``` **panda/src/downloadertools/multify.cxx:791:** Taking true branch ```cpp if (argc >= 2) { ^ ``` **panda/src/downloadertools/multify.cxx:792:** Assuming the condition is false ```cpp if (*argv[1] != '-' && *argv[1] != '\0') { ^ ``` **panda/src/downloadertools/multify.cxx:792:** Left side of '&&' is false ```cpp if (*argv[1] != '-' && *argv[1] != '\0') { ^ ``` **panda/src/downloadertools/multify.cxx:807:** Left side of '&&' is false ```cpp if (source_date_epoch_str != nullptr && source_date_epoch_str[0] != 0) { ^ ``` **panda/src/downloadertools/multify.cxx:817:** Assuming the condition is false ```cpp while (flag != EOF) { ^ ``` **panda/src/downloadertools/multify.cxx:817:** Loop condition is false. Execution continues on line 953 ```cpp while (flag != EOF) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** Assuming 'create' is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** '?' condition is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** Assuming 'append' is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** '?' condition is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** Assuming 'update' is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** '?' condition is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** Assuming 'tlist' is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** '?' condition is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** Assuming 'extract' is true ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** '?' condition is true ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** Assuming 'kill_cmd' is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** '?' condition is false ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:956:** Taking false branch ```cpp if ((create?1:0) + (append?1:0) + (update?1:0) + (tlist?1:0) + (extract?1:0) + (kill_cmd?1:0) != 1) { ^ ``` **panda/src/downloadertools/multify.cxx:962:** Assuming 'got_multifile_name' is true ```cpp if (!got_multifile_name) { ^ ``` **panda/src/downloadertools/multify.cxx:962:** Taking false branch ```cpp if (!got_multifile_name) { ^ ``` **panda/src/downloadertools/multify.cxx:977:** Assuming 'i' is >= 'argc' ```cpp for (int i = 1; i < argc; i++) { ^ ``` **panda/src/downloadertools/multify.cxx:977:** Loop condition is false. Execution continues on line 982 ```cpp for (int i = 1; i < argc; i++) { ^ ``` **panda/src/downloadertools/multify.cxx:982:** Assuming 'create' is true ```cpp if (create || append || update) { ^ ``` **panda/src/downloadertools/multify.cxx:982:** Left side of '||' is true ```cpp if (create || append || update) { ^ ``` **panda/src/downloadertools/multify.cxx:983:** Calling 'add_files' ```cpp okflag = add_files(params); ^ ``` **panda/src/downloadertools/multify.cxx:381:** Assuming 'append' is false ```cpp if (append || update) { ^ ``` **panda/src/downloadertools/multify.cxx:381:** Left side of '||' is false ```cpp if (append || update) { ^ ``` **panda/src/downloadertools/multify.cxx:381:** Assuming 'update' is false ```cpp if (append || update) { ^ ``` **panda/src/downloadertools/multify.cxx:381:** Taking false branch ```cpp if (append || update) { ^ ``` **panda/src/downloadertools/multify.cxx:387:** Assuming the condition is false ```cpp if (!multifile->open_write(multifile_name)) { ^ ``` **panda/src/downloadertools/multify.cxx:387:** Taking false branch ```cpp if (!multifile->open_write(multifile_name)) { ^ ``` **panda/src/downloadertools/multify.cxx:396:** Assuming 'got_record_timestamp_flag' is false ```cpp if (got_record_timestamp_flag) { ^ ``` **panda/src/downloadertools/multify.cxx:396:** Taking false branch ```cpp if (got_record_timestamp_flag) { ^ ``` **panda/src/downloadertools/multify.cxx:400:** Assuming 'encryption_flag' is false ```cpp if (encryption_flag) { ^ ``` **panda/src/downloadertools/multify.cxx:400:** Taking false branch ```cpp if (encryption_flag) { ^ ``` **panda/src/downloadertools/multify.cxx:405:** Assuming 'got_header_prefix' is false ```cpp if (got_header_prefix) { ^ ``` **panda/src/downloadertools/multify.cxx:405:** Taking false branch ```cpp if (got_header_prefix) { ^ ``` **panda/src/downloadertools/multify.cxx:409:** Assuming 'scale_factor' is equal to 0 ```cpp if (scale_factor != 0 && scale_factor != multifile->get_scale_factor()) { ^ ``` **panda/src/downloadertools/multify.cxx:409:** Left side of '&&' is false ```cpp if (scale_factor != 0 && scale_factor != multifile->get_scale_factor()) { ^ ``` **panda/src/downloadertools/multify.cxx:419:** Loop condition is false. Execution continues on line 426 ```cpp for (si = params.begin(); si != params.end(); ++si) { ^ ``` **panda/src/downloadertools/multify.cxx:425:** Assuming 'got_chdir_to' is false ```cpp if (got_chdir_to && !chdir_to.chdir()) { ^ ``` **panda/src/downloadertools/multify.cxx:425:** Left side of '&&' is false ```cpp if (got_chdir_to && !chdir_to.chdir()) { ^ ``` **panda/src/downloadertools/multify.cxx:430:** Calling 'do_add_files' ```cpp bool okflag = do_add_files(multifile, filenames); ^ ``` **panda/src/downloadertools/multify.cxx:338:** Loop condition is true. Entering loop body ```cpp for (fi = filenames.begin(); fi != filenames.end(); ++fi) { ^ ``` **panda/src/downloadertools/multify.cxx:341:** Assuming the condition is false ```cpp if (subfile_name.is_directory()) { ^ ``` **panda/src/downloadertools/multify.cxx:341:** Taking false branch ```cpp if (subfile_name.is_directory()) { ^ ``` **panda/src/downloadertools/multify.cxx:346:** Assuming the condition is false ```cpp } else if (!subfile_name.exists()) { ^ ``` **panda/src/downloadertools/multify.cxx:346:** Taking false branch ```cpp } else if (!subfile_name.exists()) { ^ ``` **panda/src/downloadertools/multify.cxx:351:** Taking false branch ```cpp if (is_text(subfile_name)) { ^ ``` **panda/src/downloadertools/multify.cxx:358:** Assuming 'update' is false ```cpp if (update) { ^ ``` **panda/src/downloadertools/multify.cxx:358:** Taking false branch ```cpp if (update) { ^ ``` **panda/src/downloadertools/multify.cxx:363:** Calling 'get_compression_level' ```cpp (subfile_name, subfile_name, get_compression_level(subfile_name)); ^ ``` **panda/src/downloadertools/multify.cxx:297:** 'result' declared without an initial value ```cpp int result; ^ ``` **panda/src/downloadertools/multify.cxx:298:** Assuming 'compress_flag' is true ```cpp if (!compress_flag) { ^ ``` **panda/src/downloadertools/multify.cxx:298:** Taking false branch ```cpp if (!compress_flag) { ^ ``` **panda/src/downloadertools/multify.cxx:303:** Calling 'operator!=' ```cpp if (dont_compress.find(ext) != dont_compress.end()) { ^ ``` **/usr/include/c++/11/bits/stl_tree.h:401:** Assuming '__x._M_node' is equal to '__y._M_node' ```cpp { return __x._M_node != __y._M_node; } ^ ``` **/usr/include/c++/11/bits/stl_tree.h:401:** Returning zero, which participates in a condition later ```cpp { return __x._M_node != __y._M_node; } ^ ``` **panda/src/downloadertools/multify.cxx:303:** Returning from 'operator!=' ```cpp if (dont_compress.find(ext) != dont_compress.end()) { ^ ``` **panda/src/downloadertools/multify.cxx:303:** Taking false branch ```cpp if (dont_compress.find(ext) != dont_compress.end()) { ^ ``` **panda/src/downloadertools/multify.cxx:309:** Undefined or garbage value returned to caller ```cpp return result; ^ ```