Skip to content

Commit

Permalink
change computation of structural CFI to coincide with df-based CFI
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rüdiger Steuer committed Sep 19, 2023
1 parent f83e5b9 commit 038234c
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions varats/varats/data/reports/feature_blame_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,22 +424,16 @@ def generate_general_commit_dcfi_data(
SFBR, DFBR
)
interacting_structurally_and_through_dataflow = 0
interacting_structurally_and_not_through_dataflow = 0
for sch, features in commits_structurally_interacting_features.items():
entry = commits_dataflow_interacting_features.get(sch)
if entry is None:
interacting_structurally_and_not_through_dataflow += 1
continue
for feature in features:
if feature in entry[0]:
interacting_structurally_and_through_dataflow += 1
else:
interacting_structurally_and_not_through_dataflow += 1
# check for every structural CFI, if its respective commit and feature also interact through dataflow

Check failure on line 427 in varats/varats/data/reports/feature_blame_report.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/reports/feature_blame_report.py#L427 <301>

Line too long (105/80) (line-too-long)
Raw output
varats/varats/data/reports/feature_blame_report.py:427:0: C0301: Line too long (105/80) (line-too-long)
for SCFI in SFBR.commit_feature_interactions:

Check failure on line 428 in varats/varats/data/reports/feature_blame_report.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/reports/feature_blame_report.py#L428 <103>

Variable name "SCFI" doesn't conform to snake_case naming style (invalid-name)
Raw output
varats/varats/data/reports/feature_blame_report.py:428:8: C0103: Variable name "SCFI" doesn't conform to snake_case naming style (invalid-name)
commit_hash: str = ShortCommitHash(SCFI.commit.commit_hash).hash

Check failure on line 429 in varats/varats/data/reports/feature_blame_report.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] varats/varats/data/reports/feature_blame_report.py#L429

error: Argument 1 to "ShortCommitHash" has incompatible type "FullCommitHash"; expected "str" [arg-type]
Raw output
varats/varats/data/reports/feature_blame_report.py:429:44: error: Argument 1 to "ShortCommitHash" has incompatible type "FullCommitHash"; expected "str"  [arg-type]
entry = commits_dataflow_interacting_features.get(commit_hash)
if (not (entry is None)) and SCFI.feature in entry[0]:

Check failure on line 431 in varats/varats/data/reports/feature_blame_report.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/reports/feature_blame_report.py#L431 <325>

Unnecessary parens after 'not' keyword (superfluous-parens)
Raw output
varats/varats/data/reports/feature_blame_report.py:431:0: C0325: Unnecessary parens after 'not' keyword (superfluous-parens)
interacting_structurally_and_through_dataflow += 1

row.append(
interacting_structurally_and_through_dataflow / (
interacting_structurally_and_through_dataflow +
interacting_structurally_and_not_through_dataflow
)
interacting_structurally_and_through_dataflow /
len(SFBR.commit_feature_interactions)
)

columns = [
Expand Down

0 comments on commit 038234c

Please sign in to comment.