aws-samples / amazon-textract-code-samples
Duplication

Places in code with 6 or more lines that are exactly the same.

Intro
  • For duplication, we look at places in code where there are 6 or more lines of code that are exactly the same.
  • Before duplication is calculated, the code is cleaned to remove empty lines, comments, and frequently duplicated constructs such as imports.
  • You should aim at having as little as possible (<5%) of duplicated code as high-level of duplication can lead to maintenance difficulties, poor factoring, and logical contradictions.
Learn more...
Duplication Overall
  • 14% duplication:
    • 1,222 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 172 duplicated lines
  • 20 duplicates
system14% (172 lines)
Duplication per Extension
py33% (97 lines)
cs8% (75 lines)
Duplication per Component (primary)
python33% (97 lines)
src-csharp/TextractExtensions16% (63 lines)
src-csharp/ArgHandlers5% (12 lines)
src-csharp0% (0 lines)
src-csharp/Services0% (0 lines)
Longest Duplicates
The list of 20 longest duplicates.
See data for all 20 duplicates...
Size#FoldersFilesLinesCode
14 x 2 src-csharp/TextractExtensions
src-csharp/TextractExtensions
FieldKey.cs
FieldValue.cs
59:74 (51%)
65:79 (45%)
view
13 x 2 python
python
04-nlp-comprehend.py
05-nlp-medical.py
7:25 (61%)
7:25 (50%)
view
11 x 2 src-csharp/TextractExtensions
src-csharp/TextractExtensions
FieldKey.cs
FieldValue.cs
76:92 (40%)
85:100 (35%)
view
10 x 2 python
python
02-detect-text-s3.py
07-search.py
4:17 (76%)
39:52 (25%)
view
9 x 2 python
python
08-forms.py
09-forms-redaction.py
5:20 (39%)
6:21 (39%)
view
8 x 2 python
python
10-tables.py
11-tables-expense.py
8:20 (57%)
8:20 (26%)
view
8 x 2 python
python
04-nlp-comprehend.py
06-translate.py
4:15 (38%)
4:15 (50%)
view
7 x 2 python
python
03-reading-order.py
04-nlp-comprehend.py
7:15 (25%)
7:15 (33%)
view
7 x 2 python
python
03-reading-order.py
06-translate.py
7:15 (25%)
7:15 (43%)
view
7 x 2 src-csharp/TextractExtensions
src-csharp/TextractExtensions
Cell.cs
FieldValue.cs
45:52 (16%)
92:99 (22%)
view
7 x 2 python
python
09-forms-redaction.py
10-tables.py
6:16 (30%)
5:15 (50%)
view
7 x 2 python
python
03-reading-order.py
05-nlp-medical.py
7:15 (25%)
7:15 (26%)
view
7 x 2 python
python
08-forms.py
10-tables.py
5:15 (30%)
5:15 (50%)
view
7 x 2 src-csharp/TextractExtensions
src-csharp/TextractExtensions
Cell.cs
FieldKey.cs
45:52 (16%)
84:91 (25%)
view
7 x 2 python
python
05-nlp-medical.py
06-translate.py
7:15 (26%)
7:15 (43%)
view
6 x 2 src-csharp/TextractExtensions
src-csharp/TextractExtensions
FieldValue.cs
Word.cs
94:100 (19%)
52:58 (37%)
view
6 x 2 src-csharp/TextractExtensions
src-csharp/TextractExtensions
FieldKey.cs
Word.cs
86:92 (22%)
52:58 (37%)
view
6 x 2 src-csharp/ArgHandlers
src-csharp/ArgHandlers
TablesExpenseHandler.cs
TablesHandler.cs
23:28 (18%)
18:23 (26%)
view
6 x 2 python
python
08-forms.py
11-tables-expense.py
8:15 (26%)
8:15 (20%)
view
6 x 2 python
python
09-forms-redaction.py
11-tables-expense.py
9:16 (26%)
8:15 (20%)
view