Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _calculate_metrics(self):
if self.source_code and self._nloc is None:
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))