Check for duplicate code with a one-liner

Duplicate lines in your code are sometimes a sign that your code needs refactoring. If a line appears very often, you might want to wrap it in a function and call the function instead, for example, making maintenance easier. Here’s a quick Linux pipeline that lists duplicate lines to help you in this task. I’ll explain it step by step. (Thanks to Robert Strandh for the basic technique.

Source

 •  0 comments  •  flag
Share on Twitter
Published on April 06, 2022 17:57
No comments have been added yet.