@@ -291,10 +291,10 @@ def changed_methods(self) -> List[Method]:
291291 added = self .diff_parsed ['added' ]
292292 deleted = self .diff_parsed ['deleted' ]
293293
294- methods_changed_new = set ([
295- y for x in added for y in new_methods if y .start_line <= x [0 ] <= y .end_line ])
296- methods_changed_old = set (
297- [ y for x in deleted for y in old_methods if y .start_line <= x [0 ] <= y .end_line ])
294+ methods_changed_new = { y for x in added for y in new_methods if
295+ y .start_line <= x [0 ] <= y .end_line }
296+ methods_changed_old = { y for x in deleted for y in old_methods if
297+ y .start_line <= x [0 ] <= y .end_line }
298298
299299 return list (methods_changed_new .union (methods_changed_old ))
300300
@@ -304,19 +304,19 @@ def _calculate_metrics(self, include_before=False):
304304 for source_code_before, i.e. before the change happened
305305 """
306306 if self .source_code and self ._nloc is None :
307- analysis = lizard .analyze_file .analyze_source_code (self .filename ,
308- self .source_code
309- )
307+ analysis = lizard .analyze_file .analyze_source_code (
308+ self .filename , self .source_code )
310309 self ._nloc = analysis .nloc
311310 self ._complexity = analysis .CCN
312311 self ._token_count = analysis .token_count
313312
314313 for func in analysis .function_list :
315314 self ._function_list .append (Method (func ))
316- # logic to parse the methods before the change
317- if include_before and self .source_code_before and not self ._function_list_before :
318- anal = lizard .analyze_file .analyze_source_code (self .filename ,
319- self .source_code_before )
315+
316+ if include_before and self .source_code_before and \
317+ not self ._function_list_before :
318+ anal = lizard .analyze_file .analyze_source_code (
319+ self .filename , self .source_code_before )
320320
321321 self ._function_list_before = [
322322 Method (x ) for x in anal .function_list ]
0 commit comments