Skip to content
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

Merged
merged 1 commit into from
Nov 19, 2024
Merged

[FIX] CodeQL reports #3307

merged 1 commit into from
Nov 19, 2024

Conversation

eseiler
Copy link
Member

@eseiler eseiler commented Nov 19, 2024

These are all Comparison of narrow type with wide type in loop condition

@seqan-actions seqan-actions added lint [INTERNAL] signal for linting and removed lint [INTERNAL] signal for linting labels Nov 19, 2024
@seqan-actions
Copy link
Member

Documentation preview available at https://docs.seqan.de/preview/seqan/seqan3/3307

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.13%. Comparing base (6f38aac) to head (18e5ddb).
Report is 2 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.


🚨 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)
Copy link
Contributor

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

Copy link
Member Author

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 😆

@@ -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));
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@seqan-actions seqan-actions added lint [INTERNAL] signal for linting and removed lint [INTERNAL] signal for linting labels Nov 19, 2024
@eseiler
Copy link
Member Author

eseiler commented Nov 19, 2024

BTW, reports are here https://github.com/seqan/seqan3/security/code-scanning

@eseiler eseiler merged commit c5a8eb5 into seqan:main Nov 19, 2024
42 checks passed
@eseiler eseiler deleted the fix/codeql branch November 19, 2024 15:46
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