Login
View Ticket
Login
Ticket Hash: cac8a77a3b785a995b4949a40a6158c6abeacba0
Title: search complexity lists below or equal to the selected value
Status: Fixed Type: Documentation
Resolution: Fixed Last Modified: 2025-10-18 11:56:21
Version Found In: Latest
User Comments:
firasuke added on 2025-10-17 12:29:47:

Hey there, thank you for your work on Nimalyzer!

I found another silly bug, it seems that search for complexity is checking for values less than equal the selected value (both check and count are checking for values greater than the selected value which is the intended behavior according to the available_rules.rst file.

Using search not complexity all 3 works as intended and checks for values that are greater than the selected value (which is 3 here).


thindil added on 2025-10-18 07:13:15:

Hello,

Thank you for the report. At the moment I think, it works as I expected, but I'm open to discussion in that matter. ;) My thoughts:

  1. I have some experience with a couple of similar tools from other programming languages, and usually they worked in the same way. Thus, for me it is more like convenience.

  2. If we set to detect both with equal, then positive search and negative (with not) will report the same block of code for both search. Personally I would prefer to avoid it.


firasuke added on 2025-10-18 09:10:43:

Oh I see, if it's an expected behavior then kindly ignore this ticket.

That being said, I personally think it would be a good idea to update the phrasing of available_rules.rst from:

Search type will list all code blocks of the selected type with the complexity above the selected value and raise error if nothing was found.

to:

Search type will list all code blocks of the selected type with the complexity less than or equal to the selected value and raise an error if nothing was found.

Thank you for your time!


thindil added on 2025-10-18 11:56:21:

Then it isn't a bug in the code, but a bug in the documentation. Not ignoring it. :)

Ok, it should be fixed too. Thank you again, for your report.