-
Notifications
You must be signed in to change notification settings - Fork 352
Extend ScanSummary to be able to return findings from snippet scanners #6791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
eb676c4
5532c68
0666631
e8be2f7
d1fb1da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright (C) 2023 The ORT Project Authors (See <https://github.com/oss-review-toolkit/ort-server/blob/main/NOTICE>) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* License-Filename: LICENSE | ||
*/ | ||
|
||
package org.ossreviewtoolkit.model.utils | ||
|
||
import org.ossreviewtoolkit.model.Provenance | ||
import org.ossreviewtoolkit.model.TextLocation | ||
import org.ossreviewtoolkit.utils.spdx.SpdxExpression | ||
|
||
data class Snippet( | ||
/** | ||
* The matching score between the code being scanned and the code snippet. This is scanner specific (e.g. for | ||
* ScanOSS this is a percentage). | ||
*/ | ||
val score: Float, | ||
|
||
/** | ||
* The text location in the snippet that has matched. | ||
*/ | ||
val location: TextLocation, | ||
|
||
/** | ||
* The provenance of the snippet, either an artifact or a repository. | ||
*/ | ||
val provenance: Provenance, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As this property is not really used yet, I'm wondering how this could be an (unknown) provenance. Does one of the snippet scanners really return snippets where it doesn't know where this comes from? If so, could you maybe explain this in the docs above? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Once again we are paying the price of the lack of data model for FossID.... However, in the various responses I get from the FossID API service, it seems the url is never There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I'd love to be able to do that, yes. Could you try to reach our to FossId to learn if a non-null URL is a valid assumption? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I opened a FossID support ticket 👍 |
||
|
||
/** | ||
* The purl representing the author/vendor, artifact, version of the code snippet. If the snippet scanner does not | ||
* natively support purls, it will be generated by ORT. | ||
*/ | ||
val purl: String, | ||
|
||
/** | ||
* The license of the component the code snippet is commit from. | ||
*/ | ||
val licenses: SpdxExpression | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Copyright (C) 2023 The ORT Project Authors (see <https://github.com/oss-review-toolkit/ort/blob/main/NOTICE>) | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* https://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* License-Filename: LICENSE | ||
*/ | ||
|
||
package org.ossreviewtoolkit.model.utils | ||
|
||
import org.ossreviewtoolkit.model.TextLocation | ||
|
||
/** | ||
* A class representing a snippet finding for a source file. A snippet finding is a code snippet from another origin, | ||
* matching the code being scanned. | ||
* It is meant to be reviewed by an operator as it could be a false positive. | ||
*/ | ||
data class SnippetFinding( | ||
/** | ||
* The text location in the scanned source file where the snippet has matched. | ||
*/ | ||
val sourceLocation: TextLocation, | ||
|
||
/** | ||
* The corresponding snippet. | ||
*/ | ||
val snippet: Snippet | ||
) |
Uh oh!
There was an error while loading. Please reload this page.