A thread.
github.com/Remi-Gau/check…
1/16
One day you were given some .m files, a tap on the shoulder, a "good luck" and you have been reverse engineering the wheel of what it means to write good code since then.
2/16
i.e very unlikely but don't feel bad those classes are usually not proposed in most neuroscience departments anyway.
3/16
4/16
5/16
6/16
mathworks.com/help/matlab/re…
8/16
The McCabe complexity of a function is roughly how many paths one can take while navigating through all the conditional statements of the function (`if`, `switch`, ...).
en.wikipedia.org/wiki/Cyclomati…
9/16
If you are above 15, you want to seriously consider refactoring your code (with sub-functions for example).
en.wikipedia.org/wiki/Code_refa…
refactoring.com
refactoring.guru/refactoring
10/16
11/16
tiktok.com/@delaina00moor…
12/16
So why do we say that we will clean our code when we are ready to submit our paper? or after it has been published 😱😱😱 ?
And then we wonder why our code stink.
13/16
github.com/Remi-Gau/check…
15/16
THE END
16/16
@CyrilRPernet @Ch_Phillips @fmrwhy @cassgvp @cmaumet @cMadan @Giga_CRCivi @agahkarakuzu @_mattboud @BattalCeren
In case anyone wonders why I did not mention Octave or why this does not work with octave.
Well it is because this octave does not have a linter equivalent to the matlab one and that this whole function relies on the matlab internal linter.
github.com/florianschanda…
github.com/florianschanda…
github.com/florianschanda…
'SEEE!! Even matlab users says it's weird.' :-p