diff --git a/scanpipe/api/views.py b/scanpipe/api/views.py index fd7416b85f..1b0b1fd183 100644 --- a/scanpipe/api/views.py +++ b/scanpipe/api/views.py @@ -178,21 +178,9 @@ def results_download(self, request, *args, **kwargs): if format == "json": return project_results_json_response(project, as_attachment=True) - elif format == "xlsx": - output_file = output.to_xlsx(project) - elif format == "spdx": - output_file = output.to_spdx(project, **output_kwargs) - elif format == "cyclonedx": - output_file = output.to_cyclonedx(project, **output_kwargs) - elif format == "attribution": - output_file = output.to_attribution(project) - elif format == "ort-package-list": - output_file = output.to_ort_package_list_yml(project) - elif format == "all_formats": - output_file = output.to_all_formats(project) - elif format == "all_outputs": - output_file = output.to_all_outputs(project) - else: + try: + output_file = output.get_output_for_format(project, format, **output_kwargs) + except ValueError: return ErrorResponse(f"Format {format} not supported.") filename = output.safe_filename(f"scancodeio_{project.name}_{output_file.name}") diff --git a/scanpipe/pipes/output.py b/scanpipe/pipes/output.py index 03fc4ca51c..0a8754f8cf 100644 --- a/scanpipe/pipes/output.py +++ b/scanpipe/pipes/output.py @@ -177,6 +177,22 @@ def to_csv(project): return output_files +def strip_symbols(data): + """ + Remove symbol-related keys from general project output. + + Returns a new dict with symbols removed, leaving the input unchanged. + """ + if not isinstance(data, dict) or not data: + return data + + data_copy = dict(data) + for key in ("source_symbols", "source_strings", "source_comments"): + data_copy.pop(key, None) + + return data_copy + + class JSONResultsGenerator: """ Return the `project` JSON results as a Python generator. @@ -236,6 +252,12 @@ def get_headers(self, project): messages = project.projectmessages.all() messages = ProjectMessageSerializer(messages, many=True) + sanitized_messages = [] + for msg in messages.data: + msg_copy = msg + if "details" in msg_copy: + msg_copy["details"] = strip_symbols(msg_copy.get("details")) + sanitized_messages.append(msg_copy) other_tools = [f"pkg:pypi/scancode-toolkit@{scancode_toolkit_version}"] @@ -250,7 +272,7 @@ def get_headers(self, project): "settings": project.settings, "input_sources": project.get_inputs_with_source(), "runs": runs.data, - "messages": messages.data, + "messages": sanitized_messages, "extra_data": project.extra_data, } yield self.encode(headers) @@ -258,7 +280,10 @@ def get_headers(self, project): def encode_queryset(self, project, model_name, serializer): queryset = get_queryset(project, model_name) for obj in queryset.iterator(chunk_size=2000): - yield self.encode(serializer(obj).data) + data = serializer(obj).data + if model_name == "codebaseresource" and "extra_data" in data: + data["extra_data"] = strip_symbols(data.get("extra_data")) + yield self.encode(data) def get_packages(self, project): from scanpipe.api.serializers import DiscoveredPackageSerializer @@ -289,7 +314,41 @@ def get_relations(self, project): ) -def to_json(project): +class SymbolsJSONResultsGenerator(JSONResultsGenerator): + """ + Specialized JSON generator that only outputs resources with symbol data. + Inherits header generation from parent, but filters resources. + """ + + def get_resources(self, project): + from scanpipe.api.serializers import CodebaseResourceSerializer + + queryset = project.codebaseresources.all() + for resource in queryset.iterator(chunk_size=2000): + extra_data = resource.extra_data or {} + has_symbols = any( + key in extra_data + for key in ("source_symbols", "source_strings", "source_comments") + ) + if has_symbols: + yield self.encode(CodebaseResourceSerializer(resource).data) + + def __iter__(self): + yield '{"headers":[' + for chunk in self.get_headers(self.project): + yield chunk + yield '],"files":[' + + first = True + for chunk in self.get_resources(self.project): + if not first: + yield "," + first = False + yield chunk + yield "]}" + + +def to_json(project, **kwargs): """ Generate output for the provided `project` in JSON format. The output file is created in the `project` output/ directory. @@ -387,6 +446,9 @@ def add_xlsx_worksheet(workbook, worksheet_name, rows, fields): for row_index, record in enumerate(rows, start=1): row_errors = [] record_is_dict = isinstance(record, dict) + record_is_projectmessage = not isinstance(record, dict) and isinstance( + record, ProjectMessage + ) for col_index, field in enumerate(fields): if record_is_dict: value = record.get(field) @@ -396,6 +458,8 @@ def add_xlsx_worksheet(workbook, worksheet_name, rows, fields): if not value: continue + if record_is_projectmessage and field == "details": + value = strip_symbols(value) value, error = _adapt_value_for_xlsx(field, value) if error: @@ -532,7 +596,7 @@ def _adapt_value_for_xlsx(fieldname, value, maximum_length=32767, _adapt=True): ] -def to_xlsx(project): +def to_xlsx(project, **kwargs): """ Generate output for the provided ``project`` in XLSX format. The output file is created in the ``project`` "output/" directory. @@ -1079,7 +1143,7 @@ def get_unique_licenses(packages): return licenses -def to_attribution(project): +def to_attribution(project, **kwargs): """ Generate attribution for the provided ``project``. The output file is created in the ``project`` "output/" directory. @@ -1120,7 +1184,7 @@ def to_attribution(project): return output_file -def to_ort_package_list_yml(project): +def to_ort_package_list_yml(project, **kwargs): """ Generate an ORT compatible "package-list.yml" output. The output file is created in the ``project`` "output/" directory. @@ -1132,6 +1196,26 @@ def to_ort_package_list_yml(project): return output_file +def to_symbols_json(project, **kwargs): + """ + Generate a symbols-only JSON output for the provided `project`. + + This output contains only the symbols-related extracted data stored on + CodebaseResource.extra_data: + - source_symbols + - source_strings + - source_comments + """ + results_generator = SymbolsJSONResultsGenerator(project) + output_file = project.get_output_file_path("symbols", "json") + + with output_file.open("w") as file: + for chunk in results_generator: + file.write(chunk) + + return output_file + + FORMAT_TO_FUNCTION_MAPPING = { "json": to_json, "xlsx": to_xlsx, @@ -1139,6 +1223,7 @@ def to_ort_package_list_yml(project): "cyclonedx": to_cyclonedx, "attribution": to_attribution, "ort-package-list": to_ort_package_list_yml, + "symbols": to_symbols_json, } @@ -1180,3 +1265,24 @@ def to_all_outputs(project): zip_file.name = safe_filename(f"{project.name}_outputs.zip") return zip_file + + +def get_output_for_format(project, format, version=None): + """ + Generate output file for the given format. + Returns the output file object. + """ + output_kwargs = {} + if version: + output_kwargs["version"] = version + + if format == "all_formats": + return to_all_formats(project) + if format == "all_outputs": + return to_all_outputs(project) + + output_function = FORMAT_TO_FUNCTION_MAPPING.get(format) + if output_function: + return output_function(project, **output_kwargs) + + raise ValueError(f"Unsupported output format: {format}") diff --git a/scanpipe/tests/data/d2d-elfs/brotli-elf-d2d.json b/scanpipe/tests/data/d2d-elfs/brotli-elf-d2d.json index 1031a89f5a..ef72e25b3b 100644 --- a/scanpipe/tests/data/d2d-elfs/brotli-elf-d2d.json +++ b/scanpipe/tests/data/d2d-elfs/brotli-elf-d2d.json @@ -661,14 +661,7 @@ "matched_symbols_count": "1.00", "matched_symbols_ratio": "0.50", "matched_symbols_unique_ratio": "0.50" - }, - "source_strings": [ - "\"constants.h\"" - ], - "source_symbols": [ - "_kBrotliPrefixCodeRanges", - "BROTLI_NUM_BLOCK_LEN_SYMBOLS" - ] + } } }, { @@ -765,123 +758,7 @@ "matched_symbols_count": "1.00", "matched_symbols_ratio": "0.01", "matched_symbols_unique_ratio": "0.02" - }, - "source_strings": [ - "\"platform.h\"" - ], - "source_symbols": [ - "BROTLI_COMMON_CONSTANTS_H_", - "BROTLI_COMMON_CONSTANTS_H_", - "BROTLI_CONTEXT_MAP_MAX_RLE", - "BROTLI_MAX_NUMBER_OF_BLOCK_TYPES", - "BROTLI_NUM_LITERAL_SYMBOLS", - "BROTLI_NUM_COMMAND_SYMBOLS", - "BROTLI_NUM_BLOCK_LEN_SYMBOLS", - "BROTLI_MAX_CONTEXT_MAP_SYMBOLS", - "BROTLI_MAX_BLOCK_TYPE_SYMBOLS", - "BROTLI_REPEAT_PREVIOUS_CODE_LENGTH", - "BROTLI_REPEAT_ZERO_CODE_LENGTH", - "BROTLI_CODE_LENGTH_CODES", - "BROTLI_INITIAL_REPEATED_CODE_LENGTH", - "BROTLI_LARGE_MAX_DISTANCE_BITS", - "BROTLI_LARGE_MIN_WBITS", - "BROTLI_LARGE_MAX_WBITS", - "BROTLI_NUM_DISTANCE_SHORT_CODES", - "BROTLI_MAX_NPOSTFIX", - "BROTLI_MAX_NDIRECT", - "BROTLI_MAX_DISTANCE_BITS", - "BROTLI_DISTANCE_ALPHABET_SIZE", - "NPOSTFIX", - "NDIRECT", - "MAXNBITS", - "BROTLI_NUM_DISTANCE_SYMBOLS", - "BROTLI_MAX_DISTANCE", - "BROTLI_MAX_ALLOWED_DISTANCE", - "BROTLI_NUM_INS_COPY_CODES", - "BROTLI_LITERAL_CONTEXT_BITS", - "BROTLI_DISTANCE_CONTEXT_BITS", - "BROTLI_WINDOW_GAP", - "BROTLI_MAX_BACKWARD_LIMIT", - "W", - "BrotliDistanceCodeLimit", - "BrotliCalculateDistanceCodeLimit", - "max_distance", - "npostfix", - "ndirect", - "result", - "BROTLI_UNUSED", - "BrotliCalculateDistanceCodeLimit", - "max_distance", - "ndirect", - "result", - "max_distance", - "BROTLI_NUM_DISTANCE_SHORT_CODES", - "result", - "max_distance", - "result", - "forbidden_distance", - "max_distance", - "offset", - "forbidden_distance", - "ndirect", - "ndistbits", - "tmp", - "half", - "group", - "postfix", - "npostfix", - "extra", - "start", - "offset", - "offset", - "npostfix", - "tmp", - "offset", - "tmp", - "ndistbits", - "tmp", - "tmp", - "ndistbits", - "half", - "offset", - "ndistbits", - "group", - "ndistbits", - "half", - "group", - "result", - "ndirect", - "BROTLI_NUM_DISTANCE_SHORT_CODES", - "result", - "ndirect", - "result", - "group", - "ndistbits", - "group", - "extra", - "ndistbits", - "start", - "ndistbits", - "start", - "group", - "ndistbits", - "result", - "group", - "npostfix", - "postfix", - "ndirect", - "BROTLI_NUM_DISTANCE_SHORT_CODES", - "result", - "start", - "extra", - "npostfix", - "postfix", - "ndirect", - "result", - "BrotliPrefixCodeRange", - "_kBrotliPrefixCodeRanges", - "BROTLI_NUM_BLOCK_LEN_SYMBOLS" - ] + } } }, { @@ -928,13 +805,7 @@ "matched_symbols_count": "1.00", "matched_symbols_ratio": "1.00", "matched_symbols_unique_ratio": "1.00" - }, - "source_strings": [ - "\"context.h\"" - ], - "source_symbols": [ - "_kBrotliContextLookupTable" - ] + } } }, { @@ -1037,24 +908,7 @@ "matched_symbols_count": "1.00", "matched_symbols_ratio": "0.07", "matched_symbols_unique_ratio": "0.08" - }, - "source_strings": [], - "source_symbols": [ - "BROTLI_COMMON_CONTEXT_H_", - "BROTLI_COMMON_CONTEXT_H_", - "CONTEXT_LSB6", - "CONTEXT_MSB6", - "CONTEXT_UTF8", - "CONTEXT_SIGNED", - "uint8_t", - "_kBrotliContextLookupTable", - "BROTLI_CONTEXT_LUT", - "MODE", - "BROTLI_CONTEXT", - "P1", - "P2", - "LUT" - ] + } } }, { @@ -1154,37 +1008,7 @@ "matched_symbols_count": "2.00", "matched_symbols_ratio": "0.09", "matched_symbols_unique_ratio": "0.20" - }, - "source_strings": [ - "\"dictionary.h\"", - "\"platform.h\"", - "\"C\"" - ], - "source_symbols": [ - "__cplusplus", - "c_plusplus", - "BROTLI_EXTERNAL_DICTIONARY_DATA", - "kBrotliDictionaryData", - "BROTLI_EXTERNAL_DICTIONARY_DATA", - "kBrotliDictionary", - "BrotliDictionary", - "kBrotliDictionary", - "BROTLI_EXTERNAL_DICTIONARY_DATA", - "kBrotliDictionaryData", - "BrotliGetDictionary", - "kBrotliDictionary", - "BrotliSetDictionaryData", - "data", - "BROTLI_EXTERNAL_DICTIONARY_DATA", - "data", - "kBrotliDictionary", - "kBrotliDictionary", - "data", - "BROTLI_UNUSED", - "data", - "__cplusplus", - "c_plusplus" - ] + } } }, { @@ -1284,26 +1108,7 @@ "matched_symbols_count": "2.00", "matched_symbols_ratio": "0.14", "matched_symbols_unique_ratio": "0.20" - }, - "source_strings": [ - "\"C\"" - ], - "source_symbols": [ - "BROTLI_COMMON_DICTIONARY_H_", - "BROTLI_COMMON_DICTIONARY_H_", - "__cplusplus", - "c_plusplus", - "BrotliDictionary", - "BrotliGetDictionary", - "void", - "void", - "BrotliSetDictionaryData", - "data", - "BROTLI_MIN_DICTIONARY_WORD_LENGTH", - "BROTLI_MAX_DICTIONARY_WORD_LENGTH", - "__cplusplus", - "c_plusplus" - ] + } } }, { @@ -1401,26 +1206,7 @@ "matched_symbols_count": "2.00", "matched_symbols_ratio": "0.14", "matched_symbols_unique_ratio": "0.25" - }, - "source_strings": [ - "\"platform.h\"" - ], - "source_symbols": [ - "BrotliDefaultAllocFunc", - "opaque", - "size", - "BROTLI_UNUSED", - "opaque", - "malloc", - "size", - "BrotliDefaultFreeFunc", - "opaque", - "address", - "BROTLI_UNUSED", - "opaque", - "free", - "address" - ] + } } }, { @@ -1643,561 +1429,7 @@ "matched_symbols_count": "4.00", "matched_symbols_ratio": "0.01", "matched_symbols_unique_ratio": "0.01" - }, - "source_strings": [ - "\"%s:%d (%s)\\n\"", - "\"rbit %0, %1\\n\"", - "\"=r\"", - "\"r\"" - ], - "source_symbols": [ - "BROTLI_COMMON_PLATFORM_H_", - "BROTLI_COMMON_PLATFORM_H_", - "OS_LINUX", - "OS_CYGWIN", - "__EMSCRIPTEN__", - "OS_FREEBSD", - "OS_MACOSX", - "BROTLI_X_BYTE_ORDER", - "BROTLI_X_LITTLE_ENDIAN", - "BROTLI_X_BIG_ENDIAN", - "BROTLI_MSVC_VERSION_CHECK", - "BROTLI_ENABLE_LOG", - "BROTLI_DEBUG", - "BROTLI_GNUC_HAS_BUILTIN", - "__builtin_expect", - "BROTLI_INTEL_VERSION_CHECK", - "BROTLI_SUNPRO_VERSION_CHECK", - "BROTLI_ARM_VERSION_CHECK", - "BROTLI_IBM_VERSION_CHECK", - "BROTLI_TI_VERSION_CHECK", - "BROTLI_TINYC_VERSION_CHECK", - "BROTLI_PREDICT_TRUE", - "x", - "BROTLI_PREDICT_FALSE", - "x", - "BROTLI_PREDICT_FALSE", - "x", - "BROTLI_PREDICT_TRUE", - "x", - "__STDC_VERSION__", - "__STDC_VERSION__", - "__cplusplus", - "BROTLI_RESTRICT", - "BROTLI_GNUC_VERSION_CHECK", - "BROTLI_MSVC_VERSION_CHECK", - "BROTLI_INTEL_VERSION_CHECK", - "BROTLI_ARM_VERSION_CHECK", - "BROTLI_IBM_VERSION_CHECK", - "BROTLI_PGI_VERSION_CHECK", - "BROTLI_TI_VERSION_CHECK", - "BROTLI_IAR_VERSION_CHECK", - "BROTLI_SUNPRO_VERSION_CHECK", - "__cplusplus", - "BROTLI_RESTRICT", - "BROTLI_SUNPRO_VERSION_CHECK", - "__cplusplus", - "BROTLI_RESTRICT", - "BROTLI_RESTRICT", - "__STDC_VERSION__", - "__STDC_VERSION__", - "__cplusplus", - "__cplusplus", - "BROTLI_MAYBE_INLINE", - "__GNUC_STDC_INLINE__", - "__GNUC_GNU_INLINE__", - "BROTLI_ARM_VERSION_CHECK", - "BROTLI_MAYBE_INLINE", - "BROTLI_MSVC_VERSION_CHECK", - "BROTLI_ARM_VERSION_CHECK", - "BROTLI_TI_VERSION_CHECK", - "BROTLI_MAYBE_INLINE", - "BROTLI_MAYBE_INLINE", - "BROTLI_GNUC_HAS_ATTRIBUTE", - "always_inline", - "BROTLI_INTEL_VERSION_CHECK", - "BROTLI_SUNPRO_VERSION_CHECK", - "BROTLI_ARM_VERSION_CHECK", - "BROTLI_IBM_VERSION_CHECK", - "BROTLI_TI_VERSION_CHECK", - "BROTLI_TI_VERSION_CHECK", - "__TI_GNU_ATTRIBUTE_SUPPORT__", - "BROTLI_INLINE", - "BROTLI_MSVC_VERSION_CHECK", - "BROTLI_INLINE", - "BROTLI_TI_VERSION_CHECK", - "__cplusplus", - "BROTLI_INLINE", - "BROTLI_IAR_VERSION_CHECK", - "BROTLI_INLINE", - "BROTLI_INLINE", - "BROTLI_GNUC_HAS_ATTRIBUTE", - "noinline", - "BROTLI_INTEL_VERSION_CHECK", - "BROTLI_SUNPRO_VERSION_CHECK", - "BROTLI_ARM_VERSION_CHECK", - "BROTLI_IBM_VERSION_CHECK", - "BROTLI_TI_VERSION_CHECK", - "BROTLI_TI_VERSION_CHECK", - "__TI_GNU_ATTRIBUTE_SUPPORT__", - "BROTLI_NOINLINE", - "BROTLI_MSVC_VERSION_CHECK", - "BROTLI_NOINLINE", - "BROTLI_PGI_VERSION_CHECK", - "BROTLI_NOINLINE", - "BROTLI_TI_VERSION_CHECK", - "__cplusplus", - "BROTLI_NOINLINE", - "BROTLI_IAR_VERSION_CHECK", - "BROTLI_NOINLINE", - "BROTLI_NOINLINE", - "BROTLI_GNUC_HAS_ATTRIBUTE", - "unused", - "BROTLI_INTEL_VERSION_CHECK", - "BROTLI_UNUSED_FUNCTION", - "BROTLI_UNUSED_FUNCTION", - "BROTLI_GNUC_HAS_ATTRIBUTE", - "aligned", - "BROTLI_ALIGNED", - "N", - "BROTLI_ALIGNED", - "N", - "__ARM_ARCH", - "__ARM_ARCH", - "M_ARM", - "M_ARM", - "BROTLI_TARGET_ARMV7", - "__ARM_ARCH", - "__ARM_ARCH", - "__aarch64__", - "__ARM64_ARCH_8__", - "BROTLI_TARGET_ARMV8_ANY", - "__ARM_32BIT_STATE", - "BROTLI_TARGET_ARMV8_32", - "__ARM_64BIT_STATE", - "BROTLI_TARGET_ARMV8_64", - "__ARM_NEON__", - "__ARM_NEON", - "BROTLI_TARGET_NEON", - "__i386", - "_M_IX86", - "BROTLI_TARGET_X86", - "__x86_64__", - "_M_X64", - "BROTLI_TARGET_X64", - "__PPC64__", - "BROTLI_TARGET_POWERPC64", - "__riscv", - "__riscv_xlen", - "__riscv_xlen", - "BROTLI_TARGET_RISCV64", - "__loongarch_lp64", - "BROTLI_TARGET_LOONGARCH64", - "BROTLI_TARGET_X64", - "BROTLI_TARGET_ARMV8_64", - "BROTLI_TARGET_POWERPC64", - "BROTLI_TARGET_RISCV64", - "BROTLI_TARGET_LOONGARCH64", - "BROTLI_TARGET_64_BITS", - "BROTLI_TARGET_64_BITS", - "BROTLI_BUILD_64_BIT", - "BROTLI_64_BITS", - "BROTLI_BUILD_32_BIT", - "BROTLI_64_BITS", - "BROTLI_64_BITS", - "BROTLI_64_BITS", - "brotli_reg_t", - "brotli_reg_t", - "BROTLI_BUILD_BIG_ENDIAN", - "BROTLI_BIG_ENDIAN", - "BROTLI_BUILD_LITTLE_ENDIAN", - "BROTLI_LITTLE_ENDIAN", - "BROTLI_BUILD_ENDIAN_NEUTRAL", - "__BYTE_ORDER__", - "__BYTE_ORDER__", - "__ORDER_LITTLE_ENDIAN__", - "BROTLI_LITTLE_ENDIAN", - "_WIN32", - "BROTLI_TARGET_X64", - "BROTLI_LITTLE_ENDIAN", - "__BYTE_ORDER__", - "__BYTE_ORDER__", - "__ORDER_BIG_ENDIAN__", - "BROTLI_BIG_ENDIAN", - "BROTLI_X_BYTE_ORDER", - "BROTLI_X_BYTE_ORDER", - "BROTLI_X_LITTLE_ENDIAN", - "BROTLI_LITTLE_ENDIAN", - "BROTLI_X_BYTE_ORDER", - "BROTLI_X_BIG_ENDIAN", - "BROTLI_BIG_ENDIAN", - "BROTLI_LITTLE_ENDIAN", - "BROTLI_LITTLE_ENDIAN", - "BROTLI_BIG_ENDIAN", - "BROTLI_BIG_ENDIAN", - "BROTLI_X_BYTE_ORDER", - "BROTLI_BUILD_NO_UNALIGNED_READ_FAST", - "BROTLI_UNALIGNED_READ_FAST", - "BROTLI_TARGET_X86", - "BROTLI_TARGET_X64", - "BROTLI_TARGET_ARMV7", - "BROTLI_TARGET_ARMV8_ANY", - "BROTLI_TARGET_RISCV64", - "BROTLI_TARGET_LOONGARCH64", - "BROTLI_UNALIGNED_READ_FAST", - "BROTLI_UNALIGNED_READ_FAST", - "uint16_t", - "BrotliUnalignedRead16", - "p", - "t", - "memcpy", - "t", - "p", - "t", - "t", - "uint32_t", - "BrotliUnalignedRead32", - "p", - "t", - "memcpy", - "t", - "p", - "t", - "t", - "uint64_t", - "BrotliUnalignedRead64", - "p", - "t", - "memcpy", - "t", - "p", - "t", - "t", - "void", - "BrotliUnalignedWrite64", - "p", - "v", - "memcpy", - "p", - "v", - "v", - "BROTLI_LITTLE_ENDIAN", - "BROTLI_UNALIGNED_LOAD16LE", - "BROTLI_UNALIGNED_LOAD32LE", - "BROTLI_UNALIGNED_LOAD64LE", - "BROTLI_UNALIGNED_STORE64LE", - "BROTLI_BIG_ENDIAN", - "BROTLI_BSWAP16_", - "V", - "uint16_t", - "BROTLI_UNALIGNED_LOAD16LE", - "p", - "value", - "BrotliUnalignedRead16", - "p", - "BROTLI_BSWAP16_", - "value", - "BROTLI_BSWAP32_", - "V", - "uint32_t", - "BROTLI_UNALIGNED_LOAD32LE", - "p", - "value", - "BrotliUnalignedRead32", - "p", - "BROTLI_BSWAP32_", - "value", - "BROTLI_BSWAP64_", - "V", - "uint64_t", - "BROTLI_UNALIGNED_LOAD64LE", - "p", - "value", - "BrotliUnalignedRead64", - "p", - "BROTLI_BSWAP64_", - "value", - "void", - "BROTLI_UNALIGNED_STORE64LE", - "p", - "v", - "value", - "BROTLI_BSWAP64_", - "v", - "BrotliUnalignedWrite64", - "p", - "value", - "uint16_t", - "BROTLI_UNALIGNED_LOAD16LE", - "p", - "in", - "p", - "in", - "in", - "uint32_t", - "BROTLI_UNALIGNED_LOAD32LE", - "p", - "in", - "p", - "value", - "in", - "value", - "in", - "value", - "in", - "value", - "in", - "value", - "uint64_t", - "BROTLI_UNALIGNED_LOAD64LE", - "p", - "in", - "p", - "value", - "in", - "value", - "in", - "value", - "in", - "value", - "in", - "value", - "in", - "value", - "in", - "value", - "in", - "value", - "in", - "value", - "void", - "BROTLI_UNALIGNED_STORE64LE", - "p", - "v", - "out", - "p", - "out", - "v", - "out", - "v", - "out", - "v", - "out", - "v", - "out", - "v", - "out", - "v", - "out", - "v", - "out", - "v", - "void", - "BROTLI_UNALIGNED_LOAD_PTR", - "p", - "v", - "memcpy", - "v", - "p", - "v", - "void", - "BROTLI_UNALIGNED_STORE_PTR", - "p", - "v", - "memcpy", - "p", - "v", - "BROTLI_GNUC_HAS_BUILTIN", - "__builtin_constant_p", - "BROTLI_INTEL_VERSION_CHECK", - "BROTLI_IS_CONSTANT", - "x", - "BROTLI_IS_CONSTANT", - "x", - "BROTLI_TARGET_ARMV7", - "BROTLI_TARGET_ARMV8_ANY", - "BROTLI_HAS_UBFX", - "BROTLI_HAS_UBFX", - "BROTLI_ENABLE_LOG", - "BROTLI_LOG", - "x", - "BROTLI_LOG", - "x", - "BROTLI_DEBUG", - "BROTLI_ENABLE_LOG", - "BROTLI_ENABLE_DUMP_DEFAULT", - "BROTLI_DCHECK", - "x", - "BROTLI_ENABLE_DUMP_DEFAULT", - "BROTLI_DCHECK", - "x", - "BROTLI_ENABLE_DUMP", - "BROTLI_ENABLE_DUMP", - "BROTLI_ENABLE_DUMP", - "void", - "BrotliDump", - "f", - "l", - "fn", - "fprintf", - "stderr", - "f", - "l", - "fn", - "fflush", - "stderr", - "BROTLI_DUMP", - "BROTLI_DUMP", - "BROTLI_64_BITS", - "BROTLI_TARGET_64_BITS", - "BROTLI_GNUC_VERSION_CHECK", - "__llvm__", - "BROTLI_BUILD_NO_RBIT", - "BROTLI_TARGET_ARMV7", - "BROTLI_TARGET_ARMV8_ANY", - "brotli_reg_t", - "BrotliRBit", - "input", - "output", - "output", - "input", - "output", - "BROTLI_RBIT", - "x", - "BROTLI_RBIT", - "void", - "BrotliRBit", - "BROTLI_REPEAT_4", - "X", - "BROTLI_REPEAT_5", - "X", - "BROTLI_REPEAT_6", - "X", - "BROTLI_UNUSED", - "X", - "BROTLI_MIN_MAX", - "T", - "BROTLI_MIN_MAX", - "BROTLI_MIN_MAX", - "BROTLI_MIN_MAX", - "int", - "BROTLI_MIN_MAX", - "size_t", - "BROTLI_MIN_MAX", - "uint32_t", - "BROTLI_MIN_MAX", - "uint8_t", - "BROTLI_MIN", - "T", - "A", - "B", - "BROTLI_MAX", - "T", - "A", - "B", - "BROTLI_SWAP", - "T", - "A", - "I", - "J", - "BROTLI_64_BITS", - "BROTLI_GNUC_HAS_BUILTIN", - "__builtin_ctzll", - "BROTLI_INTEL_VERSION_CHECK", - "BROTLI_TZCNT64", - "BROTLI_MSVC_VERSION_CHECK", - "BROTLI_TARGET_X64", - "BROTLI_TZCNT64", - "uint32_t", - "BrotliBsf64Msvc", - "x", - "lsb", - "_BitScanForward64", - "lsb", - "x", - "lsb", - "BROTLI_TZCNT64", - "BROTLI_GNUC_HAS_BUILTIN", - "__builtin_clz", - "BROTLI_INTEL_VERSION_CHECK", - "BROTLI_BSR32", - "x", - "BROTLI_MSVC_VERSION_CHECK", - "uint32_t", - "BrotliBsr32Msvc", - "x", - "msb", - "_BitScanReverse", - "msb", - "x", - "msb", - "BROTLI_BSR32", - "void", - "BrotliDefaultAllocFunc", - "opaque", - "size", - "void", - "BrotliDefaultFreeFunc", - "opaque", - "address", - "void", - "BrotliSuppressUnusedFunctions", - "BROTLI_UNUSED", - "BrotliSuppressUnusedFunctions", - "BROTLI_UNUSED", - "BrotliUnalignedRead16", - "BROTLI_UNUSED", - "BrotliUnalignedRead32", - "BROTLI_UNUSED", - "BrotliUnalignedRead64", - "BROTLI_UNUSED", - "BrotliUnalignedWrite64", - "BROTLI_UNUSED", - "BROTLI_UNALIGNED_LOAD16LE", - "BROTLI_UNUSED", - "BROTLI_UNALIGNED_LOAD32LE", - "BROTLI_UNUSED", - "BROTLI_UNALIGNED_LOAD64LE", - "BROTLI_UNUSED", - "BROTLI_UNALIGNED_STORE64LE", - "BROTLI_UNUSED", - "BROTLI_UNALIGNED_LOAD_PTR", - "BROTLI_UNUSED", - "BROTLI_UNALIGNED_STORE_PTR", - "BROTLI_UNUSED", - "BrotliRBit", - "BROTLI_UNUSED", - "brotli_min_double", - "BROTLI_UNUSED", - "brotli_max_double", - "BROTLI_UNUSED", - "brotli_min_float", - "BROTLI_UNUSED", - "brotli_max_float", - "BROTLI_UNUSED", - "brotli_min_int", - "BROTLI_UNUSED", - "brotli_max_int", - "BROTLI_UNUSED", - "brotli_min_size_t", - "BROTLI_UNUSED", - "brotli_max_size_t", - "BROTLI_UNUSED", - "brotli_min_uint32_t", - "BROTLI_UNUSED", - "brotli_max_uint32_t", - "BROTLI_UNUSED", - "brotli_min_uint8_t", - "BROTLI_UNUSED", - "brotli_max_uint8_t", - "BROTLI_UNUSED", - "BrotliDefaultAllocFunc", - "BROTLI_UNUSED", - "BrotliDefaultFreeFunc", - "BROTLI_ENABLE_DUMP", - "BROTLI_UNUSED", - "BrotliDump" - ] + } } }, { @@ -2384,754 +1616,7 @@ "matched_symbols_count": "11.00", "matched_symbols_ratio": "0.01", "matched_symbols_unique_ratio": "0.07" - }, - "source_strings": [ - "\"dictionary.h\"", - "\"platform.h\"", - "\"shared_dictionary_internal.h\"", - "\"C\"" - ], - "source_symbols": [ - "__cplusplus", - "c_plusplus", - "BROTLI_EXPERIMENTAL", - "BROTLI_NUM_ENCODED_LENGTHS", - "BROTLI_MAX_SIZE_BITS", - "ReadBool", - "encoded", - "size", - "pos", - "result", - "value", - "position", - "pos", - "position", - "size", - "BROTLI_FALSE", - "value", - "encoded", - "position", - "value", - "BROTLI_FALSE", - "result", - "TO_BROTLI_BOOL", - "value", - "pos", - "position", - "BROTLI_TRUE", - "ReadUint8", - "encoded", - "size", - "pos", - "result", - "position", - "pos", - "position", - "size", - "BROTLI_FALSE", - "result", - "encoded", - "position", - "pos", - "position", - "BROTLI_TRUE", - "ReadUint16", - "encoded", - "size", - "pos", - "result", - "position", - "pos", - "position", - "size", - "BROTLI_FALSE", - "result", - "BROTLI_UNALIGNED_LOAD16LE", - "encoded", - "position", - "position", - "pos", - "position", - "BROTLI_TRUE", - "ReadVarint32", - "encoded", - "size", - "pos", - "result", - "num", - "byte", - "result", - "pos", - "size", - "BROTLI_FALSE", - "byte", - "encoded", - "pos", - "num", - "byte", - "BROTLI_FALSE", - "result", - "byte", - "num", - "byte", - "BROTLI_TRUE", - "num", - "BrotliSizeBitsToOffsets", - "size_bits_by_length", - "offsets_by_length", - "pos", - "i", - "i", - "i", - "SHARED_BROTLI_MAX_DICTIONARY_WORD_LENGTH", - "i", - "offsets_by_length", - "i", - "pos", - "size_bits_by_length", - "i", - "pos", - "i", - "size_bits_by_length", - "i", - "pos", - "ParseWordList", - "size", - "encoded", - "pos", - "out", - "offset", - "i", - "position", - "pos", - "position", - "BROTLI_NUM_ENCODED_LENGTHS", - "size", - "BROTLI_FALSE", - "memset", - "out", - "SHARED_BROTLI_MIN_DICTIONARY_WORD_LENGTH", - "memcpy", - "out", - "SHARED_BROTLI_MIN_DICTIONARY_WORD_LENGTH", - "encoded", - "position", - "BROTLI_NUM_ENCODED_LENGTHS", - "i", - "SHARED_BROTLI_MIN_DICTIONARY_WORD_LENGTH", - "i", - "SHARED_BROTLI_MAX_DICTIONARY_WORD_LENGTH", - "i", - "out", - "i", - "BROTLI_MAX_SIZE_BITS", - "BROTLI_FALSE", - "position", - "BROTLI_NUM_ENCODED_LENGTHS", - "offset", - "BrotliSizeBitsToOffsets", - "out", - "out", - "out", - "encoded", - "position", - "out", - "offset", - "position", - "offset", - "position", - "size", - "BROTLI_FALSE", - "pos", - "position", - "BROTLI_TRUE", - "ComputeCutoffTransforms", - "transforms", - "i", - "i", - "i", - "BROTLI_TRANSFORMS_MAX_CUT_OFF", - "i", - "transforms", - "i", - "i", - "i", - "transforms", - "i", - "prefix", - "BROTLI_TRANSFORM_PREFIX", - "transforms", - "i", - "type", - "BROTLI_TRANSFORM_TYPE", - "transforms", - "i", - "suffix", - "BROTLI_TRANSFORM_SUFFIX", - "transforms", - "i", - "type", - "BROTLI_TRANSFORM_OMIT_LAST_9", - "prefix", - "suffix", - "transforms", - "type", - "transforms", - "type", - "i", - "ParsePrefixSuffixTable", - "size", - "encoded", - "pos", - "out", - "out_table", - "out_table_size", - "position", - "pos", - "offset", - "stringlet_count", - "data_length", - "ReadUint16", - "encoded", - "size", - "position", - "out", - "BROTLI_FALSE", - "data_length", - "out", - "data_length", - "BROTLI_FALSE", - "out", - "encoded", - "position", - "position", - "data_length", - "size", - "BROTLI_FALSE", - "BROTLI_TRUE", - "stringlet_len", - "encoded", - "position", - "offset", - "out_table", - "stringlet_count", - "offset", - "stringlet_count", - "offset", - "stringlet_len", - "offset", - "data_length", - "BROTLI_FALSE", - "stringlet_count", - "BROTLI_FALSE", - "offset", - "stringlet_len", - "offset", - "data_length", - "BROTLI_FALSE", - "position", - "data_length", - "pos", - "position", - "out_table_size", - "stringlet_count", - "BROTLI_TRUE", - "ParseTransformsList", - "size", - "encoded", - "pos", - "out", - "prefix_suffix_table", - "prefix_suffix_count", - "i", - "has_params", - "BROTLI_FALSE", - "prefix_suffix_ok", - "BROTLI_FALSE", - "position", - "pos", - "stringlet_cnt", - "position", - "size", - "BROTLI_FALSE", - "prefix_suffix_ok", - "ParsePrefixSuffixTable", - "size", - "encoded", - "position", - "out", - "prefix_suffix_table", - "stringlet_cnt", - "prefix_suffix_ok", - "BROTLI_FALSE", - "out", - "prefix_suffix_table", - "prefix_suffix_count", - "stringlet_cnt", - "out", - "encoded", - "position", - "out", - "encoded", - "position", - "position", - "out", - "position", - "size", - "BROTLI_FALSE", - "i", - "i", - "out", - "i", - "prefix_id", - "BROTLI_TRANSFORM_PREFIX_ID", - "out", - "i", - "type", - "BROTLI_TRANSFORM_TYPE", - "out", - "i", - "suffix_id", - "BROTLI_TRANSFORM_SUFFIX_ID", - "out", - "i", - "prefix_id", - "stringlet_cnt", - "BROTLI_FALSE", - "type", - "BROTLI_NUM_TRANSFORM_TYPES", - "BROTLI_FALSE", - "suffix_id", - "stringlet_cnt", - "BROTLI_FALSE", - "type", - "BROTLI_TRANSFORM_SHIFT_FIRST", - "type", - "BROTLI_TRANSFORM_SHIFT_ALL", - "has_params", - "BROTLI_TRUE", - "has_params", - "out", - "encoded", - "position", - "position", - "out", - "position", - "size", - "BROTLI_FALSE", - "i", - "i", - "out", - "i", - "type", - "BROTLI_TRANSFORM_TYPE", - "out", - "i", - "type", - "BROTLI_TRANSFORM_SHIFT_FIRST", - "type", - "BROTLI_TRANSFORM_SHIFT_ALL", - "out", - "i", - "out", - "i", - "BROTLI_FALSE", - "out", - "ComputeCutoffTransforms", - "out", - "pos", - "position", - "BROTLI_TRUE", - "DryParseDictionary", - "encoded", - "size", - "num_prefix", - "is_custom_static_dict", - "pos", - "chunk_size", - "num_word_lists", - "num_transform_lists", - "is_custom_static_dict", - "BROTLI_FALSE", - "num_prefix", - "pos", - "ReadVarint32", - "encoded", - "size", - "pos", - "chunk_size", - "BROTLI_FALSE", - "chunk_size", - "chunk_size", - "BROTLI_FALSE", - "num_prefix", - "pos", - "chunk_size", - "size", - "BROTLI_FALSE", - "pos", - "chunk_size", - "ReadUint8", - "encoded", - "size", - "pos", - "num_word_lists", - "BROTLI_FALSE", - "ReadUint8", - "encoded", - "size", - "pos", - "num_transform_lists", - "BROTLI_FALSE", - "num_word_lists", - "num_transform_lists", - "is_custom_static_dict", - "BROTLI_TRUE", - "BROTLI_TRUE", - "ParseDictionary", - "encoded", - "size", - "dict", - "i", - "pos", - "chunk_size", - "total_prefix_suffix_count", - "trasform_list_start", - "SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS", - "temporary_prefix_suffix_table", - "pos", - "ReadVarint32", - "encoded", - "size", - "pos", - "chunk_size", - "BROTLI_FALSE", - "chunk_size", - "pos", - "chunk_size", - "size", - "BROTLI_FALSE", - "dict", - "dict", - "chunk_size", - "dict", - "dict", - "encoded", - "pos", - "dict", - "pos", - "chunk_size", - "ReadUint8", - "encoded", - "size", - "pos", - "dict", - "BROTLI_FALSE", - "dict", - "SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS", - "BROTLI_FALSE", - "dict", - "dict", - "dict", - "dict", - "dict", - "dict", - "dict", - "BROTLI_FALSE", - "i", - "i", - "dict", - "i", - "ParseWordList", - "size", - "encoded", - "pos", - "dict", - "i", - "BROTLI_FALSE", - "ReadUint8", - "encoded", - "size", - "pos", - "dict", - "BROTLI_FALSE", - "dict", - "SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS", - "BROTLI_FALSE", - "dict", - "dict", - "dict", - "dict", - "dict", - "dict", - "dict", - "BROTLI_FALSE", - "i", - "i", - "dict", - "i", - "ok", - "BROTLI_FALSE", - "prefix_suffix_count", - "trasform_list_start", - "i", - "pos", - "dict", - "i", - "temporary_prefix_suffix_table", - "ok", - "ParseTransformsList", - "size", - "encoded", - "pos", - "dict", - "i", - "temporary_prefix_suffix_table", - "prefix_suffix_count", - "ok", - "BROTLI_FALSE", - "total_prefix_suffix_count", - "prefix_suffix_count", - "total_prefix_suffix_count", - "dict", - "dict", - "dict", - "total_prefix_suffix_count", - "dict", - "dict", - "BROTLI_FALSE", - "total_prefix_suffix_count", - "i", - "i", - "dict", - "i", - "prefix_suffix_count", - "position", - "trasform_list_start", - "i", - "prefix_suffix_map", - "dict", - "total_prefix_suffix_count", - "ok", - "ParsePrefixSuffixTable", - "size", - "encoded", - "position", - "dict", - "i", - "prefix_suffix_map", - "prefix_suffix_count", - "ok", - "BROTLI_FALSE", - "dict", - "i", - "prefix_suffix_map", - "total_prefix_suffix_count", - "prefix_suffix_count", - "dict", - "dict", - "ReadUint8", - "encoded", - "size", - "pos", - "dict", - "BROTLI_FALSE", - "dict", - "dict", - "SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS", - "BROTLI_FALSE", - "i", - "i", - "dict", - "i", - "words_index", - "transforms_index", - "ReadUint8", - "encoded", - "size", - "pos", - "words_index", - "BROTLI_FALSE", - "words_index", - "dict", - "BROTLI_FALSE", - "ReadUint8", - "encoded", - "size", - "pos", - "transforms_index", - "BROTLI_FALSE", - "transforms_index", - "dict", - "BROTLI_FALSE", - "dict", - "i", - "words_index", - "dict", - "BrotliGetDictionary", - "dict", - "words_index", - "dict", - "i", - "transforms_index", - "dict", - "BrotliGetTransforms", - "dict", - "transforms_index", - "ReadBool", - "encoded", - "size", - "pos", - "dict", - "BROTLI_FALSE", - "dict", - "i", - "i", - "SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS", - "i", - "ReadUint8", - "encoded", - "size", - "pos", - "dict", - "i", - "BROTLI_FALSE", - "dict", - "i", - "dict", - "BROTLI_FALSE", - "dict", - "BROTLI_FALSE", - "dict", - "dict", - "BrotliGetDictionary", - "dict", - "BrotliGetTransforms", - "BROTLI_TRUE", - "DecodeSharedDictionary", - "encoded", - "size", - "dict", - "num_prefix", - "is_custom_static_dict", - "BROTLI_FALSE", - "has_custom_static_dict", - "dict", - "dict", - "size", - "BROTLI_FALSE", - "encoded", - "encoded", - "BROTLI_FALSE", - "DryParseDictionary", - "encoded", - "size", - "num_prefix", - "is_custom_static_dict", - "BROTLI_FALSE", - "num_prefix", - "dict", - "SHARED_BROTLI_MAX_COMPOUND_DICTS", - "BROTLI_FALSE", - "has_custom_static_dict", - "is_custom_static_dict", - "BROTLI_FALSE", - "ParseDictionary", - "encoded", - "size", - "dict", - "BrotliSharedDictionaryDestroyInstance", - "dict", - "dict", - "free_func", - "dict", - "opaque", - "dict", - "free_func", - "opaque", - "dict", - "free_func", - "opaque", - "dict", - "free_func", - "opaque", - "dict", - "free_func", - "opaque", - "dict", - "BrotliSharedDictionaryAttach", - "dict", - "type", - "data_size", - "data", - "BROTLI_ARRAY_PARAM", - "data_size", - "dict", - "BROTLI_FALSE", - "BROTLI_EXPERIMENTAL", - "type", - "BROTLI_SHARED_DICTIONARY_SERIALIZED", - "DecodeSharedDictionary", - "data", - "data_size", - "dict", - "type", - "BROTLI_SHARED_DICTIONARY_RAW", - "dict", - "SHARED_BROTLI_MAX_COMPOUND_DICTS", - "BROTLI_FALSE", - "dict", - "dict", - "data_size", - "dict", - "dict", - "data", - "dict", - "BROTLI_TRUE", - "BROTLI_FALSE", - "BrotliSharedDictionaryCreateInstance", - "alloc_func", - "free_func", - "opaque", - "dict", - "alloc_func", - "free_func", - "dict", - "malloc", - "BrotliSharedDictionary", - "alloc_func", - "free_func", - "dict", - "alloc_func", - "opaque", - "BrotliSharedDictionary", - "dict", - "memset", - "dict", - "BrotliSharedDictionary", - "dict", - "BROTLI_FALSE", - "dict", - "dict", - "dict", - "dict", - "BrotliGetDictionary", - "dict", - "BrotliGetTransforms", - "dict", - "alloc_func", - "alloc_func", - "BrotliDefaultAllocFunc", - "dict", - "free_func", - "free_func", - "BrotliDefaultFreeFunc", - "dict", - "opaque", - "dict", - "__cplusplus", - "c_plusplus" - ] + } } }, { @@ -3183,26 +1668,7 @@ "matched_symbols_count": "0.00", "matched_symbols_ratio": "0.00", "matched_symbols_unique_ratio": "0.00" - }, - "source_strings": [ - "\"dictionary.h\"", - "\"transform.h\"", - "\"C\"" - ], - "source_symbols": [ - "BROTLI_COMMON_SHARED_DICTIONARY_INTERNAL_H_", - "BROTLI_COMMON_SHARED_DICTIONARY_INTERNAL_H_", - "__cplusplus", - "c_plusplus", - "SHARED_BROTLI_MAX_COMPOUND_DICTS", - "SHARED_BROTLI_MAX_COMPOUND_DICTS", - "SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS", - "SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS", - "SHARED_BROTLI_NUM_DICTIONARY_CONTEXTS", - "BrotliSharedDictionary", - "__cplusplus", - "c_plusplus" - ] + } } }, { @@ -3306,333 +1772,7 @@ "matched_symbols_count": "2.00", "matched_symbols_ratio": "0.01", "matched_symbols_unique_ratio": "0.04" - }, - "source_strings": [ - "\"transform.h\"", - "\"C\"", - "\"\\1 \\2, \\10 of the \\4 of \\2s \\1.\\5 and \\4 \"", - "\"in \\1\\\"\\4 to \\2\\\">\\1\\n\\2. \\1]\\5 for \\3 a \\6 \"", - "\"that \\1\\'\\6 with \\6 from \\4 by \\1(\\6. T\"", - "\"he \\4 on \\4 as \\4 is \\4ing \\2\\n\\t\\1:\\3ed \"", - "\"\\2=\\\"\\4 at \\3ly \\1,\\2=\\'\\5.com/\\7. This \\5\"", - "\" not \\3er \\3al \\4ful \\4ive \\5less \\4es\"", - "\"t \\4ize \\2\\xc2\\xa0\\4ous \\5 the \\2e \"" - ], - "source_symbols": [ - "__cplusplus", - "c_plusplus", - "kPrefixSuffix", - "kPrefixSuffixMap", - "kTransformsData", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_FIRST_1", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_FIRST_2", - "BROTLI_TRANSFORM_OMIT_LAST_1", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_LAST_3", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_FIRST_3", - "BROTLI_TRANSFORM_OMIT_LAST_2", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_FIRST_4", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_FIRST_5", - "BROTLI_TRANSFORM_OMIT_FIRST_6", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_LAST_4", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_LAST_7", - "BROTLI_TRANSFORM_OMIT_LAST_1", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_FIRST_9", - "BROTLI_TRANSFORM_OMIT_FIRST_7", - "BROTLI_TRANSFORM_OMIT_LAST_6", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_OMIT_LAST_8", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_LAST_5", - "BROTLI_TRANSFORM_OMIT_LAST_9", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "kBrotliTransforms", - "kPrefixSuffix", - "kPrefixSuffix", - "kPrefixSuffixMap", - "kTransformsData", - "kTransformsData", - "kTransformsData", - "BrotliGetTransforms", - "kBrotliTransforms", - "ToUpperCase", - "p", - "p", - "p", - "p", - "p", - "p", - "p", - "p", - "Shift", - "word", - "word_len", - "parameter", - "scalar", - "parameter", - "parameter", - "word", - "scalar", - "word", - "word", - "scalar", - "word", - "word", - "word_len", - "scalar", - "word", - "word", - "word", - "scalar", - "word", - "word", - "scalar", - "word", - "word_len", - "word_len", - "scalar", - "word", - "word", - "word", - "word", - "scalar", - "word", - "word", - "scalar", - "word", - "word", - "scalar", - "word", - "word_len", - "word_len", - "scalar", - "word", - "word", - "word", - "word", - "word", - "scalar", - "word", - "word", - "scalar", - "word", - "word", - "scalar", - "word", - "word", - "scalar", - "BrotliTransformDictionaryWord", - "dst", - "word", - "len", - "transforms", - "transform_idx", - "idx", - "prefix", - "BROTLI_TRANSFORM_PREFIX", - "transforms", - "transform_idx", - "type", - "BROTLI_TRANSFORM_TYPE", - "transforms", - "transform_idx", - "suffix", - "BROTLI_TRANSFORM_SUFFIX", - "transforms", - "transform_idx", - "prefix_len", - "prefix", - "prefix_len", - "dst", - "idx", - "prefix", - "t", - "type", - "i", - "t", - "BROTLI_TRANSFORM_OMIT_LAST_9", - "len", - "t", - "t", - "BROTLI_TRANSFORM_OMIT_FIRST_1", - "t", - "BROTLI_TRANSFORM_OMIT_FIRST_9", - "skip", - "t", - "BROTLI_TRANSFORM_OMIT_FIRST_1", - "word", - "skip", - "len", - "skip", - "i", - "len", - "dst", - "idx", - "word", - "i", - "t", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "ToUpperCase", - "dst", - "idx", - "len", - "t", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "uppercase", - "dst", - "idx", - "len", - "len", - "step", - "ToUpperCase", - "uppercase", - "uppercase", - "step", - "len", - "step", - "t", - "BROTLI_TRANSFORM_SHIFT_FIRST", - "param", - "transforms", - "transform_idx", - "transforms", - "transform_idx", - "Shift", - "dst", - "idx", - "len", - "len", - "param", - "t", - "BROTLI_TRANSFORM_SHIFT_ALL", - "param", - "transforms", - "transform_idx", - "transforms", - "transform_idx", - "shift", - "dst", - "idx", - "len", - "len", - "step", - "Shift", - "shift", - "len", - "param", - "shift", - "step", - "len", - "step", - "suffix_len", - "suffix", - "suffix_len", - "dst", - "idx", - "suffix", - "idx", - "__cplusplus", - "c_plusplus" - ] + } } }, { @@ -3724,69 +1864,7 @@ "matched_symbols_count": "2.00", "matched_symbols_ratio": "0.04", "matched_symbols_unique_ratio": "0.04" - }, - "source_strings": [ - "\"C\"" - ], - "source_symbols": [ - "BROTLI_COMMON_TRANSFORM_H_", - "BROTLI_COMMON_TRANSFORM_H_", - "__cplusplus", - "c_plusplus", - "BROTLI_TRANSFORM_IDENTITY", - "BROTLI_TRANSFORM_OMIT_LAST_1", - "BROTLI_TRANSFORM_OMIT_LAST_2", - "BROTLI_TRANSFORM_OMIT_LAST_3", - "BROTLI_TRANSFORM_OMIT_LAST_4", - "BROTLI_TRANSFORM_OMIT_LAST_5", - "BROTLI_TRANSFORM_OMIT_LAST_6", - "BROTLI_TRANSFORM_OMIT_LAST_7", - "BROTLI_TRANSFORM_OMIT_LAST_8", - "BROTLI_TRANSFORM_OMIT_LAST_9", - "BROTLI_TRANSFORM_UPPERCASE_FIRST", - "BROTLI_TRANSFORM_UPPERCASE_ALL", - "BROTLI_TRANSFORM_OMIT_FIRST_1", - "BROTLI_TRANSFORM_OMIT_FIRST_2", - "BROTLI_TRANSFORM_OMIT_FIRST_3", - "BROTLI_TRANSFORM_OMIT_FIRST_4", - "BROTLI_TRANSFORM_OMIT_FIRST_5", - "BROTLI_TRANSFORM_OMIT_FIRST_6", - "BROTLI_TRANSFORM_OMIT_FIRST_7", - "BROTLI_TRANSFORM_OMIT_FIRST_8", - "BROTLI_TRANSFORM_OMIT_FIRST_9", - "BROTLI_TRANSFORM_SHIFT_FIRST", - "BROTLI_TRANSFORM_SHIFT_ALL", - "BROTLI_NUM_TRANSFORM_TYPES", - "BROTLI_TRANSFORMS_MAX_CUT_OFF", - "BROTLI_TRANSFORMS_MAX_CUT_OFF", - "BROTLI_TRANSFORM_PREFIX_ID", - "T", - "I", - "BROTLI_TRANSFORM_TYPE", - "T", - "I", - "BROTLI_TRANSFORM_SUFFIX_ID", - "T", - "I", - "BROTLI_TRANSFORM_PREFIX", - "T", - "I", - "BROTLI_TRANSFORM_SUFFIX", - "T", - "I", - "BrotliTransforms", - "BrotliGetTransforms", - "void", - "int", - "BrotliTransformDictionaryWord", - "dst", - "word", - "len", - "transforms", - "transform_idx", - "__cplusplus", - "c_plusplus" - ] + } } }, { @@ -3844,30 +1922,7 @@ "matched_symbols_count": "0.00", "matched_symbols_ratio": "0.00", "matched_symbols_unique_ratio": "0.00" - }, - "source_strings": [], - "source_symbols": [ - "BROTLI_COMMON_VERSION_H_", - "BROTLI_COMMON_VERSION_H_", - "BROTLI_MAKE_HEX_VERSION", - "A", - "B", - "C", - "BROTLI_VERSION_MAJOR", - "BROTLI_VERSION_MINOR", - "BROTLI_VERSION_PATCH", - "BROTLI_VERSION", - "BROTLI_ABI_CURRENT", - "BROTLI_ABI_REVISION", - "BROTLI_ABI_AGE", - "BROTLI_VERSION_MAJOR", - "BROTLI_ABI_CURRENT", - "BROTLI_ABI_AGE", - "BROTLI_VERSION_MINOR", - "BROTLI_ABI_AGE", - "BROTLI_VERSION_PATCH", - "BROTLI_ABI_REVISION" - ] + } } }, { diff --git a/scanpipe/tests/data/dependencies/resolved_dependencies_cocoapods.json b/scanpipe/tests/data/dependencies/resolved_dependencies_cocoapods.json index 43c8f27489..9fe621f1f0 100644 --- a/scanpipe/tests/data/dependencies/resolved_dependencies_cocoapods.json +++ b/scanpipe/tests/data/dependencies/resolved_dependencies_cocoapods.json @@ -34,11 +34,11 @@ ], "packages": [ { - "purl": "pkg:cocoapods/Aerodramus@2.0.0", + "purl": "pkg:cocoapods/AFNetworkActivityLogger@2.0.4", "type": "cocoapods", "namespace": "", - "name": "Aerodramus", - "version": "2.0.0", + "name": "AFNetworkActivityLogger", + "version": "2.0.4", "qualifiers": "", "subpath": "", "tag": "", @@ -55,7 +55,7 @@ "repository_download_url": "", "api_data_url": "", "md5": "", - "sha1": "a22de7451c8fc85ae5d974f5d6a656f59046fffc", + "sha1": "121486778117d53b3ab1c61d264b88081d0c3eee", "sha256": "", "sha512": "", "copyright": "", @@ -70,9 +70,9 @@ "notice_text": "", "source_packages": [], "extra_data": { - "spec_repo": "https://github.com/artsy/Specs.git" + "spec_repo": "trunk" }, - "package_uid": "pkg:cocoapods/Aerodramus@2.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/AFNetworkActivityLogger@2.0.4?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -85,11 +85,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/AFNetworkActivityLogger@2.0.4", + "purl": "pkg:cocoapods/Aerodramus@2.0.0", "type": "cocoapods", "namespace": "", - "name": "AFNetworkActivityLogger", - "version": "2.0.4", + "name": "Aerodramus", + "version": "2.0.0", "qualifiers": "", "subpath": "", "tag": "", @@ -106,7 +106,7 @@ "repository_download_url": "", "api_data_url": "", "md5": "", - "sha1": "121486778117d53b3ab1c61d264b88081d0c3eee", + "sha1": "a22de7451c8fc85ae5d974f5d6a656f59046fffc", "sha256": "", "sha512": "", "copyright": "", @@ -121,9 +121,9 @@ "notice_text": "", "source_packages": [], "extra_data": { - "spec_repo": "trunk" + "spec_repo": "https://github.com/artsy/Specs.git" }, - "package_uid": "pkg:cocoapods/AFNetworkActivityLogger@2.0.4?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/Aerodramus@2.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -238,11 +238,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/Appboy-iOS-SDK@4.4.4", + "purl": "pkg:cocoapods/AppCenterReactNativeShared@5.0.0", "type": "cocoapods", "namespace": "", - "name": "Appboy-iOS-SDK", - "version": "4.4.4", + "name": "AppCenterReactNativeShared", + "version": "5.0.0", "qualifiers": "", "subpath": "", "tag": "", @@ -259,7 +259,7 @@ "repository_download_url": "", "api_data_url": "", "md5": "", - "sha1": "b05b957ab645d0a9a43d3f35195ad69202b89edc", + "sha1": "01df23849b1c3c6eb8c4049f54322635650e98f0", "sha256": "", "sha512": "", "copyright": "", @@ -276,7 +276,7 @@ "extra_data": { "spec_repo": "trunk" }, - "package_uid": "pkg:cocoapods/Appboy-iOS-SDK@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/AppCenterReactNativeShared@5.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -289,11 +289,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/appcenter-core@5.0.0", + "purl": "pkg:cocoapods/Appboy-iOS-SDK@4.4.4", "type": "cocoapods", "namespace": "", - "name": "appcenter-core", - "version": "5.0.0", + "name": "Appboy-iOS-SDK", + "version": "4.4.4", "qualifiers": "", "subpath": "", "tag": "", @@ -310,7 +310,7 @@ "repository_download_url": "", "api_data_url": "", "md5": "", - "sha1": "e192ea8b373bebd3e44998882b43311078bd7dda", + "sha1": "b05b957ab645d0a9a43d3f35195ad69202b89edc", "sha256": "", "sha512": "", "copyright": "", @@ -325,9 +325,9 @@ "notice_text": "", "source_packages": [], "extra_data": { - "external_source": "../node_modules/appcenter" + "spec_repo": "trunk" }, - "package_uid": "pkg:cocoapods/appcenter-core@5.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/Appboy-iOS-SDK@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -340,11 +340,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/AppCenterReactNativeShared@5.0.0", + "purl": "pkg:cocoapods/Base64@1.1.2", "type": "cocoapods", "namespace": "", - "name": "AppCenterReactNativeShared", - "version": "5.0.0", + "name": "Base64", + "version": "1.1.2", "qualifiers": "", "subpath": "", "tag": "", @@ -361,7 +361,7 @@ "repository_download_url": "", "api_data_url": "", "md5": "", - "sha1": "01df23849b1c3c6eb8c4049f54322635650e98f0", + "sha1": "", "sha256": "", "sha512": "", "copyright": "", @@ -375,10 +375,8 @@ "extracted_license_statement": "", "notice_text": "", "source_packages": [], - "extra_data": { - "spec_repo": "trunk" - }, - "package_uid": "pkg:cocoapods/AppCenterReactNativeShared@5.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "extra_data": {}, + "package_uid": "pkg:cocoapods/Base64@1.1.2?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -391,11 +389,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/Base64@1.1.2", + "purl": "pkg:cocoapods/ISO8601DateFormatter@0.7.1", "type": "cocoapods", "namespace": "", - "name": "Base64", - "version": "1.1.2", + "name": "ISO8601DateFormatter", + "version": "0.7.1", "qualifiers": "", "subpath": "", "tag": "", @@ -426,8 +424,10 @@ "extracted_license_statement": "", "notice_text": "", "source_packages": [], - "extra_data": {}, - "package_uid": "pkg:cocoapods/Base64@1.1.2?uuid=fixed-uid-done-for-testing-5642512d1758", + "extra_data": { + "external_source": "https://github.com/artsy/iso-8601-date-formatter/tree/1a48b819c85903ded669e74e476aceffebf311fc" + }, + "package_uid": "pkg:cocoapods/ISO8601DateFormatter@0.7.1?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -440,11 +440,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/boost@1.76.0", + "purl": "pkg:cocoapods/Pulley@2.6.2", "type": "cocoapods", "namespace": "", - "name": "boost", - "version": "1.76.0", + "name": "Pulley", + "version": "2.6.2", "qualifiers": "", "subpath": "", "tag": "", @@ -461,7 +461,7 @@ "repository_download_url": "", "api_data_url": "", "md5": "", - "sha1": "7dcd2de282d72e344012f7d6564d024930a6a440", + "sha1": "edc993fb57f7eb20541c8453d0fce10559f21dac", "sha256": "", "sha512": "", "copyright": "", @@ -476,9 +476,9 @@ "notice_text": "", "source_packages": [], "extra_data": { - "external_source": "../node_modules/react-native/third-party-podspecs/boost.podspec" + "external_source": "https://github.com/artsy/Pulley/tree/f677b18b332ea3798dc379879dbc0d038efd3ccc" }, - "package_uid": "pkg:cocoapods/boost@1.76.0?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/Pulley@2.6.2?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -491,11 +491,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/ISO8601DateFormatter@0.7.1", + "purl": "pkg:cocoapods/SwiftyJSON@5.0.2", "type": "cocoapods", "namespace": "", - "name": "ISO8601DateFormatter", - "version": "0.7.1", + "name": "SwiftyJSON", + "version": "5.0.2", "qualifiers": "", "subpath": "", "tag": "", @@ -512,7 +512,7 @@ "repository_download_url": "", "api_data_url": "", "md5": "", - "sha1": "", + "sha1": "576fbf26942d5ef414daad8870b1642413ecc00c", "sha256": "", "sha512": "", "copyright": "", @@ -527,9 +527,9 @@ "notice_text": "", "source_packages": [], "extra_data": { - "external_source": "https://github.com/artsy/iso-8601-date-formatter/tree/1a48b819c85903ded669e74e476aceffebf311fc" + "external_source": "https://github.com/SwiftyJSON/SwiftyJSON/tree/af76cf3ef710b6ca5f8c05f3a31307d44a3c5828" }, - "package_uid": "pkg:cocoapods/ISO8601DateFormatter@0.7.1?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/SwiftyJSON@5.0.2?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -542,11 +542,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/Pulley@2.6.2", + "purl": "pkg:cocoapods/appcenter-core@5.0.0", "type": "cocoapods", "namespace": "", - "name": "Pulley", - "version": "2.6.2", + "name": "appcenter-core", + "version": "5.0.0", "qualifiers": "", "subpath": "", "tag": "", @@ -563,7 +563,7 @@ "repository_download_url": "", "api_data_url": "", "md5": "", - "sha1": "edc993fb57f7eb20541c8453d0fce10559f21dac", + "sha1": "e192ea8b373bebd3e44998882b43311078bd7dda", "sha256": "", "sha512": "", "copyright": "", @@ -578,9 +578,9 @@ "notice_text": "", "source_packages": [], "extra_data": { - "external_source": "https://github.com/artsy/Pulley/tree/f677b18b332ea3798dc379879dbc0d038efd3ccc" + "external_source": "../node_modules/appcenter" }, - "package_uid": "pkg:cocoapods/Pulley@2.6.2?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/appcenter-core@5.0.0?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -593,11 +593,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/SwiftyJSON@5.0.2", + "purl": "pkg:cocoapods/boost@1.76.0", "type": "cocoapods", "namespace": "", - "name": "SwiftyJSON", - "version": "5.0.2", + "name": "boost", + "version": "1.76.0", "qualifiers": "", "subpath": "", "tag": "", @@ -614,7 +614,7 @@ "repository_download_url": "", "api_data_url": "", "md5": "", - "sha1": "576fbf26942d5ef414daad8870b1642413ecc00c", + "sha1": "7dcd2de282d72e344012f7d6564d024930a6a440", "sha256": "", "sha512": "", "copyright": "", @@ -629,9 +629,9 @@ "notice_text": "", "source_packages": [], "extra_data": { - "external_source": "https://github.com/SwiftyJSON/SwiftyJSON/tree/af76cf3ef710b6ca5f8c05f3a31307d44a3c5828" + "external_source": "../node_modules/react-native/third-party-podspecs/boost.podspec" }, - "package_uid": "pkg:cocoapods/SwiftyJSON@5.0.2?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/boost@1.76.0?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -987,11 +987,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/Appboy-iOS-SDK/ContentCards@4.4.4", + "purl": "pkg:cocoapods/AppCenter/Core@5.0.3", "type": "cocoapods", - "namespace": "Appboy-iOS-SDK", - "name": "ContentCards", - "version": "4.4.4", + "namespace": "AppCenter", + "name": "Core", + "version": "5.0.3", "qualifiers": "", "subpath": "", "tag": "", @@ -1023,7 +1023,7 @@ "notice_text": "", "source_packages": [], "extra_data": {}, - "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/ContentCards@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/AppCenter/Core@5.0.3?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -1036,10 +1036,10 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/Appboy-iOS-SDK/Core@4.4.4", + "purl": "pkg:cocoapods/Appboy-iOS-SDK/ContentCards@4.4.4", "type": "cocoapods", "namespace": "Appboy-iOS-SDK", - "name": "Core", + "name": "ContentCards", "version": "4.4.4", "qualifiers": "", "subpath": "", @@ -1072,7 +1072,7 @@ "notice_text": "", "source_packages": [], "extra_data": {}, - "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/Core@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/ContentCards@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -1085,10 +1085,10 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/Appboy-iOS-SDK/InAppMessage@4.4.4", + "purl": "pkg:cocoapods/Appboy-iOS-SDK/Core@4.4.4", "type": "cocoapods", "namespace": "Appboy-iOS-SDK", - "name": "InAppMessage", + "name": "Core", "version": "4.4.4", "qualifiers": "", "subpath": "", @@ -1121,7 +1121,7 @@ "notice_text": "", "source_packages": [], "extra_data": {}, - "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/InAppMessage@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/Core@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -1134,10 +1134,10 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/Appboy-iOS-SDK/NewsFeed@4.4.4", + "purl": "pkg:cocoapods/Appboy-iOS-SDK/InAppMessage@4.4.4", "type": "cocoapods", "namespace": "Appboy-iOS-SDK", - "name": "NewsFeed", + "name": "InAppMessage", "version": "4.4.4", "qualifiers": "", "subpath": "", @@ -1170,7 +1170,7 @@ "notice_text": "", "source_packages": [], "extra_data": {}, - "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/NewsFeed@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/InAppMessage@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -1183,10 +1183,10 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/Appboy-iOS-SDK/UI@4.4.4", + "purl": "pkg:cocoapods/Appboy-iOS-SDK/NewsFeed@4.4.4", "type": "cocoapods", "namespace": "Appboy-iOS-SDK", - "name": "UI", + "name": "NewsFeed", "version": "4.4.4", "qualifiers": "", "subpath": "", @@ -1219,7 +1219,7 @@ "notice_text": "", "source_packages": [], "extra_data": {}, - "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/UI@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/NewsFeed@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ @@ -1232,11 +1232,11 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:cocoapods/AppCenter/Core@5.0.3", + "purl": "pkg:cocoapods/Appboy-iOS-SDK/UI@4.4.4", "type": "cocoapods", - "namespace": "AppCenter", - "name": "Core", - "version": "5.0.3", + "namespace": "Appboy-iOS-SDK", + "name": "UI", + "version": "4.4.4", "qualifiers": "", "subpath": "", "tag": "", @@ -1268,7 +1268,7 @@ "notice_text": "", "source_packages": [], "extra_data": {}, - "package_uid": "pkg:cocoapods/AppCenter/Core@5.0.3?uuid=fixed-uid-done-for-testing-5642512d1758", + "package_uid": "pkg:cocoapods/Appboy-iOS-SDK/UI@4.4.4?uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": true, "datasource_ids": [ diff --git a/scanpipe/tests/data/docker/alpine_3_15_4_scan_codebase.json b/scanpipe/tests/data/docker/alpine_3_15_4_scan_codebase.json index 39990fd614..7ceea1b4a0 100644 --- a/scanpipe/tests/data/docker/alpine_3_15_4_scan_codebase.json +++ b/scanpipe/tests/data/docker/alpine_3_15_4_scan_codebase.json @@ -737,31 +737,31 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:alpine/libcrypto1.1@1.1.1n-r0?arch=x86_64", + "purl": "pkg:alpine/libc-utils@0.7.2-r3?arch=x86_64", "type": "alpine", "namespace": "", - "name": "libcrypto1.1", - "version": "1.1.1n-r0", + "name": "libc-utils", + "version": "0.7.2-r3", "qualifiers": "arch=x86_64", "subpath": "", "tag": "img-06c7c4-layer-01-40e48c", "primary_language": "", - "release_date": "2022-03-15", + "release_date": "2020-03-31", "parties": [ { "url": null, - "name": "Timo Teras ", + "name": "Natanael Copa ", "role": "maintainer", "type": "person", - "email": "" + "email": "" } ], "keywords": [], - "homepage_url": "https://www.openssl.org/", + "homepage_url": "https://alpinelinux.org", "download_url": "", "bug_tracking_url": "", "code_view_url": "", - "vcs_url": "git+https://git.alpinelinux.org/aports/commit/?id=455e966899a9358fc94f5bce633afe8a1942095c", + "vcs_url": "git+https://git.alpinelinux.org/aports/commit/?id=60424133be2e79bbfeff3d58147a22886f817ce2", "repository_homepage_url": "", "repository_download_url": "", "api_data_url": "", @@ -771,8 +771,8 @@ "sha512": "", "copyright": "", "holder": "", - "declared_license_expression": "openssl-ssleay", - "declared_license_expression_spdx": "OpenSSL", + "declared_license_expression": "bsd-simplified AND bsd-new", + "declared_license_expression_spdx": "BSD-2-Clause AND BSD-3-Clause", "license_detections": [ { "matches": [ @@ -783,65 +783,30 @@ "rule_url": null, "from_file": "40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/lib/apk/db/installed", "start_line": 1, - "matched_text": "openssl", + "matched_text": "bsd-2-clause AND bsd-3-clause", "match_coverage": 100.0, - "matched_length": 1, + "matched_length": 7, "rule_relevance": 100, - "rule_identifier": "spdx-license-identifier-openssl_ssleay-b5dd48b21e3399670d584d4ade9a9791a24c58cd", - "license_expression": "openssl-ssleay", - "license_expression_spdx": "OpenSSL" + "rule_identifier": "spdx-license-identifier-bsd_simplified_and_bsd_new-dc707a661bb1da34ff773b7e9955e0235b3b3f74", + "license_expression": "bsd-simplified AND bsd-new", + "license_expression_spdx": "BSD-2-Clause AND BSD-3-Clause" } ], - "identifier": "openssl_ssleay-602fb366-4d56-7dcd-cac5-129d99473599", - "license_expression": "openssl-ssleay", - "license_expression_spdx": "OpenSSL" + "identifier": "bsd_simplified_and_bsd_new-571c460d-b906-8e23-30cd-5429d912eee3", + "license_expression": "bsd-simplified AND bsd-new", + "license_expression_spdx": "BSD-2-Clause AND BSD-3-Clause" } ], "other_license_expression": "", "other_license_expression_spdx": "", "other_license_detections": [], - "extracted_license_statement": "OpenSSL", + "extracted_license_statement": "BSD-2-Clause AND BSD-3-Clause", "notice_text": "", "source_packages": [ - "pkg:alpine/openssl@1.1.1n-r0" + "pkg:alpine/libc-dev@0.7.2-r3" ], - "extra_data": { - "missing_file_references": [ - { - "md5": null, - "path": "etc/ssl1.1/cert.pem", - "sha1": null, - "sha256": null, - "sha512": null, - "extra_data": {} - }, - { - "md5": null, - "path": "etc/ssl1.1/certs", - "sha1": null, - "sha256": null, - "sha512": null, - "extra_data": {} - }, - { - "md5": null, - "path": "etc/ssl1.1/ct_log_list.cnf", - "sha1": null, - "sha256": null, - "sha512": null, - "extra_data": {} - }, - { - "md5": null, - "path": "usr/lib/libcrypto.so.1.1", - "sha1": null, - "sha256": null, - "sha512": null, - "extra_data": {} - } - ] - }, - "package_uid": "pkg:alpine/libcrypto1.1@1.1.1n-r0?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758", + "extra_data": {}, + "package_uid": "pkg:alpine/libc-utils@0.7.2-r3?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": false, "datasource_ids": [ @@ -856,31 +821,31 @@ "affected_by_vulnerabilities": [] }, { - "purl": "pkg:alpine/libc-utils@0.7.2-r3?arch=x86_64", + "purl": "pkg:alpine/libcrypto1.1@1.1.1n-r0?arch=x86_64", "type": "alpine", "namespace": "", - "name": "libc-utils", - "version": "0.7.2-r3", + "name": "libcrypto1.1", + "version": "1.1.1n-r0", "qualifiers": "arch=x86_64", "subpath": "", "tag": "img-06c7c4-layer-01-40e48c", "primary_language": "", - "release_date": "2020-03-31", + "release_date": "2022-03-15", "parties": [ { "url": null, - "name": "Natanael Copa ", + "name": "Timo Teras ", "role": "maintainer", "type": "person", - "email": "" + "email": "" } ], "keywords": [], - "homepage_url": "https://alpinelinux.org", + "homepage_url": "https://www.openssl.org/", "download_url": "", "bug_tracking_url": "", "code_view_url": "", - "vcs_url": "git+https://git.alpinelinux.org/aports/commit/?id=60424133be2e79bbfeff3d58147a22886f817ce2", + "vcs_url": "git+https://git.alpinelinux.org/aports/commit/?id=455e966899a9358fc94f5bce633afe8a1942095c", "repository_homepage_url": "", "repository_download_url": "", "api_data_url": "", @@ -890,8 +855,8 @@ "sha512": "", "copyright": "", "holder": "", - "declared_license_expression": "bsd-simplified AND bsd-new", - "declared_license_expression_spdx": "BSD-2-Clause AND BSD-3-Clause", + "declared_license_expression": "openssl-ssleay", + "declared_license_expression_spdx": "OpenSSL", "license_detections": [ { "matches": [ @@ -902,30 +867,65 @@ "rule_url": null, "from_file": "40e48c8ef2450e6a9e8d50b846a58ede43f1b01dd351d2bdd7dca14c5c033f20/lib/apk/db/installed", "start_line": 1, - "matched_text": "bsd-2-clause AND bsd-3-clause", + "matched_text": "openssl", "match_coverage": 100.0, - "matched_length": 7, + "matched_length": 1, "rule_relevance": 100, - "rule_identifier": "spdx-license-identifier-bsd_simplified_and_bsd_new-dc707a661bb1da34ff773b7e9955e0235b3b3f74", - "license_expression": "bsd-simplified AND bsd-new", - "license_expression_spdx": "BSD-2-Clause AND BSD-3-Clause" + "rule_identifier": "spdx-license-identifier-openssl_ssleay-b5dd48b21e3399670d584d4ade9a9791a24c58cd", + "license_expression": "openssl-ssleay", + "license_expression_spdx": "OpenSSL" } ], - "identifier": "bsd_simplified_and_bsd_new-571c460d-b906-8e23-30cd-5429d912eee3", - "license_expression": "bsd-simplified AND bsd-new", - "license_expression_spdx": "BSD-2-Clause AND BSD-3-Clause" + "identifier": "openssl_ssleay-602fb366-4d56-7dcd-cac5-129d99473599", + "license_expression": "openssl-ssleay", + "license_expression_spdx": "OpenSSL" } ], "other_license_expression": "", "other_license_expression_spdx": "", "other_license_detections": [], - "extracted_license_statement": "BSD-2-Clause AND BSD-3-Clause", + "extracted_license_statement": "OpenSSL", "notice_text": "", "source_packages": [ - "pkg:alpine/libc-dev@0.7.2-r3" + "pkg:alpine/openssl@1.1.1n-r0" ], - "extra_data": {}, - "package_uid": "pkg:alpine/libc-utils@0.7.2-r3?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758", + "extra_data": { + "missing_file_references": [ + { + "md5": null, + "path": "etc/ssl1.1/cert.pem", + "sha1": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "md5": null, + "path": "etc/ssl1.1/certs", + "sha1": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "md5": null, + "path": "etc/ssl1.1/ct_log_list.cnf", + "sha1": null, + "sha256": null, + "sha512": null, + "extra_data": {} + }, + { + "md5": null, + "path": "usr/lib/libcrypto.so.1.1", + "sha1": null, + "sha256": null, + "sha512": null, + "extra_data": {} + } + ] + }, + "package_uid": "pkg:alpine/libcrypto1.1@1.1.1n-r0?arch=x86_64&uuid=fixed-uid-done-for-testing-5642512d1758", "is_private": false, "is_virtual": false, "datasource_ids": [ diff --git a/scanpipe/tests/data/docker/centos_scan_codebase.json b/scanpipe/tests/data/docker/centos_scan_codebase.json index cd0f9d9ad3..83327297fe 100644 --- a/scanpipe/tests/data/docker/centos_scan_codebase.json +++ b/scanpipe/tests/data/docker/centos_scan_codebase.json @@ -155738,6 +155738,154 @@ "modified_resources": [], "affected_by_vulnerabilities": [] }, + { + "purl": "pkg:rpm/gpg-pubkey@d4082792", + "type": "rpm", + "namespace": "", + "name": "gpg-pubkey", + "version": "d4082792", + "qualifiers": "", + "subpath": "", + "tag": "img-c967b7-layer-01-a10cf7", + "primary_language": "", + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": "", + "download_url": "", + "bug_tracking_url": "", + "code_view_url": "", + "vcs_url": "", + "repository_homepage_url": "", + "repository_download_url": "", + "api_data_url": "", + "md5": "", + "sha1": "4d3b67245e29cc1e4ec83d6813cacc7e55c699ac", + "sha256": "", + "sha512": "", + "copyright": "", + "holder": "", + "declared_license_expression": "unknown", + "declared_license_expression_spdx": "LicenseRef-scancode-unknown", + "license_detections": [ + { + "matches": [ + { + "score": 100.0, + "matcher": "5-undetected", + "end_line": 1, + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-b9931200c2f732e2ea95da8f66af5f41a403ecf7", + "from_file": "a10cf747c363a52be048f884c084a25e03280d54a7ac02e17dbd8c5ad160e9bd/var/lib/rpm/Packages", + "start_line": 1, + "matched_text": "license pubkey", + "match_coverage": 100.0, + "matched_length": 2, + "rule_relevance": 100, + "rule_identifier": "package-manifest-unknown-b9931200c2f732e2ea95da8f66af5f41a403ecf7", + "license_expression": "unknown", + "license_expression_spdx": "LicenseRef-scancode-unknown" + } + ], + "identifier": "unknown-6638c8ac-18c2-ed3f-78bb-1c72e6cc0939", + "license_expression": "unknown", + "license_expression_spdx": "LicenseRef-scancode-unknown" + } + ], + "other_license_expression": "", + "other_license_expression_spdx": "", + "other_license_detections": [], + "extracted_license_statement": "pubkey", + "notice_text": "", + "source_packages": [], + "extra_data": {}, + "package_uid": "pkg:rpm/gpg-pubkey@d4082792?uuid=fixed-uid-done-for-testing-5642512d1758", + "is_private": false, + "is_virtual": false, + "datasource_ids": [ + "rpm_installed_database_bdb" + ], + "datafile_paths": [ + "a10cf747c363a52be048f884c084a25e03280d54a7ac02e17dbd8c5ad160e9bd/var/lib/rpm/Packages" + ], + "file_references": [], + "missing_resources": [], + "modified_resources": [], + "affected_by_vulnerabilities": [] + }, + { + "purl": "pkg:rpm/gpg-pubkey@fd431d51", + "type": "rpm", + "namespace": "", + "name": "gpg-pubkey", + "version": "fd431d51", + "qualifiers": "", + "subpath": "", + "tag": "img-c967b7-layer-01-a10cf7", + "primary_language": "", + "release_date": null, + "parties": [], + "keywords": [], + "homepage_url": "", + "download_url": "", + "bug_tracking_url": "", + "code_view_url": "", + "vcs_url": "", + "repository_homepage_url": "", + "repository_download_url": "", + "api_data_url": "", + "md5": "", + "sha1": "bbdaa73ef24bd638ff8d785ff827e0a4bc0e6eb7", + "sha256": "", + "sha512": "", + "copyright": "", + "holder": "", + "declared_license_expression": "unknown", + "declared_license_expression_spdx": "LicenseRef-scancode-unknown", + "license_detections": [ + { + "matches": [ + { + "score": 100.0, + "matcher": "5-undetected", + "end_line": 1, + "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-b9931200c2f732e2ea95da8f66af5f41a403ecf7", + "from_file": "a10cf747c363a52be048f884c084a25e03280d54a7ac02e17dbd8c5ad160e9bd/var/lib/rpm/Packages", + "start_line": 1, + "matched_text": "license pubkey", + "match_coverage": 100.0, + "matched_length": 2, + "rule_relevance": 100, + "rule_identifier": "package-manifest-unknown-b9931200c2f732e2ea95da8f66af5f41a403ecf7", + "license_expression": "unknown", + "license_expression_spdx": "LicenseRef-scancode-unknown" + } + ], + "identifier": "unknown-6638c8ac-18c2-ed3f-78bb-1c72e6cc0939", + "license_expression": "unknown", + "license_expression_spdx": "LicenseRef-scancode-unknown" + } + ], + "other_license_expression": "", + "other_license_expression_spdx": "", + "other_license_detections": [], + "extracted_license_statement": "pubkey", + "notice_text": "", + "source_packages": [], + "extra_data": {}, + "package_uid": "pkg:rpm/gpg-pubkey@fd431d51?uuid=fixed-uid-done-for-testing-5642512d1758", + "is_private": false, + "is_virtual": false, + "datasource_ids": [ + "rpm_installed_database_bdb" + ], + "datafile_paths": [ + "a10cf747c363a52be048f884c084a25e03280d54a7ac02e17dbd8c5ad160e9bd/var/lib/rpm/Packages" + ], + "file_references": [], + "missing_resources": [], + "modified_resources": [], + "affected_by_vulnerabilities": [] + }, { "purl": "pkg:rpm/gpgme@1.10.0?arch=x86_64", "type": "rpm", @@ -155943,154 +156091,6 @@ "modified_resources": [], "affected_by_vulnerabilities": [] }, - { - "purl": "pkg:rpm/gpg-pubkey@d4082792", - "type": "rpm", - "namespace": "", - "name": "gpg-pubkey", - "version": "d4082792", - "qualifiers": "", - "subpath": "", - "tag": "img-c967b7-layer-01-a10cf7", - "primary_language": "", - "release_date": null, - "parties": [], - "keywords": [], - "homepage_url": "", - "download_url": "", - "bug_tracking_url": "", - "code_view_url": "", - "vcs_url": "", - "repository_homepage_url": "", - "repository_download_url": "", - "api_data_url": "", - "md5": "", - "sha1": "4d3b67245e29cc1e4ec83d6813cacc7e55c699ac", - "sha256": "", - "sha512": "", - "copyright": "", - "holder": "", - "declared_license_expression": "unknown", - "declared_license_expression_spdx": "LicenseRef-scancode-unknown", - "license_detections": [ - { - "matches": [ - { - "score": 100.0, - "matcher": "5-undetected", - "end_line": 1, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-b9931200c2f732e2ea95da8f66af5f41a403ecf7", - "from_file": "a10cf747c363a52be048f884c084a25e03280d54a7ac02e17dbd8c5ad160e9bd/var/lib/rpm/Packages", - "start_line": 1, - "matched_text": "license pubkey", - "match_coverage": 100.0, - "matched_length": 2, - "rule_relevance": 100, - "rule_identifier": "package-manifest-unknown-b9931200c2f732e2ea95da8f66af5f41a403ecf7", - "license_expression": "unknown", - "license_expression_spdx": "LicenseRef-scancode-unknown" - } - ], - "identifier": "unknown-6638c8ac-18c2-ed3f-78bb-1c72e6cc0939", - "license_expression": "unknown", - "license_expression_spdx": "LicenseRef-scancode-unknown" - } - ], - "other_license_expression": "", - "other_license_expression_spdx": "", - "other_license_detections": [], - "extracted_license_statement": "pubkey", - "notice_text": "", - "source_packages": [], - "extra_data": {}, - "package_uid": "pkg:rpm/gpg-pubkey@d4082792?uuid=fixed-uid-done-for-testing-5642512d1758", - "is_private": false, - "is_virtual": false, - "datasource_ids": [ - "rpm_installed_database_bdb" - ], - "datafile_paths": [ - "a10cf747c363a52be048f884c084a25e03280d54a7ac02e17dbd8c5ad160e9bd/var/lib/rpm/Packages" - ], - "file_references": [], - "missing_resources": [], - "modified_resources": [], - "affected_by_vulnerabilities": [] - }, - { - "purl": "pkg:rpm/gpg-pubkey@fd431d51", - "type": "rpm", - "namespace": "", - "name": "gpg-pubkey", - "version": "fd431d51", - "qualifiers": "", - "subpath": "", - "tag": "img-c967b7-layer-01-a10cf7", - "primary_language": "", - "release_date": null, - "parties": [], - "keywords": [], - "homepage_url": "", - "download_url": "", - "bug_tracking_url": "", - "code_view_url": "", - "vcs_url": "", - "repository_homepage_url": "", - "repository_download_url": "", - "api_data_url": "", - "md5": "", - "sha1": "bbdaa73ef24bd638ff8d785ff827e0a4bc0e6eb7", - "sha256": "", - "sha512": "", - "copyright": "", - "holder": "", - "declared_license_expression": "unknown", - "declared_license_expression_spdx": "LicenseRef-scancode-unknown", - "license_detections": [ - { - "matches": [ - { - "score": 100.0, - "matcher": "5-undetected", - "end_line": 1, - "rule_url": "https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/rules/package-manifest-unknown-b9931200c2f732e2ea95da8f66af5f41a403ecf7", - "from_file": "a10cf747c363a52be048f884c084a25e03280d54a7ac02e17dbd8c5ad160e9bd/var/lib/rpm/Packages", - "start_line": 1, - "matched_text": "license pubkey", - "match_coverage": 100.0, - "matched_length": 2, - "rule_relevance": 100, - "rule_identifier": "package-manifest-unknown-b9931200c2f732e2ea95da8f66af5f41a403ecf7", - "license_expression": "unknown", - "license_expression_spdx": "LicenseRef-scancode-unknown" - } - ], - "identifier": "unknown-6638c8ac-18c2-ed3f-78bb-1c72e6cc0939", - "license_expression": "unknown", - "license_expression_spdx": "LicenseRef-scancode-unknown" - } - ], - "other_license_expression": "", - "other_license_expression_spdx": "", - "other_license_detections": [], - "extracted_license_statement": "pubkey", - "notice_text": "", - "source_packages": [], - "extra_data": {}, - "package_uid": "pkg:rpm/gpg-pubkey@fd431d51?uuid=fixed-uid-done-for-testing-5642512d1758", - "is_private": false, - "is_virtual": false, - "datasource_ids": [ - "rpm_installed_database_bdb" - ], - "datafile_paths": [ - "a10cf747c363a52be048f884c084a25e03280d54a7ac02e17dbd8c5ad160e9bd/var/lib/rpm/Packages" - ], - "file_references": [], - "missing_resources": [], - "modified_resources": [], - "affected_by_vulnerabilities": [] - }, { "purl": "pkg:rpm/grep@3.1?arch=x86_64", "type": "rpm", diff --git a/scanpipe/tests/pipes/test_output.py b/scanpipe/tests/pipes/test_output.py index f08bc5308f..8be923a2c4 100644 --- a/scanpipe/tests/pipes/test_output.py +++ b/scanpipe/tests/pipes/test_output.py @@ -208,6 +208,81 @@ def test_scanpipe_pipes_outputs_to_json(self): output_file = output.to_json(project=project) self.assertIn(output_file.name, project.output_root) + def test_scanpipe_pipes_outputs_to_json_strips_symbols(self): + """Test that JSON output removes symbols from resources and messages.""" + project = make_project(name="SymbolTest") + + resource_data = { + "path": "test.js", + "extra_data": { + "source_symbols": ["func1", "func2"], + "source_strings": ["hello world"], + "source_comments": ["// test"], + "other_field": "should_remain", + }, + } + resource = CodebaseResource.objects.create(project=project, **resource_data) + + message_details = {"source_symbols": ["sym1"], "resource_path": "test.js"} + make_message(project, details=message_details, description="Test message") + + output_file = output.to_json(project=project) + with output_file.open() as f: + results = json.loads(f.read()) + + resource_output = results["files"][0] + self.assertNotIn("source_symbols", resource_output["extra_data"]) + self.assertNotIn("source_strings", resource_output["extra_data"]) + self.assertNotIn("source_comments", resource_output["extra_data"]) + self.assertIn("other_field", resource_output["extra_data"]) + self.assertEqual("should_remain", resource_output["extra_data"]["other_field"]) + + message_output = results["headers"][0]["messages"][0] + self.assertNotIn("source_symbols", message_output["details"]) + self.assertIn("resource_path", message_output["details"]) + + resource.refresh_from_db() + self.assertIn("source_symbols", resource.extra_data) + + def test_scanpipe_pipes_outputs_to_symbols_json(self): + project = make_project(name="SymbolsOnly") + CodebaseResource.objects.create( + project=project, + path="has_symbols.js", + extra_data={ + "source_symbols": ["func1", "func2"], + "source_strings": ["test"], + "other_data": "value", + }, + ) + CodebaseResource.objects.create( + project=project, path="no_symbols.txt", extra_data={"other_data": "value"} + ) + output_file = output.to_symbols_json(project) + with output_file.open() as f: + results = json.loads(f.read()) + + self.assertIn("headers", results) + self.assertIn("files", results) + + # Should only have 1 file (the one with symbols) + self.assertEqual(1, len(results["files"])) + + # Verify it's the right file + file_output = results["files"][0] + self.assertEqual("has_symbols.js", file_output["path"]) + + # Verify symbols ARE included (not stripped) + self.assertIn("source_symbols", file_output["extra_data"]) + self.assertEqual( + ["func1", "func2"], file_output["extra_data"]["source_symbols"] + ) + self.assertIn("source_strings", file_output["extra_data"]) + + # Verify headers are present + self.assertEqual(1, len(results["headers"])) + self.assertEqual("scanpipe", results["headers"][0]["tool_name"]) + def test_scanpipe_pipes_outputs_to_xlsx(self): fixtures = self.data / "asgiref" / "asgiref-3.3.0_fixtures.json" call_command("loaddata", fixtures, **{"verbosity": 0}) @@ -271,6 +346,54 @@ def test_scanpipe_pipes_outputs_get_xlsx_report(self): ] self.assertEqual(expected_sheet_names, workbook.sheetnames) + def test_scanpipe_pipes_outputs_to_xlsx_strips_symbols(self): + project = make_project(name="SymbolXLSX") + CodebaseResource.objects.create( + project=project, + path="test.js", + extra_data={ + "source_symbols": ["func1", "func2"], + "source_strings": ["hello"], + "source_comments": ["// test"], + }, + ) + + message_details = { + "source_symbols": ["symbol1", "symbol2"], + "source_strings": ["string1"], + "source_comments": ["# comment"], + "resource_path": "test.js", + } + make_message( + project, + model="resource", + details=message_details, + description="Error with symbols", + ) + + output_file = output.to_xlsx(project) + workbook = openpyxl.load_workbook(output_file, read_only=True, data_only=True) + + self.assertIn("MESSAGES", workbook.sheetnames) + messages_sheet = workbook["MESSAGES"] + + headers = [cell.value for cell in next(messages_sheet.iter_rows())] + self.assertIn("details", headers) + details_col_index = headers.index("details") + + rows = list(messages_sheet.iter_rows(min_row=2, max_row=2, values_only=True)) + self.assertEqual(1, len(rows)) + + details_value = rows[0][details_col_index] + + if details_value: + self.assertNotIn("source_symbols", details_value) + self.assertNotIn("source_strings", details_value) + self.assertNotIn("source_comments", details_value) + + # Verify other fields ARE present + self.assertIn("resource_path", details_value) + def test_scanpipe_pipes_outputs_get_xlsx_fields_order(self): output_file = output.to_xlsx(project=make_project()) workbook = openpyxl.load_workbook(output_file, read_only=True, data_only=True) @@ -637,7 +760,7 @@ def test_scanpipe_pipes_outputs_to_all_formats(self): call_command("loaddata", fixtures, **{"verbosity": 0}) project = Project.objects.get(name="asgiref") - with self.assertNumQueries(35): + with self.assertNumQueries(39): output_file = output.to_all_formats(project=project) self.assertEqual("asgiref_outputs.zip", output_file.name) @@ -717,6 +840,35 @@ def test_scanpipe_pipes_outputs_render_template_file(self): rendered = output.render_template_file(template_location, context) self.assertEqual("value", rendered) + def test_strip_symbols_function(self): + """Test that strip_symbols removes symbol keys without mutation.""" + original = { + "path": "test.py", + "source_symbols": ["foo", "bar"], + "source_strings": ["hello"], + "source_comments": ["# comment"], + "other_data": "keep_me", + } + + result = output.strip_symbols(original) + # Verify symbols removed + self.assertNotIn("source_symbols", result) + self.assertNotIn("source_strings", result) + self.assertNotIn("source_comments", result) + + # Verify other data preserved + self.assertEqual("test.py", result["path"]) + self.assertEqual("keep_me", result["other_data"]) + + # Verify original not mutated (important!) + self.assertIn("source_symbols", original) + self.assertEqual(["foo", "bar"], original["source_symbols"]) + + # Test edge cases + self.assertIsNone(output.strip_symbols(None)) + self.assertEqual({}, output.strip_symbols({})) + self.assertEqual("string", output.strip_symbols("string")) + def test_scanpipe_pipes_outputs_get_attribution_template(self): project = make_project(name="Analysis") template_location = str(output.get_attribution_template(project)) diff --git a/scanpipe/tests/test_api.py b/scanpipe/tests/test_api.py index 03d68cfaca..c1b77980b7 100644 --- a/scanpipe/tests/test_api.py +++ b/scanpipe/tests/test_api.py @@ -631,6 +631,23 @@ def test_scanpipe_api_project_action_results_download(self): expected = ["dependencies", "files", "headers", "packages", "relations"] self.assertEqual(expected, sorted(results.keys())) + def test_api_project_results_download_symbols_format(self): + CodebaseResource.objects.create( + project=self.project1, # Use existing project from setUp + path="test.js", + extra_data={"source_symbols": ["func"]}, + ) + url = reverse("project-results-download", args=[self.project1.uuid]) + data = {"output_format": "symbols"} + response = self.csrf_client.get(url, data=data) + + self.assertEqual(200, response.status_code) + self.assertIn("application/json", response["Content-Type"]) + + results = json.loads(response.getvalue()) + self.assertIn("files", results) + self.assertGreater(len(results["files"]), 0) + @mock.patch("scanpipe.pipes.datetime", mocked_now) def test_scanpipe_api_project_action_results_download_output_formats(self): url = reverse("project-results-download", args=[self.project1.uuid]) diff --git a/scanpipe/views.py b/scanpipe/views.py index 5e657b874b..c4b424e066 100644 --- a/scanpipe/views.py +++ b/scanpipe/views.py @@ -1584,21 +1584,9 @@ def get(self, request, *args, **kwargs): if format == "json": return project_results_json_response(project, as_attachment=True) - elif format == "xlsx": - output_file = output.to_xlsx(project) - elif format == "spdx": - output_file = output.to_spdx(project, **output_kwargs) - elif format == "cyclonedx": - output_file = output.to_cyclonedx(project, **output_kwargs) - elif format == "attribution": - output_file = output.to_attribution(project) - elif format == "ort-package-list": - output_file = output.to_ort_package_list_yml(project) - elif format == "all_formats": - output_file = output.to_all_formats(project) - elif format == "all_outputs": - output_file = output.to_all_outputs(project) - else: + try: + output_file = output.get_output_for_format(project, format, **output_kwargs) + except ValueError: raise Http404("Format not supported.") filename = output.safe_filename(f"scancodeio_{project.name}_{output_file.name}")