Skip to content
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

snyk: added snyk stats to metadata #152

Closed
wants to merge 1 commit into from

Conversation

jperezdealgaba
Copy link
Collaborator

Related: https://issues.redhat.com/browse/OSH-347
Reproducer: csmock -t snyk --force -r rhel-8-x86_64 osbuild-106-1.el10+4.src.rpm

Added the stats from snyk results (snyk coverage rate, analyzed files and total of files) to the metadata file.

Related: https://issues.redhat.com/browse/OSH-347
Reproducer: csmock -t snyk --force -r rhel-8-x86_64 osbuild-106-1.el10+4.src.rpm

Added the stats from snyk results (snyk coverage rate, analyzed files and total of files) to the metadata file.
import json


def snyk_write_analysis_meta(results, results_file):

Check warning

Code scanning / vcs-diff-lint

snyk_write_analysis_meta: Missing function or method docstring Warning

snyk_write_analysis_meta: Missing function or method docstring

return 0

except Exception as e:

Check warning

Code scanning / vcs-diff-lint

snyk_write_analysis_meta: Catching too general exception Exception Warning

snyk_write_analysis_meta: Catching too general exception Exception

def snyk_write_analysis_meta(results, results_file):
try:
with open(results_file) as snyk_results_file:

Check warning

Code scanning / vcs-diff-lint

snyk_write_analysis_meta: Using open without explicitly specifying an encoding Warning

snyk_write_analysis_meta: Using open without explicitly specifying an encoding
@@ -17,6 +17,8 @@

import os

from csmock.common.snyk import snyk_write_analysis_meta

Check warning

Code scanning / vcs-diff-lint

Unable to import 'csmock.common.snyk' Warning

Unable to import 'csmock.common.snyk'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant