Codacy and code-quality follow-ups after reaching grade A (plan)
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
- 18/100
Hướng nghiên cứu
Start by reading the Codacy findings and the CI configuration referenced in the issue, especially the --ignore=tests/test_blocks.py setting and the skipped test_jtraj. The plan also points to src, tests/test_symbolic_ik*.py, blocks/spatial.py, blocks/arm.py, blocks/uav.py, and mobile/EKF.py. Choose a single mechanical item with a clear scope; for the broader test and design items, first gather evidence and comment on the issue before proposing a change.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
The code-quality work of 23 October 2026 (#888, #890, #891, #892, #893) took Codacy from grade B (89) to A (91). This is the plan for what is left. Several items are design decisions, not cleanup, so please comment here and do not send a PR for them.
Where it stands (Codacy, main, 23 October 2026)
| Start | Now | |
|---|---|---|
| Issues | 1,183 | 318 |
| Bandit B101 (assert) | 471 | 2 |
| Complex files (goal 10%) | 38% | 28% |
| Duplicated files (goal 10%) | 33% | 26% |
The 129 narrowing asserts in src went to zero with # nosec B101: <reason>, so Codacy honors it. .codacy.yml now skips Bandit in tests/, the Dynamixel and ROS sketches, the vendored Eigen headers, and pyflakes in tests/ and examples/ (deliberate star imports).
To look again, the public API needs no token: curl https://app.codacy.com/api/v3/analysis/organizations/gh/petercorke/repositories/robotics-toolbox-python for the summary, and POST …/issues/search?limit=100 with body {} for the findings.
Plan
Small, mechanical
- Add
# nosecwith a reason to the deliberateexecand subprocess uses (55 findings): the code generatorrobot/symbolic_ik_rr.py(8) andsymbolic_ik.py, the moved teststests/test_symbolic_ik*.py(20) that compile and run generated code,blocks/spatial.pyandblocks/arm.py(4 each),docs/lite/browser_check/check_lite_in_browser.py(5). - The 34 unused local variables (F841), one by one. Some are constants in
models/and are safe to delete;blocks/uav.pyhas an unusedliandalphasthat may hide a bug; several tests build ablockthey never use. - Mutable default arguments (8, W0102): fix, as they are real bugs waiting to happen.
- The 18 "undefined name" findings in
L["rpy/xyz", …]hints are false positives caused by the aliasLiteral as L. Either importLiteralunder its own name or leave them. - Look at the remaining "used before assignment" and "unexpected keyword" findings (E0601, E1123, E1120). The three I checked were false positives; the rest in
tests/andexamples/are unchecked.
Test hygiene
-
tests/test_blocks.pyis excluded from CI (--ignore=tests/test_blocks.py), and itstest_jtrajis skipped, which is why theJTrajbug in #890 lasted. Find out why it is excluded, and run it or port its tests. - Decide on the
if __name__ == "__main__"demo blocks in 91 modules (1,203 lines, mostly plots, never tested). Remove them, or move the long ones (mobile/EKF.py193 lines,Vehicle.py102) toexamples/.
Design (comment before any PR)
- Two-phase initialization. 41 asserts only narrow a type for mypy, mostly attributes that are
Noneuntilplan(),query()or a plot call (occgrid,_goal,start,fig/ax). A planner that returns a result object fromplan()would remove theNone, in line with the stateless aim indesiderata.md. - "Arguments differ" (26):
PlannerBase.plothas 33 parameters andLatticePlanner.plothas 3;Connector.adddiffers fromPyPlot.add. Overlaps #676 and #886. - "Redefined builtin" (70): parameters named
map,id,next,format,bin. These are public names, so renaming needs a deprecation. Alternatively disable the pattern in Codacy.
Probably not worth doing
- Complexity and duplication to the 10% goals. The most complex files are
robot/symbolic_ik.py(total cyclomatic complexity 505),BaseRobot.py,tools/urdf/urdf.pyandDHRobot.py. Splittingsymbolic_ik.py(about 2,200 lines) would help but is a refactor. - Reporting coverage to Codacy as well as Codecov, which would fill its fourth measure.
Decisions already made
- Windows: the two C-kernel tests that timed out on the Windows runner are marked
slowand run only in the Linux coverage job. The analytic IK solver itself passes on Windows (tests/test_analytic_ik.py). No separate slow-test workflow, decided 23 October 2026. - Third-party GitHub Actions are pinned to commit SHAs (#892). The other repos are in petercorke/rvc-ecosystem#24.
- Ngôn ngữ chính
- C++
- Star
- 3.6k
- Fork
- 645
- Merge trung bình
- 1 ngày 8 giờ
- Pull request đã merge (30 ngày)
- 144
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 petercorke/robotics-toolbox-python
-
plt.pause(0) waits for ever: PoseGraph.plot_scan(pause=0) and Vehicle animation may hangCó thể đã có người làm @huxiaoyi-ovo đã nhận 2 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
petercorke/robotics-toolbox-python#876 · 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 68/100
petercorke/robotics-toolbox-python#709 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tech-debt
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
petercorke/robotics-toolbox-python#898 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
LatticePlanner: integer headings, and motion primitives with finer turn steps (design first)Có thể đã có người làm @kVinsom đã nhận 2 ngày trước. Đang mởenhancement help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
petercorke/robotics-toolbox-python#895 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Backends wanted: CoppeliaSim, Viser, Gazebo, MuJoCo and others (plan first)Có thể đã có người làm @alexermolovich đã nhận 2 ngày trước. Đang mởenhancement help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 38/100
petercorke/robotics-toolbox-python#886 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của petercorke/robotics-toolbox-python
Issue tương tự
-
extended_stabilizer: `std::pow(2, p/2.)` in `scalar_t::to_complex()` takes ~40% of runtime on LinuxCó thể đã có người làm @mehmetniyazikayi đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
Qiskit/qiskit-aer#2502 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Test failure on FreeBSD: #26 unexpected system_clock sourceCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởlow priority rt_lib tests
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 67/100
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 65/100
RobLoach/raylib-cpp#440 · 2 bình luận ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
Maintainer thường phản hồi trong vòng 1 ngày