{"id":18546550,"url":"https://github.com/saveourtool/sarif-utils","last_synced_at":"2025-04-09T20:31:03.654Z","repository":{"id":94404315,"uuid":"572423694","full_name":"saveourtool/sarif-utils","owner":"saveourtool","description":"The set of utilities, directed to work with SARIF formatted files.","archived":false,"fork":false,"pushed_at":"2025-03-20T11:27:05.000Z","size":459,"stargazers_count":10,"open_issues_count":11,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-20T12:40:34.636Z","etag":null,"topics":["kotlin","static-analysis"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/saveourtool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-30T08:41:49.000Z","updated_at":"2024-10-28T08:19:16.000Z","dependencies_parsed_at":"2023-10-02T04:44:34.252Z","dependency_job_id":"35874327-4907-44fb-81bb-2a66b6fd51fa","html_url":"https://github.com/saveourtool/sarif-utils","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saveourtool%2Fsarif-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saveourtool%2Fsarif-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saveourtool%2Fsarif-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/saveourtool%2Fsarif-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/saveourtool","download_url":"https://codeload.github.com/saveourtool/sarif-utils/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248107229,"owners_count":21048883,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["kotlin","static-analysis"],"created_at":"2024-11-06T20:25:53.635Z","updated_at":"2025-04-09T20:31:03.162Z","avatar_url":"https://github.com/saveourtool.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sarif-Utils\n\nCurrent library provide the set of utilities, directed to work with\n`.sarif` files.\\\n**SARIF - Static Analysis Results Interchange Format**, is a [standard](https://sarifweb.azurewebsites.net/),\nJSON-based format for the output of static analysis tools, elaborated by Microsoft.\n\n### Fix-Patches module\n\nThere are different static analysis tool, but generally all of them\nare united by one concept - to detect software vulnerabilities.\n\nThus, at the output of the work of static analysis tool, there will be the set of `warnings`,\\\nwhich are pointed to the code smells. Some tools have gone further and provide an opportunity\\\nto automatically `fix` such code smells.\n\nAccordingly, `SARIF` files, which could be the one of possible formats for reports of static analysis tools,\nwill contain corresponding sections for `warnings` and `fixes`, obtained by such tools, \nwhich are pointed to the corresponding vulnerabilities in target files.\n\n`Fix-Patches` module is set to work with `fix object` sections from `SARIF` - formatted files.\n\n* A `fix object` represents a proposed fix for the problem, indicated by tool.\\\nIt specifies a set of artifacts to modify. For each artifact, it specifies regions to remove, and provides new content to insert.\n* `Fix-Patches`, in its turn, will parse such sections, create copy of target files, which are presented in `SARIF`,\nand automatically apply fixes to these copies.\n\nThe result output will contain the list of paths to the copies of provided target files with applied fixes. \n\n**Note:** If `SARIF` file will contain multiple fixes for the same region in one file, only the first fix will be appied.\n\n#### How to use:\n\nLibrary provides easy-to-use API for fix patches applying, it's just need to provide\nthe path to `SARIF` file, which contain the list of fixes (`fix objects`) for target files and the list of paths to these files,\nin the manner, in which they are presented in `SARIF` (via absolute/relative paths).\n\n```kotlin\n    val processedFiles: List\u003cPath\u003e = SarifFixAdapter(\n                                        sarifFile = sarifFilePath,\n                                        targetFiles = listOfTargetFilesPaths,\n                                        testRoot = \"/path/to/test/root/directory/\".toPath()\n                                      ).process()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaveourtool%2Fsarif-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsaveourtool%2Fsarif-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsaveourtool%2Fsarif-utils/lists"}