2023-11-07 10:43 PM
I tried to analyze our mixed C/C++ STM32F4xx project, but all functions in *.cpp sources including "main()" are not shown by default, until I deactivated the "hide dead code" checkbox.
ST,
could you please confirm the bug in new Cyclomatic Complexity tool?
Hiding unlinked code would be useful indeed, if all actually called C++ functions would be reported correctly.
2023-11-27 06:33 AM
Hello @0x0BADCODE
First let me thank you for posting and apologize for the late reply.
I made a test and I'm not able to reproduce the described behavior.
Could you provide some code snip which help the see the issue?
KR,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2023-11-27 08:08 AM
Hello Semer,
I just noticed today that the Cyclomatic Complexity window is empty - until I actually connect the target with Debugger (which is a bit surprising as I would expect the CC is a kind of static analysis tool, so having ELF image on host PC should be sufficient to track unused code, etc.).
So back to your question: if you cannot reproduce the behavior - it is not about a specific "code snip" but the debug configuration. In my case I use Segger JLink Plus or also Segger OB reflashed on Nucleo board. Moreover, with debugger and Breakpoint set on RESET vector, the CC window is initially empty until the C main() is reached, then the C functions appear in the CC list but none of the C++... Hope this helps.
2023-11-27 10:09 AM
Hello @0x0BADCODE
"I just noticed today that the Cyclomatic Complexity window is empty - until I actually connect the target with Debugger (which is a bit surprising as I would expect the CC is a kind of static analysis tool, so having ELF image on host PC should be sufficient to track unused code, etc.)."
> You are right only the elf file is needed for the feature to function and it's unusual to see the described behavior.
However, about the original question, after further test I see what you are talking about. Initially I misunderstood the question. I thought you talk about function declared with extern "C" not the class methods.
I fact I imported a CPP project I found that methods declared in a class will not be shown unless the "Hide dead code" is ticked.
I will escalade this question internally and go back to you with an answer ASAP.
KR,
Semer.
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-06-17 10:19 AM
Same here. I am on Cube 1.15.0 and none of my class methods in any of my *.cc files show until I deactivate that "Hide dead code" option. At least that workaround exists.
2024-10-01 01:56 AM
I'm on 1.16.1 and despite "hide dead code" is unchecked, I can't see Cyclomatic Complexity.
The only way is to download in debug mode to the physical microcontroller
Is it a bug?