def f string = "a" last_c = false while string.size < 11 if string[-1] == 'c' string += "b" last_c = false else string += "c" last_c = true end end last_c endExpected behavior
No Lint/UselessAssignment
offenses
test.rb:5:7: W: [Correctable] Lint/UselessAssignment: Useless assignment to variable - string. (https://rubystyle.guide#underscore-unused-vars) string += "b"Steps to reproduce the problem
Run provided code on latest RuboCop version.
Likely caused by #14377
RuboCop version1.79.0 (using Parser 3.3.8.0, Prism 1.4.0, parser_prism, rubocop-ast 1.46.0, analyzing as Ruby 3.4, running on ruby 3.4.4) [x86_64-linux]
mscrivo, ntkme, franzliedke and jacksonhuether
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4