def updateTopology(self, action, target, referrer, targetNodeType, referrerNodeType): PfisGraph.updateTopology(self, action, target, referrer, targetNodeType, referrerNodeType) if action == 'Method declaration': self._addEdgesToOtherVariants(referrer, referrerNodeType) self._addEdgesToOtherVariants(target, targetNodeType)
def __init__(self, dbFilePath, langHelper, projSrc, stopWords=[], verbose=False): PfisGraph.__init__(self, dbFilePath, langHelper, projSrc, stopWords, verbose)
def getGraph(self, graphType, variantsDb): if graphType == None: graphType = "PfisGraph" if graphType.lower() == "PfisGraph".lower(): return PfisGraph(self.dbPath, self.langHelper, self.projSrcPath, self.stopWords) if graphType.lower() == "PfisGraphWithVariants".lower(): return PfisGraphWithVariants(self.dbPath, self.langHelper, self.projSrcPath, self.stopWords) if graphType.lower() == "PfisGraphWithSimilarPatches".lower(): if variantsDb is None: raise Exception( "Missing attrib: variantsDb for graphType PfisGraphWithSimilarPatches in XML config file." ) return PfisGraphWithSimilarPatches(self.dbPath, self.langHelper, self.projSrcPath, variantsDb, self.stopWords)
def cloneNode(self, cloneTo, cloneFrom): PfisGraph.cloneNode(self, cloneTo, cloneFrom) nodeType = self.getNode(cloneTo)['type'] self._addEdgesToOtherVariants(cloneTo, nodeType)