jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/1164670?usp=email )
Change subject: Test: set threshold for cyclomatic complexity to 50 ......................................................................
Test: set threshold for cyclomatic complexity to 50
The threshold can be described with the following values:
1-5: low risk - No action needed. 6-15: medium risk - Review and monitor. 16-25: high risk - Review and refactor. Recommended to add comments if the function is absolutely needed to be kept as it is. 26-50: very-high risk - Refactor to reduce the complexity.
50: critical risk - Must refactor this.
This can make the code untestable and very difficult to understand.
n.b. there are 24 issues with threshold of 25.
Change-Id: Ia96900950580dee6ec8fbeec13c46df6ef294390 --- M scripts/replace.py M tox.ini 2 files changed, 3 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/scripts/replace.py b/scripts/replace.py index c771be0..7414bfc 100755 --- a/scripts/replace.py +++ b/scripts/replace.py @@ -161,7 +161,7 @@ the top of the help. """ # -# (C) Pywikibot team, 2004-2024 +# (C) Pywikibot team, 2004-2025 # # Distributed under the terms of the MIT license. # @@ -910,7 +910,7 @@ return pagegenerators.MySQLPageGenerator(sql)
-def main(*args: str) -> None: # noqa: C901 +def main(*args: str) -> None: """Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used. diff --git a/tox.ini b/tox.ini index de53fd6..0c859e3 100644 --- a/tox.ini +++ b/tox.ini @@ -131,7 +131,7 @@ exclude = .tox,.git,./*.egg,build,./scripts/i18n/* color = always format = %(blue)s%(path)s%(reset)s: %(bold)sline %(row)d:%(reset)s%(col)d: %(bold)s%(red)s%(code)s%(reset)s %(text)s -max-complexity = 49 +max-complexity = 50 max-doc-length = 79
# The following are to be fixed
pywikibot-commits@lists.wikimedia.org