#!/usr/bin/env python
# coding: utf-8

# In[17]:


from sklearn.metrics import roc_curve, auc
import pandas as pd
import numpy as np
from sklearn.metrics import confusion_matrix
from sklearn.metrics import accuracy_score

x = pd.read_csv("xss.csv") 
y_res = x[x.columns[1]].copy()
y_res = y_res.map({'      false':0, '    true':1})

print('My Project:')
y_pred_project = x[x.columns[2]].copy()
y_pred_project = y_pred_project.map({'FALSE':0, '        true':1})
false_positive_rate_project, true_positive_rate_project, thresholds = roc_curve( y_res,y_pred_project)
array1 = confusion_matrix(y_res, y_pred_project)
print(array1)
print(false_positive_rate)
print( true_positive_rate)
score1 = accuracy_score(y_res, y_pred_project)
print(score1)

print('FBwFindSecBugs:')
y_pred_FBwFindSecBugs = x[x.columns[3]].copy()
y_pred_FBwFindSecBugs = y_pred_FBwFindSecBugs.map({'      false':0, '    true':1})
false_positive_rate_FBwFindSecBugs, true_positive_rate_FBwFindSecBugs, thresholds = roc_curve(y_pred_FBwFindSecBugs, y_res)
array2 = confusion_matrix(y_res, y_pred_FBwFindSecBugs)
print(array2)
print(false_positive_rate)
print( true_positive_rate)
score2 = accuracy_score(y_res, y_pred_FBwFindSecBugs)
print(score2)

print('FindBugs:')
y_pred_FindBugs = x[x.columns[4]].copy()
y_pred_FindBugs = y_pred_FindBugs.map({'      false':0, '    true':1})
false_positive_rate_FindBugs, true_positive_rate_FindBugs, thresholds = roc_curve(y_pred_FindBugs, y_res)
array3 = confusion_matrix(y_res, y_pred_FindBugs)
print(array3)
print(false_positive_rate_FindBugs)
print( true_positive_rate_FindBugs)
score3 = accuracy_score(y_res, y_pred_FindBugs)
print(score3)

print('OWASP_ZAP:')
y_pred_OWASP_ZAP = x[x.columns[5]].copy()
y_pred_OWASP_ZAP = y_pred_OWASP_ZAP.map({'      false':0, '    true':1})
false_positive_rate_OWASP_ZAP, true_positive_rate_OWASP_ZAP, thresholds = roc_curve(y_pred_OWASP_ZAP, y_res)
array4 = confusion_matrix(y_res, y_pred_OWASP_ZAP)
print(array4)
print(false_positive_rate_OWASP_ZAP)
print( true_positive_rate_OWASP_ZAP)
score4 = accuracy_score(y_res, y_pred_OWASP_ZAP)
print(score4)

print('PMD:')
y_pred_PMD = x[x.columns[6]].copy()
y_pred_PMD = y_pred_PMD.map({'      false':0, '    true':1})
false_positive_rate_PMD, true_positive_rate_PMD, thresholds = roc_curve(y_pred_PMD, y_res)
array5 = confusion_matrix(y_res, y_pred_PMD)
print(array5)
print(false_positive_rate_PMD)
print( true_positive_rate_PMD)
score5 = accuracy_score(y_res, y_pred_PMD)
print(score5)

print('SonarQube_Java:')
y_pred_SonarQube_Java = x[x.columns[7]].copy()
y_pred_SonarQube_Java = y_pred_SonarQube_Java.map({'      false':0, '    true':1})
false_positive_rate_SonarQube_Java, true_positive_rate_SonarQube_Java, thresholds = roc_curve(y_pred_SonarQube_Java, y_res)
array6 = confusion_matrix(y_res, y_pred_SonarQube_Java)
print(array6)
print(false_positive_rate_SonarQube_Java)
print( true_positive_rate_SonarQube_Java)
score6 = accuracy_score(y_res, y_pred_SonarQube_Java)
print(score6)


# In[ ]:




