Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pub
frama-c
Commits
446b2246
Commit
446b2246
authored
4 years ago
by
Andre Maroneze
Committed by
Virgile Prevosto
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[MdR] do not emit location in SARIF if unknown
parent
490ec6c7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/markdown-report/sarif_gen.ml
+6
-2
6 additions, 2 deletions
src/plugins/markdown-report/sarif_gen.ml
with
6 additions
and
2 deletions
src/plugins/markdown-report/sarif_gen.ml
+
6
−
2
View file @
446b2246
...
@@ -98,6 +98,10 @@ let make_message alarm annot remark =
...
@@ -98,6 +98,10 @@ let make_message alarm annot remark =
in
in
Message
.
create
~
text
~
richText
()
Message
.
create
~
text
~
richText
()
let
opt_physical_location_of_loc
loc
=
if
loc
=
Cil_datatype
.
Location
.
unknown
then
[]
else
[
Location
.
of_loc
loc
]
let
gen_results
remarks
=
let
gen_results
remarks
=
let
treat_alarm
_e
kf
s
~
rank
:_
alarm
annot
(
i
,
rules
,
content
)
=
let
treat_alarm
_e
kf
s
~
rank
:_
alarm
annot
(
i
,
rules
,
content
)
=
let
prop
=
Property
.
ip_of_code_annot_single
kf
s
annot
in
let
prop
=
Property
.
ip_of_code_annot_single
kf
s
annot
in
...
@@ -109,7 +113,7 @@ let gen_results remarks =
...
@@ -109,7 +113,7 @@ let gen_results remarks =
let
level
=
level_of_status
(
Property_status
.
Feedback
.
get
prop
)
in
let
level
=
level_of_status
(
Property_status
.
Feedback
.
get
prop
)
in
let
remark
=
get_remark
remarks
label
in
let
remark
=
get_remark
remarks
label
in
let
message
=
make_message
alarm
annot
remark
in
let
message
=
make_message
alarm
annot
remark
in
let
locations
=
[
L
ocation
.
of_loc
(
Cil_datatype
.
Stmt
.
loc
s
)
]
in
let
locations
=
opt_physical_l
ocation
_
of_loc
(
Cil_datatype
.
Stmt
.
loc
s
)
in
let
res
=
let
res
=
Sarif_result
.
create
~
level
~
ruleId
~
message
~
locations
()
Sarif_result
.
create
~
level
~
ruleId
~
message
~
locations
()
in
in
...
@@ -131,7 +135,7 @@ let make_ip_message ip =
...
@@ -131,7 +135,7 @@ let make_ip_message ip =
let
gen_status
ip
=
let
gen_status
ip
=
let
status
=
Property_status
.
Feedback
.
get
ip
in
let
status
=
Property_status
.
Feedback
.
get
ip
in
let
level
=
level_of_status
status
in
let
level
=
level_of_status
status
in
let
locations
=
[
L
ocation
.
of_loc
(
Property
.
location
ip
)
]
in
let
locations
=
opt_physical_l
ocation
_
of_loc
(
Property
.
location
ip
)
in
let
message
=
make_ip_message
ip
in
let
message
=
make_ip_message
ip
in
Sarif_result
.
create
~
level
~
locations
~
message
()
Sarif_result
.
create
~
level
~
locations
~
message
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment