protocolbuffers/protobuf
Protocol Buffers - Google's data interchange format
The code number leaves out tests, fixtures, docs, examples, data files, styles, translations and vendored code, and 238 generated files: ci/push_auto_update.sh, compatibility/smoke/v21.12/legacy_gencode_test/proto3/Proto3GencodeTestProto.java, compatibility/smoke/v25.8/legacy_gencode_test/proto3/Proto3GencodeTestProto.java, compatibility/smoke/v26.0/legacy_gencode_test/proto3/Proto3GencodeTestProto.java, compatibility/smoke/v3.0.0/legacy_gencode_test/proto3/Proto3GencodeTestProto.java, compatibility/smoke/v3.11.0/legacy_gencode_test/proto3/Proto3GencodeTestProto.java, compatibility/smoke/v3.19.0/legacy_gencode_test/proto3/Proto3GencodeTestProto.java, compatibility/smoke/v3.20.0/legacy_gencode_test/proto3/Proto3GencodeTestProto.java, compatibility/smoke/v3.8.0/legacy_gencode_test/proto3/Proto3GencodeTestProto.java, compatibility/smoke/v32.1/legacy_gencode_test/proto3/Proto3GencodeTestProto.java, csharp/src/AddressBook/Addressbook.pb.cs, csharp/src/Google.Protobuf.Conformance/Conformance.pb.cs, csharp/src/Google.Protobuf.Test.TestProtos/JsonEnumvalCustomString.pb.cs, csharp/src/Google.Protobuf.Test.TestProtos/MapUnittestProto3.pb.cs, csharp/src/Google.Protobuf.Test.TestProtos/Nrt.pb.cs, csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions1.cs, csharp/src/Google.Protobuf.Test.TestProtos/OldExtensions2.cs, csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesEdition2023.pb.cs, csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesEditionUnstable.pb.cs, csharp/src/Google.Protobuf.Test.TestProtos/TestMessagesProto2.pb.cs and 218 more.
Largest clones in the code
- 8844 lines in 2 placesc-header87,580 tokens
7082#ifndef UPB_REFLECTION_DEF_H_ 7083#define UPB_REFLECTION_DEF_H_ 7084 7085// IWYU pragma: begin_exports 7086 7087// IWYU pragma: private, include "upb/reflection/def.h" 7088 7089#ifndef UPB_REFLECTION_DEF_POOL_H_ 7090#define UPB_REFLECTION_DEF_POOL_H_ 7091First 10 of 8844 lines.
- 13445 lines in 2 placesc86,741 tokens
3847 sizeof(descriptor_google_protobuf_json_enumvalue_options_proto_upbdefinit)), 3848}; 3849 3850 3851#include <errno.h> 3852#include <float.h> 3853#include <stdarg.h> 3854#include <stdlib.h> 3855#include <string.h> 38562598 1, 2599}; 2600 2601 2602 2603 2604#include <errno.h> 2605#include <float.h> 2606#include <stdarg.h> 2607#include <stdlib.h>First 10 of 13445 lines, the second copy on the right.
- 7080 lines in 2 placesc-header45,129 tokens
1/* Amalgamated source file */ 2 3/* 4 * This is where we define internal portability macros used across upb. 5 * 6 * All of these macros are undef'd in undef.inc to avoid leaking them to users. 7 * 8 * The correct usage is: 9 * 10 * #include "upb/foobar.h"First 10 of 7080 lines.
7 more
- 2526 lines in 2 placesc22,264 tokens
- 2580 lines in 2 placesc15,874 tokens
- 1588 lines in 2 placesc12,990 tokens
- 2472 lines in 2 placesc-header12,409 tokens
- 35 lines in 8 placesjava1,649 tokensruby/src/main/java/com/google/protobuf/jruby/RubyDescriptor.java:1–35ruby/src/main/java/com/google/protobuf/jruby/RubyDescriptorPool.java:1–35ruby/src/main/java/com/google/protobuf/jruby/RubyEnum.java:1–35ruby/src/main/java/com/google/protobuf/jruby/RubyMap.java:1–35ruby/src/main/java/com/google/protobuf/jruby/RubyMessage.java:1–35and 3 more
- 1335 lines in 2 placesc8,368 tokens
- 942 lines in 2 placesc7,610 tokens
Largest clones over all files, tests and data included
- 7686 lines in 2 placesjava110,605 tokenscompatibility/smoke/v3.19.0/legacy_gencode_test/proto3/Proto3GencodeTestProto.java:15366–23051compatibility/smoke/v3.20.0/legacy_gencode_test/proto3/Proto3GencodeTestProto.java:15388–23073
15366 * @return The optionalNestedEnum. 15367 */ 15368@java.lang.Override 15369public legacy_gencode_test.proto3.Proto3GencodeTestProto.TestMostTypesProto3.NestedEnum 15370 getOptionalNestedEnum() { 15371 @SuppressWarnings("deprecation") 15372 legacy_gencode_test.proto3.Proto3GencodeTestProto.TestMostTypesProto3.NestedEnum result = 15373 legacy_gencode_test.proto3.Proto3GencodeTestProto.TestMostTypesProto3.NestedEnum 15374 .valueOf(optionalNestedEnum_); 15375 return result == nullFirst 10 of 7686 lines.
- 8844 lines in 2 placesc-header87,580 tokens
7082#ifndef UPB_REFLECTION_DEF_H_ 7083#define UPB_REFLECTION_DEF_H_ 7084 7085// IWYU pragma: begin_exports 7086 7087// IWYU pragma: private, include "upb/reflection/def.h" 7088 7089#ifndef UPB_REFLECTION_DEF_POOL_H_ 7090#define UPB_REFLECTION_DEF_POOL_H_ 7091First 10 of 8844 lines.
- 13445 lines in 2 placesc86,741 tokens
3847 sizeof(descriptor_google_protobuf_json_enumvalue_options_proto_upbdefinit)), 3848}; 3849 3850 3851#include <errno.h> 3852#include <float.h> 3853#include <stdarg.h> 3854#include <stdlib.h> 3855#include <string.h> 38562598 1, 2599}; 2600 2601 2602 2603 2604#include <errno.h> 2605#include <float.h> 2606#include <stdarg.h> 2607#include <stdlib.h>First 10 of 13445 lines, the second copy on the right.
- 5536 lines in 2 placesjava85,815 tokens
- 8151 lines in 2 placesc-header83,689 tokens
By format, code only
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| cpp | 479 | 271,465 | 1,840 | 22,772 | 8.39% |
| objectivec | 40 | 47,005 | 912 | 12,674 | 26.96% |
| c-header | 536 | 143,388 | 783 | 36,247 | 25.28% |
| java | 152 | 65,536 | 747 | 9,220 | 14.07% |
| c | 120 | 86,912 | 229 | 36,426 | 41.91% |
| csharp | 172 | 41,725 | 216 | 6,887 | 16.51% |
| python | 52 | 19,339 | 47 | 727 | 3.76% |
| php | 35 | 7,087 | 42 | 524 | 7.39% |
| rust | 61 | 11,359 | 27 | 363 | 3.2% |
| ruby | 26 | 4,414 | 8 | 80 | 1.81% |
By format, all files
| Format | Files | Lines | Clones | Duplicated lines | Duplication |
|---|---|---|---|---|---|
| java | 278 | 341,402 | 6,070 | 222,663 | 65.22% |
| csharp | 217 | 158,560 | 4,068 | 89,403 | 56.38% |
| cpp | 521 | 309,499 | 2,763 | 31,442 | 10.16% |
| c-header | 578 | 188,083 | 2,570 | 66,123 | 35.16% |
| objectivec | 56 | 69,808 | 2,305 | 27,552 | 39.47% |
| php | 151 | 33,269 | 889 | 10,445 | 31.4% |
| protobuf | 286 | 50,420 | 438 | 19,625 | 38.92% |
| c | 125 | 88,972 | 250 | 38,351 | 43.1% |
| python | 99 | 45,094 | 95 | 1,244 | 2.76% |
| yaml | 27 | 3,122 | 71 | 749 | 23.99% |
Trending appearances
| Day | Rank | Stars | Files | Lines | Clones | All files | Code | Health | Commit |
|---|---|---|---|---|---|---|---|---|---|
| Sep 3, 2026 | #10 | 71,961 (+18) | 2,779 | 1,352,227 | 19,753 | 37.81% | 17.9% | — | 065d6fa |
Want this for your own project? Install jscpd and run jscpd ., or measure it the way the baselines were measured.