I'm analyzing some code and I'm looking for string literals, to check if I have any duplicates. For example, if I have
def test_foo
input_filename = "foo.txt"
# ...
end
def test_bar
input_filename = "bar.txt" # Fine
# ...
end
def test_baz
# Bad! Refactor it to a constant that's shared by test_foo and test_baz
input_filename = "foo.txt"
# ...
end
I want the analysis program to tell me that ["foo.txt", "bar.txt", "foo.txt"] exist in my source code.
How can I do this?
%qand%Qversions...