Esempio n. 1
0
    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)
Esempio n. 2
0
 def __init__(self,
              dbFilePath,
              langHelper,
              projSrc,
              stopWords=[],
              verbose=False):
     PfisGraph.__init__(self, dbFilePath, langHelper, projSrc, stopWords,
                        verbose)
Esempio n. 3
0
    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)
Esempio n. 4
0
 def cloneNode(self, cloneTo, cloneFrom):
     PfisGraph.cloneNode(self, cloneTo, cloneFrom)
     nodeType = self.getNode(cloneTo)['type']
     self._addEdgesToOtherVariants(cloneTo, nodeType)
Esempio n. 5
0
	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)
Esempio n. 6
0
	def __init__(self, dbFilePath, langHelper, projSrc, stopWords=[], verbose=False):
		PfisGraph.__init__(self, dbFilePath, langHelper, projSrc, stopWords, verbose)
Esempio n. 7
0
	def cloneNode(self, cloneTo, cloneFrom):
		PfisGraph.cloneNode(self, cloneTo, cloneFrom)
		nodeType = self.getNode(cloneTo)['type']
		self._addEdgesToOtherVariants(cloneTo, nodeType)