ppoprojecttotals: Dict[Any, Any] = {}  # project -> dm -> dmtotal
    spoprojecttotals: Dict[Any, Any] = {}
    ppotagtotals: Dict[Any, Any] = {}  # tag -> dm -> dmtotal
    spotagtotals: Dict[Any, Any] = {}
    nosummary: List[Any] = []
    analysistimes: Dict[Any, Any] = {}

    dsmethods = RP.get_dsmethods([])

    for cwe in testcases:
        if not (cwerequested == "all" or cwerequested == cwe):
            continue
        for test in testcases[cwe]:
            p = cwe + ":" + test
            path = UF.get_juliet_testpath(cwe, test)
            results = UF.read_project_summary_results(path)
            if results is None:
                nosummary.append(p)
                continue
            pd = results
            try:
                ppod = pd["tagresults"]["ppos"]
                spod = pd["tagresults"]["spos"]
                ppoprojecttotals[p] = {}
                spoprojecttotals[p] = {}
            except BaseException:
                print("Problem with " + str(p))
                continue
            if "stats" in pd:
                projectstats[p] = pd["stats"]
                analysistimes[p] = pd["timestamp"]
Example #2
0
if __name__ == '__main__':

    args = parse()

    try:
        cpath = UF.get_project_path(args.path)
        UF.check_analysis_results(cpath)        
    except UF.CHError as e:
        print(str(e.wrap()))
        exit(1)

    if args.history:
        summarieslist = UF.read_project_summary_results_history(cpath)
    else:
        summarieslist = [ UF.read_project_summary_results(cpath) ]
   
    for summaries in summarieslist:
        # summaries = UF.read_project_summary_results(cpath)
        try:
            if summaries == None:
                sempath = os.path.join(cpath,'semantics')
                capp = CApplication(sempath)
                timestamp = os.stat(capp.path).st_ctime
                result = RP.project_proofobligation_stats_to_dict(capp)
                result['timestamp'] = timestamp
                result['project'] = cpath
                UF.save_project_summary_results(cpath, result)
                UF.save_project_summary_results_as_xml(cpath, result)
                summaries = UF.read_project_summary_results(cpath)
            print(RP.project_proofobligation_stats_dict_to_string(summaries))
Example #3
0
if __name__ == "__main__":

    args = parse()

    try:
        cpath = UF.get_project_path(args.path)
        UF.check_analysis_results(cpath)
    except UF.CHError as e:
        print(str(e.wrap()))
        exit(1)

    if args.history:
        summarieslist = UF.read_project_summary_results_history(cpath)
    else:
        summaries = UF.read_project_summary_results(cpath)
        summarieslist = [summaries] if summaries else []

    for summaries in summarieslist:
        # summaries = UF.read_project_summary_results(cpath)
        try:
            if summaries is None:
                sempath = os.path.join(cpath, "semantics")
                capp = CApplication(sempath)
                timestamp = os.stat(capp.path).st_ctime
                result = RP.project_proofobligation_stats_to_dict(capp)
                result["timestamp"] = timestamp
                result["project"] = cpath
                UF.save_project_summary_results(cpath, result)
                UF.save_project_summary_results_as_xml(cpath, result)
                summaries = UF.read_project_summary_results(cpath)