':return: A dict with {\'<vuln-type>\': [\'filename:line-number\']}
<vuln-type> is one of:
- XSS
- SQLi'

def api_read(self, local_temp_dir, pixy_location):

    self.result = {}
    pixy_path = os.path.expanduser(pixy_location)
    pixy_full = os.path.join(pixy_path, 'run-all.pl')
    proc = subprocess.Popen(pixy_full, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    stdout_value = proc.communicate()[0]
    if ('usage:    check    [options]    file' not in stdout_value):
        ValueError('Please    specify    the    correct    pixy    location')
    self.exec_payload('get_source_code', [local_temp_dir])
    def extract_info(pixy_output):
        '\n                                                Extract    info    from    :param    pixy_output    and    save    it    to    self.result.\n                                                '
        splitted_output = pixy_output.split('\n')
        for (line_number, line) in enumerate(splitted_output):
            if ('Vulnerability    detected!' in line):
                if ('xss' in splitted_output[(line_number + 3)]):
                    vuln_type = 'XSS'
                    location = splitted_output[(line_number + 2)][2:]
                    if (vuln_type not in self.result):
                        self.result[vuln_type] = []
                    self.result[vuln_type].append(location)
            elif ('directly    tainted' in line):
                if ('sql' in splitted_output[(line_number + 2)]):
                    vuln_type = 'SQLi'
                    location = splitted_output[(line_number + 1)][2:]
                    if (vuln_type not in self.result):
                        self.result[vuln_type] = []
                    self.result[vuln_type].append(location)
    def visitor(_, path, list_of_subitems):
        for item in list_of_subitems:
            full_path = os.path.join(path, item)
            if os.path.isfile(full_path):
                pixy_full_with_target = ((pixy_full + '    ') + full_path)
                proc = subprocess.Popen(pixy_full_with_target, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
                stdout_value = proc.communicate()[0]
                extract_info(stdout_value)
    os.path.walk(local_temp_dir, visitor, None)
    return self.result
