private boolean isFunction()

in codeanalyzer/src/main/java/nl/obren/sokrates/sourcecode/lang/js/JavaScriptHeuristicUnitsExtractor.java [20:29]


    private boolean isFunction(String line) {
        String idRegex = "[a-zA-Z_$][a-zA-Z_$0-9]*";
        return !line.contains(";")
                && doesNotStartWithKeyword(line)
                && (RegexUtils.matchesEntirely("[ ]*function[ ]*[(].*", line)
                || RegexUtils.matchesEntirely(".*(=|:)[ ]*function[ ]*[(].*", line)
                || RegexUtils.matchesEntirely("[ ]*[(][ ]*function[ ]*[(].*", line)
                || RegexUtils.matchesEntirely("[ ]*define[(][ ]*function[ ]*[(].*", line)
                || RegexUtils.matchesEntirely("[ ]*" + idRegex + "[(].*?[)][ ]*[{][ ]*", line));
    }