try-else clauses measured at 1 more than correct complexity
まだ誰も着手していません。
評価
調査の方向性
提示された関数を再現し、生成された複雑度グラフを調べて、現在の try/except/else/finally 制御フローと提案されたグラフを比較します。この例について、try-else の実行が正しく表現され、報告される複雑度が 1 低くなり、else が try 本体の代替として扱われていなければ、作業は完了です。
索引モデルが issue の本文から書いたものです。
説明
Currently the below code generates the following graph, giving a complexity of 5:
def f():
try:
print(1)
except TypeA:
print(2)
except TypeB:
print(3)
else:
print(4)
finally:
if x:
print(5.1)
else:
print(5.2)

I don't think this models the try-else clause correctly. The above graph seems to indicate that the else sometimes runs instead of the main clause, which isn't correct. I believe this is the correct model:

This seems to correctly indicate that the else always runs directly after the main try clause, if it runs, and never in a line of execution that involves the exception handlers. This has 1 less complexity than the above graph. This yields one less complexity than the current interpretation.
- 主要言語
- Python
- スター
- 682
- フォーク
- 69
- 平均マージ
- 5時間 56分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
PyCQA/mccabe のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
-
Test failure on 3.14対応中かも @alexchen-sys が 95 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
[Proposal] Add a check for none/multiple positional arguments再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
似ている issue
-
good first issue tools
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug deferred domain:ci P1
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
docling-project/docling-mcp#147 ·
-
issue: A pipe model's Valves button ignores the Allow Chat Valves permission対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug confirmed issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-webui/open-webui#32771 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Scheduled Security Scan is failing on main対応中かも @pkupt が今日担当しました。 オープンsecurity-scan-failure
難易度 1/5 1〜3時間 初心者へのやさしさ 74/100
semantica-agi/semantica#2045 ·
メンテナーはふだん 2 日以内に返信