IdeaDuplicates

open class IdeaDuplicates : IdeaSettingsBasedRunner
fun BuildSteps.ideaDuplicates(init: IdeaDuplicates.() -> Unit = {})

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
fun IdeaDuplicates(init: IdeaDuplicates.() -> Unit = {})

Functions

Link copied to clipboard
fun androidsdk(init: IdeaSettingsBasedRunner.IdeaSettings.AndroidSdk.() -> Unit)
Link copied to clipboard
fun booleanParameter(    customName: String? = null,     trueValue: String? = "true",     falseValue: String? = "false"): SingleDelegateProvider<Boolean>
Link copied to clipboard
fun clear()
Link copied to clipboard
fun clearConditions()

Deletes all configured build step conditions

Link copied to clipboard
fun <T : CompoundParam<T>> compoundParameter(customName: String? = null): CompoundDelegateProvider<T>
Link copied to clipboard
fun conditions(init: BuildStepConditions.() -> Unit = {})
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): SingleDelegateProvider<Double>
Link copied to clipboard
fun <E : Enum<E>> enumParameter(customName: String? = null, mapping: Map<E, String?>? = null): SingleDelegateProvider<E>
Link copied to clipboard
fun findRawParam(paramName: String): Parameter?
Link copied to clipboard
fun hasParam(paramName: String): Boolean
Link copied to clipboard
fun ideajdk(init: IdeaSettingsBasedRunner.IdeaSettings.IdeaJdk.() -> Unit)
Link copied to clipboard
fun intParameter(customName: String? = null): SingleDelegateProvider<Int>
Link copied to clipboard
fun jdk(init: IdeaSettingsBasedRunner.IdeaSettings.Jdk.() -> Unit)
Link copied to clipboard
fun library(init: IdeaSettingsBasedRunner.IdeaSettings.Library.() -> Unit)
Link copied to clipboard
fun param(name: String, value: String)

Adds parameter with specified name and value

Link copied to clipboard
fun pathvars(init: IdeaSettingsBasedRunner.IdeaSettings.PathVariables.() -> Unit)
Link copied to clipboard
fun removeRawParam(paramName: String)
Link copied to clipboard
fun sdk(init: IdeaSettingsBasedRunner.IdeaSettings.Sdk.() -> Unit)
Link copied to clipboard
fun stringParameter(customName: String? = null): SingleDelegateProvider<String>
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

Properties

Link copied to clipboard
var conditions: BuildStepConditions

Optional collection of build step execution conditions

Link copied to clipboard
var disabledPlugins: String?

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: Int?

Ignore duplicate subexpressions with complexity lower than specified

Link copied to clipboard
var distinguishFields: Boolean?

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: Boolean?

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: Boolean?

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: Boolean?

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: Boolean?

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
var enabled: Boolean = true

Specifies whether the step is enabled, true by default

Link copied to clipboard
var executionMode: BuildStep.ExecutionMode

Build step execution mode

Link copied to clipboard
var extractSubexpressions: Boolean?

Whether the duplicated subexpressions can be extracted

Link copied to clipboard
var id: String? = null

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: String?

IntelliJ Inspections and Duplicates Engine Home path

Link copied to clipboard
var includeExcludePatterns: String?

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

Link copied to clipboard
var includeTestSources: Boolean?

Whether the test sources will be included in the duplicates analysis

Link copied to clipboard
var jvmArgs: String?

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

Link copied to clipboard
var lowerBound: Int?

Ignore duplicates with complexity simpler than specified

Link copied to clipboard
var name: String

Build step name

Link copied to clipboard
val params: List<Parameter>
Link copied to clipboard
var pathToProject: String

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: String?

The path to your custom JDK used to run the build

Link copied to clipboard
var type: String

Build step type