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-bad...)
You can do this with a plugin that runs at save and displays the data in a separate sidebar. Such a plugin could support a number of languages.
github-comments@lists.geany.org