Skip to content

Conversation

@olabetskyi
Copy link
Collaborator

No description provided.

@firewave
Copy link
Collaborator

LGTM. As an improvement the time could also be collected for the individual addons.

@danmar
Copy link
Owner

danmar commented Oct 23, 2025

as a start LGTM.. I have some small nits.. like "cancell" should be "cancel". I would like that we reuse this timer for the "--showtime=file-total" output also so a different class name would be better.
do we need to have 2 individual timer classes?

@olabetskyi olabetskyi marked this pull request as ready for review October 30, 2025 09:35
Copy link
Owner

@danmar danmar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I run this command:

./cppcheck --showtime=top5_file lib/ctu.cpp lib/analyzerinfo.cpp

then I would like that the "file-total" time is shown for each file.

lib/timer.cpp Outdated
if (minutes.count() > 0)
ellapsedTime += std::to_string(minutes.count()) + "m ";
std::string secondsStr{std::to_string(seconds.count())};
return (ellapsedTime + secondsStr.substr(0, secondsStr.length() - 3) + "s");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not defined how many digits secondStr has right? So if there are 10 digits I assume the output will have 7 digits and that is way too much.

@sonarqubecloud
Copy link

sonarqubecloud bot commented Nov 6, 2025

@olabetskyi olabetskyi merged commit 2c5b872 into danmar:main Nov 6, 2025
55 checks passed
@firewave
Copy link
Collaborator

firewave commented Nov 6, 2025

This added new functionality but no new tests were added. Am I missing something?

@olabetskyi
Copy link
Collaborator Author

This added new functionality but no new tests were added. Am I missing something?

Well you are not wrong but we doesn't have anything entirly new here and in tests we mostly check for newlines for the timer output which was chaned only slightly: we don't have overall timer now for top5_file and tests modifications reflect that. As for the time measurment we can't compare it to anything as it is always different. So I agree, some small test wouldn't hurt but I suppose we already cover the changes more or less

@firewave
Copy link
Collaborator

firewave commented Nov 6, 2025

Thanks for the explanation.

The problem is that it does way more than the title says. It should have probably been split into two and gotten an additional ticket for the new timer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants