detekt-api
1.21.0-RC2

# Context

interface Context
Content copied to clipboard

A context describes the storing and reporting mechanism of Finding's inside a Rule. Additionally it handles suppression and aliases management.

The detekt engine retrieves the findings after each KtFile visit and resets the context before the next KtFile.

## Functions

clearFindings
Link copied to clipboard
abstract fun clearFindings ()
Content copied to clipboard

Clears previous findings. Normally this is done on every new KtFile analyzed and should be called by clients.

report
Link copied to clipboard
open fun report ( finding: Finding , aliases: Set < String > = emptySet(), ruleSetId: RuleSetId ? = null)
Content copied to clipboard

Reports a single new violation. By contract the implementation can check if this finding is already suppressed and should not get reported. An alias set can be given to additionally check if an alias was used when suppressing. Additionally suppression by rule set id is supported.

open fun report ( findings: List < Finding >, aliases: Set < String > = emptySet(), ruleSetId: RuleSetId ? = null)
Content copied to clipboard

Same as report but reports a list of findings.

## Properties

findings
Link copied to clipboard
abstract val findings : List < Finding >
Content copied to clipboard

## Inheritors

BaseRule
Link copied to clipboard
DefaultContext
Link copied to clipboard