|
1 | 1 | #!/bin/env python3 |
2 | 2 | # Generates a report on the amount of code sharing in this repo |
3 | 3 | # |
4 | | -# The purpose of this is |
| 4 | +# The purpose of this is |
5 | 5 | # a) To be able to understand the structure and dependencies |
6 | 6 | # b) To provide a metric that measures the amount of shared vs non-shared code |
7 | 7 |
|
@@ -224,7 +224,7 @@ def calculateDependencies(self, packageNameMap): |
224 | 224 | if lang in language_info: |
225 | 225 | info = language_info[lang] |
226 | 226 | if qlfile.isOnlyInLanguage(lang): |
227 | | - info.addQlFile(qlfile) |
| 227 | + info.addQlFile(qlfile) |
228 | 228 |
|
229 | 229 | # Determine all package dependencies |
230 | 230 |
|
@@ -276,15 +276,15 @@ def print_package_dependencies(packages): |
276 | 276 | nlines = package.lines + package.total_imported_lines |
277 | 277 | shared_percentage = 100 * package.total_imported_lines / nlines if nlines>0 else 0 |
278 | 278 | print('|', package.link(), '|', package.files, '|', package.lines, '|', package.total_imported_files, '|', package.total_imported_lines, '|', |
279 | | - # ','.join([p.name for p in package.all_dependencies]), |
| 279 | + # ','.join([p.name for p in package.all_dependencies]), |
280 | 280 | "%.2f" % shared_percentage, '|') |
281 | 281 | print() |
282 | 282 |
|
283 | 283 | def print_language_dependencies(packages): |
284 | | - print_package_dependencies([p for p in packages if p.name.endswith('-all') and p.name.count('-')==1]) |
| 284 | + print_package_dependencies([p for p in packages if p.name.endswith('-all') and p.name.count('-')==1]) |
285 | 285 |
|
286 | 286 | def list_shared_code_by_language(language_info): |
287 | | - # For each language directory, list the files that are (1) inside the directory and not shared, |
| 287 | + # For each language directory, list the files that are (1) inside the directory and not shared, |
288 | 288 | # (2) packages from outside the directory, plus identical files |
289 | 289 | print('| Language | Non-shared files | Non-shared lines of code | Imported files | Imported lines of code | Shared code % |') |
290 | 290 | print('| -------- | ---------------- | ------------------------ | -------------- | ---------------------- | ------------- |') |
|
0 commit comments