Created
June 3, 2020 00:29
-
-
Save guilhermekrz/d5324a9f4034b5af66a353df07665351 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
override fun getApplicableUastTypes(): List<Class<out UElement>>? { | |
return listOf(UMethod::class.java) | |
} | |
override fun createUastHandler(context: JavaContext): UElementHandler? { | |
return MethodHandler(context) | |
} | |
inner class MethodHandler(private val context: JavaContext) : UElementHandler() { | |
val MAX_NUMBER_OF_METHOD_PARAMETERS = 5 | |
override fun visitMethod(node: UMethod) { | |
if(node.parameters.size > MAX_NUMBER_OF_METHOD_PARAMETERS) { | |
reportUsage(context, context.getLocation(node)) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment