Skip to content

Commit

Permalink
small in commit, prepare for release
Browse files Browse the repository at this point in the history
  • Loading branch information
ishepard committed Mar 2, 2020
1 parent 40b5299 commit 293b02c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions pydriller/domain/commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,10 +291,10 @@ def changed_methods(self) -> List[Method]:
added = self.diff_parsed['added']
deleted = self.diff_parsed['deleted']

methods_changed_new = set([
y for x in added for y in new_methods if y.start_line <= x[0] <= y.end_line])
methods_changed_old = set(
[y for x in deleted for y in old_methods if y.start_line <= x[0] <= y.end_line])
methods_changed_new = {y for x in added for y in new_methods if
y.start_line <= x[0] <= y.end_line}
methods_changed_old = {y for x in deleted for y in old_methods if
y.start_line <= x[0] <= y.end_line}

return list(methods_changed_new.union(methods_changed_old))

Expand All @@ -304,19 +304,19 @@ def _calculate_metrics(self, include_before=False):
for source_code_before, i.e. before the change happened
"""
if self.source_code and self._nloc is None:
analysis = lizard.analyze_file.analyze_source_code(self.filename,
self.source_code
)
analysis = lizard.analyze_file.analyze_source_code(
self.filename, self.source_code)
self._nloc = analysis.nloc
self._complexity = analysis.CCN
self._token_count = analysis.token_count

for func in analysis.function_list:
self._function_list.append(Method(func))
# logic to parse the methods before the change
if include_before and self.source_code_before and not self._function_list_before:
anal = lizard.analyze_file.analyze_source_code(self.filename,
self.source_code_before)

if include_before and self.source_code_before and \
not self._function_list_before:
anal = lizard.analyze_file.analyze_source_code(
self.filename, self.source_code_before)

self._function_list_before = [
Method(x) for x in anal.function_list]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def read_reqs(filename: str):
long_description=long_description,
author='Davide Spadini',
author_email='[email protected]',
version='1.11.2',
version='1.12',
packages=find_packages('.'),
url='https://github.com/ishepard/pydriller',
license='Apache License',
Expand Down

0 comments on commit 293b02c

Please sign in to comment.