def add_files(self): files = self.repository.out_folder() + "/files" cmd = "find %s -name \"*.java\" > %s" % (self.repository.src_folder(), files) run_cmd(cmd) cmd = "und -quiet -db %s add @%s" % (self.udb_file(), files) run_cmd(cmd)
def collect(self): equinox = self.settings.equinox() ehfe = "EHFactsExtractor.EHFactsExtractor" main = "org.eclipse.core.launcher.Main" cmd = 'java -jar -Xms1g -Xmx6g "%s" %s -application %s "%s" "%s"' cmd = cmd % (equinox, main, ehfe, self.repository.src_folder(), self.facts_file()) run_cmd(cmd)
def collect(self): print "Collecting", self.metrics_file() self.create_udb() self.add_files() self.analyze() self.settings() cmd = "und metrics -db %s" % self.udb_file() run_cmd(cmd) cmd = "rm -f %s" % self.udb_file() run_cmd(cmd)
def collect(self): equinox = self.settings.equinox() organic = "organic.Organic" main = "org.eclipse.core.launcher.Main" cmd = 'java -jar -Xms1g -Xmx20g "%s" %s -application %s -sf "%s" -af "%s" -src "%s"' cmd = cmd % (equinox, main, organic, self.smell_file(), self.agglomeration_file(), self.repository.src_folder()) # cmd = 'java -jar -Xms1g -Xmx20g "%s" %s -application %s -sf "%s" -src "%s"' # cmd = cmd % (equinox, main, organic, self.smell_file(), self.repository.src_folder()) print cmd run_cmd(cmd)
def collect(self): params = {} params["jar"] = self.settings.ref_miner() params["old"] = self.old.src_folder() params["new"] = self.repo.src_folder() params["old_repo"] = self.old.path() params["new_repo"] = self.repo.path() params["ref_file"] = self.ref_file() + ".ugly" cmd = 'java -jar -Xms1g -Xmx10g %(jar)s "%(old)s" "%(new)s" "%(old_repo)s" "%(new_repo)s" > %(ref_file)s' % params print cmd run_cmd(cmd) # prettify the output file (useful for versioning - multiple lines) cmd = "cat %s | python -m json.tool > %s" % (params["ref_file"], self.ref_file()) run_cmd(cmd) run_cmd("rm -rf %s" % params["ref_file"])
def settings(self): cmd = "und settings -MetricOutputFile \"%s\" %s" % ( self.metrics_file(), self.udb_file()) run_cmd(cmd) cmd = "und settings -MetricMetrics all %s" % self.udb_file() run_cmd(cmd) cmd = "und settings -MetricFileNameDisplayMode RelativePath %s" % self.udb_file( ) run_cmd(cmd) cmd = "und settings -MetricDeclaredInFileDisplayMode RelativePath %s" % self.udb_file( ) run_cmd(cmd) cmd = "und settings -MetricShowDeclaredInFile on %s" % self.udb_file() run_cmd(cmd) cmd = "und settings -MetricShowFunctionParameterTypes on %s" % self.udb_file( ) run_cmd(cmd)
def analyze(self): cmd = "und -quiet analyze %s" % self.udb_file() run_cmd(cmd)
def create_udb(self): cmd = "und create -db %s -languages java" % self.udb_file() run_cmd(cmd)