> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# duplicate-implementation

> Substantial functions share the same implementation.

## What it flags

Substantial functions share a verified implementation. The report groups matching sites so a reviewer can compare their contracts before introducing a shared abstraction. JS/TS compares syntax while preserving identifiers, literals and operations. Python, Go, Java, C# and Rust compare exact body text of named functions selected by the parser. This deliberately misses reformatted or renamed copies.

## Inline fix

Keeps one top-level function and makes each other copy delegate to it, adding an import where needed. Applied only when every name the copies use resolves to the same binding.

## Configuration

Set the rule to `"off"` in `loadwise.config.json` to drop its findings:

```json theme={null}
{
  "rules": { "duplicate-implementation": "off" }
}
```

For JavaScript and TypeScript, use an integer from 1 through 8192 for `minNodes`, the minimum number of TypeScript syntax-tree nodes in each function body, including the body block. The default is 30 nodes. The three-statement minimum and analysis caps apply at every setting. A file override changes which functions in that file are eligible for a match. Other languages keep their own thresholds.

```json theme={null}
{
  "rules": {
    "duplicate-implementation": { "level": "warn", "options": { "minNodes": 45 } }
  }
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.