Violation

@Serializable
data class Violation(val ruleId: String, val subject: Subject, val target: Subject? = null, val sourceLocation: SourceLocation? = subject.location, val dependencyPath: List<Subject> = emptyList(), val message: String, val severity: Severity = Severity.ERROR, val metadata: RuleMetadata? = null, val isSuppressed: Boolean = false, val suppression: SuppressionMetadata? = null)

Represents an individual architectural rule violation.

Constructors

Link copied to clipboard
constructor(ruleId: String, subject: Subject, target: Subject? = null, sourceLocation: SourceLocation? = subject.location, dependencyPath: List<Subject> = emptyList(), message: String, severity: Severity = Severity.ERROR, metadata: RuleMetadata? = null, isSuppressed: Boolean = false, suppression: SuppressionMetadata? = null)

Properties

Link copied to clipboard

Sequence of subjects representing the dependency path leading to the violation.

Link copied to clipboard

Whether this violation has been suppressed (e.g. via @Suppress, programmatic config, or baseline).

Link copied to clipboard

Descriptive violation explanation message.

Link copied to clipboard
Link copied to clipboard

The unique identifier of the rule being violated.

Link copied to clipboard

Severity level of the violation (defaults to Severity.ERROR).

Link copied to clipboard

Optional source location for the violation. Defaults to subject location.

Link copied to clipboard

The subject (e.g. class, function, module) committing the violation.

Link copied to clipboard

Optional structured metadata explaining why and how this violation was suppressed.

Link copied to clipboard

Optional target subject involved in the violation (e.g., dependency target).