Skip to main content

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:
scanoss-py scan --min-snippet-hits 5 -o results.json /path/to/project
scanoss.json Usage:
{
  "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:
scanoss-py scan --min-snippet-lines 5 -o results.json /path/to/project
scanoss.json Usage:
{
  "settings": {
    "file_snippet": {
      "min_snippet_lines": 3
    }
  }
}

ranking_enabled

Controls whether origin project score quality is taken into account during matching. CLI Usage:
# 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:
{
  "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:
# 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:
{
  "settings": {
    "file_snippet": {
      "ranking_threshold": 5
    }
  }
}

honour_file_exts

Controls whether file extensions are considered during matching. CLI Usage:
# 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:
{
  "settings": {
    "file_snippet": {
      "honour_file_exts": false
    }
  }
}