Hello everyone.

I found and have grown fond of a particular metric. [cyclomatic complexity 
(wikipedia link)](https://en.wikipedia.org/wiki/Cyclomatic_complexity) To save 
you the "definition jargon", it counts your ifs, while, blocks, etc. in a 
function. Meaning, even a short, but a highly nested function is 'bad' and a 
long function can be considered 'good' if only it's not very complex and mostly 
linear / sequential.

I use it in python with this module: 
https://radon.readthedocs.io/en/latest/intro.html#cyclomatic-complexity

Which takes a python file and returns a sorted list of the functions in that 
file, with color coding and the worst being at the top.

For my case I can just set it up as a custom command. 

But I still need to remember to press the button. It would be a quality of life 
improvement if the command ran automatically, let's say every time I save a 
file and if the feedback I'm getting wouldn't come as text output in the built 
in console, but as some kind of colored hint in the symbol list. E.g. maybe a 
colored [CC:A] or [CC:F].

Since it's a general metric, it may be interesting to set this up for other 
languages as well.

![image](https://github.com/geany/geany-plugins/assets/5713211/6efd0300-f852-4c63-bad7-6706bcee8c26)


-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany-plugins/issues/1356
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany-plugins/issues/[email protected]>

Reply via email to