facebookresearch / fbpcs
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
  • 20% duplication:
    • 18,348 cleaned lines of cleaned code (without empty lines, comments, and frequently duplicated constructs such as imports)
    • 3,767 duplicated lines
  • 451 duplicates
system20% (3,767 lines)
Duplication per Extension
py18% (1,390 lines)
cpp22% (1,055 lines)
tf41% (465 lines)
h13% (423 lines)
hpp26% (408 lines)
cmake56% (26 lines)
Duplication per Component (primary)
fbpcs/emp_games21% (1,628 lines)
fbpcs/private_computation34% (865 lines)
fbpcs/infra20% (525 lines)
fbpcs/data_processing15% (304 lines)
fbpcs/pid15% (190 lines)
fbpcs/private_computation_cli10% (66 lines)
fbpcs/scripts17% (56 lines)
fbpcs/pl_coordinator5% (51 lines)
fbpcs/utils19% (38 lines)
docker/emp_games56% (26 lines)
fbpcs/performance_tools8% (12 lines)
fbpcs/post_processing_handler11% (6 lines)
fbpcs/pcf0% (0 lines)
fbpcs/experimental0% (0 lines)
fbpcs0% (0 lines)
fbpcs/common0% (0 lines)
fbpcs/stage_flow0% (0 lines)

Duplication Between Components (50+ lines)

G fbpcs/data_processing fbpcs/data_processing fbpcs/emp_games fbpcs/emp_games fbpcs/data_processing--fbpcs/emp_games 97

Download: SVG DOT (open online Graphviz editor)

Open 3D force graph...

