Repository navigation
[Linting Rule] Code Clones
Generated from 'wiki-linter.ts' on 2026-11-08, 08:41:20 UTC (v2.17.4), do not edit directly.
Code Clones [overview]
This rule is a best-effort rule.
Finds duplicated code (code clones) with a configurable selection of AST, token, and fingerprint based algorithms.
This linting rule is implemented in src/linter/rules/code-clones.ts.
Linting rules can be configured by passing a configuration object to the linter query as shown in the example below.
The code-clones rule accepts the following configuration options:
normalize <- function(v) {
m <- mean(v)
(v - m) / sd(v)
}
scale_it <- function(values) {
mu <- mean(values)
(values - mu) / sd(values)
}The linting query can be used to run this rule on the above example:
[ { "type": "linter", "rules": [ { "name": "code-clones", "config": {} } ] } ]Results (prettified and summarized):
Query: linter (1 ms)
╰ Code Clones (code-clones):
╰ uncertain:
╰ Code is a clone of scale_it at <input 0>:6.13-9.1 (gst, similarity 1.00)
More examples are the test cases in test/functionality/linter/lint-code-clones.test.ts.
Currently maintained by Florian Sihler and Oliver Gerstl at Ulm University
Email | GitHub | Penguins | Portfolio
- 🧑💻 Developer Onboarding
- 💻 Setup
- 👓 Overview
- 🪟 Interfacing with flowR
- 🌋 Core
- 🧹 Testing & Linting (Benchmark Page)
⁉️ FAQ- ℹ️ Extra Information