def __parse_binskim(bin_an_dic, output):
 current_run = output['runs'][0]
 if ('results' in current_run):
  rules = output['runs'][0]['rules']
  for res in current_run['results']:
   result = {'rule_id': res['ruleId'], 'status': 'Insecure', 'desc': rules[res['ruleId']]['shortDescription']}
   bin_an_dic['results'].append(result)
 else:
  print '[WARNING] binskim has no results.'
  warning = {'rule_id': 'No Binskim-Results', 'status': 'Info', 'desc': 'No results from Binskim.'}
  bin_an_dic['warnings'].append(warning)
 if ('configurationNotifications' in current_run):
  for warn in current_run['configurationNotifications']:
   warning = {'rule_id': warn['ruleId'], 'status': 'Info', 'desc': warn['message']}
   bin_an_dic['warnings'].append(warning)
 return bin_an_dic

def __parse_binskim ( bin_an_dic , output ) : current_run = output [ 'runs' ] [ 0 ] if ( 'results' in current_run ) : rules = output [ 'runs' ] [ 0 ] [ 'rules' ] for res in current_run [ 'results' ] : result = { 'rule_id' : res [ 'ruleId' ] , 'status' : 'Insecure' , 'desc' : rules [ res [ 'ruleId' ] ] [ 'shortDescription' ] } bin_an_dic [ 'results' ] . append ( result ) else : print '[WARNING] binskim has no results.' warning = { 'rule_id' : 'No Binskim-Results' , 'status' : 'Info' , 'desc' : 'No results from Binskim.' } bin_an_dic [ 'warnings' ] . append ( warning ) if ( 'configurationNotifications' in current_run ) : for warn in current_run [ 'configurationNotifications' ] : warning = { 'rule_id' : warn [ 'ruleId' ] , 'status' : 'Info' , 'desc' : warn [ 'message' ] } bin_an_dic [ 'warnings' ] . append ( warning ) return bin_an_dic
parse output to results and warnings .