Show more details on duplication between components...
Longest Duplicates
The list of 20 longest duplicates.
See data for all 451 duplicates...
Size#FoldersFilesLinesCode
75 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_attribution
AttributionRule.cpp
AttributionRule.cpp
12:130 (98%)
12:130 (98%)
view
43 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_attribution
Attribution.hpp
Attribution.hpp
42:92 (21%)
34:84 (31%)
view
36 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_attribution
AttributionOptions.cpp
AttributionOptions.cpp
12:47 (94%)
12:47 (85%)
view
31 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_aggregation
Attribution.hpp
Aggregation.hpp
95:133 (15%)
126:166 (15%)
view
31 x 2 fbpcs/private_computation/stage_flows
fbpcs/private_computation/stage_flows
private_computation_local_test_stage_...
private_computation_stage_flow.py
55:98 (40%)
81:124 (25%)
view
26 x 2 fbpcs/private_computation/stage_flows
fbpcs/private_computation/stage_flows
private_computation_decoupled_local_t...
private_computation_decoupled_stage_f...
58:83 (33%)
74:99 (23%)
view
25 x 2 fbpcs/private_computation/service
fbpcs/private_computation/service
compute_metrics_stage_service.py
decoupled_aggregation_stage_service.py
56:97 (15%)
54:95 (20%)
view
25 x 2 fbpcs/private_computation/service
fbpcs/private_computation/service
decoupled_aggregation_stage_service.py
decoupled_attribution_stage_service.py
54:95 (20%)
53:94 (20%)
view
25 x 2 fbpcs/private_computation/service
fbpcs/private_computation/service
compute_metrics_stage_service.py
decoupled_attribution_stage_service.py
129:182 (15%)
123:174 (20%)
view
25 x 2 fbpcs/private_computation/service
fbpcs/private_computation/service
compute_metrics_stage_service.py
decoupled_attribution_stage_service.py
56:97 (15%)
53:94 (20%)
view
23 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_attribution
AttributionMetrics.h
AttributionMetrics.h
148:181 (22%)
106:139 (23%)
view
22 x 2 fbpcs/private_computation/stage_flows
fbpcs/private_computation/stage_flows
private_computation_local_test_stage_...
private_computation_stage_flow.py
99:120 (28%)
147:168 (17%)
view
21 x 2 fbpcs/private_computation/stage_flows
fbpcs/private_computation/stage_flows
private_computation_decoupled_local_t...
private_computation_decoupled_stage_f...
102:122 (26%)
132:152 (19%)
view
21 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_attribution
AttributionMetrics.cpp
AttributionMetrics.cpp
27:55 (15%)
27:55 (22%)
view
20 x 2 fbpcs/private_computation/stage_flows
fbpcs/private_computation/stage_flows
private_computation_decoupled_stage_f...
private_computation_stage_flow.py
62:81 (18%)
69:88 (16%)
view
19 x 2 fbpcs/data_processing/sharding
fbpcs/data_processing/sharding
shard.cpp
shard_pid.cpp
15:33 (61%)
15:33 (52%)
view
19 x 2 fbpcs/private_computation/stage_flows
fbpcs/private_computation/stage_flows
private_computation_decoupled_stage_f...
private_computation_stage_flow.py
92:123 (17%)
93:124 (15%)
view
19 x 2 fbpcs/infra/pce/aws_terr...plate/common/pce_shared
fbpcs/infra/pce/aws_terr...plate/common/pce_shared
iam.tf
iam.tf
3:22 (38%)
26:45 (38%)
view
19 x 2 fbpcs/private_computation/stage_flows
fbpcs/private_computation/stage_flows
private_computation_decoupled_stage_f...
private_computation_local_test_stage_...
92:123 (17%)
67:98 (24%)
view
18 x 2 fbpcs/private_computation/service
fbpcs/private_computation/service
decoupled_aggregation_stage_service.py
decoupled_attribution_stage_service.py
129:162 (14%)
141:174 (15%)
view
Duplicated Units
The list of top 17 duplicated units.
See data for all 17 unit duplicates...
Size#FoldersFilesLinesCode
32 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_aggregation
Attribution.hpp
Aggregation.hpp
96:131 
127:162 
view
29 x 2 fbpcs/emp_games/attribution/decoupled_attribution
fbpcs/emp_games/attribution
Attribution.hpp
Attribution.hpp
53:85 
61:93 
view
19 x 2 fbpcs/emp_games/attribution/decoupled_attribution
fbpcs/emp_games/attribution
AttributionMetrics.cpp
AttributionMetrics.cpp
27:50 
27:50 
view
13 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution
Aggregator.cpp
Aggregator.cpp
109:126 
223:238 
view
12 x 2 fbpcs/emp_games/attribution/decoupled_attribution
fbpcs/emp_games/attribution
AttributionMetrics.h
AttributionMetrics.h
122:136 
164:178 
view
8 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_aggregation
Aggregator.cpp
Aggregator.cpp
29:39 
40:50 
view
8 x 2 fbpcs/emp_games/attribution/decoupled_attribution
fbpcs/emp_games/attribution
AttributionRule.cpp
AttributionRule.cpp
109:118 
109:118 
view
8 x 3 fbpcs/emp_games/attribution/decoupled_attribution
fbpcs/emp_games/attribution/decoupled_aggregation
fbpcs/emp_games/attribution
AttributionMetrics.h
AggregationMetrics.h
AttributionMetrics.h
111:120 
131:140 
153:162 
view
8 x 2 fbpcs/emp_games/attribution/decoupled_aggregation
fbpcs/emp_games/attribution
AggregationMetrics.h
AttributionMetrics.h
59:68 
75:84 
view
7 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_aggregation
Aggregator.cpp
Aggregator.cpp
502:510 
215:223 
view
7 x 2 fbpcs/emp_games/attribution
fbpcs/emp_games/attribution/decoupled_aggregation
Aggregator.cpp
Aggregator.cpp
512:520 
225:233 
view
7 x 2 fbpcs/emp_games/attribution/decoupled_attribution
fbpcs/emp_games/attribution
AttributionRule.cpp
AttributionRule.cpp
120:128 
120:128 
view
7 x 2 fbpcs/emp_games/lift/calculator
fbpcs/emp_games/lift/calculator
OutputMetrics.hpp
OutputMetrics.hpp
856:866 
869:879 
view
7 x 3 fbpcs/private_computation/service
fbpcs/private_computation/service
fbpcs/private_computation/service
decoupled_attribution_stage_service.py
decoupled_aggregation_stage_service.py
compute_metrics_stage_service.py
0:0 
0:0 
0:0 
view
6 x 2 fbpcs/emp_games/attribution/shard_aggregator
fbpcs/data_processing/attribution_id_combiner
MainUtil.h
AttributionIdSpineCombinerUtil.h
15:21 
15:21 
view
6 x 3 fbpcs/emp_games/attribution/decoupled_attribution
fbpcs/emp_games/attribution/decoupled_aggregation
fbpcs/emp_games/attribution/decoupled_aggregation
Conversion.h
TouchPointMetadata.h
ConversionMetadata.h
43:50 
77:85 
62:69 
view
6 x 2 fbpcs/data_processing/pid_preparer
fbpcs/data_processing/pid_preparer
preparer.py
union_pid_preparer_cpp.py
0:0 
0:0 
view