Skip to content

Copies a rule another function owns: a format, regex, SQL or date pattern ​

Code that already exists: one of the ways AI coding agents bloat software, from lessloc's pattern catalog. lessloc catches it as repeated-literal.

What makes copying a rule another function owns a bad practice? ​

The standards that call it a bad practice: DRY; Sonar S1192.

What does lessloc do about copying a rule another function owns? ​

lessloc catches it as repeated-literal.

  • repeated-literal (tier 2): A rule, such as a format, regex, query or date pattern, copied out of the function that owns it, or one new rule written in several places.

The other patterns in Code that already exists:

Released under the Apache-2.0 license. · llms.txt