{ "tokens": { "input": 6931, "cache_read": 6156, "cache_write": 2052, "output": 1608 }, "reviews": [ { "key": [ "https://ftp.debian.org/debian/pool/main/f/furnace/furnace_0.6.8.3+git20250912+ds.orig.tar.xz", "main furnace-0.6.8.3+git20250912+ds/extern/imgui_patched/backends/imgui_impl_win32.cpp:153:70: style: Parameter 'io' can be declared as reference to const [constParameterReference]" ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "The function only reads the pointer value stored in `io.BackendPlatformUserData` and casts it to `ImGui_ImplWin32_Data*`. It returns that stored pointer, not a pointer or reference into `io` itself. With `const ImGuiIO& io`, the member has type `void* const`, and casting that value to `ImGui_ImplWin32_Data*` still compiles. So `io` can be const and the warning was a true positive. The new AST visitor also checks intermediate nodes such as the `.` member access. It treats the member access as a lifetime of `io` and wrongly concludes that the function returns a reference to `io`, which suppresses a correct warning." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/mygui/mygui_3.4.4+dfsg.orig.tar.xz", "main MyGUI-mygui-84c2874/Demos/Demo_Colour/ColourPanel.cpp:305:45: style: Parameter '_colour' can be declared as reference to const [constParameterReference]" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "byIndex returns a non-const float& that refers to members of _colour (return _colour.red etc.). If _colour were made const, those returns would not compile as a float&, so the constParameterReference warning was a false positive. The PR now walks the '.' operator in the return expression and recognizes that the returned reference points into _colour, which removes the false positive." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/m/mygui/mygui_3.4.4+dfsg.orig.tar.xz", "main MyGUI-mygui-84c2874/Tools/EditorFramework/ColourPanel.cpp:330:45: style: Parameter '_colour' can be declared as reference to const [constParameterReference]" ], "verdict": { "verdict": "improvement", "confidence": "high", "explanation": "byIndex returns a non-const float& that refers to members of _colour (e.g. `return _colour.red;`). If the parameter were declared const, these returns would not compile. The old code missed this because findReturns gives the '.' token, and for that token neither the varId check nor the lifetime check matched. The new AST visitor walks into the operand of '.', finds _colour, and suppresses the warning. Removing this false positive is correct." } }, { "key": [ "https://ftp.debian.org/debian/pool/main/t/treesheets/treesheets_1.0.2.orig.tar.gz", "main treesheets-1.0.2/lobster/src/lobster/typecheck.h:620:42: style: Parameter '_scopes' can be declared as reference to const [constParameterReference]" ], "verdict": { "verdict": "regression", "confidence": "high", "explanation": "TopScope returns `_scopes.back().sf`, which is a copy of a `SubFunction*` value stored in a Scope. It is not a pointer to the vector or its elements. With `const vector&`, `back().sf` has type `SubFunction* const`, which still converts to `SubFunction*`. So the parameter can indeed be const, and the original warning was a true positive. The new AST walk follows the `?:` branches and the `.` member access. It then wrongly treats the returned member pointer as having its lifetime tied to `_scopes`, and suppresses a valid warning." } } ], "started": "2026-10-22 12:40:22 UTC", "runner": "aws-testrunner-1" }