Commit e45ca30
committed
chore: add a cyclomatic complexity plugin to
This commit add a feature commented by @jaonoctus on a [\selfcustody#847
comment](https://github.com/selfcustody/krux/pull/847/changes#r3029819808),
where an review about multiple lines review could be avoided
automatically if we apply the `mccabe` plugin to `pylint`.
E.g, visually complexity could lead humans to interpret some lines as
complex given a experience of how code should be or not to be; some
standars could say that 25 lines could be the limit of a readability.
But a cyclomatic complexity on a function could be used as a "how real
complex is the function" and "it should be really refactored?".
Tested with `max-complexity=13` and `max-complexity=20` in tags
`v26.03.0`, branches `main`, `develop` and
`feat/stackbit-1248-vertical`. For more details about values a wikipedia
short ref:
* 1–10: Simple procedure: `little risk`;
* 11–20: More complex: `moderate risk`;
* 21–50: Complex: `high risk`.
* > 50: Untestable code: `very high risk`;
For now, this commit found 7 `too-complex` functions on source code
base.pylint
1 parent e531811 commit e45ca30
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
104 | 105 | | |
105 | 106 | | |
106 | 107 | | |
| |||
0 commit comments