IdeaDuplicates

The Duplicates Finder (Java) build runner is intended for catching similar code fragments and providing a report on discovered repetitive blocks of Java code.

Example. Adds a Duplicates Finder (Java) build step with custom JVM setup, default IDEA tool, include/exclude patterns and disabled plugins. This build step will run even if some previous build steps are failed.

buildType {
// Other Build Type settings ...
steps {
// Other Build Steps ...
        ideaDuplicates {
name = "My Duplicates step"
executionMode = BuildStep.ExecutionMode.RUN_ON_FAILURE
pathToProject = ""
jdk {
name = "13"
path = "%env.JDK_13_0%"
patterns("jre/lib/*.jar", "jre/lib/ext/jfxrt.jar")
extAnnotationPatterns("%teamcity.tool.idea%/lib/jdkAnnotations.jar")
}
jvmArgs = "-Xmx1G -XX:ReservedCodeCacheSize=512m"
targetJdkHome = "%env.JDK_11%"
ideaAppHome = "%teamcity.tool.intellij.DEFAULT%"
lowerBound = 10
discardCost = 0
distinguishVariables = true
distinguishFields = true
distinguishMethods = true
distinguishTypes = true
distinguishLiterals = true
extractSubexpressions = true
includeTestSources = true
includeExcludePatterns = """
+:pattern1
-:pattern2
""".trimIndent()
disabledPlugins = "disabled_plugin1"
}


























}
}




*/

Constructors

Link copied to clipboard
constructor(init: IdeaDuplicates.() -> Unit = {})

Properties

Link copied to clipboard

Optional collection of build step execution conditions

Link copied to clipboard
var disabledPlugins: <Error class: unknown class>

List of identifiers of IntelliJ IDEA disabled plugins. If plugin is disabled it won't be loaded when IntelliJ IDEA starts on the agent. Please refer to ${user.home}/.IntelliJIdea/config/disabled_plugins.txt on the machine where IntelliJ IDEA is installed for an example of such a list.

Link copied to clipboard
var discardCost: <Error class: unknown class>

Ignore duplicate subexpressions with complexity lower than specified

Link copied to clipboard
var distinguishFields: <Error class: unknown class>

Whether the similar contents with different field names will be recognized as different or such contents will be recognized as duplicated

Link copied to clipboard
var distinguishLiterals: <Error class: unknown class>

Whether similar line of code with different literals will be considered different or such lines will be recognized as duplicates.

Link copied to clipboard
var distinguishMethods: <Error class: unknown class>

Whether the methods of similar structure will be recognized as different or such methods will be recognized as duplicated (in this case, they can be extracted and reused).

Link copied to clipboard
var distinguishTypes: <Error class: unknown class>

Whether the similar code fragments with different type names will be recognized as different or such code fragments will be recognized as duplicates.

Link copied to clipboard
var distinguishVariables: <Error class: unknown class>

Whether the similar contents with different variable names will be recognized as different or such contents will be recognized as duplicated.

Link copied to clipboard

Specifies whether the step is enabled, true by default

Link copied to clipboard
Link copied to clipboard
var extractSubexpressions: <Error class: unknown class>

Whether the duplicated subexpressions can be extracted

Link copied to clipboard
var id: String?

Optional id of the step. Usually the id is not required, however if a build configuration inherits from a template and wants to override a build step defined there, then both steps should have the same id.

Link copied to clipboard
var ideaAppHome: <Error class: unknown class>

IntelliJ Inspections and Duplicates Engine Home path

Link copied to clipboard
var includeExcludePatterns: <Error class: unknown class>

Newline-delimited set or rules in the form of +:|-:pattern

Link copied to clipboard
var includeTestSources: <Error class: unknown class>

Whether the test sources will be included in the duplicates analysis

Link copied to clipboard
var jvmArgs: <Error class: unknown class>

JVM command line parameters which are passed by the JVM used to run your build

Link copied to clipboard
var lowerBound: <Error class: unknown class>

Ignore duplicates with complexity simpler than specified

Link copied to clipboard

Build step name

Link copied to clipboard
Link copied to clipboard

The path to the project file (.ipr) or path to the project directory (root directory of the project that contains .idea directory). The path should be relative to the checkout directory.

Link copied to clipboard
var targetJdkHome: <Error class: unknown class>

The path to your custom JDK used to run the build

Link copied to clipboard

Build step type

Functions

Link copied to clipboard
fun booleanParameter(customName: String? = null, trueValue: String? = "true", falseValue: String? = "false"): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun clear()
Link copied to clipboard

Deletes all configured build step conditions

Link copied to clipboard
fun <T : CompoundParam<T>> compoundParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
Link copied to clipboard
fun <T : Parametrized> copyParamsTo(target: T): T

Copies parameters of this object to the specified target

Link copied to clipboard
open fun create(): BuildStep

Creates an instance of this build step via reflection using a no argument constructor, used during copying. Throws an error if this class doesn't have a default constructor. Subclasses can override it to create an instance without using a default constructor.

Link copied to clipboard
fun doubleParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun <E : Enum<E>> enumParameter(customName: String? = null, mapping: Map<E, String?>? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
fun findRawParam(paramName: String): Parameter?
Link copied to clipboard
fun hasParam(paramName: String): Boolean
Link copied to clipboard
Link copied to clipboard
fun intParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun param(name: String, value: String)

Adds parameter with specified name and value

Link copied to clipboard
Link copied to clipboard
fun removeRawParam(paramName: String)
Link copied to clipboard
Link copied to clipboard
open fun stringParameter(customName: String? = null): <Error class: unknown class><Parametrized, <Error class: unknown class><Parametrized, T?>>
Link copied to clipboard
open override fun toString(): String
Link copied to clipboard
open override fun validate(consumer: ErrorConsumer)

Validates this object and reports found errors to the provided consumer