|
| 1 | +[#-- |
| 2 | + Copyright (C) 2023 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>) |
| 3 | +
|
| 4 | + Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + you may not use this file except in compliance with the License. |
| 6 | + You may obtain a copy of the License at |
| 7 | +
|
| 8 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | + Unless required by applicable law or agreed to in writing, software |
| 11 | + distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + See the License for the specific language governing permissions and |
| 14 | + limitations under the License. |
| 15 | +
|
| 16 | + SPDX-License-Identifier: Apache-2.0 |
| 17 | + License-Filename: LICENSE |
| 18 | +--] |
| 19 | + |
| 20 | +:publisher: OSS Review Toolkit |
| 21 | +[#assign now = .now] |
| 22 | +:revdate: ${now?date?iso_local} |
| 23 | + |
| 24 | +:title-page: |
| 25 | +:sectnums: |
| 26 | +:toc: |
| 27 | + |
| 28 | += SCANOSS Snippets |
| 29 | +List of all the provenances with their files and snippets. |
| 30 | +[#list ortResult.scanner.scanResults as scanResult] |
| 31 | + |
| 32 | +[#--[#if scanResult.scanner.name != "FossId"] [#continue] [/#if]--] |
| 33 | + |
| 34 | +[#assign snippetsLimitIssue = helper.getSnippetsLimitIssue()] |
| 35 | + |
| 36 | +[#if snippetsLimitIssue?has_content] |
| 37 | +[WARNING] |
| 38 | +==== |
| 39 | +${snippetsLimitIssue} |
| 40 | +==== |
| 41 | +[/#if] |
| 42 | + |
| 43 | +[#if scanResult.provenance.vcsInfo??] |
| 44 | + [#assign url = scanResult.provenance.vcsInfo.url] |
| 45 | +[#else] |
| 46 | + [#assign url = scanResult.provenance.sourceArtifact.url] |
| 47 | +[/#if] |
| 48 | +== Provenance '${url}' |
| 49 | + |
| 50 | +[#assign summary = scanResult.summary] |
| 51 | + |
| 52 | +Scan start time : ${summary.startTime} + |
| 53 | +End time : ${summary.startTime} + |
| 54 | +[#if scanResult.provenance.vcsInfo??] |
| 55 | + [#assign gitRepoUrl = url] |
| 56 | + [#assign gitRevision = scanResult.provenance.vcsInfo.revision] |
| 57 | + Git repo URL: ${gitRepoUrl} + |
| 58 | + Git revision: ${gitRevision} |
| 59 | + |
| 60 | + [#if gitRepoUrl?contains("github.com")] |
| 61 | + [#assign githubBaseURL = '${gitRepoUrl?remove_ending(".git")}/blob/${gitRevision}'] |
| 62 | + [/#if] |
| 63 | +[/#if] |
| 64 | + |
| 65 | +[#list helper.groupSnippetsByFile(summary.snippetFindings) as filePath, snippetFindings ] |
| 66 | + |
| 67 | +[#if gitRepoUrl?? && gitRepoUrl?contains("github.com")] |
| 68 | + [#assign localFileURL = '${githubBaseURL}/${filePath}[${filePath}]'] |
| 69 | +[#else] |
| 70 | + [#assign localFileURL = "${filePath}"] |
| 71 | +[/#if] |
| 72 | +[#assign licenses = helper.collectLicenses(snippetFindings)] |
| 73 | + |
| 74 | +*${localFileURL}* + |
| 75 | +License(s): |
| 76 | +[#list licenses as license] |
| 77 | + ${license}[#sep], |
| 78 | +[/#list] |
| 79 | + |
| 80 | +[#list helper.groupSnippetsBySourceLines(snippetFindings) as sourceLocation, snippetFinding] |
| 81 | +[#assign snippetCount = snippetFinding.snippets?size] |
| 82 | + |
| 83 | +[width=100%] |
| 84 | +[cols="1,3,4,1,1"] |
| 85 | +|=== |
| 86 | +| Source Location | pURL | License | Score | Release Date |
| 87 | + |
| 88 | +.${snippetCount*2}+| |
| 89 | +Partial match + |
| 90 | +${sourceLocation.startLine?c}-${sourceLocation.endLine?c} |
| 91 | + |
| 92 | + |
| 93 | +[#list snippetFinding.snippets as snippet ] |
| 94 | + |
| 95 | +| ${snippet.purl!""} |
| 96 | +| ${snippet.license!""} |
| 97 | +| ${snippet.score!""} |
| 98 | +| ${snippet.additionalData['release_date']} |
| 99 | + |
| 100 | +4+a| |
| 101 | +.Create a snippet choice for this snippet or mark it as false positive |
| 102 | +[%collapsible] |
| 103 | +==== |
| 104 | +Add the following lines to the *.ort.yml* file. |
| 105 | + |
| 106 | +To **choose** this snippet: |
| 107 | +[source,yaml] |
| 108 | +-- |
| 109 | +snippet_choices: |
| 110 | +- provenance: |
| 111 | + url: "${scanResult.provenance.vcsInfo.url}" |
| 112 | + choices: |
| 113 | + - given: |
| 114 | + source_location: |
| 115 | + path: "${filePath}" |
| 116 | + start_line: ${snippetFinding.sourceLocation.startLine?c} |
| 117 | + end_line: ${snippetFinding.sourceLocation.endLine?c} |
| 118 | + choice: |
| 119 | + purl: "${snippet.purl!""}" |
| 120 | + reason: "ORIGINAL_FINDING" |
| 121 | + comment: "Explain why this snippet choice was made" |
| 122 | +-- |
| 123 | +Or to mark this location has having ONLY **false positives snippets**: |
| 124 | +[source,yaml] |
| 125 | +-- |
| 126 | +snippet_choices: |
| 127 | +- provenance: |
| 128 | + url: "${scanResult.provenance.vcsInfo.url}" |
| 129 | + choices: |
| 130 | + - given: |
| 131 | + source_location: |
| 132 | + path: "${filePath}" |
| 133 | + start_line: ${snippetFinding.sourceLocation.startLine?c} |
| 134 | + end_line: ${snippetFinding.sourceLocation.endLine?c} |
| 135 | + choice: |
| 136 | + reason: "NO_RELEVANT_FINDING" |
| 137 | + comment: "Explain why this location has only false positives snippets" |
| 138 | +-- |
| 139 | +==== |
| 140 | +[/#list] |
| 141 | +|=== |
| 142 | +[/#list] |
| 143 | +[/#list] |
| 144 | +[/#list] |
0 commit comments