private int countParameters(final String functionBody) {
        int maxParam = -1;
        final Matcher matcher = paramPattern.matcher(functionBody);
        while (matcher.find()) {
            final int paramNumber;
            paramNumber = Integer.valueOf(matcher.group(1));
            if (paramNumber > maxParam) {
                maxParam = paramNumber;
            }
        }
        return maxParam + 1;
    }