I am using pydriller to retrieve the commit information, but I have got an error 'AttributeError: 'FunctionInfo' object has no attribute 'fan_in'. Do you have any solution?
executing the code-
from pydriller import RepositoryMining
for commit in RepositoryMining (path_to_repo='https://github.com/openssl/openssl', only_commits=['9cedfc90cebc905b20275d534699a1070bba65a4']).traverse_commits():
commit_row = {
'hash': str(commit.hash),
'msg': str(commit.msg),
'author_date': str(commit.author_date),
'merge': str(commit.merge),
'dmm_unit_size': str(commit.dmm_unit_size)
}
print(commit_row)
I have got the following error output:-
Traceback (most recent call last):
File "/Volumes/GoogleDrive/Shared drives/guru_shared/guru_research/CVE-code-extraction/Code/example_extraction.py", line 30, in <module>
'dmm_unit_size': str(commit.dmm_unit_size)
File "/usr/local/lib/python3.8/site-packages/pydriller/domain/commit.py", line 687, in dmm_unit_size
return self._delta_maintainability(DMMProperty.UNIT_SIZE)
File "/usr/local/lib/python3.8/site-packages/pydriller/domain/commit.py", line 735, in _delta_maintainability
delta_profile = self._delta_risk_profile(dmm_prop)
File "/usr/local/lib/python3.8/site-packages/pydriller/domain/commit.py", line 752, in _delta_risk_profile
deltas = [mod._delta_risk_profile(dmm_prop) for mod in supported_modifications]
File "/usr/local/lib/python3.8/site-packages/pydriller/domain/commit.py", line 752, in <listcomp>
deltas = [mod._delta_risk_profile(dmm_prop) for mod in supported_modifications]
File "/usr/local/lib/python3.8/site-packages/pydriller/domain/commit.py", line 386, in _delta_risk_profile
low_before, high_before = self._risk_profile(self.methods_before, dmm_prop)
File "/usr/local/lib/python3.8/site-packages/pydriller/domain/commit.py", line 336, in methods_before
self._calculate_metrics(include_before=True)
File "/usr/local/lib/python3.8/site-packages/pydriller/domain/commit.py", line 406, in _calculate_metrics
self._function_list.append(Method(func))
File "/usr/local/lib/python3.8/site-packages/pydriller/domain/commit.py", line 80, in __init__
self.fan_in = func.fan_in
AttributeError: 'FunctionInfo' object has no attribute 'fan_in'
I found the reason for the problem and this is related to the issue with interpreter. The problem is solved after I changed the Python interpreter into version 3.8 in IDE.