Inspectopedia
 
2024.3

Possibly misplaced call to Gradle method

Info
Sanity
New
Last modified: 03 December 2024

Detects possibly misplaced calls to Gradle methods.

Gradle buildscripts comprise a lot of nested closures, making the code structure similar to a markup language. Due to the behavior of DSL languages, the methods that you can write in the outer closures are also available in the inner ones. Such methods may have no meaning when written outside their scope. Sometimes it may be hard to detect this situation. This inspection aims to detect such methods.

Example: