github / github/codeql

LGTM.com - py/similar-function might be too sensitive

Đang mở
#2,882 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
false-positive Python
Ngôn ngữ chính
CodeQL
Star
10.1k
Fork
2.1k
Merge trung bình
2 ngày 15 giờ
Pull request đã merge (30 ngày)
141

Mô tả

**Description of the false positive**

The two functions *are* similar, so I hesitate to call this a true "false positive".

But the differences are substantial enough—variations in which SQLAlchemy table is queried, which columns are used in filters, which object properties are needed, etc.—that trying to write a single function to do both jobs would (arguably) be a bigger code smell than this.

It's also worth noting that there are other pairs of functions (the `set` and `get` companions in each suite for `nick` and `channel`) _not_ marked as similar, even though they're no more or less so than the `delete` functions that were detected. And there's another suite of also-similar `plugin` functions that weren't flagged by the analysis.

**URL to the alert on the project page on LGTM.com**

https://lgtm.com/projects/g/sopel-irc/sopel/snapshot/f6d393044ee7c7f1a7ba6fe0c4e8a152eb5948b2/files/sopel/db.py?sort=name&dir=ASC&mode=heatmap#x9fad0d3c3a380402:1

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.