int (@NotNull GrArgumentList args) { int argsCount = 0; boolean namedArgProcessed = false; for (GroovyPsiElement arg : args.getAllArguments()) { if (arg instanceof GrNamedArgument) { if (!namedArgProcessed) { namedArgProcessed = true; argsCount++; } } else { argsCount++; } } return argsCount; }