8355f501c96016e14f268e26a2f034ee43b2f984,db_mgmt_cwe.py,,,#,70

Before Change



// config
Config = configparser.ConfigParser()
Config.read("../configuration.ini")
// default config
mongoHost = "localhost"
mongoPort = 27017
// read config from file

After Change



// config
Config = configparser.ConfigParser()
Config.read(os.path.join(runPath, "./configuration.ini"))
// default config
mongoHost = "localhost"
mongoPort = 27017
cwedict = "http://cwe.mitre.org/data/xml/cwec_v2.8.xml.zip"
// read config from file
if ("Host" in Config["Mongo"]) and (Config.get("Mongo", "Host")!=""):
    mongoHost = Config.get("Mongo", "Host")
if ("Port" in Config["Mongo"]) and (Config.get("Mongo", "Port")!=""):
    mongoPort = int(Config.get("Mongo", "Port"))
if ("CWE" in Config["Sources"]) and (Config.get("Sources", "CWE")!=""):
    cwedict = Config.get("Sources", "CWE")

// connect to db
connect = pymongo.MongoClient(mongoHost, mongoPort)
db = connect.cvedb
cwedb = db.cwe
info = db.info
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 14

Instances


Project Name: cve-search/cve-search
Commit Name: 8355f501c96016e14f268e26a2f034ee43b2f984
Time: 2015-01-07
Author: pieterjan.moreels@gmail.com
File Name: db_mgmt_cwe.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: 8355f501c96016e14f268e26a2f034ee43b2f984
Time: 2015-01-07
Author: pieterjan.moreels@gmail.com
File Name: db_mgmt_cpe_dictionary.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: 8355f501c96016e14f268e26a2f034ee43b2f984
Time: 2015-01-07
Author: pieterjan.moreels@gmail.com
File Name: db_mgmt_cwe.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: 8355f501c96016e14f268e26a2f034ee43b2f984
Time: 2015-01-07
Author: pieterjan.moreels@gmail.com
File Name: db_mgmt_vendorstatements.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: 8355f501c96016e14f268e26a2f034ee43b2f984
Time: 2015-01-07
Author: pieterjan.moreels@gmail.com
File Name: db_mgmt_d2sec.py
Class Name:
Method Name: