-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIX] CodeQL reports #3307
[FIX] CodeQL reports #3307
Conversation
Documentation preview available at https://docs.seqan.de/preview/seqan/seqan3/3307 |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3307 +/- ##
=======================================
Coverage 98.13% 98.13%
=======================================
Files 271 271
Lines 11948 11954 +6
Branches 104 104
=======================================
+ Hits 11725 11731 +6
Misses 223 223 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
unsigned_t end = start << 1u; | ||
for (unsigned_t n = start, k = 0u; n < end && k < max_iterations; ++n, ++k) | ||
unsigned_t end = static_cast<unsigned_t>(std::min<size_t>(start / 2u, max_iterations)); | ||
for (unsigned_t n = start; n < end; ++n) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be something wrong here.
end = start * 2
but also the result of std::min seems wrong:
I expeected something like:
std::min(start, max_iterations) + start
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was very wrong 😆
test/unit/utility/math_test.cpp
Outdated
@@ -65,13 +65,13 @@ TYPED_TEST(unsigned_operations, ceil_log2) | |||
for (uint8_t log2_value = 0; log2_value < seqan3::detail::bits_of<unsigned_t>; ++log2_value) | |||
{ | |||
unsigned_t start = unsigned_t{1u} << log2_value; | |||
unsigned_t end = start << 1u; | |||
unsigned_t end = static_cast<unsigned_t>(std::min<size_t>(start / 2u, max_iterations)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
BTW, reports are here https://github.com/seqan/seqan3/security/code-scanning |
These are all
Comparison of narrow type with wide type in loop condition