Why is this an issue?

Using the Kotlin Gradle DSL, a task can be defined in several ways:

It is generally more efficient to use tasks.register(…​) instead of tasks.create(…​) as the task will not be configured if it is not needed.

How to fix it

Replace tasks.create(…​) with tasks.register(…​).

Code examples

Noncompliant code example

tasks.create("myTask") {
    group = JavaBasePlugin.DOCUMENTATION_GROUP
    description = "My task."
    // other configuration logic

    doLast {
      // ...
    }
}

Compliant solution

tasks.register("myTask") {
    group = JavaBasePlugin.DOCUMENTATION_GROUP
    description = "My task."
    // other configuration logic

    doLast {
      // ...
    }
}

Resources

Documentation

Standards