codeclone 1.0.0__py3-none-any.whl → 1.2.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- codeclone/__init__.py +16 -0
- codeclone/baseline.py +21 -9
- codeclone/blockhash.py +10 -1
- codeclone/blocks.py +26 -16
- codeclone/cache.py +20 -6
- codeclone/cfg.py +338 -0
- codeclone/cli.py +357 -93
- codeclone/extractor.py +92 -32
- codeclone/fingerprint.py +11 -1
- codeclone/html_report.py +936 -0
- codeclone/normalize.py +73 -26
- codeclone/report.py +29 -13
- codeclone/scanner.py +24 -4
- codeclone-1.2.0.dist-info/METADATA +264 -0
- codeclone-1.2.0.dist-info/RECORD +19 -0
- {codeclone-1.0.0.dist-info → codeclone-1.2.0.dist-info}/WHEEL +1 -1
- codeclone-1.0.0.dist-info/METADATA +0 -211
- codeclone-1.0.0.dist-info/RECORD +0 -17
- {codeclone-1.0.0.dist-info → codeclone-1.2.0.dist-info}/entry_points.txt +0 -0
- {codeclone-1.0.0.dist-info → codeclone-1.2.0.dist-info}/licenses/LICENSE +0 -0
- {codeclone-1.0.0.dist-info → codeclone-1.2.0.dist-info}/top_level.txt +0 -0
codeclone/fingerprint.py
CHANGED
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
"""
|
|
2
|
+
CodeClone — AST and CFG-based code clone detector for Python
|
|
3
|
+
focused on architectural duplication.
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026 Den Rozhnovskiy
|
|
6
|
+
Licensed under the MIT License.
|
|
7
|
+
"""
|
|
8
|
+
|
|
1
9
|
from __future__ import annotations
|
|
2
10
|
|
|
3
11
|
import hashlib
|
|
4
12
|
|
|
13
|
+
|
|
5
14
|
def sha1(s: str) -> str:
|
|
6
15
|
return hashlib.sha1(s.encode("utf-8")).hexdigest()
|
|
7
16
|
|
|
17
|
+
|
|
8
18
|
def bucket_loc(loc: int) -> str:
|
|
9
19
|
# Helps avoid grouping wildly different sizes if desired
|
|
10
20
|
if loc < 20:
|
|
@@ -13,4 +23,4 @@ def bucket_loc(loc: int) -> str:
|
|
|
13
23
|
return "20-49"
|
|
14
24
|
if loc < 100:
|
|
15
25
|
return "50-99"
|
|
16
|
-
return "100+"
|
|
26
|
+
return "100+"
|