deduplicator

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 2, 2026 License: GPL-2.0, GPL-2.0-only Imports: 2 Imported by: 0

Documentation

Overview

Package deduplicator provides functionality to deduplicate cryptographic assets based on their identity in the source code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeduplicateInterimReport

func DeduplicateInterimReport(report *entities.InterimReport) *entities.InterimReport

DeduplicateInterimReport removes duplicate CryptographicAssets that share the same identity (file path + asset key + location). When duplicates are found, their metadata and rule information are merged into a single asset.

The deduplication process:

  1. Groups assets by (file_path, asset_key, start_line, end_line) tuple, where asset_key is generated by CryptographicAsset.GetKey() based on asset-type-specific identifying fields
  2. For each group, merges all assets into one representative asset
  3. Preserves all unique metadata values from merged assets
  4. Merges all unique rules from all assets in the group

Assets with different identifying characteristics (e.g., different algorithmFamily or algorithmName) or at different locations are kept separate to prevent metadata confusion.

This function modifies the report in-place and returns it for convenience.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL