# Path: SmellDetector/Utilities.py
# def myPrint(msg):
# def reportSmell(outputFile, fileName, smellName, reason):
# def intersection(list1, list2):
# def summation(list1, list2):


from SmellDetector import Utilities


def getLCOM(elementList):
    disconnectedElements = 0
    while len(elementList) > 0:
        disconnectedElements += 1
        curElement = elementList.pop()
        variableList = curElement.getUsedVariables()
        i = 0
        while len(elementList) > 0 and i < len(elementList):
            elementToCompare = elementList[i]
            curVariableList = elementToCompare.getUsedVariables()

# Path: SmellDetector/Utilities.py
# def myPrint(msg):
# def reportSmell(outputFile, fileName, smellName, reason):
# def intersection(list1, list2):
# def summation(list1, list2):


# Path: SourceModel/SM_LCOM.py
from SmellDetector import Utilities



def getLCOM(elementList):
    disconnectedElements = 0
    while len(elementList) > 0:
        disconnectedElements += 1
        curElement = elementList.pop()
        variableList = curElement.getUsedVariables()
        i = 0
        while len(elementList) > 0 and i < len(elementList):
            elementToCompare = elementList[i]
            curVariableList = elementToCompare.getUsedVariables()

            if len(Utilities.intersection(curVariableList, variableList)) > 0: