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

F feature blame plots #834

Draft
wants to merge 101 commits into
base: vara-dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
9722976
implement FeatureBlameReportExperiment
Apr 11, 2023
5d415a1
add test_repo to test projects
Apr 11, 2023
1405e8c
some nmae/type fixes
Apr 12, 2023
bb75269
correct binary?
Apr 12, 2023
44a4669
added print feature
Apr 13, 2023
fd99f6c
change config
Apr 13, 2023
11bf7ba
create bc with clang
Apr 13, 2023
5fe3a66
print out FBR
Apr 13, 2023
2603afc
remove unnecessary code
Apr 14, 2023
a1a9f4c
minor cleanup
Apr 14, 2023
edc3c4b
added new file
Apr 14, 2023
071b7c3
fixes for pre-commit hook
Apr 17, 2023
c52af3e
review changes
Apr 17, 2023
0deac4e
fixes by pre-commit
Apr 18, 2023
45f881f
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-G…
Apr 18, 2023
b3cad79
adapt code to work after pull from vara-dev
Apr 18, 2023
8a6f71e
adapted python fbr to new yaml fbr
May 22, 2023
2c56155
separated feature blame report
Jun 25, 2023
2b8e197
first implementations for plots of FeatureBlameReports
Jun 27, 2023
9d122fe
note
Jun 27, 2023
ca1240e
first plot
Jul 5, 2023
3d57365
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-F…
Jul 7, 2023
f3bf72b
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-G…
Jul 7, 2023
5e221e1
added detection of feature model
Jul 10, 2023
933f9ce
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-F…
Jul 10, 2023
873e512
Merge branch 'f-GenerateFeatureBlameReport' of github.com:se-sic/VaRA…
Jul 10, 2023
8fc18ef
added new dcfi plot
Jul 11, 2023
40dc326
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-F…
Jul 16, 2023
bfe3b47
new plots and table
Jul 17, 2023
a983b7a
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-F…
Jul 20, 2023
2883862
remove unused dependencies
Jul 24, 2023
88c869d
new data creation and plots for authors
Jul 24, 2023
4e73420
improve generation of author cfi data
Aug 21, 2023
d5c6fcc
implement table for structural report
Aug 21, 2023
46486ec
shorthand correction
Aug 25, 2023
912a4bc
remove unused import
Aug 25, 2023
28637bd
stacked author distribution plot for projects
Aug 25, 2023
8d89035
change occurences of 'scope' to 'size'
Aug 25, 2023
6303928
FeatureSizeCorrPlot displays multiple case studies
Aug 25, 2023
322ed95
FeatureSizeCorrDFBRPlot + its data generation
Aug 28, 2023
0f5d6ba
tables can now show data for several projects
Aug 28, 2023
ffd9d3e
new feature interaction dis plot several projects
Aug 29, 2023
de87215
add new function num_active_commits to git_util.py
Aug 29, 2023
d482879
num impl features dis of commits is now stacked for every project
Aug 30, 2023
1f1aee8
num impl features dis of commits is now stacked for every project
Aug 30, 2023
2575ff3
num features affect through dataflow of commits is now stacked for ev…
Aug 30, 2023
ecee990
Merge branch 'f-FeatureBlamePlots' of github.com:se-sic/VaRA-Tool-Sui…
Aug 30, 2023
2b423eb
add changes lost in merge
Aug 30, 2023
11a6511
minor changes
Sep 4, 2023
e387265
improve row access, add variance to tables
Sep 4, 2023
41a7e38
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-F…
Sep 4, 2023
f73afda
added new pie chart for both structural/df-based interactions of commits
Sep 4, 2023
bd16a88
some adjustments for pie charts
Sep 5, 2023
22d90a8
improvements for author plots and data generation
Sep 6, 2023
dafb1ba
refactoring
Sep 7, 2023
c5ee49a
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-G…
Sep 7, 2023
6c7e685
changes for checks
Sep 11, 2023
ab8bd91
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-F…
Sep 11, 2023
173d0c3
Merge branch 'vara-dev' of github.com:se-sic/VaRA-Tool-Suite into f-G…
Sep 11, 2023
c0abdde
added missing FeatureModelProvider to dataflow report
Sep 11, 2023
d542167
adapt test_bb_config for merge of experiments
Sep 11, 2023
9aad357
swap rows and columns for tables
Sep 14, 2023
526c6ff
only consider succesful report files
Sep 14, 2023
7280284
improve proportional df plot
Sep 14, 2023
519d96b
changes to review
Sep 14, 2023
4180986
can now get authors of submodules
Sep 15, 2023
60d101c
new proportional commit plots
Sep 15, 2023
da584b8
split sfbr-tables into three tables
Sep 18, 2023
f83e5b9
entries of rows are now rounded to two decimals
Sep 18, 2023
038234c
change computation of structural CFI to coincide with df-based CFI
Sep 19, 2023
4ff4e20
calc p-values for correlation coefficient as well
Sep 19, 2023
2f4d97c
adapt commit sfbr pie charts
Sep 20, 2023
dc5db5d
remove unused import
Sep 20, 2023
2f76768
implement new author dataflow analysis
Sep 25, 2023
42de982
adapt to changes in structural cfi collection
Sep 25, 2023
3d992e6
Merge branch 'f-GenerateFeatureBlameReport' of github.com:se-sic/VaRA…
Sep 25, 2023
1af8119
adapt generate_commit_scfi_data
Sep 25, 2023
e62aa45
work on sfbr-commit-eval-table
Sep 25, 2023
5848c18
fix mistake in return type
Sep 25, 2023
3e4cd69
Merge branch 'f-GenerateFeatureBlameReport' of github.com:se-sic/VaRA…
Sep 25, 2023
bcfe677
adapt data collection to changes in sfbr
Sep 26, 2023
3e3f7b9
fixes for sfbr-commit-eval-table
Sep 26, 2023
e9b3dc2
move util functions to bottom
Sep 27, 2023
2b34bdd
sort features for combined authors
Sep 27, 2023
f150746
new plot for structural interactions of commits
Sep 27, 2023
d85ed12
new struct author plot
Sep 27, 2023
5382403
improve structural feature data generation
Sep 28, 2023
7a283bd
plots and tables used for RQ1improved
Sep 28, 2023
19562ab
changes to dataflow plots
Sep 29, 2023
87131ce
refactoring for pre-commits
Sep 29, 2023
2b9571d
changes to structural plots/tables
Oct 3, 2023
fdc6c4f
changes to FeatureDFBRPlot
Oct 4, 2023
61a24d6
changes to commti dfbr plots and tables
Oct 4, 2023
539236a
changes to sfbr plots
Oct 5, 2023
de75092
new author plot
Oct 5, 2023
a64121a
changes to dfbr plots
Oct 9, 2023
8ca9088
changes to feature plots
Oct 12, 2023
24a4f71
show commit-sfbr in histplot
Oct 12, 2023
8047073
add plot type to feature-sfbr plot
Oct 13, 2023
1a4bcac
small changes to plots
Oct 17, 2023
b2485fe
correctly count number of active lines for commits
Oct 18, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/utils/test_bb_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def test_if_experiments_were_added(self):
"varats.experiments.discover_experiments",
"varats.experiments.vara.region_instrumentation",
"varats.experiments.vara.commit_annotation_report",
"varats.experiments.vara.blame_experiment",
"varats.experiments.vara.vara_experiments",
"varats.experiments.vara.feature_experiment"
]

Expand Down
46 changes: 46 additions & 0 deletions varats-core/varats/utils/git_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,52 @@
)


def num_active_commits(
repo_folder: Path, churn_config: tp.Optional['ChurnConfig'] = None
) -> int:
"""
Count the number of active commits, i.e. commits whose changes still
contribute source code to a git repo.

Args:
repo_folder: path to the git repo
churn_config: to specify the files that should be considered

Returns:
the number of active commits
"""
if not churn_config:
churn_config = ChurnConfig.create_c_style_languages_config()
commits = get_all_revisions_between(
get_initial_commit(repo_folder).to_short_commit_hash().hash,
get_head_commit(repo_folder).to_short_commit_hash().hash, ShortCH,
repo_folder
)
return sum([
contains_source_code(
commit.to_short_commit_hash(), repo_folder, churn_config
) for commit in commits
])


def get_author(commit_hash: any, repo: pygit2.Repository) -> tp.Optional[str]:

Check failure on line 409 in varats-core/varats/utils/git_util.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] varats-core/varats/utils/git_util.py#L409

error: Function "builtins.any" is not valid as a type [valid-type]
Raw output
varats-core/varats/utils/git_util.py:409:29: error: Function "builtins.any" is not valid as a type  [valid-type]

Check failure on line 409 in varats-core/varats/utils/git_util.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] varats-core/varats/utils/git_util.py#L409

note: Perhaps you meant "typing.Any" instead of "any"?
Raw output
varats-core/varats/utils/git_util.py:409:29: note: Perhaps you meant "typing.Any" instead of "any"?
"""
Get the author (name) of a commit with its respective hash.

Args:
commit_hash: hash of the commit
repo_folder: path to the git repo

Returns:
the name of the author
"""
commit: pygit2.Commit = repo.get(commit_hash)
if commit is None:
return None
author: str = commit.author.name
return author


def num_authors(
c_start: str = "HEAD", repo_folder: tp.Optional[Path] = None
) -> int:
Expand Down
208 changes: 208 additions & 0 deletions varats/varats/data/databases/feature_blame_databases.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,208 @@
"""Module for feature blame-data metrics."""
import typing as tp
from datetime import datetime

Check warning on line 3 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L3 <611>

Unused datetime imported from datetime (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:3:0: W0611: Unused datetime imported from datetime (unused-import)
from enum import Enum

Check warning on line 4 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L4 <611>

Unused Enum imported from enum (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:4:0: W0611: Unused Enum imported from enum (unused-import)
from itertools import chain
from pathlib import Path

Check warning on line 6 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L6 <611>

Unused Path imported from pathlib (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:6:0: W0611: Unused Path imported from pathlib (unused-import)

import pandas as pd

from varats.data.cache_helper import build_cached_report_table

Check warning on line 10 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L10 <611>

Unused build_cached_report_table imported from varats.data.cache_helper (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:10:0: W0611: Unused build_cached_report_table imported from varats.data.cache_helper (unused-import)
from varats.data.databases.evaluationdatabase import EvaluationDatabase
from varats.data.reports.feature_blame_report import (

Check failure on line 12 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] varats/varats/data/databases/feature_blame_databases.py#L12

error: Module "varats.data.reports.feature_blame_report" has no attribute "generate_features_scfi_data"; maybe "generate_feature_scfi_data", "generate_feature_dcfi_data", or "generate_feature_author_data"? [attr-defined]
Raw output
varats/varats/data/databases/feature_blame_databases.py:12:1: error: Module "varats.data.reports.feature_blame_report" has no attribute "generate_features_scfi_data"; maybe "generate_feature_scfi_data", "generate_feature_dcfi_data", or "generate_feature_author_data"?  [attr-defined]

Check failure on line 12 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L12 <611>

No name 'generate_features_scfi_data' in module 'varats.data.reports.feature_blame_report' (no-name-in-module)
Raw output
varats/varats/data/databases/feature_blame_databases.py:12:0: E0611: No name 'generate_features_scfi_data' in module 'varats.data.reports.feature_blame_report' (no-name-in-module)

Check warning on line 12 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L12 <611>

Unused DataflowFeatureBlameReport imported from varats.data.reports.feature_blame_report (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:12:0: W0611: Unused DataflowFeatureBlameReport imported from varats.data.reports.feature_blame_report (unused-import)
StructuralFeatureBlameReport,
DataflowFeatureBlameReport,
generate_features_scfi_data
)
from varats.experiments.vara.feature_blame_report_experiment import (

Check warning on line 17 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L17 <611>

Unused DataflowFeatureBlameReportExperiment imported from varats.experiments.vara.feature_blame_report_experiment (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:17:0: W0611: Unused DataflowFeatureBlameReportExperiment imported from varats.experiments.vara.feature_blame_report_experiment (unused-import)
StructuralFeatureBlameReportExperiment,
DataflowFeatureBlameReportExperiment
)
from varats.jupyterhelper.file import (

Check warning on line 21 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L21 <611>

Unused load_dataflow_feature_blame_report imported from varats.jupyterhelper.file (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:21:0: W0611: Unused load_dataflow_feature_blame_report imported from varats.jupyterhelper.file (unused-import)
load_structural_feature_blame_report,
load_dataflow_feature_blame_report
)
from varats.mapping.commit_map import CommitMap
from varats.paper.case_study import CaseStudy
from varats.paper_mgmt.case_study import get_case_study_file_name_filter
from varats.project.project_util import get_local_project_git

Check warning on line 28 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L28 <611>

Unused get_local_project_git imported from varats.project.project_util (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:28:0: W0611: Unused get_local_project_git imported from varats.project.project_util (unused-import)
from varats.report.report import ReportFilepath
from varats.revision.revisions import (
get_processed_revisions_files,
get_failed_revisions_files,
get_processed_revisions,
)
from varats.data.databases.blame_diff_metrics_database import (

Check warning on line 35 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L35 <611>

Unused id_from_paths imported from varats.data.databases.blame_diff_metrics_database (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:35:0: W0611: Unused id_from_paths imported from varats.data.databases.blame_diff_metrics_database (unused-import)

Check warning on line 35 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L35 <611>

Unused timestamp_from_paths imported from varats.data.databases.blame_diff_metrics_database (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:35:0: W0611: Unused timestamp_from_paths imported from varats.data.databases.blame_diff_metrics_database (unused-import)

Check warning on line 35 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L35 <611>

Unused compare_timestamps imported from varats.data.databases.blame_diff_metrics_database (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:35:0: W0611: Unused compare_timestamps imported from varats.data.databases.blame_diff_metrics_database (unused-import)
get_predecessor_report_file,
get_successor_report_file,
id_from_paths,
timestamp_from_paths,
compare_timestamps
)
from varats.utils.git_util import (

Check warning on line 42 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L42 <611>

Unused ChurnConfig imported from varats.utils.git_util (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:42:0: W0611: Unused ChurnConfig imported from varats.utils.git_util (unused-import)

Check warning on line 42 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L42 <611>

Unused calc_code_churn imported from varats.utils.git_util (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:42:0: W0611: Unused calc_code_churn imported from varats.utils.git_util (unused-import)

Check warning on line 42 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L42 <611>

Unused create_commit_lookup_helper imported from varats.utils.git_util (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:42:0: W0611: Unused create_commit_lookup_helper imported from varats.utils.git_util (unused-import)

Check warning on line 42 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L42 <611>

Unused FullCommitHash imported from varats.utils.git_util (unused-import)
Raw output
varats/varats/data/databases/feature_blame_databases.py:42:0: W0611: Unused FullCommitHash imported from varats.utils.git_util (unused-import)
ChurnConfig,
calc_code_churn,
create_commit_lookup_helper,
ShortCommitHash,
FullCommitHash,
)

def build_feature_blame_report_files_tuple(
project_name: str, case_study: tp.Optional[CaseStudy], fbr_type: type
) -> tp.Tuple[tp.Dict[ShortCommitHash, ReportFilepath], tp.Dict[
ShortCommitHash, ReportFilepath]]:
"""
Build the mappings between commit hash to its corresponding report file
path, where the first mapping corresponds to commit hashes and their
successful report files and the second mapping to commit hashes and their
failed report files.

Args:
project_name: the name of the project
case_study: the selected CaseStudy

Returns:
the mappings from commit hash to successful and failed report files as
tuple
"""
report_files: tp.Dict[ShortCommitHash, ReportFilepath] = {
report.report_filename.commit_hash: report
for report in get_processed_revisions_files(
project_name=project_name,
report_type=fbr_type,
only_newest=False
)
}

failed_report_files: tp.Dict[ShortCommitHash, ReportFilepath] = {
report.report_filename.commit_hash: report
for report in get_failed_revisions_files(
project_name,
fbr_type,
file_name_filter=get_case_study_file_name_filter(case_study)
if case_study else lambda x: False,
)
}
return report_files, failed_report_files

ReportPairTupleList = tp.List[tp.Tuple[ReportFilepath, ReportFilepath]]

def build_structural_report_pairs_tuple(
project_name: str, commit_map: CommitMap, case_study: tp.Optional[CaseStudy]
) -> tp.Tuple[ReportPairTupleList, ReportPairTupleList]:
"""
Builds a tuple of tuples (ReportPairTupleList, ReportPairTupleList) of
successful report files with their corresponding predecessors and tuples of
failed report files with their corresponding predecessor.

Args:
project_name: the name of the project
commit_map: the selected CommitMap
case_study: the selected CaseStudy

Returns:
the tuple of report file to predecessor tuples for all successful and
failed reports
"""

report_files, failed_report_files = build_feature_blame_report_files_tuple(
project_name, case_study, StructuralFeatureBlameReport
)

print("REPORT FILES")
print(report_files)

sampled_revs: tp.List[ShortCommitHash]
if case_study:
sampled_revs = [
rev.to_short_commit_hash() for rev in case_study.revisions
]
else:
sampled_revs = get_processed_revisions(
project_name, StructuralFeatureBlameReportExperiment
)
short_time_id_cache: tp.Dict[ShortCommitHash, int] = {
rev: commit_map.short_time_id(rev) for rev in sampled_revs
}

report_pairs: tp.List[tp.Tuple[ReportFilepath, ReportFilepath]] = [
(report, pred) for report, pred in [(
report_file,
get_predecessor_report_file(
c_hash, commit_map, short_time_id_cache, report_files,
sampled_revs
)
) for c_hash, report_file in report_files.items()] if pred is not None
]

failed_report_pairs: tp.List[tp.Tuple[ReportFilepath, ReportFilepath]] = [
(report, pred) for report, pred in chain.from_iterable(
[[(
report_file,
get_predecessor_report_file(
c_hash, commit_map, short_time_id_cache, report_files,
sampled_revs
)
),
(
get_successor_report_file(
c_hash, commit_map, short_time_id_cache, report_files,
sampled_revs
), report_file
)] for c_hash, report_file in failed_report_files.items()]
) if report is not None and pred is not None
]
return report_pairs, failed_report_pairs

class FeaturesSCFIMetricsDatabase(
EvaluationDatabase,
cache_id="features_SCFI_metrics_database",
column_types={"feature": 'str', "num_interacting_commits": 'int64', "feature_scope": 'int64'}

Check failure on line 160 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L160 <301>

Line too long (97/80) (line-too-long)
Raw output
varats/varats/data/databases/feature_blame_databases.py:160:0: C0301: Line too long (97/80) (line-too-long)
):
"""Metrics database that contains all structural cfi information of every feature

Check failure on line 162 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L162 <301>

Line too long (85/80) (line-too-long)
Raw output
varats/varats/data/databases/feature_blame_databases.py:162:0: C0301: Line too long (85/80) (line-too-long)
based on a `StructuralFeatureBlameReport`."""

@classmethod
def _load_dataframe(
cls, project_name: str, commit_map: CommitMap,
case_study: tp.Optional[CaseStudy], **kwargs: tp.Any
) -> pd.DataFrame:

Check failure on line 170 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L170 <303>

Trailing whitespace (trailing-whitespace)
Raw output
varats/varats/data/databases/feature_blame_databases.py:170:0: C0303: Trailing whitespace (trailing-whitespace)
def create_dataframe_layout() -> pd.DataFrame:

Check warning on line 171 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L171 <612>

Unused variable 'create_dataframe_layout' (unused-variable)
Raw output
varats/varats/data/databases/feature_blame_databases.py:171:8: W0612: Unused variable 'create_dataframe_layout' (unused-variable)
df_layout = pd.DataFrame(columns=cls.COLUMNS)
df_layout = df_layout.astype(cls.COLUMN_TYPES)
return df_layout

Check failure on line 175 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L175 <303>

Trailing whitespace (trailing-whitespace)
Raw output
varats/varats/data/databases/feature_blame_databases.py:175:0: C0303: Trailing whitespace (trailing-whitespace)
def create_data_frame_for_report(
report_path: ReportFilepath
) -> pd.DataFrame:
report = load_structural_feature_blame_report(report_path)
revision = case_study.revisions[0]

Check failure on line 180 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / mypy

[mypy] varats/varats/data/databases/feature_blame_databases.py#L180

error: Item "None" of "Optional[CaseStudy]" has no attribute "revisions" [union-attr]
Raw output
varats/varats/data/databases/feature_blame_databases.py:180:24: error: Item "None" of "Optional[CaseStudy]" has no attribute "revisions"  [union-attr]
time_id = commit_map.short_time_id(revision.to_short_commit_hash())
return generate_features_scfi_data(report, revision.hash, time_id)

report_paths, failed_report_paths = build_feature_blame_report_files_tuple(

Check failure on line 184 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L184 <301>

Line too long (83/80) (line-too-long)
Raw output
varats/varats/data/databases/feature_blame_databases.py:184:0: C0301: Line too long (83/80) (line-too-long)

Check warning on line 184 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L184 <612>

Unused variable 'failed_report_paths' (unused-variable)
Raw output
varats/varats/data/databases/feature_blame_databases.py:184:22: W0612: Unused variable 'failed_report_paths' (unused-variable)
project_name, case_study, StructuralFeatureBlameReport
)

data_frame: pd.DataFrame = None
for RFP in report_paths.values():

Check failure on line 189 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L189 <103>

Variable name "RFP" doesn't conform to snake_case naming style (invalid-name)
Raw output
varats/varats/data/databases/feature_blame_databases.py:189:12: C0103: Variable name "RFP" doesn't conform to snake_case naming style (invalid-name)
if not data_frame:
data_frame = create_data_frame_for_report(RFP)
continue
pd.concat([data_frame, create_data_frame_for_report(RFP)])

Check failure on line 194 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L194 <303>

Trailing whitespace (trailing-whitespace)
Raw output
varats/varats/data/databases/feature_blame_databases.py:194:0: C0303: Trailing whitespace (trailing-whitespace)
return data_frame
#report_pairs, failed_report_pairs = build_structural_report_pairs_tuple(

Check failure on line 196 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L196 <301>

Line too long (81/80) (line-too-long)
Raw output
varats/varats/data/databases/feature_blame_databases.py:196:0: C0301: Line too long (81/80) (line-too-long)
# project_name, commit_map, case_study
#)

# cls.CACHE_ID is set by superclass
# pylint: disable=E1101
#data_frame = build_cached_report_table(
# cls.CACHE_ID, project_name, report_pairs, failed_report_pairs,
# create_dataframe_layout, create_data_frame_for_report,
# id_from_paths, timestamp_from_paths, compare_timestamps
#)

Check failure on line 206 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L206 <303>

Trailing whitespace (trailing-whitespace)
Raw output
varats/varats/data/databases/feature_blame_databases.py:206:10: C0303: Trailing whitespace (trailing-whitespace)

#return data_frame

Check failure on line 208 in varats/varats/data/databases/feature_blame_databases.py

View workflow job for this annotation

GitHub Actions / pylint

[pylint] varats/varats/data/databases/feature_blame_databases.py#L208 <304>

Final newline missing (missing-final-newline)
Raw output
varats/varats/data/databases/feature_blame_databases.py:208:0: C0304: Final newline missing (missing-final-newline)
Loading
Loading