Parse the file metadata from the given file. Args: file_name (str): name of the compiled file functions_config (list): list of serialized functions, as extracted from the JSON file
(file_name, functions_config)
| 161 | fd.close() |
| 162 | |
| 163 | def parseFileStats(file_name, functions_config): |
| 164 | """Parse the file metadata from the given file. |
| 165 | |
| 166 | Args: |
| 167 | file_name (str): name of the compiled file |
| 168 | functions_config (list): list of serialized functions, as extracted from the JSON file |
| 169 | """ |
| 170 | global src_seen_consts, src_seen_strings, src_functions_list, src_functions_ctx, src_file_mappings |
| 171 | |
| 172 | src_file_mappings[file_name] = [] |
| 173 | source_index = len(src_functions_list) |
| 174 | for func_config in functions_config: |
| 175 | context = sourceContext().deserialize(func_config, source_index) |
| 176 | context.file = file_name |
| 177 | # accumulate the artifacts |
| 178 | src_seen_consts += context.consts |
| 179 | src_seen_strings += context.strings |
| 180 | # register the seen function |
| 181 | src_functions_list.append(context.name) |
| 182 | src_functions_ctx.append(context) |
| 183 | src_file_mappings[file_name].append(context) |
| 184 | source_index += 1 |
| 185 | |
| 186 | def getContextsStats(): |
| 187 | """Return the statistics of the analyzed source functions. |
no test coverage detected