detectors match text, not code: comments, string/template literals and regex literals are judged as code (M1)
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- typescript
- Lĩnh vực
- devtools, testing-qa
Hướng nghiên cứu
Start by reading the listed detector files: zero-tolerance-strict.ts, no-explicit-any-non-null.ts, dead-code-elimination.ts, magic-number-prevention.ts, and code-duplication-control.ts; also inspect the existing CodeText.codeOnly implementation. Trace which detectors scan raw text and compare their results with the self-audit examples in the issue. Done means text inside comments and literals no longer triggers these detectors, with AST checks used where appropriate; the issue gives no specific test files or commands.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Found in the 8.0.0 self-audit triage: RoC 7.29.1 (npm, 5fc54afe) on a clean clone of develop at 2d2fa9a, with typescript resolvable (verdict compliance, 0 failed / 46 warnings). The bucket method and per-law tables are kept by QA; counts are from that run.
What happens
Many regex-based detectors run over the raw file text (or strip comments only), so words inside comments, message strings, template literals and regex literals count as code. In the self-audit this is the largest single source of false findings.
| law | examples (file:line) | share |
|---|---|---|
| Unit Test Quality | .then(, fetch(, setTimeout inside fixture strings: 0 of 22 / 18 / 6 flagged files make a real call |
≥59 of 661 |
| Absolute Zero Tolerance | `/console.(log | …)/and///(.*?)(TODO |
| No Explicit Any / Non-Null | only stripComments (no-explicit-any-non-null.ts:40); 'AWS::Serverless::Function' matches :Function; hasThresholds: Object.keys( matches : Object |
14 of 17 |
| No Double Cast | the text as unknown as in law prose |
3 of 16 |
| Dead Code Elimination | includes('debugger') on raw text (dead-code-elimination.ts:221); // prose containing function/const/let (:138-145); startsWith('return') matches returned: (:164) |
12 of 12 |
| Error Handling Completeness | await/then/fetch/addEventListener counted in comments and strings: 33 → 4 once comments and strings are removed | 29 of 33 |
| Data Encryption | crypto names anywhere in the file; the HTTP sub-check never strips comments | 28 of 29 |
| Magic Number | regex literals are skipped but their contents not blanked (magic-number-prevention.ts:224-227): {0,300} counted |
75 literals |
| Code Duplication | template literals normalised to STR (code-duplication-control.ts:194); => inside strings starts a block |
part of 16 |
Suggested direction
One shared "code only" view for every text detector: blank comments, string/template literals and regex literals before matching, from the TypeScript scanner when available (CodeText.codeOnly exists) and an explicit not-read note otherwise (see the separate issue on the silent fallback). Prefer AST node checks (CallExpression of fetch, AwaitExpression, DebuggerStatement, AsExpression chains) over substrings.
- Ngôn ngữ chính
- TypeScript
- Star
- 0
- Fork
- 0
- Merge trung bình
- 38 phút
- Pull request đã merge (30 ngày)
- 96
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Rule-Of-Code/RoC
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Rule-Of-Code/RoC#436 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
Rule-Of-Code/RoC#439 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 49/100
Rule-Of-Code/RoC#438 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 53/100
Rule-Of-Code/RoC#437 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
Rule-Of-Code/RoC#435 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Rule-Of-Code/RoC
Issue tương tự
-
ready-for-agent
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
LucasSantana-Dev/Lucky#3257 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
XiaomiMiMo/MiMo-Code#2849 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
danielmiessler/LifeOS#2894 ·
Maintainer thường phản hồi trong vòng 5 ngày
-
enhancement frontend good first issue help wanted testing-infrastructure
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 2 ngày
-
enhancement follow-up
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày