nicolargo / glances

Glances an Eye on your system. A top/htop alternative for GNU/Linux, BSD, Mac OS and Windows operating systems.
http://nicolargo.github.io/glances/
Other
26.75k stars 1.53k forks source link

Reduce code complexity #2801

Open nicolargo opened 5 months ago

nicolargo commented 5 months ago

Reduce complexity of function higher than 20:

https://scrutinizer-ci.com/g/nicolargo/glances/code-structure/develop?elementType=py-function&orderField=conditional_complexity&order=desc&changesExpanded=0

ariel-anieli commented 3 months ago

Hello @nicolargo, I will take on glances.plugins.system.PluginModel.update(). For us to agree on the expectation; I should follow How to fix, and that's it. Is it right?

nicolargo commented 3 months ago

@ariel-anieli yes and all code optimization that look interesting to you .

Thanks !

ariel-anieli commented 3 months ago

@ariel-anieli yes and all code optimization that loo, interesting to you .

Thanks !

:slightly_smiling_face: Je t'en prie! I will keep you posted.

ariel-anieli commented 3 months ago

@nicolargo, I will take on glances.plugins.percpu.PluginModel.msg_curse().

nicolargo commented 3 months ago

Huge task :) This method is historical...

ariel-anieli commented 3 months ago

Huge task :) This method is historical...

:slightly_smiling_face: I'll have a try. Are there caveats worth noticing?

ariel-anieli commented 3 months ago

@nicolargo, I am taking on unittest-core.TestGlances._common_plugin_tests().

ariel-anieli commented 3 months ago

I will tackle _GlancesCurses.__catch_key()

ariel-anieli commented 2 months ago

I'll take on PluginModel.__msg_curse_extended_process_thread()

ariel-anieli commented 2 months ago

I'll take up glances.plugins.containers.PluginModel.msg_curse()

ariel-anieli commented 3 weeks ago

I'll take on glances.plugins.ports.PluginModel.msg_curse()

ariel-anieli commented 1 week ago

I'll take on glances.plugins.ip.PluginModel.update.

nicolargo commented 5 days ago

Current status (2024 oct 26):

Glances 4.1.x score 6.39 Glances 4.2: score 6.63 (thanks to @ariel-anieli)

Next steps:

image