parserTest.py
def metricOne(contents):
    """ Returns % of full identifiers in code, excluding comments"""
    
    countBank = []
    wordBank = []
    contents = removeComments(contents)
    contents = removeEmptyLine(contents)
    contents = pragmaRemover(contents)
    contents = libraryRemover(contents)
    
    contents = codeToArray(contents)
    for line in contents:
        parseLine = wordsFromLine(line)
        processLine = splitLine(parseLine)
        for word in processLine:
            wordBank.append(word)

    wordBank = solKeywordFilter(wordBank)

    for word in wordBank:
        countBank.append(word in english_words)
        
    totalLen = len(countBank)
    totalTrue = sum(countBank)
    return(totalTrue/totalLen)
 Returns % of full identifiers in code, excluding comments
Returns % of full identifiers in code, excluding comments
Returns % of full identifiers in code excluding comments
def metricOne(contents):
    countBank = []
    wordBank = []
    contents = removeComments(contents)
    contents = removeEmptyLine(contents)
    contents = pragmaRemover(contents)
    contents = libraryRemover(contents)
    contents = codeToArray(contents)
    for line in contents:
        parseLine = wordsFromLine(line)
        processLine = splitLine(parseLine)
        for word in processLine:
            wordBank.append(word)
    wordBank = solKeywordFilter(wordBank)
    for word in wordBank:
        countBank.append(word in english_words)
    totalLen = len(countBank)
    totalTrue = sum(countBank)
    return(totalTrue/totalLen)
def metricOne ( contents ) : countBank = [ ] wordBank = [ ] contents = removeComments ( contents ) contents = removeEmptyLine ( contents ) contents = pragmaRemover ( contents ) contents = libraryRemover ( contents ) contents = codeToArray ( contents ) for line in contents : parseLine = wordsFromLine ( line ) processLine = splitLine ( parseLine ) for word in processLine : wordBank . append ( word ) wordBank = solKeywordFilter ( wordBank ) for word in wordBank : countBank . append ( word in english_words ) totalLen = len ( countBank ) totalTrue = sum ( countBank ) return ( totalTrue / totalLen )
Returns % of full identifiers in code, excluding comments
Returns % of full identifiers in code excluding comments
""" Returns % of full identifiers in code, excluding comments"""
contents