You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Test.kt:76:21 (see cursor in screenshot): Multiple occurrences of the same string literal within a single file detected. Prefer extracting the string literal into a property or constant. [StringLiteralDuplication]
Steps to Reproduce
Context
As you can see in the screenshot above, the dynamic test names are being detected as duplicate. This would be fine, because at first glance all the "cycle start-end" strings "look" the same, but if you look at the start/end variables, you can see they all have different types. At this point, I'm unsure if this detection is valid, because there would be no function that could be extracted to simplify the code.
Your Environment
Version of detekt used: 1.23.6
Version of Gradle used (if applicable): 8.7
Gradle scan link (add --scan option when running the gradle task): N/A
Operating System and version: N/A
Link to your project (if it's a public repository): N/A
The text was updated successfully, but these errors were encountered:
I guess your observation will hold true for any expression inside an interpolated string. So extracting a function with String or Any params is a viable way to fix the duplication.
Could this be just a doc update with a hint then? (TBH, I haven't read the docs of this rule yet, might be already there...)
Expected Behavior
No finding.
Observed Behavior
Steps to Reproduce
Context
As you can see in the screenshot above, the dynamic test names are being detected as duplicate. This would be fine, because at first glance all the "cycle start-end" strings "look" the same, but if you look at the start/end variables, you can see they all have different types. At this point, I'm unsure if this detection is valid, because there would be no function that could be extracted to simplify the code.
Your Environment
--scan
option when running the gradle task): N/AThe text was updated successfully, but these errors were encountered: