hylo-lang / hylo

The Hylo programming language
https://www.hylo-lang.org
Apache License 2.0
1.21k stars 56 forks source link

Eliminate code duplication #776

Open dabrahams opened 1 year ago

dabrahams commented 1 year ago

We have a lot of duplicated code. Obviously, we need to decide exactly what the target should be, but we're currently exceeding any reasonable target.

Using this tool with the following command produced this output.

pmd cpd --language swift --ignore-literal-sequences --ignore-literals --ignore-identifiers --ignore-annotations  --minimum-tokens 70 --dir ~/src/val/Sources

Using this tool with the following command reports these >50% probabilities of duplication:

python3 -W ignore duplicate-code-detection-tool/duplicate_code_detection.py -d ~/src/val/Sources --file-extensions swift --ignore-threshold 50
kyouko-taiga commented 1 year ago

Seems like a very broadly defined issue.

I don't really understand how to interpret the results of these tools so it's difficult to derive any actionable insight.

dabrahams commented 1 year ago

Taking responsibility for this issue; I'm not sure it's as serious a problem as I reported.