MCPcopy Create free account
hub / github.com/CheckPointSW/Karta / parseFileStats

Function parseFileStats

src/config/utils.py:163–184  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

161 fd.close()
162
163def 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
186def getContextsStats():
187 """Return the statistics of the analyzed source functions.

Callers 3

recordManualAnchorsFunction · 0.85
analyzeLibraryFunction · 0.85
loadAndPrepareSourceMethod · 0.85

Calls 2

sourceContextFunction · 0.85
deserializeMethod · 0.80

Tested by

no test coverage detected