pylint
pylint copied to clipboard
Add a test case for ``too-complex`` in match case, for discussion
Type of Changes
| Type | |
|---|---|
| ✓ | :bug: Bug fix |
| ✓ | :scroll: Docs |
Description
See https://github.com/astral-sh/ruff/issues/11421 for initial reasoning behind this. I think we should modify the way we compute match case. But not sure if we should add a new visit method in pylint or add a get_children method for match case in astroid so we ends up not having to modify anything on the pylint side (and would benefit from it elsewhere too ?).
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉
This comment was generated for commit 1096f19c745bd7f3cf057ba89e41100285a6b1d7
But not sure if we should add a new visit method in pylint or add a
get_childrenmethod for match case in astroid so we ends up not having to modify anything on the pylint side (and would benefit from it elsewhere too ?).
get_children should already work same as visitMatchCase. I haven't looked into the mccabe extension yet, so not sure I can really help with that at this point.
🤖 According to the primer, this change has no effect on the checked open source code. 🤖🎉
This comment was generated for commit b1ba516ffb7355797a517b30e371bfbd7f87ec1a
Cross posting https://github.com/pylint-dev/pylint/pull/10542#issuecomment-3263691148 here.
IMO match in Python is basically an enhanced if statement. So checks should treat it similarly. AFAICT that was also your opinion on the ruff issue, unless I got that wrong.
I.e. each match case should probably increase the complexity by one.
But not sure if we should add a new visit method in pylint or add a
get_childrenmethod for match case in astroid so we ends up not having to modify anything on the pylint side (and would benefit from it elsewhere too ?).
Astroid get_children() should already work just fine. We'll likely need to add some custom logic to the mccabe extension.
Some are asking for the possibility to configure it on the ruff side here : https://github.com/astral-sh/ruff/issues/11421#issuecomment-2137326528
I wish the consideration for match-case statement for PLR rules was configurable to be turned off with lint.pylint setting. Long match-case statements are very common while walking abstract syntax trees and are arguably way less complex than any other solution.
I'm thinking that they possibly want to make match case that are too complex without having to think about design too much (never saw a > 5 case match statement in pylint, probably because we use the visitor pattern). But at the same time pylint is generally very configurable so why not in this case ?
What do you think @DanielNoord @jacobtylerwalls ?
I'm thinking that they possibly want to make match case that are too complex without having to think about design too much (never saw a > 5 case match statement in pylint, probably because we use the visitor pattern). But at the same time pylint is generally very configurable so why not in this case ?
Arguably the configurability is also one its the downsides. Nevertheless good defaults go a long way. So why not. I do think though this should only apply to the too-complex check and not for too-many-branches.
Arguably the configurability is also one its the downsides. Nevertheless good defaults go a long way.
Yeah I agree with both points. Slightly in favor of adding the option because at this point it's a little hard to rebrand pylint as an opinionated turn-key linter, even if we wanted that. And I strongly think that the default should be that each "case", count as an edge in the McCabe graph.
I never know if the users requesting new settings have fully explored the existing ones. Can't we expect users to just adjust the max-branches setting? If we need better tooling to do that per module, we need better tooling to do that per module.
I think their idea is to have max-branches behave differently for match cases because they "are arguably way less complex than any other solution." while still having the default max-branches value for other code constructs.
I think we should keep checkers simple and easy to reason about until we can't. If you only update one setting and then find that your team can cheat by factoring code into or out of match case, that's a surprise.
Let's vote: Option : ❤️ No option: 🚀
Let's vote: Option : ❤️ No option: 🚀
I lean towards no option. If we add one, I think it should only be for too-complex.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 95.89%. Comparing base (c708b6a) to head (a43ce55).
:warning: Report is 5 commits behind head on main.
Additional details and impacted files
@@ Coverage Diff @@
## main #9667 +/- ##
==========================================
- Coverage 95.90% 95.89% -0.01%
==========================================
Files 177 177
Lines 19368 19419 +51
==========================================
+ Hits 18574 18622 +48
- Misses 794 797 +3
| Files with missing lines | Coverage Δ | |
|---|---|---|
| pylint/extensions/mccabe.py | 97.47% <100.00%> (+0.20%) |
:arrow_up: |
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
🤖 Effect of this PR on checked open source code: 🤖
Effect on home-assistant: The following messages are now emitted:
- too-complex: '_reduce_statistics' is too complex. The McCabe rating is 17 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1019
- too-complex: '_get_max_mean_min_statistic_in_sub_period' is too complex. The McCabe rating is 14 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1289
- too-complex: '_get_max_mean_min_statistic' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1343
- too-complex: 'async_setup_entry' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/pi_hole/init.py#L57
- too-complex: 'compile_statistics' is too complex. The McCabe rating is 40 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/sensor/recorder.py#L455
- too-complex: '_update_from_device' is too complex. The McCabe rating is 21 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/matter/climate.py#L258
- too-complex: '_get_media_types_from_query' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/music_assistant/media_browser.py#L464
- too-complex: '_process_search_results' is too complex. The McCabe rating is 12 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/music_assistant/media_browser.py#L515
- too-complex: '_event_listener' is too complex. The McCabe rating is 30 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/home_connect/coordinator.py#L181
- too-complex: 'process_update' is too complex. The McCabe rating is 22 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/onkyo/media_player.py#L341
- too-complex: '_update_stream_source' is too complex. The McCabe rating is 14 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/go2rtc/init.py#L306
The following messages are no longer emitted:
- too-complex: '_reduce_statistics' is too complex. The McCabe rating is 15 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1019
- too-complex: 'compile_statistics' is too complex. The McCabe rating is 38 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/sensor/recorder.py#L455
- too-complex: '_event_listener' is too complex. The McCabe rating is 24 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/home_connect/coordinator.py#L181
Effect on music21: The following messages are now emitted:
- too-complex: 'elementToMidiEventList' is too complex. The McCabe rating is 12 https://github.com/cuthbertLab/music21/blob/501e13d0058804471cbfba4b2d848971c86e7582/music21/midi/translate.py#L1344
Effect on django: The following messages are now emitted:
- too-complex: 'normalize_choices' is too complex. The McCabe rating is 11 https://github.com/django/django/blob/7b26b64a63b5fc15134426a6ee0534dca2a1a855/django/utils/choices.py#L72
Effect on pandas: The following messages are now emitted:
- too-complex: '_split_by_backtick' is too complex. The McCabe rating is 14 https://github.com/pandas-dev/pandas/blob/2f2664433f6ae18fc2013a0c1e86fe562cd74c3b/pandas/core/computation/parsing.py#L145
The following messages are no longer emitted:
- too-complex: '_split_by_backtick' is too complex. The McCabe rating is 11 https://github.com/pandas-dev/pandas/blob/2f2664433f6ae18fc2013a0c1e86fe562cd74c3b/pandas/core/computation/parsing.py#L145
Effect on sentry: The following messages are now emitted:
- too-complex: 'handle_result' is too complex. The McCabe rating is 24 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/consumers/results_consumer.py#L278
- too-complex: 'create_uptime_detector' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/subscriptions/subscriptions.py#L178
- too-complex: 'convert_rule_condition_to_snuba_condition' is too complex. The McCabe rating is 15 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/rules/conditions/event_frequency.py#L790
- too-complex: 'as_log_message' is too complex. The McCabe rating is 33 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/usecases/summarize.py#L305
- too-complex: 'as_trace_item_context' is too complex. The McCabe rating is 36 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/usecases/ingest/event_parser.py#L347
- too-complex: 'literal' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/lib/eap/snuba_transpiler.py#L722
- too-complex: 'convert_filter_to_snuba_condition' is too complex. The McCabe rating is 22 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/workflow_engine/handlers/condition/event_frequency_query_handlers.py#L196
- too-complex: 'filter_detectors' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/workflow_engine/endpoints/organization_detector_index.py#L152
- too-complex: 'filter_workflows' is too complex. The McCabe rating is 11 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/workflow_engine/endpoints/organization_workflow_index.py#L95
The following messages are no longer emitted:
- too-complex: 'handle_result' is too complex. The McCabe rating is 21 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/consumers/results_consumer.py#L278
- too-complex: 'create_uptime_detector' is too complex. The McCabe rating is 11 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/subscriptions/subscriptions.py#L178
- too-complex: 'as_trace_item_context' is too complex. The McCabe rating is 19 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/usecases/ingest/event_parser.py#L347
This comment was generated for commit 3da530b9b64750db3abebc5ec2ce31da8fff96e9
I wonder if we should instead modify https://github.com/pycqa/mccabe directly so it handle match case or if we should simply drop the dependency and vendor it. It hasn't been upgraded since 2021. And it's hard to optimize performance if we don't understand what's in it (which I don't for the moment, but it's looking like adding handling for match in PathGraphingAstVisitor would simplify things). Also it's a maintenance / supply chain attack risk for a hundred line of codes. (https://github.com/pylint-dev/pylint/pull/10551)
🤖 Effect of this PR on checked open source code: 🤖
Effect on home-assistant: The following messages are now emitted:
- too-complex: '_reduce_statistics' is too complex. The McCabe rating is 17 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1019
- too-complex: '_get_max_mean_min_statistic_in_sub_period' is too complex. The McCabe rating is 14 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1289
- too-complex: '_get_max_mean_min_statistic' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1343
- too-complex: 'async_setup_entry' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/pi_hole/init.py#L57
- too-complex: 'compile_statistics' is too complex. The McCabe rating is 40 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/sensor/recorder.py#L455
- too-complex: '_update_from_device' is too complex. The McCabe rating is 21 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/matter/climate.py#L258
- too-complex: '_get_media_types_from_query' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/music_assistant/media_browser.py#L464
- too-complex: '_process_search_results' is too complex. The McCabe rating is 12 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/music_assistant/media_browser.py#L515
- too-complex: '_event_listener' is too complex. The McCabe rating is 30 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/home_connect/coordinator.py#L181
- too-complex: 'process_update' is too complex. The McCabe rating is 22 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/onkyo/media_player.py#L341
- too-complex: '_update_stream_source' is too complex. The McCabe rating is 14 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/go2rtc/init.py#L306
The following messages are no longer emitted:
- too-complex: '_reduce_statistics' is too complex. The McCabe rating is 15 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1019
- too-complex: 'compile_statistics' is too complex. The McCabe rating is 38 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/sensor/recorder.py#L455
- too-complex: '_event_listener' is too complex. The McCabe rating is 24 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/home_connect/coordinator.py#L181
Effect on music21: The following messages are now emitted:
- too-complex: 'elementToMidiEventList' is too complex. The McCabe rating is 12 https://github.com/cuthbertLab/music21/blob/501e13d0058804471cbfba4b2d848971c86e7582/music21/midi/translate.py#L1344
Effect on django: The following messages are now emitted:
- too-complex: 'normalize_choices' is too complex. The McCabe rating is 11 https://github.com/django/django/blob/7b26b64a63b5fc15134426a6ee0534dca2a1a855/django/utils/choices.py#L72
Effect on pandas: The following messages are now emitted:
- too-complex: '_split_by_backtick' is too complex. The McCabe rating is 14 https://github.com/pandas-dev/pandas/blob/2f2664433f6ae18fc2013a0c1e86fe562cd74c3b/pandas/core/computation/parsing.py#L145
The following messages are no longer emitted:
- too-complex: '_split_by_backtick' is too complex. The McCabe rating is 11 https://github.com/pandas-dev/pandas/blob/2f2664433f6ae18fc2013a0c1e86fe562cd74c3b/pandas/core/computation/parsing.py#L145
Effect on sentry: The following messages are now emitted:
- too-complex: 'handle_result' is too complex. The McCabe rating is 24 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/consumers/results_consumer.py#L278
- too-complex: 'create_uptime_detector' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/subscriptions/subscriptions.py#L178
- too-complex: 'convert_rule_condition_to_snuba_condition' is too complex. The McCabe rating is 15 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/rules/conditions/event_frequency.py#L790
- too-complex: 'as_log_message' is too complex. The McCabe rating is 33 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/usecases/summarize.py#L305
- too-complex: 'as_trace_item_context' is too complex. The McCabe rating is 36 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/usecases/ingest/event_parser.py#L347
- too-complex: 'literal' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/lib/eap/snuba_transpiler.py#L722
- too-complex: 'convert_filter_to_snuba_condition' is too complex. The McCabe rating is 22 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/workflow_engine/handlers/condition/event_frequency_query_handlers.py#L196
- too-complex: 'filter_detectors' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/workflow_engine/endpoints/organization_detector_index.py#L152
- too-complex: 'filter_workflows' is too complex. The McCabe rating is 11 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/workflow_engine/endpoints/organization_workflow_index.py#L95
The following messages are no longer emitted:
- too-complex: 'handle_result' is too complex. The McCabe rating is 21 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/consumers/results_consumer.py#L278
- too-complex: 'create_uptime_detector' is too complex. The McCabe rating is 11 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/subscriptions/subscriptions.py#L178
- too-complex: 'as_trace_item_context' is too complex. The McCabe rating is 19 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/usecases/ingest/event_parser.py#L347
This comment was generated for commit 7ddbd4bd62011fd1bb6565d7807a4b3aab09ca3e
Not an expert in the mccabe code but this looks about right to me.
Looked at the mccabe code for long enough to see that we're re-using a piece of code intended to generate dot graph, so whatever I did here it's going to be a small detail if we ever merge #10551 and want to optimize later
🤖 Effect of this PR on checked open source code: 🤖
Effect on home-assistant: The following messages are now emitted:
- too-complex: '_reduce_statistics' is too complex. The McCabe rating is 17 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1019
- too-complex: '_get_max_mean_min_statistic_in_sub_period' is too complex. The McCabe rating is 14 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1289
- too-complex: '_get_max_mean_min_statistic' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1343
- too-complex: 'async_setup_entry' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/pi_hole/init.py#L57
- too-complex: 'compile_statistics' is too complex. The McCabe rating is 40 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/sensor/recorder.py#L455
- too-complex: '_update_from_device' is too complex. The McCabe rating is 21 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/matter/climate.py#L258
- too-complex: '_get_media_types_from_query' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/music_assistant/media_browser.py#L464
- too-complex: '_process_search_results' is too complex. The McCabe rating is 12 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/music_assistant/media_browser.py#L515
- too-complex: '_event_listener' is too complex. The McCabe rating is 30 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/home_connect/coordinator.py#L181
- too-complex: 'process_update' is too complex. The McCabe rating is 22 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/onkyo/media_player.py#L341
- too-complex: '_update_stream_source' is too complex. The McCabe rating is 14 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/go2rtc/init.py#L306
The following messages are no longer emitted:
- too-complex: '_reduce_statistics' is too complex. The McCabe rating is 15 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/recorder/statistics.py#L1019
- too-complex: 'compile_statistics' is too complex. The McCabe rating is 38 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/sensor/recorder.py#L455
- too-complex: '_event_listener' is too complex. The McCabe rating is 24 https://github.com/home-assistant/core/blob/9f8f7d2fde9b0ca5e5e961a3ebaa9bc5b48f5090/homeassistant/components/home_connect/coordinator.py#L181
Effect on music21: The following messages are now emitted:
- too-complex: 'elementToMidiEventList' is too complex. The McCabe rating is 12 https://github.com/cuthbertLab/music21/blob/501e13d0058804471cbfba4b2d848971c86e7582/music21/midi/translate.py#L1344
Effect on django: The following messages are now emitted:
- too-complex: 'normalize_choices' is too complex. The McCabe rating is 11 https://github.com/django/django/blob/7b26b64a63b5fc15134426a6ee0534dca2a1a855/django/utils/choices.py#L72
Effect on pandas: The following messages are now emitted:
- too-complex: '_split_by_backtick' is too complex. The McCabe rating is 14 https://github.com/pandas-dev/pandas/blob/2f2664433f6ae18fc2013a0c1e86fe562cd74c3b/pandas/core/computation/parsing.py#L145
The following messages are no longer emitted:
- too-complex: '_split_by_backtick' is too complex. The McCabe rating is 11 https://github.com/pandas-dev/pandas/blob/2f2664433f6ae18fc2013a0c1e86fe562cd74c3b/pandas/core/computation/parsing.py#L145
Effect on sentry: The following messages are now emitted:
- too-complex: 'handle_result' is too complex. The McCabe rating is 24 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/consumers/results_consumer.py#L278
- too-complex: 'create_uptime_detector' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/subscriptions/subscriptions.py#L178
- too-complex: 'convert_rule_condition_to_snuba_condition' is too complex. The McCabe rating is 15 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/rules/conditions/event_frequency.py#L790
- too-complex: 'as_log_message' is too complex. The McCabe rating is 33 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/usecases/summarize.py#L305
- too-complex: 'as_trace_item_context' is too complex. The McCabe rating is 36 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/usecases/ingest/event_parser.py#L347
- too-complex: 'literal' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/lib/eap/snuba_transpiler.py#L722
- too-complex: 'convert_filter_to_snuba_condition' is too complex. The McCabe rating is 22 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/workflow_engine/handlers/condition/event_frequency_query_handlers.py#L196
- too-complex: 'filter_detectors' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/workflow_engine/endpoints/organization_detector_index.py#L152
- too-complex: 'filter_workflows' is too complex. The McCabe rating is 11 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/workflow_engine/endpoints/organization_workflow_index.py#L95
The following messages are no longer emitted:
- too-complex: 'handle_result' is too complex. The McCabe rating is 21 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/consumers/results_consumer.py#L278
- too-complex: 'create_uptime_detector' is too complex. The McCabe rating is 11 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/uptime/subscriptions/subscriptions.py#L178
- too-complex: 'as_trace_item_context' is too complex. The McCabe rating is 19 https://github.com/getsentry/sentry/blob/93c93df08d5756fc48efd424151763cfb4cbd863/src/sentry/replays/usecases/ingest/event_parser.py#L347
This comment was generated for commit a6203c060c66b53fc39e22d283edf85b64b2dce5
🤖 Effect of this PR on checked open source code: 🤖
Effect on home-assistant: The following messages are now emitted:
- too-complex: '_reduce_statistics' is too complex. The McCabe rating is 17 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/recorder/statistics.py#L1019
- too-complex: '_get_max_mean_min_statistic_in_sub_period' is too complex. The McCabe rating is 14 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/recorder/statistics.py#L1289
- too-complex: '_get_max_mean_min_statistic' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/recorder/statistics.py#L1343
- too-complex: 'async_setup_entry' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/pi_hole/init.py#L57
- too-complex: 'compile_statistics' is too complex. The McCabe rating is 40 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/sensor/recorder.py#L455
- too-complex: '_update_from_device' is too complex. The McCabe rating is 20 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/matter/climate.py#L258
- too-complex: '_get_media_types_from_query' is too complex. The McCabe rating is 11 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/music_assistant/media_browser.py#L464
- too-complex: '_process_search_results' is too complex. The McCabe rating is 12 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/music_assistant/media_browser.py#L515
- too-complex: '_event_listener' is too complex. The McCabe rating is 30 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/home_connect/coordinator.py#L181
- too-complex: 'process_update' is too complex. The McCabe rating is 22 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/onkyo/media_player.py#L341
- too-complex: '_update_stream_source' is too complex. The McCabe rating is 14 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/go2rtc/init.py#L306
The following messages are no longer emitted:
- too-complex: '_reduce_statistics' is too complex. The McCabe rating is 15 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/recorder/statistics.py#L1019
- too-complex: 'compile_statistics' is too complex. The McCabe rating is 38 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/sensor/recorder.py#L455
- too-complex: '_update_from_device' is too complex. The McCabe rating is 12 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/matter/climate.py#L258
- too-complex: '_event_listener' is too complex. The McCabe rating is 24 https://github.com/home-assistant/core/blob/410c3df6dd9797d3a835ce4fea1ce6a92d77c409/homeassistant/components/home_connect/coordinator.py#L181
Effect on music21: The following messages are now emitted:
- too-complex: 'elementToMidiEventList' is too complex. The McCabe rating is 12 https://github.com/cuthbertLab/music21/blob/501e13d0058804471cbfba4b2d848971c86e7582/music21/midi/translate.py#L1344
Effect on django: The following messages are now emitted:
- too-complex: 'normalize_choices' is too complex. The McCabe rating is 11 https://github.com/django/django/blob/014be2f0dabb1eea4748df528edf65878dcfdecc/django/utils/choices.py#L72
Effect on pandas: The following messages are now emitted:
- too-complex: '_split_by_backtick' is too complex. The McCabe rating is 14 https://github.com/pandas-dev/pandas/blob/cc40732889b59d0ebd867b087691f02221e5666c/pandas/core/computation/parsing.py#L145
The following messages are no longer emitted:
- too-complex: '_split_by_backtick' is too complex. The McCabe rating is 11 https://github.com/pandas-dev/pandas/blob/cc40732889b59d0ebd867b087691f02221e5666c/pandas/core/computation/parsing.py#L145
Effect on sentry: The following messages are now emitted:
- too-complex: 'handle_result' is too complex. The McCabe rating is 24 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/uptime/consumers/results_consumer.py#L278
- too-complex: 'create_uptime_detector' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/uptime/subscriptions/subscriptions.py#L178
- too-complex: 'convert_rule_condition_to_snuba_condition' is too complex. The McCabe rating is 15 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/rules/conditions/event_frequency.py#L790
- too-complex: 'as_log_message' is too complex. The McCabe rating is 33 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/replays/usecases/summarize.py#L305
- too-complex: 'as_trace_item_context' is too complex. The McCabe rating is 36 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/replays/usecases/ingest/event_parser.py#L347
- too-complex: 'literal' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/replays/lib/eap/snuba_transpiler.py#L722
- too-complex: 'convert_filter_to_snuba_condition' is too complex. The McCabe rating is 22 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/workflow_engine/handlers/condition/event_frequency_query_handlers.py#L196
- too-complex: 'filter_detectors' is too complex. The McCabe rating is 13 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/workflow_engine/endpoints/organization_detector_index.py#L152
- too-complex: 'filter_workflows' is too complex. The McCabe rating is 11 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/workflow_engine/endpoints/organization_workflow_index.py#L95
The following messages are no longer emitted:
- too-complex: 'handle_result' is too complex. The McCabe rating is 21 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/uptime/consumers/results_consumer.py#L278
- too-complex: 'create_uptime_detector' is too complex. The McCabe rating is 11 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/uptime/subscriptions/subscriptions.py#L178
- too-complex: 'as_trace_item_context' is too complex. The McCabe rating is 19 https://github.com/getsentry/sentry/blob/999558bf4b621e4baaaf8ed266bcb66f6dab3106/src/sentry/replays/usecases/ingest/event_parser.py#L347
This comment was generated for commit a43ce55a5430e5a73b837042343b3314cdcf020d