detekt-api
1.21.0-RC2

# CodeSmell

open class CodeSmell ( val issue: Issue , val entity: Entity , val message: String , val metrics: List < Metric > = emptyList(), val references: List < Entity > = emptyList()) : Finding
Content copied to clipboard

A code smell indicates any possible design problem inside a program's source code. The type of a code smell is described by an Issue.

If the design problem results from metric violations, a list of Metric's can describe further the kind of metrics.

If the design problem manifests by different source locations, references to these locations can be stored in additional Entity's.

## Constructors

CodeSmell
Link copied to clipboard
fun CodeSmell ( issue: Issue , entity: Entity , message: String , metrics: List < Metric > = emptyList(), references: List < Entity > = emptyList())
Content copied to clipboard

## Functions

compact
Link copied to clipboard
open override fun compact (): String
Content copied to clipboard

Contract to format implementing object to a string representation.

compactWithSignature
Link copied to clipboard
open override fun compactWithSignature (): String
Content copied to clipboard

Same as compact except the content should contain a substring which represents this exact findings via a custom identifier.

messageOrDescription
Link copied to clipboard
open override fun messageOrDescription (): String
Content copied to clipboard

Explanation why this finding was raised.

metricByType
Link copied to clipboard
open fun metricByType (type: String ): Metric ?
Content copied to clipboard

Finds the first metric matching given type.

toString
Link copied to clipboard
open override fun toString (): String
Content copied to clipboard

## Properties

charPosition
Link copied to clipboard
open val charPosition : TextLocation
Content copied to clipboard
entity
Link copied to clipboard
open override val entity : Entity
Content copied to clipboard
file
Link copied to clipboard
open val file : String
Content copied to clipboard
id
Link copied to clipboard
open override val id : String
Content copied to clipboard
issue
Link copied to clipboard
override val issue : Issue
Content copied to clipboard
location
Link copied to clipboard
open val location : Location
Content copied to clipboard
message
Link copied to clipboard
open override val message : String
Content copied to clipboard
metrics
Link copied to clipboard
open override val metrics : List < Metric >
Content copied to clipboard
references
Link copied to clipboard
open override val references : List < Entity >
Content copied to clipboard
severity
Link copied to clipboard
open override val severity : SeverityLevel
Content copied to clipboard
signature
Link copied to clipboard
open val signature : String
Content copied to clipboard
startPosition
Link copied to clipboard
open val startPosition : SourceLocation
Content copied to clipboard

## Inheritors

CorrectableCodeSmell
Link copied to clipboard
ThresholdedCodeSmell
Link copied to clipboard