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

# Snippet Tuning Guide

> Learn how to use snippet matching tuning parameters effectively to reduce false positives, improve match accuracy and customise SCANOSS scanning behavior for your codebase.

## What is Snippet Tuning?

Snippet tuning is the process of configuring detection thresholds and matching behavior to suit your specific needs. SCANOSS uses advanced fingerprinting algorithms to identify code similarities and tuning parameters let you control how sensitive this detection should be.

## When to Use CLI vs `scanoss.json`

**Use CLI parameters when:**

* Testing different configurations
* One-off scans with specific requirements
* Overriding baseline settings for particular scans
* Running automated scans with varying sensitivity

**Use `scanoss.json` when:**

* Establishing baseline behavior for your project
* Ensuring consistent scans across team members
* Defining project-wide detection policies
* Version controlling your scanning configuration

## Parameter Reference

### `min_snippet_hits`

Sets the minimum number of snippet matches required before reporting a component.

**CLI Usage:**

```bash theme={null}
scanoss-py scan --min-snippet-hits 5 -o results.json /path/to/project
```

**scanoss.json Usage:**

```json theme={null}
{
  "settings": {
    "file_snippet": {
      "min_snippet_hits": 5
    }
  }
}
```

### `min_snippet_lines`

Sets the minimum number of lines a code snippet must span to be considered a match.

**CLI Usage:**

```bash theme={null}
scanoss-py scan --min-snippet-lines 5 -o results.json /path/to/project
```

**scanoss.json Usage:**

```json theme={null}
{
  "settings": {
    "file_snippet": {
      "min_snippet_lines": 3
    }
  }
}
```

### `ranking_enabled`

Controls whether origin project score quality is taken into account during matching.

**CLI Usage:**

```bash theme={null}
# Enable ranking
scanoss-py scan --ranking true -o results.json /path/to/project

# Disable ranking
scanoss-py scan --ranking false -o results.json /path/to/project
```

**scanoss.json Usage:**

```json theme={null}
{
  "settings": {
    "file_snippet": {
      "ranking_enabled": true
    }
  }
}
```

### `ranking_threshold`

Sets the minimum ranking score (0-10) required for matches to be reported. Use `-1` for server default.

**CLI Usage:**

```bash theme={null}
# High confidence only
scanoss-py scan --ranking-threshold=10 -o results.json /path/to/project

# Server default
scanoss-py scan --ranking-threshold=-1 -o results.json /path/to/project
```

**scanoss.json Usage:**

```json theme={null}
{
  "settings": {
    "file_snippet": {
      "ranking_threshold": 5
    }
  }
}
```

### `honour_file_exts`

Controls whether file extensions are considered during matching.

**CLI Usage:**

```bash theme={null}
# Consider extensions (default)
scanoss-py scan --honour-file-exts true -o results.json src/

# Ignore extensions
scanoss-py scan --honour-file-exts false -o results.json src/
```

**scanoss.json Usage:**

```json theme={null}
{
  "settings": {
    "file_snippet": {
      "honour_file_exts": false
    }
  }
}
```
